main_2020_show.js 2.6 MB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967896889698970897189728973897489758976897789788979898089818982898389848985898689878988898989908991899289938994899589968997899889999000900190029003900490059006900790089009901090119012901390149015901690179018901990209021902290239024902590269027902890299030903190329033903490359036903790389039904090419042904390449045904690479048904990509051905290539054905590569057905890599060906190629063906490659066906790689069907090719072907390749075907690779078907990809081908290839084908590869087908890899090909190929093909490959096909790989099910091019102910391049105910691079108910991109111911291139114911591169117911891199120912191229123912491259126912791289129913091319132913391349135913691379138913991409141914291439144914591469147914891499150915191529153915491559156915791589159916091619162916391649165916691679168916991709171917291739174917591769177917891799180918191829183918491859186918791889189919091919192919391949195919691979198919992009201920292039204920592069207920892099210921192129213921492159216921792189219922092219222922392249225922692279228922992309231923292339234923592369237923892399240924192429243924492459246924792489249925092519252925392549255925692579258925992609261926292639264926592669267926892699270927192729273927492759276927792789279928092819282928392849285928692879288928992909291929292939294929592969297929892999300930193029303930493059306930793089309931093119312931393149315931693179318931993209321932293239324932593269327932893299330933193329333933493359336933793389339934093419342934393449345934693479348934993509351935293539354935593569357935893599360936193629363936493659366936793689369937093719372937393749375937693779378937993809381938293839384938593869387938893899390939193929393939493959396939793989399940094019402940394049405940694079408940994109411941294139414941594169417941894199420942194229423942494259426942794289429943094319432943394349435943694379438943994409441944294439444944594469447944894499450945194529453945494559456945794589459946094619462946394649465946694679468946994709471947294739474947594769477947894799480948194829483948494859486948794889489949094919492949394949495949694979498949995009501950295039504950595069507950895099510951195129513951495159516951795189519952095219522952395249525952695279528952995309531953295339534953595369537953895399540954195429543954495459546954795489549955095519552955395549555955695579558955995609561956295639564956595669567956895699570957195729573957495759576957795789579958095819582958395849585958695879588958995909591959295939594959595969597959895999600960196029603960496059606960796089609961096119612961396149615961696179618961996209621962296239624962596269627962896299630963196329633963496359636963796389639964096419642964396449645964696479648964996509651965296539654965596569657965896599660966196629663966496659666966796689669967096719672967396749675967696779678967996809681968296839684968596869687968896899690969196929693969496959696969796989699970097019702970397049705970697079708970997109711971297139714971597169717971897199720972197229723972497259726972797289729973097319732973397349735973697379738973997409741974297439744974597469747974897499750975197529753975497559756975797589759976097619762976397649765976697679768976997709771977297739774977597769777977897799780978197829783978497859786978797889789979097919792979397949795979697979798979998009801980298039804980598069807980898099810981198129813981498159816981798189819982098219822982398249825982698279828982998309831983298339834983598369837983898399840984198429843984498459846984798489849985098519852985398549855985698579858985998609861986298639864986598669867986898699870987198729873987498759876987798789879988098819882988398849885988698879888988998909891989298939894989598969897989898999900990199029903990499059906990799089909991099119912991399149915991699179918991999209921992299239924992599269927992899299930993199329933993499359936993799389939994099419942994399449945994699479948994999509951995299539954995599569957995899599960996199629963996499659966996799689969997099719972997399749975997699779978997999809981998299839984998599869987998899899990999199929993999499959996999799989999100001000110002100031000410005100061000710008100091001010011100121001310014100151001610017100181001910020100211002210023100241002510026100271002810029100301003110032100331003410035100361003710038100391004010041100421004310044100451004610047100481004910050100511005210053100541005510056100571005810059100601006110062100631006410065100661006710068100691007010071100721007310074100751007610077100781007910080100811008210083100841008510086100871008810089100901009110092100931009410095100961009710098100991010010101101021010310104101051010610107101081010910110101111011210113101141011510116101171011810119101201012110122101231012410125101261012710128101291013010131101321013310134101351013610137101381013910140101411014210143101441014510146101471014810149101501015110152101531015410155101561015710158101591016010161101621016310164101651016610167101681016910170101711017210173101741017510176101771017810179101801018110182101831018410185101861018710188101891019010191101921019310194101951019610197101981019910200102011020210203102041020510206102071020810209102101021110212102131021410215102161021710218102191022010221102221022310224102251022610227102281022910230102311023210233102341023510236102371023810239102401024110242102431024410245102461024710248102491025010251102521025310254102551025610257102581025910260102611026210263102641026510266102671026810269102701027110272102731027410275102761027710278102791028010281102821028310284102851028610287102881028910290102911029210293102941029510296102971029810299103001030110302103031030410305103061030710308103091031010311103121031310314103151031610317103181031910320103211032210323103241032510326103271032810329103301033110332103331033410335103361033710338103391034010341103421034310344103451034610347103481034910350103511035210353103541035510356103571035810359103601036110362103631036410365103661036710368103691037010371103721037310374103751037610377103781037910380103811038210383103841038510386103871038810389103901039110392103931039410395103961039710398103991040010401104021040310404104051040610407104081040910410104111041210413104141041510416104171041810419104201042110422104231042410425104261042710428104291043010431104321043310434104351043610437104381043910440104411044210443104441044510446104471044810449104501045110452104531045410455104561045710458104591046010461104621046310464104651046610467104681046910470104711047210473104741047510476104771047810479104801048110482104831048410485104861048710488104891049010491104921049310494104951049610497104981049910500105011050210503105041050510506105071050810509105101051110512105131051410515105161051710518105191052010521105221052310524105251052610527105281052910530105311053210533105341053510536105371053810539105401054110542105431054410545105461054710548105491055010551105521055310554105551055610557105581055910560105611056210563105641056510566105671056810569105701057110572105731057410575105761057710578105791058010581105821058310584105851058610587105881058910590105911059210593105941059510596105971059810599106001060110602106031060410605106061060710608106091061010611106121061310614106151061610617106181061910620106211062210623106241062510626106271062810629106301063110632106331063410635106361063710638106391064010641106421064310644106451064610647106481064910650106511065210653106541065510656106571065810659106601066110662106631066410665106661066710668106691067010671106721067310674106751067610677106781067910680106811068210683106841068510686106871068810689106901069110692106931069410695106961069710698106991070010701107021070310704107051070610707107081070910710107111071210713107141071510716107171071810719107201072110722107231072410725107261072710728107291073010731107321073310734107351073610737107381073910740107411074210743107441074510746107471074810749107501075110752107531075410755107561075710758107591076010761107621076310764107651076610767107681076910770107711077210773107741077510776107771077810779107801078110782107831078410785107861078710788107891079010791107921079310794107951079610797107981079910800108011080210803108041080510806108071080810809108101081110812108131081410815108161081710818108191082010821108221082310824108251082610827108281082910830108311083210833108341083510836108371083810839108401084110842108431084410845108461084710848108491085010851108521085310854108551085610857108581085910860108611086210863108641086510866108671086810869108701087110872108731087410875108761087710878108791088010881108821088310884108851088610887108881088910890108911089210893108941089510896108971089810899109001090110902109031090410905109061090710908109091091010911109121091310914109151091610917109181091910920109211092210923109241092510926109271092810929109301093110932109331093410935109361093710938109391094010941109421094310944109451094610947109481094910950109511095210953109541095510956109571095810959109601096110962109631096410965109661096710968109691097010971109721097310974109751097610977109781097910980109811098210983109841098510986109871098810989109901099110992109931099410995109961099710998109991100011001110021100311004110051100611007110081100911010110111101211013110141101511016110171101811019110201102111022110231102411025110261102711028110291103011031110321103311034110351103611037110381103911040110411104211043110441104511046110471104811049110501105111052110531105411055110561105711058110591106011061110621106311064110651106611067110681106911070110711107211073110741107511076110771107811079110801108111082110831108411085110861108711088110891109011091110921109311094110951109611097110981109911100111011110211103111041110511106111071110811109111101111111112111131111411115111161111711118111191112011121111221112311124111251112611127111281112911130111311113211133111341113511136111371113811139111401114111142111431114411145111461114711148111491115011151111521115311154111551115611157111581115911160111611116211163111641116511166111671116811169111701117111172111731117411175111761117711178111791118011181111821118311184111851118611187111881118911190111911119211193111941119511196111971119811199112001120111202112031120411205112061120711208112091121011211112121121311214112151121611217112181121911220112211122211223112241122511226112271122811229112301123111232112331123411235112361123711238112391124011241112421124311244112451124611247112481124911250112511125211253112541125511256112571125811259112601126111262112631126411265112661126711268112691127011271112721127311274112751127611277112781127911280112811128211283112841128511286112871128811289112901129111292112931129411295112961129711298112991130011301113021130311304113051130611307113081130911310113111131211313113141131511316113171131811319113201132111322113231132411325113261132711328113291133011331113321133311334113351133611337113381133911340113411134211343113441134511346113471134811349113501135111352113531135411355113561135711358113591136011361113621136311364113651136611367113681136911370113711137211373113741137511376113771137811379113801138111382113831138411385113861138711388113891139011391113921139311394113951139611397113981139911400114011140211403114041140511406114071140811409114101141111412114131141411415114161141711418114191142011421114221142311424114251142611427114281142911430114311143211433114341143511436114371143811439114401144111442114431144411445114461144711448114491145011451114521145311454114551145611457114581145911460114611146211463114641146511466114671146811469114701147111472114731147411475114761147711478114791148011481114821148311484114851148611487114881148911490114911149211493114941149511496114971149811499115001150111502115031150411505115061150711508115091151011511115121151311514115151151611517115181151911520115211152211523115241152511526115271152811529115301153111532115331153411535115361153711538115391154011541115421154311544115451154611547115481154911550115511155211553115541155511556115571155811559115601156111562115631156411565115661156711568115691157011571115721157311574115751157611577115781157911580115811158211583115841158511586115871158811589115901159111592115931159411595115961159711598115991160011601116021160311604116051160611607116081160911610116111161211613116141161511616116171161811619116201162111622116231162411625116261162711628116291163011631116321163311634116351163611637116381163911640116411164211643116441164511646116471164811649116501165111652116531165411655116561165711658116591166011661116621166311664116651166611667116681166911670116711167211673116741167511676116771167811679116801168111682116831168411685116861168711688116891169011691116921169311694116951169611697116981169911700117011170211703117041170511706117071170811709117101171111712117131171411715117161171711718117191172011721117221172311724117251172611727117281172911730117311173211733117341173511736117371173811739117401174111742117431174411745117461174711748117491175011751117521175311754117551175611757117581175911760117611176211763117641176511766117671176811769117701177111772117731177411775117761177711778117791178011781117821178311784117851178611787117881178911790117911179211793117941179511796117971179811799118001180111802118031180411805118061180711808118091181011811118121181311814118151181611817118181181911820118211182211823118241182511826118271182811829118301183111832118331183411835118361183711838118391184011841118421184311844118451184611847118481184911850118511185211853118541185511856118571185811859118601186111862118631186411865118661186711868118691187011871118721187311874118751187611877118781187911880118811188211883118841188511886118871188811889118901189111892118931189411895118961189711898118991190011901119021190311904119051190611907119081190911910119111191211913119141191511916119171191811919119201192111922119231192411925119261192711928119291193011931119321193311934119351193611937119381193911940119411194211943119441194511946119471194811949119501195111952119531195411955119561195711958119591196011961119621196311964119651196611967119681196911970119711197211973119741197511976119771197811979119801198111982119831198411985119861198711988119891199011991119921199311994119951199611997119981199912000120011200212003120041200512006120071200812009120101201112012120131201412015120161201712018120191202012021120221202312024120251202612027120281202912030120311203212033120341203512036120371203812039120401204112042120431204412045120461204712048120491205012051120521205312054120551205612057120581205912060120611206212063120641206512066120671206812069120701207112072120731207412075120761207712078120791208012081120821208312084120851208612087120881208912090120911209212093120941209512096120971209812099121001210112102121031210412105121061210712108121091211012111121121211312114121151211612117121181211912120121211212212123121241212512126121271212812129121301213112132121331213412135121361213712138121391214012141121421214312144121451214612147121481214912150121511215212153121541215512156121571215812159121601216112162121631216412165121661216712168121691217012171121721217312174121751217612177121781217912180121811218212183121841218512186121871218812189121901219112192121931219412195121961219712198121991220012201122021220312204122051220612207122081220912210122111221212213122141221512216122171221812219122201222112222122231222412225122261222712228122291223012231122321223312234122351223612237122381223912240122411224212243122441224512246122471224812249122501225112252122531225412255122561225712258122591226012261122621226312264122651226612267122681226912270122711227212273122741227512276122771227812279122801228112282122831228412285122861228712288122891229012291122921229312294122951229612297122981229912300123011230212303123041230512306123071230812309123101231112312123131231412315123161231712318123191232012321123221232312324123251232612327123281232912330123311233212333123341233512336123371233812339123401234112342123431234412345123461234712348123491235012351123521235312354123551235612357123581235912360123611236212363123641236512366123671236812369123701237112372123731237412375123761237712378123791238012381123821238312384123851238612387123881238912390123911239212393123941239512396123971239812399124001240112402124031240412405124061240712408124091241012411124121241312414124151241612417124181241912420124211242212423124241242512426124271242812429124301243112432124331243412435124361243712438124391244012441124421244312444124451244612447124481244912450124511245212453124541245512456124571245812459124601246112462124631246412465124661246712468124691247012471124721247312474124751247612477124781247912480124811248212483124841248512486124871248812489124901249112492124931249412495124961249712498124991250012501125021250312504125051250612507125081250912510125111251212513125141251512516125171251812519125201252112522125231252412525125261252712528125291253012531125321253312534125351253612537125381253912540125411254212543125441254512546125471254812549125501255112552125531255412555125561255712558125591256012561125621256312564125651256612567125681256912570125711257212573125741257512576125771257812579125801258112582125831258412585125861258712588125891259012591125921259312594125951259612597125981259912600126011260212603126041260512606126071260812609126101261112612126131261412615126161261712618126191262012621126221262312624126251262612627126281262912630126311263212633126341263512636126371263812639126401264112642126431264412645126461264712648126491265012651126521265312654126551265612657126581265912660126611266212663126641266512666126671266812669126701267112672126731267412675126761267712678126791268012681126821268312684126851268612687126881268912690126911269212693126941269512696126971269812699127001270112702127031270412705127061270712708127091271012711127121271312714127151271612717127181271912720127211272212723127241272512726127271272812729127301273112732127331273412735127361273712738127391274012741127421274312744127451274612747127481274912750127511275212753127541275512756127571275812759127601276112762127631276412765127661276712768127691277012771127721277312774127751277612777127781277912780127811278212783127841278512786127871278812789127901279112792127931279412795127961279712798127991280012801128021280312804128051280612807128081280912810128111281212813128141281512816128171281812819128201282112822128231282412825128261282712828128291283012831128321283312834128351283612837128381283912840128411284212843128441284512846128471284812849128501285112852128531285412855128561285712858128591286012861128621286312864128651286612867128681286912870128711287212873128741287512876128771287812879128801288112882128831288412885128861288712888128891289012891128921289312894128951289612897128981289912900129011290212903129041290512906129071290812909129101291112912129131291412915129161291712918129191292012921129221292312924129251292612927129281292912930129311293212933129341293512936129371293812939129401294112942129431294412945129461294712948129491295012951129521295312954129551295612957129581295912960129611296212963129641296512966129671296812969129701297112972129731297412975129761297712978129791298012981129821298312984129851298612987129881298912990129911299212993129941299512996129971299812999130001300113002130031300413005130061300713008130091301013011130121301313014130151301613017130181301913020130211302213023130241302513026130271302813029130301303113032130331303413035130361303713038130391304013041130421304313044130451304613047130481304913050130511305213053130541305513056130571305813059130601306113062130631306413065130661306713068130691307013071130721307313074130751307613077130781307913080130811308213083130841308513086130871308813089130901309113092130931309413095130961309713098130991310013101131021310313104131051310613107131081310913110131111311213113131141311513116131171311813119131201312113122131231312413125131261312713128131291313013131131321313313134131351313613137131381313913140131411314213143131441314513146131471314813149131501315113152131531315413155131561315713158131591316013161131621316313164131651316613167131681316913170131711317213173131741317513176131771317813179131801318113182131831318413185131861318713188131891319013191131921319313194131951319613197131981319913200132011320213203132041320513206132071320813209132101321113212132131321413215132161321713218132191322013221132221322313224132251322613227132281322913230132311323213233132341323513236132371323813239132401324113242132431324413245132461324713248132491325013251132521325313254132551325613257132581325913260132611326213263132641326513266132671326813269132701327113272132731327413275132761327713278132791328013281132821328313284132851328613287132881328913290132911329213293132941329513296132971329813299133001330113302133031330413305133061330713308133091331013311133121331313314133151331613317133181331913320133211332213323133241332513326133271332813329133301333113332133331333413335133361333713338133391334013341133421334313344133451334613347133481334913350133511335213353133541335513356133571335813359133601336113362133631336413365133661336713368133691337013371133721337313374133751337613377133781337913380133811338213383133841338513386133871338813389133901339113392133931339413395133961339713398133991340013401134021340313404134051340613407134081340913410134111341213413134141341513416134171341813419134201342113422134231342413425134261342713428134291343013431134321343313434134351343613437134381343913440134411344213443134441344513446134471344813449134501345113452134531345413455134561345713458134591346013461134621346313464134651346613467134681346913470134711347213473134741347513476134771347813479134801348113482134831348413485134861348713488134891349013491134921349313494134951349613497134981349913500135011350213503135041350513506135071350813509135101351113512135131351413515135161351713518135191352013521135221352313524135251352613527135281352913530135311353213533135341353513536135371353813539135401354113542135431354413545135461354713548135491355013551135521355313554135551355613557135581355913560135611356213563135641356513566135671356813569135701357113572135731357413575135761357713578135791358013581135821358313584135851358613587135881358913590135911359213593135941359513596135971359813599136001360113602136031360413605136061360713608136091361013611136121361313614136151361613617136181361913620136211362213623136241362513626136271362813629136301363113632136331363413635136361363713638136391364013641136421364313644136451364613647136481364913650136511365213653136541365513656136571365813659136601366113662136631366413665136661366713668136691367013671136721367313674136751367613677136781367913680136811368213683136841368513686136871368813689136901369113692136931369413695136961369713698136991370013701137021370313704137051370613707137081370913710137111371213713137141371513716137171371813719137201372113722137231372413725137261372713728137291373013731137321373313734137351373613737137381373913740137411374213743137441374513746137471374813749137501375113752137531375413755137561375713758137591376013761137621376313764137651376613767137681376913770137711377213773137741377513776137771377813779137801378113782137831378413785137861378713788137891379013791137921379313794137951379613797137981379913800138011380213803138041380513806138071380813809138101381113812138131381413815138161381713818138191382013821138221382313824138251382613827138281382913830138311383213833138341383513836138371383813839138401384113842138431384413845138461384713848138491385013851138521385313854138551385613857138581385913860138611386213863138641386513866138671386813869138701387113872138731387413875138761387713878138791388013881138821388313884138851388613887138881388913890138911389213893138941389513896138971389813899139001390113902139031390413905139061390713908139091391013911139121391313914139151391613917139181391913920139211392213923139241392513926139271392813929139301393113932139331393413935139361393713938139391394013941139421394313944139451394613947139481394913950139511395213953139541395513956139571395813959139601396113962139631396413965139661396713968139691397013971139721397313974139751397613977139781397913980139811398213983139841398513986139871398813989139901399113992139931399413995139961399713998139991400014001140021400314004140051400614007140081400914010140111401214013140141401514016140171401814019140201402114022140231402414025140261402714028140291403014031140321403314034140351403614037140381403914040140411404214043140441404514046140471404814049140501405114052140531405414055140561405714058140591406014061140621406314064140651406614067140681406914070140711407214073140741407514076140771407814079140801408114082140831408414085140861408714088140891409014091140921409314094140951409614097140981409914100141011410214103141041410514106141071410814109141101411114112141131411414115141161411714118141191412014121141221412314124141251412614127141281412914130141311413214133141341413514136141371413814139141401414114142141431414414145141461414714148141491415014151141521415314154141551415614157141581415914160141611416214163141641416514166141671416814169141701417114172141731417414175141761417714178141791418014181141821418314184141851418614187141881418914190141911419214193141941419514196141971419814199142001420114202142031420414205142061420714208142091421014211142121421314214142151421614217142181421914220142211422214223142241422514226142271422814229142301423114232142331423414235142361423714238142391424014241142421424314244142451424614247142481424914250142511425214253142541425514256142571425814259142601426114262142631426414265142661426714268142691427014271142721427314274142751427614277142781427914280142811428214283142841428514286142871428814289142901429114292142931429414295142961429714298142991430014301143021430314304143051430614307143081430914310143111431214313143141431514316143171431814319143201432114322143231432414325143261432714328143291433014331143321433314334143351433614337143381433914340143411434214343143441434514346143471434814349143501435114352143531435414355143561435714358143591436014361143621436314364143651436614367143681436914370143711437214373143741437514376143771437814379143801438114382143831438414385143861438714388143891439014391143921439314394143951439614397143981439914400144011440214403144041440514406144071440814409144101441114412144131441414415144161441714418144191442014421144221442314424144251442614427144281442914430144311443214433144341443514436144371443814439144401444114442144431444414445144461444714448144491445014451144521445314454144551445614457144581445914460144611446214463144641446514466144671446814469144701447114472144731447414475144761447714478144791448014481144821448314484144851448614487144881448914490144911449214493144941449514496144971449814499145001450114502145031450414505145061450714508145091451014511145121451314514145151451614517145181451914520145211452214523145241452514526145271452814529145301453114532145331453414535145361453714538145391454014541145421454314544145451454614547145481454914550145511455214553145541455514556145571455814559145601456114562145631456414565145661456714568145691457014571145721457314574145751457614577145781457914580145811458214583145841458514586145871458814589145901459114592145931459414595145961459714598145991460014601146021460314604146051460614607146081460914610146111461214613146141461514616146171461814619146201462114622146231462414625146261462714628146291463014631146321463314634146351463614637146381463914640146411464214643146441464514646146471464814649146501465114652146531465414655146561465714658146591466014661146621466314664146651466614667146681466914670146711467214673146741467514676146771467814679146801468114682146831468414685146861468714688146891469014691146921469314694146951469614697146981469914700147011470214703147041470514706147071470814709147101471114712147131471414715147161471714718147191472014721147221472314724147251472614727147281472914730147311473214733147341473514736147371473814739147401474114742147431474414745147461474714748147491475014751147521475314754147551475614757147581475914760147611476214763147641476514766147671476814769147701477114772147731477414775147761477714778147791478014781147821478314784147851478614787147881478914790147911479214793147941479514796147971479814799148001480114802148031480414805148061480714808148091481014811148121481314814148151481614817148181481914820148211482214823148241482514826148271482814829148301483114832148331483414835148361483714838148391484014841148421484314844148451484614847148481484914850148511485214853148541485514856148571485814859148601486114862148631486414865148661486714868148691487014871148721487314874148751487614877148781487914880148811488214883148841488514886148871488814889148901489114892148931489414895148961489714898148991490014901149021490314904149051490614907149081490914910149111491214913149141491514916149171491814919149201492114922149231492414925149261492714928149291493014931149321493314934149351493614937149381493914940149411494214943149441494514946149471494814949149501495114952149531495414955149561495714958149591496014961149621496314964149651496614967149681496914970149711497214973149741497514976149771497814979149801498114982149831498414985149861498714988149891499014991149921499314994149951499614997149981499915000150011500215003150041500515006150071500815009150101501115012150131501415015150161501715018150191502015021150221502315024150251502615027150281502915030150311503215033150341503515036150371503815039150401504115042150431504415045150461504715048150491505015051150521505315054150551505615057150581505915060150611506215063150641506515066150671506815069150701507115072150731507415075150761507715078150791508015081150821508315084150851508615087150881508915090150911509215093150941509515096150971509815099151001510115102151031510415105151061510715108151091511015111151121511315114151151511615117151181511915120151211512215123151241512515126151271512815129151301513115132151331513415135151361513715138151391514015141151421514315144151451514615147151481514915150151511515215153151541515515156151571515815159151601516115162151631516415165151661516715168151691517015171151721517315174151751517615177151781517915180151811518215183151841518515186151871518815189151901519115192151931519415195151961519715198151991520015201152021520315204152051520615207152081520915210152111521215213152141521515216152171521815219152201522115222152231522415225152261522715228152291523015231152321523315234152351523615237152381523915240152411524215243152441524515246152471524815249152501525115252152531525415255152561525715258152591526015261152621526315264152651526615267152681526915270152711527215273152741527515276152771527815279152801528115282152831528415285152861528715288152891529015291152921529315294152951529615297152981529915300153011530215303153041530515306153071530815309153101531115312153131531415315153161531715318153191532015321153221532315324153251532615327153281532915330153311533215333153341533515336153371533815339153401534115342153431534415345153461534715348153491535015351153521535315354153551535615357153581535915360153611536215363153641536515366153671536815369153701537115372153731537415375153761537715378153791538015381153821538315384153851538615387153881538915390153911539215393153941539515396153971539815399154001540115402154031540415405154061540715408154091541015411154121541315414154151541615417154181541915420154211542215423154241542515426154271542815429154301543115432154331543415435154361543715438154391544015441154421544315444154451544615447154481544915450154511545215453154541545515456154571545815459154601546115462154631546415465154661546715468154691547015471154721547315474154751547615477154781547915480154811548215483154841548515486154871548815489154901549115492154931549415495154961549715498154991550015501155021550315504155051550615507155081550915510155111551215513155141551515516155171551815519155201552115522155231552415525155261552715528155291553015531155321553315534155351553615537155381553915540155411554215543155441554515546155471554815549155501555115552155531555415555155561555715558155591556015561155621556315564155651556615567155681556915570155711557215573155741557515576155771557815579155801558115582155831558415585155861558715588155891559015591155921559315594155951559615597155981559915600156011560215603156041560515606156071560815609156101561115612156131561415615156161561715618156191562015621156221562315624156251562615627156281562915630156311563215633156341563515636156371563815639156401564115642156431564415645156461564715648156491565015651156521565315654156551565615657156581565915660156611566215663156641566515666156671566815669156701567115672156731567415675156761567715678156791568015681156821568315684156851568615687156881568915690156911569215693156941569515696156971569815699157001570115702157031570415705157061570715708157091571015711157121571315714157151571615717157181571915720157211572215723157241572515726157271572815729157301573115732157331573415735157361573715738157391574015741157421574315744157451574615747157481574915750157511575215753157541575515756157571575815759157601576115762157631576415765157661576715768157691577015771157721577315774157751577615777157781577915780157811578215783157841578515786157871578815789157901579115792157931579415795157961579715798157991580015801158021580315804158051580615807158081580915810158111581215813158141581515816158171581815819158201582115822158231582415825158261582715828158291583015831158321583315834158351583615837158381583915840158411584215843158441584515846158471584815849158501585115852158531585415855158561585715858158591586015861158621586315864158651586615867158681586915870158711587215873158741587515876158771587815879158801588115882158831588415885158861588715888158891589015891158921589315894158951589615897158981589915900159011590215903159041590515906159071590815909159101591115912159131591415915159161591715918159191592015921159221592315924159251592615927159281592915930159311593215933159341593515936159371593815939159401594115942159431594415945159461594715948159491595015951159521595315954159551595615957159581595915960159611596215963159641596515966159671596815969159701597115972159731597415975159761597715978159791598015981159821598315984159851598615987159881598915990159911599215993159941599515996159971599815999160001600116002160031600416005160061600716008160091601016011160121601316014160151601616017160181601916020160211602216023160241602516026160271602816029160301603116032160331603416035160361603716038160391604016041160421604316044160451604616047160481604916050160511605216053160541605516056160571605816059160601606116062160631606416065160661606716068160691607016071160721607316074160751607616077160781607916080160811608216083160841608516086160871608816089160901609116092160931609416095160961609716098160991610016101161021610316104161051610616107161081610916110161111611216113161141611516116161171611816119161201612116122161231612416125161261612716128161291613016131161321613316134161351613616137161381613916140161411614216143161441614516146161471614816149161501615116152161531615416155161561615716158161591616016161161621616316164161651616616167161681616916170161711617216173161741617516176161771617816179161801618116182161831618416185161861618716188161891619016191161921619316194161951619616197161981619916200162011620216203162041620516206162071620816209162101621116212162131621416215162161621716218162191622016221162221622316224162251622616227162281622916230162311623216233162341623516236162371623816239162401624116242162431624416245162461624716248162491625016251162521625316254162551625616257162581625916260162611626216263162641626516266162671626816269162701627116272162731627416275162761627716278162791628016281162821628316284162851628616287162881628916290162911629216293162941629516296162971629816299163001630116302163031630416305163061630716308163091631016311163121631316314163151631616317163181631916320163211632216323163241632516326163271632816329163301633116332163331633416335163361633716338163391634016341163421634316344163451634616347163481634916350163511635216353163541635516356163571635816359163601636116362163631636416365163661636716368163691637016371163721637316374163751637616377163781637916380163811638216383163841638516386163871638816389163901639116392163931639416395163961639716398163991640016401164021640316404164051640616407164081640916410164111641216413164141641516416164171641816419164201642116422164231642416425164261642716428164291643016431164321643316434164351643616437164381643916440164411644216443164441644516446164471644816449164501645116452164531645416455164561645716458164591646016461164621646316464164651646616467164681646916470164711647216473164741647516476164771647816479164801648116482164831648416485164861648716488164891649016491164921649316494164951649616497164981649916500165011650216503165041650516506165071650816509165101651116512165131651416515165161651716518165191652016521165221652316524165251652616527165281652916530165311653216533165341653516536165371653816539165401654116542165431654416545165461654716548165491655016551165521655316554165551655616557165581655916560165611656216563165641656516566165671656816569165701657116572165731657416575165761657716578165791658016581165821658316584165851658616587165881658916590165911659216593165941659516596165971659816599166001660116602166031660416605166061660716608166091661016611166121661316614166151661616617166181661916620166211662216623166241662516626166271662816629166301663116632166331663416635166361663716638166391664016641166421664316644166451664616647166481664916650166511665216653166541665516656166571665816659166601666116662166631666416665166661666716668166691667016671166721667316674166751667616677166781667916680166811668216683166841668516686166871668816689166901669116692166931669416695166961669716698166991670016701167021670316704167051670616707167081670916710167111671216713167141671516716167171671816719167201672116722167231672416725167261672716728167291673016731167321673316734167351673616737167381673916740167411674216743167441674516746167471674816749167501675116752167531675416755167561675716758167591676016761167621676316764167651676616767167681676916770167711677216773167741677516776167771677816779167801678116782167831678416785167861678716788167891679016791167921679316794167951679616797167981679916800168011680216803168041680516806168071680816809168101681116812168131681416815168161681716818168191682016821168221682316824168251682616827168281682916830168311683216833168341683516836168371683816839168401684116842168431684416845168461684716848168491685016851168521685316854168551685616857168581685916860168611686216863168641686516866168671686816869168701687116872168731687416875168761687716878168791688016881168821688316884168851688616887168881688916890168911689216893168941689516896168971689816899169001690116902169031690416905169061690716908169091691016911169121691316914169151691616917169181691916920169211692216923169241692516926169271692816929169301693116932169331693416935169361693716938169391694016941169421694316944169451694616947169481694916950169511695216953169541695516956169571695816959169601696116962169631696416965169661696716968169691697016971169721697316974169751697616977169781697916980169811698216983169841698516986169871698816989169901699116992169931699416995169961699716998169991700017001170021700317004170051700617007170081700917010170111701217013170141701517016170171701817019170201702117022170231702417025170261702717028170291703017031170321703317034170351703617037170381703917040170411704217043170441704517046170471704817049170501705117052170531705417055170561705717058170591706017061170621706317064170651706617067170681706917070170711707217073170741707517076170771707817079170801708117082170831708417085170861708717088170891709017091170921709317094170951709617097170981709917100171011710217103171041710517106171071710817109171101711117112171131711417115171161711717118171191712017121171221712317124171251712617127171281712917130171311713217133171341713517136171371713817139171401714117142171431714417145171461714717148171491715017151171521715317154171551715617157171581715917160171611716217163171641716517166171671716817169171701717117172171731717417175171761717717178171791718017181171821718317184171851718617187171881718917190171911719217193171941719517196171971719817199172001720117202172031720417205172061720717208172091721017211172121721317214172151721617217172181721917220172211722217223172241722517226172271722817229172301723117232172331723417235172361723717238172391724017241172421724317244172451724617247172481724917250172511725217253172541725517256172571725817259172601726117262172631726417265172661726717268172691727017271172721727317274172751727617277172781727917280172811728217283172841728517286172871728817289172901729117292172931729417295172961729717298172991730017301173021730317304173051730617307173081730917310173111731217313173141731517316173171731817319173201732117322173231732417325173261732717328173291733017331173321733317334173351733617337173381733917340173411734217343173441734517346173471734817349173501735117352173531735417355173561735717358173591736017361173621736317364173651736617367173681736917370173711737217373173741737517376173771737817379173801738117382173831738417385173861738717388173891739017391173921739317394173951739617397173981739917400174011740217403174041740517406174071740817409174101741117412174131741417415174161741717418174191742017421174221742317424174251742617427174281742917430174311743217433174341743517436174371743817439174401744117442174431744417445174461744717448174491745017451174521745317454174551745617457174581745917460174611746217463174641746517466174671746817469174701747117472174731747417475174761747717478174791748017481174821748317484174851748617487174881748917490174911749217493174941749517496174971749817499175001750117502175031750417505175061750717508175091751017511175121751317514175151751617517175181751917520175211752217523175241752517526175271752817529175301753117532175331753417535175361753717538175391754017541175421754317544175451754617547175481754917550175511755217553175541755517556175571755817559175601756117562175631756417565175661756717568175691757017571175721757317574175751757617577175781757917580175811758217583175841758517586175871758817589175901759117592175931759417595175961759717598175991760017601176021760317604176051760617607176081760917610176111761217613176141761517616176171761817619176201762117622176231762417625176261762717628176291763017631176321763317634176351763617637176381763917640176411764217643176441764517646176471764817649176501765117652176531765417655176561765717658176591766017661176621766317664176651766617667176681766917670176711767217673176741767517676176771767817679176801768117682176831768417685176861768717688176891769017691176921769317694176951769617697176981769917700177011770217703177041770517706177071770817709177101771117712177131771417715177161771717718177191772017721177221772317724177251772617727177281772917730177311773217733177341773517736177371773817739177401774117742177431774417745177461774717748177491775017751177521775317754177551775617757177581775917760177611776217763177641776517766177671776817769177701777117772177731777417775177761777717778177791778017781177821778317784177851778617787177881778917790177911779217793177941779517796177971779817799178001780117802178031780417805178061780717808178091781017811178121781317814178151781617817178181781917820178211782217823178241782517826178271782817829178301783117832178331783417835178361783717838178391784017841178421784317844178451784617847178481784917850178511785217853178541785517856178571785817859178601786117862178631786417865178661786717868178691787017871178721787317874178751787617877178781787917880178811788217883178841788517886178871788817889178901789117892178931789417895178961789717898178991790017901179021790317904179051790617907179081790917910179111791217913179141791517916179171791817919179201792117922179231792417925179261792717928179291793017931179321793317934179351793617937179381793917940179411794217943179441794517946179471794817949179501795117952179531795417955179561795717958179591796017961179621796317964179651796617967179681796917970179711797217973179741797517976179771797817979179801798117982179831798417985179861798717988179891799017991179921799317994179951799617997179981799918000180011800218003180041800518006180071800818009180101801118012180131801418015180161801718018180191802018021180221802318024180251802618027180281802918030180311803218033180341803518036180371803818039180401804118042180431804418045180461804718048180491805018051180521805318054180551805618057180581805918060180611806218063180641806518066180671806818069180701807118072180731807418075180761807718078180791808018081180821808318084180851808618087180881808918090180911809218093180941809518096180971809818099181001810118102181031810418105181061810718108181091811018111181121811318114181151811618117181181811918120181211812218123181241812518126181271812818129181301813118132181331813418135181361813718138181391814018141181421814318144181451814618147181481814918150181511815218153181541815518156181571815818159181601816118162181631816418165181661816718168181691817018171181721817318174181751817618177181781817918180181811818218183181841818518186181871818818189181901819118192181931819418195181961819718198181991820018201182021820318204182051820618207182081820918210182111821218213182141821518216182171821818219182201822118222182231822418225182261822718228182291823018231182321823318234182351823618237182381823918240182411824218243182441824518246182471824818249182501825118252182531825418255182561825718258182591826018261182621826318264182651826618267182681826918270182711827218273182741827518276182771827818279182801828118282182831828418285182861828718288182891829018291182921829318294182951829618297182981829918300183011830218303183041830518306183071830818309183101831118312183131831418315183161831718318183191832018321183221832318324183251832618327183281832918330183311833218333183341833518336183371833818339183401834118342183431834418345183461834718348183491835018351183521835318354183551835618357183581835918360183611836218363183641836518366183671836818369183701837118372183731837418375183761837718378183791838018381183821838318384183851838618387183881838918390183911839218393183941839518396183971839818399184001840118402184031840418405184061840718408184091841018411184121841318414184151841618417184181841918420184211842218423184241842518426184271842818429184301843118432184331843418435184361843718438184391844018441184421844318444184451844618447184481844918450184511845218453184541845518456184571845818459184601846118462184631846418465184661846718468184691847018471184721847318474184751847618477184781847918480184811848218483184841848518486184871848818489184901849118492184931849418495184961849718498184991850018501185021850318504185051850618507185081850918510185111851218513185141851518516185171851818519185201852118522185231852418525185261852718528185291853018531185321853318534185351853618537185381853918540185411854218543185441854518546185471854818549185501855118552185531855418555185561855718558185591856018561185621856318564185651856618567185681856918570185711857218573185741857518576185771857818579185801858118582185831858418585185861858718588185891859018591185921859318594185951859618597185981859918600186011860218603186041860518606186071860818609186101861118612186131861418615186161861718618186191862018621186221862318624186251862618627186281862918630186311863218633186341863518636186371863818639186401864118642186431864418645186461864718648186491865018651186521865318654186551865618657186581865918660186611866218663186641866518666186671866818669186701867118672186731867418675186761867718678186791868018681186821868318684186851868618687186881868918690186911869218693186941869518696186971869818699187001870118702187031870418705187061870718708187091871018711187121871318714187151871618717187181871918720187211872218723187241872518726187271872818729187301873118732187331873418735187361873718738187391874018741187421874318744187451874618747187481874918750187511875218753187541875518756187571875818759187601876118762187631876418765187661876718768187691877018771187721877318774187751877618777187781877918780187811878218783187841878518786187871878818789187901879118792187931879418795187961879718798187991880018801188021880318804188051880618807188081880918810188111881218813188141881518816188171881818819188201882118822188231882418825188261882718828188291883018831188321883318834188351883618837188381883918840188411884218843188441884518846188471884818849188501885118852188531885418855188561885718858188591886018861188621886318864188651886618867188681886918870188711887218873188741887518876188771887818879188801888118882188831888418885188861888718888188891889018891188921889318894188951889618897188981889918900189011890218903189041890518906189071890818909189101891118912189131891418915189161891718918189191892018921189221892318924189251892618927189281892918930189311893218933189341893518936189371893818939189401894118942189431894418945189461894718948189491895018951189521895318954189551895618957189581895918960189611896218963189641896518966189671896818969189701897118972189731897418975189761897718978189791898018981189821898318984189851898618987189881898918990189911899218993189941899518996189971899818999190001900119002190031900419005190061900719008190091901019011190121901319014190151901619017190181901919020190211902219023190241902519026190271902819029190301903119032190331903419035190361903719038190391904019041190421904319044190451904619047190481904919050190511905219053190541905519056190571905819059190601906119062190631906419065190661906719068190691907019071190721907319074190751907619077190781907919080190811908219083190841908519086190871908819089190901909119092190931909419095190961909719098190991910019101191021910319104191051910619107191081910919110191111911219113191141911519116191171911819119191201912119122191231912419125191261912719128191291913019131191321913319134191351913619137191381913919140191411914219143191441914519146191471914819149191501915119152191531915419155191561915719158191591916019161191621916319164191651916619167191681916919170191711917219173191741917519176191771917819179191801918119182191831918419185191861918719188191891919019191191921919319194191951919619197191981919919200192011920219203192041920519206192071920819209192101921119212192131921419215192161921719218192191922019221192221922319224192251922619227192281922919230192311923219233192341923519236192371923819239192401924119242192431924419245192461924719248192491925019251192521925319254192551925619257192581925919260192611926219263192641926519266192671926819269192701927119272192731927419275192761927719278192791928019281192821928319284192851928619287192881928919290192911929219293192941929519296192971929819299193001930119302193031930419305193061930719308193091931019311193121931319314193151931619317193181931919320193211932219323193241932519326193271932819329193301933119332193331933419335193361933719338193391934019341193421934319344193451934619347193481934919350193511935219353193541935519356193571935819359193601936119362193631936419365193661936719368193691937019371193721937319374193751937619377193781937919380193811938219383193841938519386193871938819389193901939119392193931939419395193961939719398193991940019401194021940319404194051940619407194081940919410194111941219413194141941519416194171941819419194201942119422194231942419425194261942719428194291943019431194321943319434194351943619437194381943919440194411944219443194441944519446194471944819449194501945119452194531945419455194561945719458194591946019461194621946319464194651946619467194681946919470194711947219473194741947519476194771947819479194801948119482194831948419485194861948719488194891949019491194921949319494194951949619497194981949919500195011950219503195041950519506195071950819509195101951119512195131951419515195161951719518195191952019521195221952319524195251952619527195281952919530195311953219533195341953519536195371953819539195401954119542195431954419545195461954719548195491955019551195521955319554195551955619557195581955919560195611956219563195641956519566195671956819569195701957119572195731957419575195761957719578195791958019581195821958319584195851958619587195881958919590195911959219593195941959519596195971959819599196001960119602196031960419605196061960719608196091961019611196121961319614196151961619617196181961919620196211962219623196241962519626196271962819629196301963119632196331963419635196361963719638196391964019641196421964319644196451964619647196481964919650196511965219653196541965519656196571965819659196601966119662196631966419665196661966719668196691967019671196721967319674196751967619677196781967919680196811968219683196841968519686196871968819689196901969119692196931969419695196961969719698196991970019701197021970319704197051970619707197081970919710197111971219713197141971519716197171971819719197201972119722197231972419725197261972719728197291973019731197321973319734197351973619737197381973919740197411974219743197441974519746197471974819749197501975119752197531975419755197561975719758197591976019761197621976319764197651976619767197681976919770197711977219773197741977519776197771977819779197801978119782197831978419785197861978719788197891979019791197921979319794197951979619797197981979919800198011980219803198041980519806198071980819809198101981119812198131981419815198161981719818198191982019821198221982319824198251982619827198281982919830198311983219833198341983519836198371983819839198401984119842198431984419845198461984719848198491985019851198521985319854198551985619857198581985919860198611986219863198641986519866198671986819869198701987119872198731987419875198761987719878198791988019881198821988319884198851988619887198881988919890198911989219893198941989519896198971989819899199001990119902199031990419905199061990719908199091991019911199121991319914199151991619917199181991919920199211992219923199241992519926199271992819929199301993119932199331993419935199361993719938199391994019941199421994319944199451994619947199481994919950199511995219953199541995519956199571995819959199601996119962199631996419965199661996719968199691997019971199721997319974199751997619977199781997919980199811998219983199841998519986199871998819989199901999119992199931999419995199961999719998199992000020001200022000320004200052000620007200082000920010200112001220013200142001520016200172001820019200202002120022200232002420025200262002720028200292003020031200322003320034200352003620037200382003920040200412004220043200442004520046200472004820049200502005120052200532005420055200562005720058200592006020061200622006320064200652006620067200682006920070200712007220073200742007520076200772007820079200802008120082200832008420085200862008720088200892009020091200922009320094200952009620097200982009920100201012010220103201042010520106201072010820109201102011120112201132011420115201162011720118201192012020121201222012320124201252012620127201282012920130201312013220133201342013520136201372013820139201402014120142201432014420145201462014720148201492015020151201522015320154201552015620157201582015920160201612016220163201642016520166201672016820169201702017120172201732017420175201762017720178201792018020181201822018320184201852018620187201882018920190201912019220193201942019520196201972019820199202002020120202202032020420205202062020720208202092021020211202122021320214202152021620217202182021920220202212022220223202242022520226202272022820229202302023120232202332023420235202362023720238202392024020241202422024320244202452024620247202482024920250202512025220253202542025520256202572025820259202602026120262202632026420265202662026720268202692027020271202722027320274202752027620277202782027920280202812028220283202842028520286202872028820289202902029120292202932029420295202962029720298202992030020301203022030320304203052030620307203082030920310203112031220313203142031520316203172031820319203202032120322203232032420325203262032720328203292033020331203322033320334203352033620337203382033920340203412034220343203442034520346203472034820349203502035120352203532035420355203562035720358203592036020361203622036320364203652036620367203682036920370203712037220373203742037520376203772037820379203802038120382203832038420385203862038720388203892039020391203922039320394203952039620397203982039920400204012040220403204042040520406204072040820409204102041120412204132041420415204162041720418204192042020421204222042320424204252042620427204282042920430204312043220433204342043520436204372043820439204402044120442204432044420445204462044720448204492045020451204522045320454204552045620457204582045920460204612046220463204642046520466204672046820469204702047120472204732047420475204762047720478204792048020481204822048320484204852048620487204882048920490204912049220493204942049520496204972049820499205002050120502205032050420505205062050720508205092051020511205122051320514205152051620517205182051920520205212052220523205242052520526205272052820529205302053120532205332053420535205362053720538205392054020541205422054320544205452054620547205482054920550205512055220553205542055520556205572055820559205602056120562205632056420565205662056720568205692057020571205722057320574205752057620577205782057920580205812058220583205842058520586205872058820589205902059120592205932059420595205962059720598205992060020601206022060320604206052060620607206082060920610206112061220613206142061520616206172061820619206202062120622206232062420625206262062720628206292063020631206322063320634206352063620637206382063920640206412064220643206442064520646206472064820649206502065120652206532065420655206562065720658206592066020661206622066320664206652066620667206682066920670206712067220673206742067520676206772067820679206802068120682206832068420685206862068720688206892069020691206922069320694206952069620697206982069920700207012070220703207042070520706207072070820709207102071120712207132071420715207162071720718207192072020721207222072320724207252072620727207282072920730207312073220733207342073520736207372073820739207402074120742207432074420745207462074720748207492075020751207522075320754207552075620757207582075920760207612076220763207642076520766207672076820769207702077120772207732077420775207762077720778207792078020781207822078320784207852078620787207882078920790207912079220793207942079520796207972079820799208002080120802208032080420805208062080720808208092081020811208122081320814208152081620817208182081920820208212082220823208242082520826208272082820829208302083120832208332083420835208362083720838208392084020841208422084320844208452084620847208482084920850208512085220853208542085520856208572085820859208602086120862208632086420865208662086720868208692087020871208722087320874208752087620877208782087920880208812088220883208842088520886208872088820889208902089120892208932089420895208962089720898208992090020901209022090320904209052090620907209082090920910209112091220913209142091520916209172091820919209202092120922209232092420925209262092720928209292093020931209322093320934209352093620937209382093920940209412094220943209442094520946209472094820949209502095120952209532095420955209562095720958209592096020961209622096320964209652096620967209682096920970209712097220973209742097520976209772097820979209802098120982209832098420985209862098720988209892099020991209922099320994209952099620997209982099921000210012100221003210042100521006210072100821009210102101121012210132101421015210162101721018210192102021021210222102321024210252102621027210282102921030210312103221033210342103521036210372103821039210402104121042210432104421045210462104721048210492105021051210522105321054210552105621057210582105921060210612106221063210642106521066210672106821069210702107121072210732107421075210762107721078210792108021081210822108321084210852108621087210882108921090210912109221093210942109521096210972109821099211002110121102211032110421105211062110721108211092111021111211122111321114211152111621117211182111921120211212112221123211242112521126211272112821129211302113121132211332113421135211362113721138211392114021141211422114321144211452114621147211482114921150211512115221153211542115521156211572115821159211602116121162211632116421165211662116721168211692117021171211722117321174211752117621177211782117921180211812118221183211842118521186211872118821189211902119121192211932119421195211962119721198211992120021201212022120321204212052120621207212082120921210212112121221213212142121521216212172121821219212202122121222212232122421225212262122721228212292123021231212322123321234212352123621237212382123921240212412124221243212442124521246212472124821249212502125121252212532125421255212562125721258212592126021261212622126321264212652126621267212682126921270212712127221273212742127521276212772127821279212802128121282212832128421285212862128721288212892129021291212922129321294212952129621297212982129921300213012130221303213042130521306213072130821309213102131121312213132131421315213162131721318213192132021321213222132321324213252132621327213282132921330213312133221333213342133521336213372133821339213402134121342213432134421345213462134721348213492135021351213522135321354213552135621357213582135921360213612136221363213642136521366213672136821369213702137121372213732137421375213762137721378213792138021381213822138321384213852138621387213882138921390213912139221393213942139521396213972139821399214002140121402214032140421405214062140721408214092141021411214122141321414214152141621417214182141921420214212142221423214242142521426214272142821429214302143121432214332143421435214362143721438214392144021441214422144321444214452144621447214482144921450214512145221453214542145521456214572145821459214602146121462214632146421465214662146721468214692147021471214722147321474214752147621477214782147921480214812148221483214842148521486214872148821489214902149121492214932149421495214962149721498214992150021501215022150321504215052150621507215082150921510215112151221513215142151521516215172151821519215202152121522215232152421525215262152721528215292153021531215322153321534215352153621537215382153921540215412154221543215442154521546215472154821549215502155121552215532155421555215562155721558215592156021561215622156321564215652156621567215682156921570215712157221573215742157521576215772157821579215802158121582215832158421585215862158721588215892159021591215922159321594215952159621597215982159921600216012160221603216042160521606216072160821609216102161121612216132161421615216162161721618216192162021621216222162321624216252162621627216282162921630216312163221633216342163521636216372163821639216402164121642216432164421645216462164721648216492165021651216522165321654216552165621657216582165921660216612166221663216642166521666216672166821669216702167121672216732167421675216762167721678216792168021681216822168321684216852168621687216882168921690216912169221693216942169521696216972169821699217002170121702217032170421705217062170721708217092171021711217122171321714217152171621717217182171921720217212172221723217242172521726217272172821729217302173121732217332173421735217362173721738217392174021741217422174321744217452174621747217482174921750217512175221753217542175521756217572175821759217602176121762217632176421765217662176721768217692177021771217722177321774217752177621777217782177921780217812178221783217842178521786217872178821789217902179121792217932179421795217962179721798217992180021801218022180321804218052180621807218082180921810218112181221813218142181521816218172181821819218202182121822218232182421825218262182721828218292183021831218322183321834218352183621837218382183921840218412184221843218442184521846218472184821849218502185121852218532185421855218562185721858218592186021861218622186321864218652186621867218682186921870218712187221873218742187521876218772187821879218802188121882218832188421885218862188721888218892189021891218922189321894218952189621897218982189921900219012190221903219042190521906219072190821909219102191121912219132191421915219162191721918219192192021921219222192321924219252192621927219282192921930219312193221933219342193521936219372193821939219402194121942219432194421945219462194721948219492195021951219522195321954219552195621957219582195921960219612196221963219642196521966219672196821969219702197121972219732197421975219762197721978219792198021981219822198321984219852198621987219882198921990219912199221993219942199521996219972199821999220002200122002220032200422005220062200722008220092201022011220122201322014220152201622017220182201922020220212202222023220242202522026220272202822029220302203122032220332203422035220362203722038220392204022041220422204322044220452204622047220482204922050220512205222053220542205522056220572205822059220602206122062220632206422065220662206722068220692207022071220722207322074220752207622077220782207922080220812208222083220842208522086220872208822089220902209122092220932209422095220962209722098220992210022101221022210322104221052210622107221082210922110221112211222113221142211522116221172211822119221202212122122221232212422125221262212722128221292213022131221322213322134221352213622137221382213922140221412214222143221442214522146221472214822149221502215122152221532215422155221562215722158221592216022161221622216322164221652216622167221682216922170221712217222173221742217522176221772217822179221802218122182221832218422185221862218722188221892219022191221922219322194221952219622197221982219922200222012220222203222042220522206222072220822209222102221122212222132221422215222162221722218222192222022221222222222322224222252222622227222282222922230222312223222233222342223522236222372223822239222402224122242222432224422245222462224722248222492225022251222522225322254222552225622257222582225922260222612226222263222642226522266222672226822269222702227122272222732227422275222762227722278222792228022281222822228322284222852228622287222882228922290222912229222293222942229522296222972229822299223002230122302223032230422305223062230722308223092231022311223122231322314223152231622317223182231922320223212232222323223242232522326223272232822329223302233122332223332233422335223362233722338223392234022341223422234322344223452234622347223482234922350223512235222353223542235522356223572235822359223602236122362223632236422365223662236722368223692237022371223722237322374223752237622377223782237922380223812238222383223842238522386223872238822389223902239122392223932239422395223962239722398223992240022401224022240322404224052240622407224082240922410224112241222413224142241522416224172241822419224202242122422224232242422425224262242722428224292243022431224322243322434224352243622437224382243922440224412244222443224442244522446224472244822449224502245122452224532245422455224562245722458224592246022461224622246322464224652246622467224682246922470224712247222473224742247522476224772247822479224802248122482224832248422485224862248722488224892249022491224922249322494224952249622497224982249922500225012250222503225042250522506225072250822509225102251122512225132251422515225162251722518225192252022521225222252322524225252252622527225282252922530225312253222533225342253522536225372253822539225402254122542225432254422545225462254722548225492255022551225522255322554225552255622557225582255922560225612256222563225642256522566225672256822569225702257122572225732257422575225762257722578225792258022581225822258322584225852258622587225882258922590225912259222593225942259522596225972259822599226002260122602226032260422605226062260722608226092261022611226122261322614226152261622617226182261922620226212262222623226242262522626226272262822629226302263122632226332263422635226362263722638226392264022641226422264322644226452264622647226482264922650226512265222653226542265522656226572265822659226602266122662226632266422665226662266722668226692267022671226722267322674226752267622677226782267922680226812268222683226842268522686226872268822689226902269122692226932269422695226962269722698226992270022701227022270322704227052270622707227082270922710227112271222713227142271522716227172271822719227202272122722227232272422725227262272722728227292273022731227322273322734227352273622737227382273922740227412274222743227442274522746227472274822749227502275122752227532275422755227562275722758227592276022761227622276322764227652276622767227682276922770227712277222773227742277522776227772277822779227802278122782227832278422785227862278722788227892279022791227922279322794227952279622797227982279922800228012280222803228042280522806228072280822809228102281122812228132281422815228162281722818228192282022821228222282322824228252282622827228282282922830228312283222833228342283522836228372283822839228402284122842228432284422845228462284722848228492285022851228522285322854228552285622857228582285922860228612286222863228642286522866228672286822869228702287122872228732287422875228762287722878228792288022881228822288322884228852288622887228882288922890228912289222893228942289522896228972289822899229002290122902229032290422905229062290722908229092291022911229122291322914229152291622917229182291922920229212292222923229242292522926229272292822929229302293122932229332293422935229362293722938229392294022941229422294322944229452294622947229482294922950229512295222953229542295522956229572295822959229602296122962229632296422965229662296722968229692297022971229722297322974229752297622977229782297922980229812298222983229842298522986229872298822989229902299122992229932299422995229962299722998229992300023001230022300323004230052300623007230082300923010230112301223013230142301523016230172301823019230202302123022230232302423025230262302723028230292303023031230322303323034230352303623037230382303923040230412304223043230442304523046230472304823049230502305123052230532305423055230562305723058230592306023061230622306323064230652306623067230682306923070230712307223073230742307523076230772307823079230802308123082230832308423085230862308723088230892309023091230922309323094230952309623097230982309923100231012310223103231042310523106231072310823109231102311123112231132311423115231162311723118231192312023121231222312323124231252312623127231282312923130231312313223133231342313523136231372313823139231402314123142231432314423145231462314723148231492315023151231522315323154231552315623157231582315923160231612316223163231642316523166231672316823169231702317123172231732317423175231762317723178231792318023181231822318323184231852318623187231882318923190231912319223193231942319523196231972319823199232002320123202232032320423205232062320723208232092321023211232122321323214232152321623217232182321923220232212322223223232242322523226232272322823229232302323123232232332323423235232362323723238232392324023241232422324323244232452324623247232482324923250232512325223253232542325523256232572325823259232602326123262232632326423265232662326723268232692327023271232722327323274232752327623277232782327923280232812328223283232842328523286232872328823289232902329123292232932329423295232962329723298232992330023301233022330323304233052330623307233082330923310233112331223313233142331523316233172331823319233202332123322233232332423325233262332723328233292333023331233322333323334233352333623337233382333923340233412334223343233442334523346233472334823349233502335123352233532335423355233562335723358233592336023361233622336323364233652336623367233682336923370233712337223373233742337523376233772337823379233802338123382233832338423385233862338723388233892339023391233922339323394233952339623397233982339923400234012340223403234042340523406234072340823409234102341123412234132341423415234162341723418234192342023421234222342323424234252342623427234282342923430234312343223433234342343523436234372343823439234402344123442234432344423445234462344723448234492345023451234522345323454234552345623457234582345923460234612346223463234642346523466234672346823469234702347123472234732347423475234762347723478234792348023481234822348323484234852348623487234882348923490234912349223493234942349523496234972349823499235002350123502235032350423505235062350723508235092351023511235122351323514235152351623517235182351923520235212352223523235242352523526235272352823529235302353123532235332353423535235362353723538235392354023541235422354323544235452354623547235482354923550235512355223553235542355523556235572355823559235602356123562235632356423565235662356723568235692357023571235722357323574235752357623577235782357923580235812358223583235842358523586235872358823589235902359123592235932359423595235962359723598235992360023601236022360323604236052360623607236082360923610236112361223613236142361523616236172361823619236202362123622236232362423625236262362723628236292363023631236322363323634236352363623637236382363923640236412364223643236442364523646236472364823649236502365123652236532365423655236562365723658236592366023661236622366323664236652366623667236682366923670236712367223673236742367523676236772367823679236802368123682236832368423685236862368723688236892369023691236922369323694236952369623697236982369923700237012370223703237042370523706237072370823709237102371123712237132371423715237162371723718237192372023721237222372323724237252372623727237282372923730237312373223733237342373523736237372373823739237402374123742237432374423745237462374723748237492375023751237522375323754237552375623757237582375923760237612376223763237642376523766237672376823769237702377123772237732377423775237762377723778237792378023781237822378323784237852378623787237882378923790237912379223793237942379523796237972379823799238002380123802238032380423805238062380723808238092381023811238122381323814238152381623817238182381923820238212382223823238242382523826238272382823829238302383123832238332383423835238362383723838238392384023841238422384323844238452384623847238482384923850238512385223853238542385523856238572385823859238602386123862238632386423865238662386723868238692387023871238722387323874238752387623877238782387923880238812388223883238842388523886238872388823889238902389123892238932389423895238962389723898238992390023901239022390323904239052390623907239082390923910239112391223913239142391523916239172391823919239202392123922239232392423925239262392723928239292393023931239322393323934239352393623937239382393923940239412394223943239442394523946239472394823949239502395123952239532395423955239562395723958239592396023961239622396323964239652396623967239682396923970239712397223973239742397523976239772397823979239802398123982239832398423985239862398723988239892399023991239922399323994239952399623997239982399924000240012400224003240042400524006240072400824009240102401124012240132401424015240162401724018240192402024021240222402324024240252402624027240282402924030240312403224033240342403524036240372403824039240402404124042240432404424045240462404724048240492405024051240522405324054240552405624057240582405924060240612406224063240642406524066240672406824069240702407124072240732407424075240762407724078240792408024081240822408324084240852408624087240882408924090240912409224093240942409524096240972409824099241002410124102241032410424105241062410724108241092411024111241122411324114241152411624117241182411924120241212412224123241242412524126241272412824129241302413124132241332413424135241362413724138241392414024141241422414324144241452414624147241482414924150241512415224153241542415524156241572415824159241602416124162241632416424165241662416724168241692417024171241722417324174241752417624177241782417924180241812418224183241842418524186241872418824189241902419124192241932419424195241962419724198241992420024201242022420324204242052420624207242082420924210242112421224213242142421524216242172421824219242202422124222242232422424225242262422724228242292423024231242322423324234242352423624237242382423924240242412424224243242442424524246242472424824249242502425124252242532425424255242562425724258242592426024261242622426324264242652426624267242682426924270242712427224273242742427524276242772427824279242802428124282242832428424285242862428724288242892429024291242922429324294242952429624297242982429924300243012430224303243042430524306243072430824309243102431124312243132431424315243162431724318243192432024321243222432324324243252432624327243282432924330243312433224333243342433524336243372433824339243402434124342243432434424345243462434724348243492435024351243522435324354243552435624357243582435924360243612436224363243642436524366243672436824369243702437124372243732437424375243762437724378243792438024381243822438324384243852438624387243882438924390243912439224393243942439524396243972439824399244002440124402244032440424405244062440724408244092441024411244122441324414244152441624417244182441924420244212442224423244242442524426244272442824429244302443124432244332443424435244362443724438244392444024441244422444324444244452444624447244482444924450244512445224453244542445524456244572445824459244602446124462244632446424465244662446724468244692447024471244722447324474244752447624477244782447924480244812448224483244842448524486244872448824489244902449124492244932449424495244962449724498244992450024501245022450324504245052450624507245082450924510245112451224513245142451524516245172451824519245202452124522245232452424525245262452724528245292453024531245322453324534245352453624537245382453924540245412454224543245442454524546245472454824549245502455124552245532455424555245562455724558245592456024561245622456324564245652456624567245682456924570245712457224573245742457524576245772457824579245802458124582245832458424585245862458724588245892459024591245922459324594245952459624597245982459924600246012460224603246042460524606246072460824609246102461124612246132461424615246162461724618246192462024621246222462324624246252462624627246282462924630246312463224633246342463524636246372463824639246402464124642246432464424645246462464724648246492465024651246522465324654246552465624657246582465924660246612466224663246642466524666246672466824669246702467124672246732467424675246762467724678246792468024681246822468324684246852468624687246882468924690246912469224693246942469524696246972469824699247002470124702247032470424705247062470724708247092471024711247122471324714247152471624717247182471924720247212472224723247242472524726247272472824729247302473124732247332473424735247362473724738247392474024741247422474324744247452474624747247482474924750247512475224753247542475524756247572475824759247602476124762247632476424765247662476724768247692477024771247722477324774247752477624777247782477924780247812478224783247842478524786247872478824789247902479124792247932479424795247962479724798247992480024801248022480324804248052480624807248082480924810248112481224813248142481524816248172481824819248202482124822248232482424825248262482724828248292483024831248322483324834248352483624837248382483924840248412484224843248442484524846248472484824849248502485124852248532485424855248562485724858248592486024861248622486324864248652486624867248682486924870248712487224873248742487524876248772487824879248802488124882248832488424885248862488724888248892489024891248922489324894248952489624897248982489924900249012490224903249042490524906249072490824909249102491124912249132491424915249162491724918249192492024921249222492324924249252492624927249282492924930249312493224933249342493524936249372493824939249402494124942249432494424945249462494724948249492495024951249522495324954249552495624957249582495924960249612496224963249642496524966249672496824969249702497124972249732497424975249762497724978249792498024981249822498324984249852498624987249882498924990249912499224993249942499524996249972499824999250002500125002250032500425005250062500725008250092501025011250122501325014250152501625017250182501925020250212502225023250242502525026250272502825029250302503125032250332503425035250362503725038250392504025041250422504325044250452504625047250482504925050250512505225053250542505525056250572505825059250602506125062250632506425065250662506725068250692507025071250722507325074250752507625077250782507925080250812508225083250842508525086250872508825089250902509125092250932509425095250962509725098250992510025101251022510325104251052510625107251082510925110251112511225113251142511525116251172511825119251202512125122251232512425125251262512725128251292513025131251322513325134251352513625137251382513925140251412514225143251442514525146251472514825149251502515125152251532515425155251562515725158251592516025161251622516325164251652516625167251682516925170251712517225173251742517525176251772517825179251802518125182251832518425185251862518725188251892519025191251922519325194251952519625197251982519925200252012520225203252042520525206252072520825209252102521125212252132521425215252162521725218252192522025221252222522325224252252522625227252282522925230252312523225233252342523525236252372523825239252402524125242252432524425245252462524725248252492525025251252522525325254252552525625257252582525925260252612526225263252642526525266252672526825269252702527125272252732527425275252762527725278252792528025281252822528325284252852528625287252882528925290252912529225293252942529525296252972529825299253002530125302253032530425305253062530725308253092531025311253122531325314253152531625317253182531925320253212532225323253242532525326253272532825329253302533125332253332533425335253362533725338253392534025341253422534325344253452534625347253482534925350253512535225353253542535525356253572535825359253602536125362253632536425365253662536725368253692537025371253722537325374253752537625377253782537925380253812538225383253842538525386253872538825389253902539125392253932539425395253962539725398253992540025401254022540325404254052540625407254082540925410254112541225413254142541525416254172541825419254202542125422254232542425425254262542725428254292543025431254322543325434254352543625437254382543925440254412544225443254442544525446254472544825449254502545125452254532545425455254562545725458254592546025461254622546325464254652546625467254682546925470254712547225473254742547525476254772547825479254802548125482254832548425485254862548725488254892549025491254922549325494254952549625497254982549925500255012550225503255042550525506255072550825509255102551125512255132551425515255162551725518255192552025521255222552325524255252552625527255282552925530255312553225533255342553525536255372553825539255402554125542255432554425545255462554725548255492555025551255522555325554255552555625557255582555925560255612556225563255642556525566255672556825569255702557125572255732557425575255762557725578255792558025581255822558325584255852558625587255882558925590255912559225593255942559525596255972559825599256002560125602256032560425605256062560725608256092561025611256122561325614256152561625617256182561925620256212562225623256242562525626256272562825629256302563125632256332563425635256362563725638256392564025641256422564325644256452564625647256482564925650256512565225653256542565525656256572565825659256602566125662256632566425665256662566725668256692567025671256722567325674256752567625677256782567925680256812568225683256842568525686256872568825689256902569125692256932569425695256962569725698256992570025701257022570325704257052570625707257082570925710257112571225713257142571525716257172571825719257202572125722257232572425725257262572725728257292573025731257322573325734257352573625737257382573925740257412574225743257442574525746257472574825749257502575125752257532575425755257562575725758257592576025761257622576325764257652576625767257682576925770257712577225773257742577525776257772577825779257802578125782257832578425785257862578725788257892579025791257922579325794257952579625797257982579925800258012580225803258042580525806258072580825809258102581125812258132581425815258162581725818258192582025821258222582325824258252582625827258282582925830258312583225833258342583525836258372583825839258402584125842258432584425845258462584725848258492585025851258522585325854258552585625857258582585925860258612586225863258642586525866258672586825869258702587125872258732587425875258762587725878258792588025881258822588325884258852588625887258882588925890258912589225893258942589525896258972589825899259002590125902259032590425905259062590725908259092591025911259122591325914259152591625917259182591925920259212592225923259242592525926259272592825929259302593125932259332593425935259362593725938259392594025941259422594325944259452594625947259482594925950259512595225953259542595525956259572595825959259602596125962259632596425965259662596725968259692597025971259722597325974259752597625977259782597925980259812598225983259842598525986259872598825989259902599125992259932599425995259962599725998259992600026001260022600326004260052600626007260082600926010260112601226013260142601526016260172601826019260202602126022260232602426025260262602726028260292603026031260322603326034260352603626037260382603926040260412604226043260442604526046260472604826049260502605126052260532605426055260562605726058260592606026061260622606326064260652606626067260682606926070260712607226073260742607526076260772607826079260802608126082260832608426085260862608726088260892609026091260922609326094260952609626097260982609926100261012610226103261042610526106261072610826109261102611126112261132611426115261162611726118261192612026121261222612326124261252612626127261282612926130261312613226133261342613526136261372613826139261402614126142261432614426145261462614726148261492615026151261522615326154261552615626157261582615926160261612616226163261642616526166261672616826169261702617126172261732617426175261762617726178261792618026181261822618326184261852618626187261882618926190261912619226193261942619526196261972619826199262002620126202262032620426205262062620726208262092621026211262122621326214262152621626217262182621926220262212622226223262242622526226262272622826229262302623126232262332623426235262362623726238262392624026241262422624326244262452624626247262482624926250262512625226253262542625526256262572625826259262602626126262262632626426265262662626726268262692627026271262722627326274262752627626277262782627926280262812628226283262842628526286262872628826289262902629126292262932629426295262962629726298262992630026301263022630326304263052630626307263082630926310263112631226313263142631526316263172631826319263202632126322263232632426325263262632726328263292633026331263322633326334263352633626337263382633926340263412634226343263442634526346263472634826349263502635126352263532635426355263562635726358263592636026361263622636326364263652636626367263682636926370263712637226373263742637526376263772637826379263802638126382263832638426385263862638726388263892639026391263922639326394263952639626397263982639926400264012640226403264042640526406264072640826409264102641126412264132641426415264162641726418264192642026421264222642326424264252642626427264282642926430264312643226433264342643526436264372643826439264402644126442264432644426445264462644726448264492645026451264522645326454264552645626457264582645926460264612646226463264642646526466264672646826469264702647126472264732647426475264762647726478264792648026481264822648326484264852648626487264882648926490264912649226493264942649526496264972649826499265002650126502265032650426505265062650726508265092651026511265122651326514265152651626517265182651926520265212652226523265242652526526265272652826529265302653126532265332653426535265362653726538265392654026541265422654326544265452654626547265482654926550265512655226553265542655526556265572655826559265602656126562265632656426565265662656726568265692657026571265722657326574265752657626577265782657926580265812658226583265842658526586265872658826589265902659126592265932659426595265962659726598265992660026601266022660326604266052660626607266082660926610266112661226613266142661526616266172661826619266202662126622266232662426625266262662726628266292663026631266322663326634266352663626637266382663926640266412664226643266442664526646266472664826649266502665126652266532665426655266562665726658266592666026661266622666326664266652666626667266682666926670266712667226673266742667526676266772667826679266802668126682266832668426685266862668726688266892669026691266922669326694266952669626697266982669926700267012670226703267042670526706267072670826709267102671126712267132671426715267162671726718267192672026721267222672326724267252672626727267282672926730267312673226733267342673526736267372673826739267402674126742267432674426745267462674726748267492675026751267522675326754267552675626757267582675926760267612676226763267642676526766267672676826769267702677126772267732677426775267762677726778267792678026781267822678326784267852678626787267882678926790267912679226793267942679526796267972679826799268002680126802268032680426805268062680726808268092681026811268122681326814268152681626817268182681926820268212682226823268242682526826268272682826829268302683126832268332683426835268362683726838268392684026841268422684326844268452684626847268482684926850268512685226853268542685526856268572685826859268602686126862268632686426865268662686726868268692687026871268722687326874268752687626877268782687926880268812688226883268842688526886268872688826889268902689126892268932689426895268962689726898268992690026901269022690326904269052690626907269082690926910269112691226913269142691526916269172691826919269202692126922269232692426925269262692726928269292693026931269322693326934269352693626937269382693926940269412694226943269442694526946269472694826949269502695126952269532695426955269562695726958269592696026961269622696326964269652696626967269682696926970269712697226973269742697526976269772697826979269802698126982269832698426985269862698726988269892699026991269922699326994269952699626997269982699927000270012700227003270042700527006270072700827009270102701127012270132701427015270162701727018270192702027021270222702327024270252702627027270282702927030270312703227033270342703527036270372703827039270402704127042270432704427045270462704727048270492705027051270522705327054270552705627057270582705927060270612706227063270642706527066270672706827069270702707127072270732707427075270762707727078270792708027081270822708327084270852708627087270882708927090270912709227093270942709527096270972709827099271002710127102271032710427105271062710727108271092711027111271122711327114271152711627117271182711927120271212712227123271242712527126271272712827129271302713127132271332713427135271362713727138271392714027141271422714327144271452714627147271482714927150271512715227153271542715527156271572715827159271602716127162271632716427165271662716727168271692717027171271722717327174271752717627177271782717927180271812718227183271842718527186271872718827189271902719127192271932719427195271962719727198271992720027201272022720327204272052720627207272082720927210272112721227213272142721527216272172721827219272202722127222272232722427225272262722727228272292723027231272322723327234272352723627237272382723927240272412724227243272442724527246272472724827249272502725127252272532725427255272562725727258272592726027261272622726327264272652726627267272682726927270272712727227273272742727527276272772727827279272802728127282272832728427285272862728727288272892729027291272922729327294272952729627297272982729927300273012730227303273042730527306273072730827309273102731127312273132731427315273162731727318273192732027321273222732327324273252732627327273282732927330273312733227333273342733527336273372733827339273402734127342273432734427345273462734727348273492735027351273522735327354273552735627357273582735927360273612736227363273642736527366273672736827369273702737127372273732737427375273762737727378273792738027381273822738327384273852738627387273882738927390273912739227393273942739527396273972739827399274002740127402274032740427405274062740727408274092741027411274122741327414274152741627417274182741927420274212742227423274242742527426274272742827429274302743127432274332743427435274362743727438274392744027441274422744327444274452744627447274482744927450274512745227453274542745527456274572745827459274602746127462274632746427465274662746727468274692747027471274722747327474274752747627477274782747927480274812748227483274842748527486274872748827489274902749127492274932749427495274962749727498274992750027501275022750327504275052750627507275082750927510275112751227513275142751527516275172751827519275202752127522275232752427525275262752727528275292753027531275322753327534275352753627537275382753927540275412754227543275442754527546275472754827549275502755127552275532755427555275562755727558275592756027561275622756327564275652756627567275682756927570275712757227573275742757527576275772757827579275802758127582275832758427585275862758727588275892759027591275922759327594275952759627597275982759927600276012760227603276042760527606276072760827609276102761127612276132761427615276162761727618276192762027621276222762327624276252762627627276282762927630276312763227633276342763527636276372763827639276402764127642276432764427645276462764727648276492765027651276522765327654276552765627657276582765927660276612766227663276642766527666276672766827669276702767127672276732767427675276762767727678276792768027681276822768327684276852768627687276882768927690276912769227693276942769527696276972769827699277002770127702277032770427705277062770727708277092771027711277122771327714277152771627717277182771927720277212772227723277242772527726277272772827729277302773127732277332773427735277362773727738277392774027741277422774327744277452774627747277482774927750277512775227753277542775527756277572775827759277602776127762277632776427765277662776727768277692777027771277722777327774277752777627777277782777927780277812778227783277842778527786277872778827789277902779127792277932779427795277962779727798277992780027801278022780327804278052780627807278082780927810278112781227813278142781527816278172781827819278202782127822278232782427825278262782727828278292783027831278322783327834278352783627837278382783927840278412784227843278442784527846278472784827849278502785127852278532785427855278562785727858278592786027861278622786327864278652786627867278682786927870278712787227873278742787527876278772787827879278802788127882278832788427885278862788727888278892789027891278922789327894278952789627897278982789927900279012790227903279042790527906279072790827909279102791127912279132791427915279162791727918279192792027921279222792327924279252792627927279282792927930279312793227933279342793527936279372793827939279402794127942279432794427945279462794727948279492795027951279522795327954279552795627957279582795927960279612796227963279642796527966279672796827969279702797127972279732797427975279762797727978279792798027981279822798327984279852798627987279882798927990279912799227993279942799527996279972799827999280002800128002280032800428005280062800728008280092801028011280122801328014280152801628017280182801928020280212802228023280242802528026280272802828029280302803128032280332803428035280362803728038280392804028041280422804328044280452804628047280482804928050280512805228053280542805528056280572805828059280602806128062280632806428065280662806728068280692807028071280722807328074280752807628077280782807928080280812808228083280842808528086280872808828089280902809128092280932809428095280962809728098280992810028101281022810328104281052810628107281082810928110281112811228113281142811528116281172811828119281202812128122281232812428125281262812728128281292813028131281322813328134281352813628137281382813928140281412814228143281442814528146281472814828149281502815128152281532815428155281562815728158281592816028161281622816328164281652816628167281682816928170281712817228173281742817528176281772817828179281802818128182281832818428185281862818728188281892819028191281922819328194281952819628197281982819928200282012820228203282042820528206282072820828209282102821128212282132821428215282162821728218282192822028221282222822328224282252822628227282282822928230282312823228233282342823528236282372823828239282402824128242282432824428245282462824728248282492825028251282522825328254282552825628257282582825928260282612826228263282642826528266282672826828269282702827128272282732827428275282762827728278282792828028281282822828328284282852828628287282882828928290282912829228293282942829528296282972829828299283002830128302283032830428305283062830728308283092831028311283122831328314283152831628317283182831928320283212832228323283242832528326283272832828329283302833128332283332833428335283362833728338283392834028341283422834328344283452834628347283482834928350283512835228353283542835528356283572835828359283602836128362283632836428365283662836728368283692837028371283722837328374283752837628377283782837928380283812838228383283842838528386283872838828389283902839128392283932839428395283962839728398283992840028401284022840328404284052840628407284082840928410284112841228413284142841528416284172841828419284202842128422284232842428425284262842728428284292843028431284322843328434284352843628437284382843928440284412844228443284442844528446284472844828449284502845128452284532845428455284562845728458284592846028461284622846328464284652846628467284682846928470284712847228473284742847528476284772847828479284802848128482284832848428485284862848728488284892849028491284922849328494284952849628497284982849928500285012850228503285042850528506285072850828509285102851128512285132851428515285162851728518285192852028521285222852328524285252852628527285282852928530285312853228533285342853528536285372853828539285402854128542285432854428545285462854728548285492855028551285522855328554285552855628557285582855928560285612856228563285642856528566285672856828569285702857128572285732857428575285762857728578285792858028581285822858328584285852858628587285882858928590285912859228593285942859528596285972859828599286002860128602286032860428605286062860728608286092861028611286122861328614286152861628617286182861928620286212862228623286242862528626286272862828629286302863128632286332863428635286362863728638286392864028641286422864328644286452864628647286482864928650286512865228653286542865528656286572865828659286602866128662286632866428665286662866728668286692867028671286722867328674286752867628677286782867928680286812868228683286842868528686286872868828689286902869128692286932869428695286962869728698286992870028701287022870328704287052870628707287082870928710287112871228713287142871528716287172871828719287202872128722287232872428725287262872728728287292873028731287322873328734287352873628737287382873928740287412874228743287442874528746287472874828749287502875128752287532875428755287562875728758287592876028761287622876328764287652876628767287682876928770287712877228773287742877528776287772877828779287802878128782287832878428785287862878728788287892879028791287922879328794287952879628797287982879928800288012880228803288042880528806288072880828809288102881128812288132881428815288162881728818288192882028821288222882328824288252882628827288282882928830288312883228833288342883528836288372883828839288402884128842288432884428845288462884728848288492885028851288522885328854288552885628857288582885928860288612886228863288642886528866288672886828869288702887128872288732887428875288762887728878288792888028881288822888328884288852888628887288882888928890288912889228893288942889528896288972889828899289002890128902289032890428905289062890728908289092891028911289122891328914289152891628917289182891928920289212892228923289242892528926289272892828929289302893128932289332893428935289362893728938289392894028941289422894328944289452894628947289482894928950289512895228953289542895528956289572895828959289602896128962289632896428965289662896728968289692897028971289722897328974289752897628977289782897928980289812898228983289842898528986289872898828989289902899128992289932899428995289962899728998289992900029001290022900329004290052900629007290082900929010290112901229013290142901529016290172901829019290202902129022290232902429025290262902729028290292903029031290322903329034290352903629037290382903929040290412904229043290442904529046290472904829049290502905129052290532905429055290562905729058290592906029061290622906329064290652906629067290682906929070290712907229073290742907529076290772907829079290802908129082290832908429085290862908729088290892909029091290922909329094290952909629097290982909929100291012910229103291042910529106291072910829109291102911129112291132911429115291162911729118291192912029121291222912329124291252912629127291282912929130291312913229133291342913529136291372913829139291402914129142291432914429145291462914729148291492915029151291522915329154291552915629157291582915929160291612916229163291642916529166291672916829169291702917129172291732917429175291762917729178291792918029181291822918329184291852918629187291882918929190291912919229193291942919529196291972919829199292002920129202292032920429205292062920729208292092921029211292122921329214292152921629217292182921929220292212922229223292242922529226292272922829229292302923129232292332923429235292362923729238292392924029241292422924329244292452924629247292482924929250292512925229253292542925529256292572925829259292602926129262292632926429265292662926729268292692927029271292722927329274292752927629277292782927929280292812928229283292842928529286292872928829289292902929129292292932929429295292962929729298292992930029301293022930329304293052930629307293082930929310293112931229313293142931529316293172931829319293202932129322293232932429325293262932729328293292933029331293322933329334293352933629337293382933929340293412934229343293442934529346293472934829349293502935129352293532935429355293562935729358293592936029361293622936329364293652936629367293682936929370293712937229373293742937529376293772937829379293802938129382293832938429385293862938729388293892939029391293922939329394293952939629397293982939929400294012940229403294042940529406294072940829409294102941129412294132941429415294162941729418294192942029421294222942329424294252942629427294282942929430294312943229433294342943529436294372943829439294402944129442294432944429445294462944729448294492945029451294522945329454294552945629457294582945929460294612946229463294642946529466294672946829469294702947129472294732947429475294762947729478294792948029481294822948329484294852948629487294882948929490294912949229493294942949529496294972949829499295002950129502295032950429505295062950729508295092951029511295122951329514295152951629517295182951929520295212952229523295242952529526295272952829529295302953129532295332953429535295362953729538295392954029541295422954329544295452954629547295482954929550295512955229553295542955529556295572955829559295602956129562295632956429565295662956729568295692957029571295722957329574295752957629577295782957929580295812958229583295842958529586295872958829589295902959129592295932959429595295962959729598295992960029601296022960329604296052960629607296082960929610296112961229613296142961529616296172961829619296202962129622296232962429625296262962729628296292963029631296322963329634296352963629637296382963929640296412964229643296442964529646296472964829649296502965129652296532965429655296562965729658296592966029661296622966329664296652966629667296682966929670296712967229673296742967529676296772967829679296802968129682296832968429685296862968729688296892969029691296922969329694296952969629697296982969929700297012970229703297042970529706297072970829709297102971129712297132971429715297162971729718297192972029721297222972329724297252972629727297282972929730297312973229733297342973529736297372973829739297402974129742297432974429745297462974729748297492975029751297522975329754297552975629757297582975929760297612976229763297642976529766297672976829769297702977129772297732977429775297762977729778297792978029781297822978329784297852978629787297882978929790297912979229793297942979529796297972979829799298002980129802298032980429805298062980729808298092981029811298122981329814298152981629817298182981929820298212982229823298242982529826298272982829829298302983129832298332983429835298362983729838298392984029841298422984329844298452984629847298482984929850298512985229853298542985529856298572985829859298602986129862298632986429865298662986729868298692987029871298722987329874298752987629877298782987929880298812988229883298842988529886298872988829889298902989129892298932989429895298962989729898298992990029901299022990329904299052990629907299082990929910299112991229913299142991529916299172991829919299202992129922299232992429925299262992729928299292993029931299322993329934299352993629937299382993929940299412994229943299442994529946299472994829949299502995129952299532995429955299562995729958299592996029961299622996329964299652996629967299682996929970299712997229973299742997529976299772997829979299802998129982299832998429985299862998729988299892999029991299922999329994299952999629997299982999930000300013000230003300043000530006300073000830009300103001130012300133001430015300163001730018300193002030021300223002330024300253002630027300283002930030300313003230033300343003530036300373003830039300403004130042300433004430045300463004730048300493005030051300523005330054300553005630057300583005930060300613006230063300643006530066300673006830069300703007130072300733007430075300763007730078300793008030081300823008330084300853008630087300883008930090300913009230093300943009530096300973009830099301003010130102301033010430105301063010730108301093011030111301123011330114301153011630117301183011930120301213012230123301243012530126301273012830129301303013130132301333013430135301363013730138301393014030141301423014330144301453014630147301483014930150301513015230153301543015530156301573015830159301603016130162301633016430165301663016730168301693017030171301723017330174301753017630177301783017930180301813018230183301843018530186301873018830189301903019130192301933019430195301963019730198301993020030201302023020330204302053020630207302083020930210302113021230213302143021530216302173021830219302203022130222302233022430225302263022730228302293023030231302323023330234302353023630237302383023930240302413024230243302443024530246302473024830249302503025130252302533025430255302563025730258302593026030261302623026330264302653026630267302683026930270302713027230273302743027530276302773027830279302803028130282302833028430285302863028730288302893029030291302923029330294302953029630297302983029930300303013030230303303043030530306303073030830309303103031130312303133031430315303163031730318303193032030321303223032330324303253032630327303283032930330303313033230333303343033530336303373033830339303403034130342303433034430345303463034730348303493035030351303523035330354303553035630357303583035930360303613036230363303643036530366303673036830369303703037130372303733037430375303763037730378303793038030381303823038330384303853038630387303883038930390303913039230393303943039530396303973039830399304003040130402304033040430405304063040730408304093041030411304123041330414304153041630417304183041930420304213042230423304243042530426304273042830429304303043130432304333043430435304363043730438304393044030441304423044330444304453044630447304483044930450304513045230453304543045530456304573045830459304603046130462304633046430465304663046730468304693047030471304723047330474304753047630477304783047930480304813048230483304843048530486304873048830489304903049130492304933049430495304963049730498304993050030501305023050330504305053050630507305083050930510305113051230513305143051530516305173051830519305203052130522305233052430525305263052730528305293053030531305323053330534305353053630537305383053930540305413054230543305443054530546305473054830549305503055130552305533055430555305563055730558305593056030561305623056330564305653056630567305683056930570305713057230573305743057530576305773057830579305803058130582305833058430585305863058730588305893059030591305923059330594305953059630597305983059930600306013060230603306043060530606306073060830609306103061130612306133061430615306163061730618306193062030621306223062330624306253062630627306283062930630306313063230633306343063530636306373063830639306403064130642306433064430645306463064730648306493065030651306523065330654306553065630657306583065930660306613066230663306643066530666306673066830669306703067130672306733067430675306763067730678306793068030681306823068330684306853068630687306883068930690306913069230693306943069530696306973069830699307003070130702307033070430705307063070730708307093071030711307123071330714307153071630717307183071930720307213072230723307243072530726307273072830729307303073130732307333073430735307363073730738307393074030741307423074330744307453074630747307483074930750307513075230753307543075530756307573075830759307603076130762307633076430765307663076730768307693077030771307723077330774307753077630777307783077930780307813078230783307843078530786307873078830789307903079130792307933079430795307963079730798307993080030801308023080330804308053080630807308083080930810308113081230813308143081530816308173081830819308203082130822308233082430825308263082730828308293083030831308323083330834308353083630837308383083930840308413084230843308443084530846308473084830849308503085130852308533085430855308563085730858308593086030861308623086330864308653086630867308683086930870308713087230873308743087530876308773087830879308803088130882308833088430885308863088730888308893089030891308923089330894308953089630897308983089930900309013090230903309043090530906309073090830909309103091130912309133091430915309163091730918309193092030921309223092330924309253092630927309283092930930309313093230933309343093530936309373093830939309403094130942309433094430945309463094730948309493095030951309523095330954309553095630957309583095930960309613096230963309643096530966309673096830969309703097130972309733097430975309763097730978309793098030981309823098330984309853098630987309883098930990309913099230993309943099530996309973099830999310003100131002310033100431005310063100731008310093101031011310123101331014310153101631017310183101931020310213102231023310243102531026310273102831029310303103131032310333103431035310363103731038310393104031041310423104331044310453104631047310483104931050310513105231053310543105531056310573105831059310603106131062310633106431065310663106731068310693107031071310723107331074310753107631077310783107931080310813108231083310843108531086310873108831089310903109131092310933109431095310963109731098310993110031101311023110331104311053110631107311083110931110311113111231113311143111531116311173111831119311203112131122311233112431125311263112731128311293113031131311323113331134311353113631137311383113931140311413114231143311443114531146311473114831149311503115131152311533115431155311563115731158311593116031161311623116331164311653116631167311683116931170311713117231173311743117531176311773117831179311803118131182311833118431185311863118731188311893119031191311923119331194311953119631197311983119931200312013120231203312043120531206312073120831209312103121131212312133121431215312163121731218312193122031221312223122331224312253122631227312283122931230312313123231233312343123531236312373123831239312403124131242312433124431245312463124731248312493125031251312523125331254312553125631257312583125931260312613126231263312643126531266312673126831269312703127131272312733127431275312763127731278312793128031281312823128331284312853128631287312883128931290312913129231293312943129531296312973129831299313003130131302313033130431305313063130731308313093131031311313123131331314313153131631317313183131931320313213132231323313243132531326313273132831329313303133131332313333133431335313363133731338313393134031341313423134331344313453134631347313483134931350313513135231353313543135531356313573135831359313603136131362313633136431365313663136731368313693137031371313723137331374313753137631377313783137931380313813138231383313843138531386313873138831389313903139131392313933139431395313963139731398313993140031401314023140331404314053140631407314083140931410314113141231413314143141531416314173141831419314203142131422314233142431425314263142731428314293143031431314323143331434314353143631437314383143931440314413144231443314443144531446314473144831449314503145131452314533145431455314563145731458314593146031461314623146331464314653146631467314683146931470314713147231473314743147531476314773147831479314803148131482314833148431485314863148731488314893149031491314923149331494314953149631497314983149931500315013150231503315043150531506315073150831509315103151131512315133151431515315163151731518315193152031521315223152331524315253152631527315283152931530315313153231533315343153531536315373153831539315403154131542315433154431545315463154731548315493155031551315523155331554315553155631557315583155931560315613156231563315643156531566315673156831569315703157131572315733157431575315763157731578315793158031581315823158331584315853158631587315883158931590315913159231593315943159531596315973159831599316003160131602316033160431605316063160731608316093161031611316123161331614316153161631617316183161931620316213162231623316243162531626316273162831629316303163131632316333163431635316363163731638316393164031641316423164331644316453164631647316483164931650316513165231653316543165531656316573165831659316603166131662316633166431665316663166731668316693167031671316723167331674316753167631677316783167931680316813168231683316843168531686316873168831689316903169131692316933169431695316963169731698316993170031701317023170331704317053170631707317083170931710317113171231713317143171531716317173171831719317203172131722317233172431725317263172731728317293173031731317323173331734317353173631737317383173931740317413174231743317443174531746317473174831749317503175131752317533175431755317563175731758317593176031761317623176331764317653176631767317683176931770317713177231773317743177531776317773177831779317803178131782317833178431785317863178731788317893179031791317923179331794317953179631797317983179931800318013180231803318043180531806318073180831809318103181131812318133181431815318163181731818318193182031821318223182331824318253182631827318283182931830318313183231833318343183531836318373183831839318403184131842318433184431845318463184731848318493185031851318523185331854318553185631857318583185931860318613186231863318643186531866318673186831869318703187131872318733187431875318763187731878318793188031881318823188331884318853188631887318883188931890318913189231893318943189531896318973189831899319003190131902319033190431905319063190731908319093191031911319123191331914319153191631917319183191931920319213192231923319243192531926319273192831929319303193131932319333193431935319363193731938319393194031941319423194331944319453194631947319483194931950319513195231953319543195531956319573195831959319603196131962319633196431965319663196731968319693197031971319723197331974319753197631977319783197931980319813198231983319843198531986319873198831989319903199131992319933199431995319963199731998319993200032001320023200332004320053200632007320083200932010320113201232013320143201532016320173201832019320203202132022320233202432025320263202732028320293203032031320323203332034320353203632037320383203932040320413204232043320443204532046320473204832049320503205132052320533205432055320563205732058320593206032061320623206332064320653206632067320683206932070320713207232073320743207532076320773207832079320803208132082320833208432085320863208732088320893209032091320923209332094320953209632097320983209932100321013210232103321043210532106321073210832109321103211132112321133211432115321163211732118321193212032121321223212332124321253212632127321283212932130321313213232133321343213532136321373213832139321403214132142321433214432145321463214732148321493215032151321523215332154321553215632157321583215932160321613216232163321643216532166321673216832169321703217132172321733217432175321763217732178321793218032181321823218332184321853218632187321883218932190321913219232193321943219532196321973219832199322003220132202322033220432205322063220732208322093221032211322123221332214322153221632217322183221932220322213222232223322243222532226322273222832229322303223132232322333223432235322363223732238322393224032241322423224332244322453224632247322483224932250322513225232253322543225532256322573225832259322603226132262322633226432265322663226732268322693227032271322723227332274322753227632277322783227932280322813228232283322843228532286322873228832289322903229132292322933229432295322963229732298322993230032301323023230332304323053230632307323083230932310323113231232313323143231532316323173231832319323203232132322323233232432325323263232732328323293233032331323323233332334323353233632337323383233932340323413234232343323443234532346323473234832349323503235132352323533235432355323563235732358323593236032361323623236332364323653236632367323683236932370323713237232373323743237532376323773237832379323803238132382323833238432385323863238732388323893239032391323923239332394323953239632397323983239932400324013240232403324043240532406324073240832409324103241132412324133241432415324163241732418324193242032421324223242332424324253242632427324283242932430324313243232433324343243532436324373243832439324403244132442324433244432445324463244732448324493245032451324523245332454324553245632457324583245932460324613246232463324643246532466324673246832469324703247132472324733247432475324763247732478324793248032481324823248332484324853248632487324883248932490324913249232493324943249532496324973249832499325003250132502325033250432505325063250732508325093251032511325123251332514325153251632517325183251932520325213252232523325243252532526325273252832529325303253132532325333253432535325363253732538325393254032541325423254332544325453254632547325483254932550325513255232553325543255532556325573255832559325603256132562325633256432565325663256732568325693257032571325723257332574325753257632577325783257932580325813258232583325843258532586325873258832589325903259132592325933259432595325963259732598325993260032601326023260332604326053260632607326083260932610326113261232613326143261532616326173261832619326203262132622326233262432625326263262732628326293263032631326323263332634326353263632637326383263932640326413264232643326443264532646326473264832649326503265132652326533265432655326563265732658326593266032661326623266332664326653266632667326683266932670326713267232673326743267532676326773267832679326803268132682326833268432685326863268732688326893269032691326923269332694326953269632697326983269932700327013270232703327043270532706327073270832709327103271132712327133271432715327163271732718327193272032721327223272332724327253272632727327283272932730327313273232733327343273532736327373273832739327403274132742327433274432745327463274732748327493275032751327523275332754327553275632757327583275932760327613276232763327643276532766327673276832769327703277132772327733277432775327763277732778327793278032781327823278332784327853278632787327883278932790327913279232793327943279532796327973279832799328003280132802328033280432805328063280732808328093281032811328123281332814328153281632817328183281932820328213282232823328243282532826328273282832829328303283132832328333283432835328363283732838328393284032841328423284332844328453284632847328483284932850328513285232853328543285532856328573285832859328603286132862328633286432865328663286732868328693287032871328723287332874328753287632877328783287932880328813288232883328843288532886328873288832889328903289132892328933289432895328963289732898328993290032901329023290332904329053290632907329083290932910329113291232913329143291532916329173291832919329203292132922329233292432925329263292732928329293293032931329323293332934329353293632937329383293932940329413294232943329443294532946329473294832949329503295132952329533295432955329563295732958329593296032961329623296332964329653296632967329683296932970329713297232973329743297532976329773297832979329803298132982329833298432985329863298732988329893299032991329923299332994329953299632997329983299933000330013300233003330043300533006330073300833009330103301133012330133301433015330163301733018330193302033021330223302333024330253302633027330283302933030330313303233033330343303533036330373303833039330403304133042330433304433045330463304733048330493305033051330523305333054330553305633057330583305933060330613306233063330643306533066330673306833069330703307133072330733307433075330763307733078330793308033081330823308333084330853308633087330883308933090330913309233093330943309533096330973309833099331003310133102331033310433105331063310733108331093311033111331123311333114331153311633117331183311933120331213312233123331243312533126331273312833129331303313133132331333313433135331363313733138331393314033141331423314333144331453314633147331483314933150331513315233153331543315533156331573315833159331603316133162331633316433165331663316733168331693317033171331723317333174331753317633177331783317933180331813318233183331843318533186331873318833189331903319133192331933319433195331963319733198331993320033201332023320333204332053320633207332083320933210332113321233213332143321533216332173321833219332203322133222332233322433225332263322733228332293323033231332323323333234332353323633237332383323933240332413324233243332443324533246332473324833249332503325133252332533325433255332563325733258332593326033261332623326333264332653326633267332683326933270332713327233273332743327533276332773327833279332803328133282332833328433285332863328733288332893329033291332923329333294332953329633297332983329933300333013330233303333043330533306333073330833309333103331133312333133331433315333163331733318333193332033321333223332333324333253332633327333283332933330333313333233333333343333533336333373333833339333403334133342333433334433345333463334733348333493335033351333523335333354333553335633357333583335933360333613336233363333643336533366333673336833369333703337133372333733337433375333763337733378333793338033381333823338333384333853338633387333883338933390333913339233393333943339533396333973339833399334003340133402334033340433405334063340733408334093341033411334123341333414334153341633417334183341933420334213342233423334243342533426334273342833429334303343133432334333343433435334363343733438334393344033441334423344333444334453344633447334483344933450334513345233453334543345533456334573345833459334603346133462334633346433465334663346733468334693347033471334723347333474334753347633477334783347933480334813348233483334843348533486334873348833489334903349133492334933349433495334963349733498334993350033501335023350333504335053350633507335083350933510335113351233513335143351533516335173351833519335203352133522335233352433525335263352733528335293353033531335323353333534335353353633537335383353933540335413354233543335443354533546335473354833549335503355133552335533355433555335563355733558335593356033561335623356333564335653356633567335683356933570335713357233573335743357533576335773357833579335803358133582335833358433585335863358733588335893359033591335923359333594335953359633597335983359933600336013360233603336043360533606336073360833609336103361133612336133361433615336163361733618336193362033621336223362333624336253362633627336283362933630336313363233633336343363533636336373363833639336403364133642336433364433645336463364733648336493365033651336523365333654336553365633657336583365933660336613366233663336643366533666336673366833669336703367133672336733367433675336763367733678336793368033681336823368333684336853368633687336883368933690336913369233693336943369533696336973369833699337003370133702337033370433705337063370733708337093371033711337123371333714337153371633717337183371933720337213372233723337243372533726337273372833729337303373133732337333373433735337363373733738337393374033741337423374333744337453374633747337483374933750337513375233753337543375533756337573375833759337603376133762337633376433765337663376733768337693377033771337723377333774337753377633777337783377933780337813378233783337843378533786337873378833789337903379133792337933379433795337963379733798337993380033801338023380333804338053380633807338083380933810338113381233813338143381533816338173381833819338203382133822338233382433825338263382733828338293383033831338323383333834338353383633837338383383933840338413384233843338443384533846338473384833849338503385133852338533385433855338563385733858338593386033861338623386333864338653386633867338683386933870338713387233873338743387533876338773387833879338803388133882338833388433885338863388733888338893389033891338923389333894338953389633897338983389933900339013390233903339043390533906339073390833909339103391133912339133391433915339163391733918339193392033921339223392333924339253392633927339283392933930339313393233933339343393533936339373393833939339403394133942339433394433945339463394733948339493395033951339523395333954339553395633957339583395933960339613396233963339643396533966339673396833969339703397133972339733397433975339763397733978339793398033981339823398333984339853398633987339883398933990339913399233993339943399533996339973399833999340003400134002340033400434005340063400734008340093401034011340123401334014340153401634017340183401934020340213402234023340243402534026340273402834029340303403134032340333403434035340363403734038340393404034041340423404334044340453404634047340483404934050340513405234053340543405534056340573405834059340603406134062340633406434065340663406734068340693407034071340723407334074340753407634077340783407934080340813408234083340843408534086340873408834089340903409134092340933409434095340963409734098340993410034101341023410334104341053410634107341083410934110341113411234113341143411534116341173411834119341203412134122341233412434125341263412734128341293413034131341323413334134341353413634137341383413934140341413414234143341443414534146341473414834149341503415134152341533415434155341563415734158341593416034161341623416334164341653416634167341683416934170341713417234173341743417534176341773417834179341803418134182341833418434185341863418734188341893419034191341923419334194341953419634197341983419934200342013420234203342043420534206342073420834209342103421134212342133421434215342163421734218342193422034221342223422334224342253422634227342283422934230342313423234233342343423534236342373423834239342403424134242342433424434245342463424734248342493425034251342523425334254342553425634257342583425934260342613426234263342643426534266342673426834269342703427134272342733427434275342763427734278342793428034281342823428334284342853428634287342883428934290342913429234293342943429534296342973429834299343003430134302343033430434305343063430734308343093431034311343123431334314343153431634317343183431934320343213432234323343243432534326343273432834329343303433134332343333433434335343363433734338343393434034341343423434334344343453434634347343483434934350343513435234353343543435534356343573435834359343603436134362343633436434365343663436734368343693437034371343723437334374343753437634377343783437934380343813438234383343843438534386343873438834389343903439134392343933439434395343963439734398343993440034401344023440334404344053440634407344083440934410344113441234413344143441534416344173441834419344203442134422344233442434425344263442734428344293443034431344323443334434344353443634437344383443934440344413444234443344443444534446344473444834449344503445134452344533445434455344563445734458344593446034461344623446334464344653446634467344683446934470344713447234473344743447534476344773447834479344803448134482344833448434485344863448734488344893449034491344923449334494344953449634497344983449934500345013450234503345043450534506345073450834509345103451134512345133451434515345163451734518345193452034521345223452334524345253452634527345283452934530345313453234533345343453534536345373453834539345403454134542345433454434545345463454734548345493455034551345523455334554345553455634557345583455934560345613456234563345643456534566345673456834569345703457134572345733457434575345763457734578345793458034581345823458334584345853458634587345883458934590345913459234593345943459534596345973459834599346003460134602346033460434605346063460734608346093461034611346123461334614346153461634617346183461934620346213462234623346243462534626346273462834629346303463134632346333463434635346363463734638346393464034641346423464334644346453464634647346483464934650346513465234653346543465534656346573465834659346603466134662346633466434665346663466734668346693467034671346723467334674346753467634677346783467934680346813468234683346843468534686346873468834689346903469134692346933469434695346963469734698346993470034701347023470334704347053470634707347083470934710347113471234713347143471534716347173471834719347203472134722347233472434725347263472734728347293473034731347323473334734347353473634737347383473934740347413474234743347443474534746347473474834749347503475134752347533475434755347563475734758347593476034761347623476334764347653476634767347683476934770347713477234773347743477534776347773477834779347803478134782347833478434785347863478734788347893479034791347923479334794347953479634797347983479934800348013480234803348043480534806348073480834809348103481134812348133481434815348163481734818348193482034821348223482334824348253482634827348283482934830348313483234833348343483534836348373483834839348403484134842348433484434845348463484734848348493485034851348523485334854348553485634857348583485934860348613486234863348643486534866348673486834869348703487134872348733487434875348763487734878348793488034881348823488334884348853488634887348883488934890348913489234893348943489534896348973489834899349003490134902349033490434905349063490734908349093491034911349123491334914349153491634917349183491934920349213492234923349243492534926349273492834929349303493134932349333493434935349363493734938349393494034941349423494334944349453494634947349483494934950349513495234953349543495534956349573495834959349603496134962349633496434965349663496734968349693497034971349723497334974349753497634977349783497934980349813498234983349843498534986349873498834989349903499134992349933499434995349963499734998349993500035001350023500335004350053500635007350083500935010350113501235013350143501535016350173501835019350203502135022350233502435025350263502735028350293503035031350323503335034350353503635037350383503935040350413504235043350443504535046350473504835049350503505135052350533505435055350563505735058350593506035061350623506335064350653506635067350683506935070350713507235073350743507535076350773507835079350803508135082350833508435085350863508735088350893509035091350923509335094350953509635097350983509935100351013510235103351043510535106351073510835109351103511135112351133511435115351163511735118351193512035121351223512335124351253512635127351283512935130351313513235133351343513535136351373513835139351403514135142351433514435145351463514735148351493515035151351523515335154351553515635157351583515935160351613516235163351643516535166351673516835169351703517135172351733517435175351763517735178351793518035181351823518335184351853518635187351883518935190351913519235193351943519535196351973519835199352003520135202352033520435205352063520735208352093521035211352123521335214352153521635217352183521935220352213522235223352243522535226352273522835229352303523135232352333523435235352363523735238352393524035241352423524335244352453524635247352483524935250352513525235253352543525535256352573525835259352603526135262352633526435265352663526735268352693527035271352723527335274352753527635277352783527935280352813528235283352843528535286352873528835289352903529135292352933529435295352963529735298352993530035301353023530335304353053530635307353083530935310353113531235313353143531535316353173531835319353203532135322353233532435325353263532735328353293533035331353323533335334353353533635337353383533935340353413534235343353443534535346353473534835349353503535135352353533535435355353563535735358353593536035361353623536335364353653536635367353683536935370353713537235373353743537535376353773537835379353803538135382353833538435385353863538735388353893539035391353923539335394353953539635397353983539935400354013540235403354043540535406354073540835409354103541135412354133541435415354163541735418354193542035421354223542335424354253542635427354283542935430354313543235433354343543535436354373543835439354403544135442354433544435445354463544735448354493545035451354523545335454354553545635457354583545935460354613546235463354643546535466354673546835469354703547135472354733547435475354763547735478354793548035481354823548335484354853548635487354883548935490354913549235493354943549535496354973549835499355003550135502355033550435505355063550735508355093551035511355123551335514355153551635517355183551935520355213552235523355243552535526355273552835529355303553135532355333553435535355363553735538355393554035541355423554335544355453554635547355483554935550355513555235553355543555535556355573555835559355603556135562355633556435565355663556735568355693557035571355723557335574355753557635577355783557935580355813558235583355843558535586355873558835589355903559135592355933559435595355963559735598355993560035601356023560335604356053560635607356083560935610356113561235613356143561535616356173561835619356203562135622356233562435625356263562735628356293563035631356323563335634356353563635637356383563935640356413564235643356443564535646356473564835649356503565135652356533565435655356563565735658356593566035661356623566335664356653566635667356683566935670356713567235673356743567535676356773567835679356803568135682356833568435685356863568735688356893569035691356923569335694356953569635697356983569935700357013570235703357043570535706357073570835709357103571135712357133571435715357163571735718357193572035721357223572335724357253572635727357283572935730357313573235733357343573535736357373573835739357403574135742357433574435745357463574735748357493575035751357523575335754357553575635757357583575935760357613576235763357643576535766357673576835769357703577135772357733577435775357763577735778357793578035781357823578335784357853578635787357883578935790357913579235793357943579535796357973579835799358003580135802358033580435805358063580735808358093581035811358123581335814358153581635817358183581935820358213582235823358243582535826358273582835829358303583135832358333583435835358363583735838358393584035841358423584335844358453584635847358483584935850358513585235853358543585535856358573585835859358603586135862358633586435865358663586735868358693587035871358723587335874358753587635877358783587935880358813588235883358843588535886358873588835889358903589135892358933589435895358963589735898358993590035901359023590335904359053590635907359083590935910359113591235913359143591535916359173591835919359203592135922359233592435925359263592735928359293593035931359323593335934359353593635937359383593935940359413594235943359443594535946359473594835949359503595135952359533595435955359563595735958359593596035961359623596335964359653596635967359683596935970359713597235973359743597535976359773597835979359803598135982359833598435985359863598735988359893599035991359923599335994359953599635997359983599936000360013600236003360043600536006360073600836009360103601136012360133601436015360163601736018360193602036021360223602336024360253602636027360283602936030360313603236033360343603536036360373603836039360403604136042360433604436045360463604736048360493605036051360523605336054360553605636057360583605936060360613606236063360643606536066360673606836069360703607136072360733607436075360763607736078360793608036081360823608336084360853608636087360883608936090360913609236093360943609536096360973609836099361003610136102361033610436105361063610736108361093611036111361123611336114361153611636117361183611936120361213612236123361243612536126361273612836129361303613136132361333613436135361363613736138361393614036141361423614336144361453614636147361483614936150361513615236153361543615536156361573615836159361603616136162361633616436165361663616736168361693617036171361723617336174361753617636177361783617936180361813618236183361843618536186361873618836189361903619136192361933619436195361963619736198361993620036201362023620336204362053620636207362083620936210362113621236213362143621536216362173621836219362203622136222362233622436225362263622736228362293623036231362323623336234362353623636237362383623936240362413624236243362443624536246362473624836249362503625136252362533625436255362563625736258362593626036261362623626336264362653626636267362683626936270362713627236273362743627536276362773627836279362803628136282362833628436285362863628736288362893629036291362923629336294362953629636297362983629936300363013630236303363043630536306363073630836309363103631136312363133631436315363163631736318363193632036321363223632336324363253632636327363283632936330363313633236333363343633536336363373633836339363403634136342363433634436345363463634736348363493635036351363523635336354363553635636357363583635936360363613636236363363643636536366363673636836369363703637136372363733637436375363763637736378363793638036381363823638336384363853638636387363883638936390363913639236393363943639536396363973639836399364003640136402364033640436405364063640736408364093641036411364123641336414364153641636417364183641936420364213642236423364243642536426364273642836429364303643136432364333643436435364363643736438364393644036441364423644336444364453644636447364483644936450364513645236453364543645536456364573645836459364603646136462364633646436465364663646736468364693647036471364723647336474364753647636477364783647936480364813648236483364843648536486364873648836489364903649136492364933649436495364963649736498364993650036501365023650336504365053650636507365083650936510365113651236513365143651536516365173651836519365203652136522365233652436525365263652736528365293653036531365323653336534365353653636537365383653936540365413654236543365443654536546365473654836549365503655136552365533655436555365563655736558365593656036561365623656336564365653656636567365683656936570365713657236573365743657536576365773657836579365803658136582365833658436585365863658736588365893659036591365923659336594365953659636597365983659936600366013660236603366043660536606366073660836609366103661136612366133661436615366163661736618366193662036621366223662336624366253662636627366283662936630366313663236633366343663536636366373663836639366403664136642366433664436645366463664736648366493665036651366523665336654366553665636657366583665936660366613666236663366643666536666366673666836669366703667136672366733667436675366763667736678366793668036681366823668336684366853668636687366883668936690366913669236693366943669536696366973669836699367003670136702367033670436705367063670736708367093671036711367123671336714367153671636717367183671936720367213672236723367243672536726367273672836729367303673136732367333673436735367363673736738367393674036741367423674336744367453674636747367483674936750367513675236753367543675536756367573675836759367603676136762367633676436765367663676736768367693677036771367723677336774367753677636777367783677936780367813678236783367843678536786367873678836789367903679136792367933679436795367963679736798367993680036801368023680336804368053680636807368083680936810368113681236813368143681536816368173681836819368203682136822368233682436825368263682736828368293683036831368323683336834368353683636837368383683936840368413684236843368443684536846368473684836849368503685136852368533685436855368563685736858368593686036861368623686336864368653686636867368683686936870368713687236873368743687536876368773687836879368803688136882368833688436885368863688736888368893689036891368923689336894368953689636897368983689936900369013690236903369043690536906369073690836909369103691136912369133691436915369163691736918369193692036921369223692336924369253692636927369283692936930369313693236933369343693536936369373693836939369403694136942369433694436945369463694736948369493695036951369523695336954369553695636957369583695936960369613696236963369643696536966369673696836969369703697136972369733697436975369763697736978369793698036981369823698336984369853698636987369883698936990369913699236993369943699536996369973699836999370003700137002370033700437005370063700737008370093701037011370123701337014370153701637017370183701937020370213702237023370243702537026370273702837029370303703137032370333703437035370363703737038370393704037041370423704337044370453704637047370483704937050370513705237053370543705537056370573705837059370603706137062370633706437065370663706737068370693707037071370723707337074370753707637077370783707937080370813708237083370843708537086370873708837089370903709137092370933709437095370963709737098370993710037101371023710337104371053710637107371083710937110371113711237113371143711537116371173711837119371203712137122371233712437125371263712737128371293713037131371323713337134371353713637137371383713937140371413714237143371443714537146371473714837149371503715137152371533715437155371563715737158371593716037161371623716337164371653716637167371683716937170371713717237173371743717537176371773717837179371803718137182371833718437185371863718737188371893719037191371923719337194371953719637197371983719937200372013720237203372043720537206372073720837209372103721137212372133721437215372163721737218372193722037221372223722337224372253722637227372283722937230372313723237233372343723537236372373723837239372403724137242372433724437245372463724737248372493725037251372523725337254372553725637257372583725937260372613726237263372643726537266372673726837269372703727137272372733727437275372763727737278372793728037281372823728337284372853728637287372883728937290372913729237293372943729537296372973729837299373003730137302373033730437305373063730737308373093731037311373123731337314373153731637317373183731937320373213732237323373243732537326373273732837329373303733137332373333733437335373363733737338373393734037341373423734337344373453734637347373483734937350373513735237353373543735537356373573735837359373603736137362373633736437365373663736737368373693737037371373723737337374373753737637377373783737937380373813738237383373843738537386373873738837389373903739137392373933739437395373963739737398373993740037401374023740337404374053740637407374083740937410374113741237413374143741537416374173741837419374203742137422374233742437425374263742737428374293743037431374323743337434374353743637437374383743937440374413744237443374443744537446374473744837449374503745137452374533745437455374563745737458374593746037461374623746337464374653746637467374683746937470374713747237473374743747537476374773747837479374803748137482374833748437485374863748737488374893749037491374923749337494374953749637497374983749937500375013750237503375043750537506375073750837509375103751137512375133751437515375163751737518375193752037521375223752337524375253752637527375283752937530375313753237533375343753537536375373753837539375403754137542375433754437545375463754737548375493755037551375523755337554375553755637557375583755937560375613756237563375643756537566375673756837569375703757137572375733757437575375763757737578375793758037581375823758337584375853758637587375883758937590375913759237593375943759537596375973759837599376003760137602376033760437605376063760737608376093761037611376123761337614376153761637617376183761937620376213762237623376243762537626376273762837629376303763137632376333763437635376363763737638376393764037641376423764337644376453764637647376483764937650376513765237653376543765537656376573765837659376603766137662376633766437665376663766737668376693767037671376723767337674376753767637677376783767937680376813768237683376843768537686376873768837689376903769137692376933769437695376963769737698376993770037701377023770337704377053770637707377083770937710377113771237713377143771537716377173771837719377203772137722377233772437725377263772737728377293773037731377323773337734377353773637737377383773937740377413774237743377443774537746377473774837749377503775137752377533775437755377563775737758377593776037761377623776337764377653776637767377683776937770377713777237773377743777537776377773777837779377803778137782377833778437785377863778737788377893779037791377923779337794377953779637797377983779937800378013780237803378043780537806378073780837809378103781137812378133781437815378163781737818378193782037821378223782337824378253782637827378283782937830378313783237833378343783537836378373783837839378403784137842378433784437845378463784737848378493785037851378523785337854378553785637857378583785937860378613786237863378643786537866378673786837869378703787137872378733787437875378763787737878378793788037881378823788337884378853788637887378883788937890378913789237893378943789537896378973789837899379003790137902379033790437905379063790737908379093791037911379123791337914379153791637917379183791937920379213792237923379243792537926379273792837929379303793137932379333793437935379363793737938379393794037941379423794337944379453794637947379483794937950379513795237953379543795537956379573795837959379603796137962379633796437965379663796737968379693797037971379723797337974379753797637977379783797937980379813798237983379843798537986379873798837989379903799137992379933799437995379963799737998379993800038001380023800338004380053800638007380083800938010380113801238013380143801538016380173801838019380203802138022380233802438025380263802738028380293803038031380323803338034380353803638037380383803938040380413804238043380443804538046380473804838049380503805138052380533805438055380563805738058380593806038061380623806338064380653806638067380683806938070380713807238073380743807538076380773807838079380803808138082380833808438085380863808738088380893809038091380923809338094380953809638097380983809938100381013810238103381043810538106381073810838109381103811138112381133811438115381163811738118381193812038121381223812338124381253812638127381283812938130381313813238133381343813538136381373813838139381403814138142381433814438145381463814738148381493815038151381523815338154381553815638157381583815938160381613816238163381643816538166381673816838169381703817138172381733817438175381763817738178381793818038181381823818338184381853818638187381883818938190381913819238193381943819538196381973819838199382003820138202382033820438205382063820738208382093821038211382123821338214382153821638217382183821938220382213822238223382243822538226382273822838229382303823138232382333823438235382363823738238382393824038241382423824338244382453824638247382483824938250382513825238253382543825538256382573825838259382603826138262382633826438265382663826738268382693827038271382723827338274382753827638277382783827938280382813828238283382843828538286382873828838289382903829138292382933829438295382963829738298382993830038301383023830338304383053830638307383083830938310383113831238313383143831538316383173831838319383203832138322383233832438325383263832738328383293833038331383323833338334383353833638337383383833938340383413834238343383443834538346383473834838349383503835138352383533835438355383563835738358383593836038361383623836338364383653836638367383683836938370383713837238373383743837538376383773837838379383803838138382383833838438385383863838738388383893839038391383923839338394383953839638397383983839938400384013840238403384043840538406384073840838409384103841138412384133841438415384163841738418384193842038421384223842338424384253842638427384283842938430384313843238433384343843538436384373843838439384403844138442384433844438445384463844738448384493845038451384523845338454384553845638457384583845938460384613846238463384643846538466384673846838469384703847138472384733847438475384763847738478384793848038481384823848338484384853848638487384883848938490384913849238493384943849538496384973849838499385003850138502385033850438505385063850738508385093851038511385123851338514385153851638517385183851938520385213852238523385243852538526385273852838529385303853138532385333853438535385363853738538385393854038541385423854338544385453854638547385483854938550385513855238553385543855538556385573855838559385603856138562385633856438565385663856738568385693857038571385723857338574385753857638577385783857938580385813858238583385843858538586385873858838589385903859138592385933859438595385963859738598385993860038601386023860338604386053860638607386083860938610386113861238613386143861538616386173861838619386203862138622386233862438625386263862738628386293863038631386323863338634386353863638637386383863938640386413864238643386443864538646386473864838649386503865138652386533865438655386563865738658386593866038661386623866338664386653866638667386683866938670386713867238673386743867538676386773867838679386803868138682386833868438685386863868738688386893869038691386923869338694386953869638697386983869938700387013870238703387043870538706387073870838709387103871138712387133871438715387163871738718387193872038721387223872338724387253872638727387283872938730387313873238733387343873538736387373873838739387403874138742387433874438745387463874738748387493875038751387523875338754387553875638757387583875938760387613876238763387643876538766387673876838769387703877138772387733877438775387763877738778387793878038781387823878338784387853878638787387883878938790387913879238793387943879538796387973879838799388003880138802388033880438805388063880738808388093881038811388123881338814388153881638817388183881938820388213882238823388243882538826388273882838829388303883138832388333883438835388363883738838388393884038841388423884338844388453884638847388483884938850388513885238853388543885538856388573885838859388603886138862388633886438865388663886738868388693887038871388723887338874388753887638877388783887938880388813888238883388843888538886388873888838889388903889138892388933889438895388963889738898388993890038901389023890338904389053890638907389083890938910389113891238913389143891538916389173891838919389203892138922389233892438925389263892738928389293893038931389323893338934389353893638937389383893938940389413894238943389443894538946389473894838949389503895138952389533895438955389563895738958389593896038961389623896338964389653896638967389683896938970389713897238973389743897538976389773897838979389803898138982389833898438985389863898738988389893899038991389923899338994389953899638997389983899939000390013900239003390043900539006390073900839009390103901139012390133901439015390163901739018390193902039021390223902339024390253902639027390283902939030390313903239033390343903539036390373903839039390403904139042390433904439045390463904739048390493905039051390523905339054390553905639057390583905939060390613906239063390643906539066390673906839069390703907139072390733907439075390763907739078390793908039081390823908339084390853908639087390883908939090390913909239093390943909539096390973909839099391003910139102391033910439105391063910739108391093911039111391123911339114391153911639117391183911939120391213912239123391243912539126391273912839129391303913139132391333913439135391363913739138391393914039141391423914339144391453914639147391483914939150391513915239153391543915539156391573915839159391603916139162391633916439165391663916739168391693917039171391723917339174391753917639177391783917939180391813918239183391843918539186391873918839189391903919139192391933919439195391963919739198391993920039201392023920339204392053920639207392083920939210392113921239213392143921539216392173921839219392203922139222392233922439225392263922739228392293923039231392323923339234392353923639237392383923939240392413924239243392443924539246392473924839249392503925139252392533925439255392563925739258392593926039261392623926339264392653926639267392683926939270392713927239273392743927539276392773927839279392803928139282392833928439285392863928739288392893929039291392923929339294392953929639297392983929939300393013930239303393043930539306393073930839309393103931139312393133931439315393163931739318393193932039321393223932339324393253932639327393283932939330393313933239333393343933539336393373933839339393403934139342393433934439345393463934739348393493935039351393523935339354393553935639357393583935939360393613936239363393643936539366393673936839369393703937139372393733937439375393763937739378393793938039381393823938339384393853938639387393883938939390393913939239393393943939539396393973939839399394003940139402394033940439405394063940739408394093941039411394123941339414394153941639417394183941939420394213942239423394243942539426394273942839429394303943139432394333943439435394363943739438394393944039441394423944339444394453944639447394483944939450394513945239453394543945539456394573945839459394603946139462394633946439465394663946739468394693947039471394723947339474394753947639477394783947939480394813948239483394843948539486394873948839489394903949139492394933949439495394963949739498394993950039501395023950339504395053950639507395083950939510395113951239513395143951539516395173951839519395203952139522395233952439525395263952739528395293953039531395323953339534395353953639537395383953939540395413954239543395443954539546395473954839549395503955139552395533955439555395563955739558395593956039561395623956339564395653956639567395683956939570395713957239573395743957539576395773957839579395803958139582395833958439585395863958739588395893959039591395923959339594395953959639597395983959939600396013960239603396043960539606396073960839609396103961139612396133961439615396163961739618396193962039621396223962339624396253962639627396283962939630396313963239633396343963539636396373963839639396403964139642396433964439645396463964739648396493965039651396523965339654396553965639657396583965939660396613966239663396643966539666396673966839669396703967139672396733967439675396763967739678396793968039681396823968339684396853968639687396883968939690396913969239693396943969539696396973969839699397003970139702397033970439705397063970739708397093971039711397123971339714397153971639717397183971939720397213972239723397243972539726397273972839729397303973139732397333973439735397363973739738397393974039741397423974339744397453974639747397483974939750397513975239753397543975539756397573975839759397603976139762397633976439765397663976739768397693977039771397723977339774397753977639777397783977939780397813978239783397843978539786397873978839789397903979139792397933979439795397963979739798397993980039801398023980339804398053980639807398083980939810398113981239813398143981539816398173981839819398203982139822398233982439825398263982739828398293983039831398323983339834398353983639837398383983939840398413984239843398443984539846398473984839849398503985139852398533985439855398563985739858398593986039861398623986339864398653986639867398683986939870398713987239873398743987539876398773987839879398803988139882398833988439885398863988739888398893989039891398923989339894398953989639897398983989939900399013990239903399043990539906399073990839909399103991139912399133991439915399163991739918399193992039921399223992339924399253992639927399283992939930399313993239933399343993539936399373993839939399403994139942399433994439945399463994739948399493995039951399523995339954399553995639957399583995939960399613996239963399643996539966399673996839969399703997139972399733997439975399763997739978399793998039981399823998339984399853998639987399883998939990399913999239993399943999539996399973999839999400004000140002400034000440005400064000740008400094001040011400124001340014400154001640017400184001940020400214002240023400244002540026400274002840029400304003140032400334003440035400364003740038400394004040041400424004340044400454004640047400484004940050400514005240053400544005540056400574005840059400604006140062400634006440065400664006740068400694007040071400724007340074400754007640077400784007940080400814008240083400844008540086400874008840089400904009140092400934009440095400964009740098400994010040101401024010340104401054010640107401084010940110401114011240113401144011540116401174011840119401204012140122401234012440125401264012740128401294013040131401324013340134401354013640137401384013940140401414014240143401444014540146401474014840149401504015140152401534015440155401564015740158401594016040161401624016340164401654016640167401684016940170401714017240173401744017540176401774017840179401804018140182401834018440185401864018740188401894019040191401924019340194401954019640197401984019940200402014020240203402044020540206402074020840209402104021140212402134021440215402164021740218402194022040221402224022340224402254022640227402284022940230402314023240233402344023540236402374023840239402404024140242402434024440245402464024740248402494025040251402524025340254402554025640257402584025940260402614026240263402644026540266402674026840269402704027140272402734027440275402764027740278402794028040281402824028340284402854028640287402884028940290402914029240293402944029540296402974029840299403004030140302403034030440305403064030740308403094031040311403124031340314403154031640317403184031940320403214032240323403244032540326403274032840329403304033140332403334033440335403364033740338403394034040341403424034340344403454034640347403484034940350403514035240353403544035540356403574035840359403604036140362403634036440365403664036740368403694037040371403724037340374403754037640377403784037940380403814038240383403844038540386403874038840389403904039140392403934039440395403964039740398403994040040401404024040340404404054040640407404084040940410404114041240413404144041540416404174041840419404204042140422404234042440425404264042740428404294043040431404324043340434404354043640437404384043940440404414044240443404444044540446404474044840449404504045140452404534045440455404564045740458404594046040461404624046340464404654046640467404684046940470404714047240473404744047540476404774047840479404804048140482404834048440485404864048740488404894049040491404924049340494404954049640497404984049940500405014050240503405044050540506405074050840509405104051140512405134051440515405164051740518405194052040521405224052340524405254052640527405284052940530405314053240533405344053540536405374053840539405404054140542405434054440545405464054740548405494055040551405524055340554405554055640557405584055940560405614056240563405644056540566405674056840569405704057140572405734057440575405764057740578405794058040581405824058340584405854058640587405884058940590405914059240593405944059540596405974059840599406004060140602406034060440605406064060740608406094061040611406124061340614406154061640617406184061940620406214062240623406244062540626406274062840629406304063140632406334063440635406364063740638406394064040641406424064340644406454064640647406484064940650406514065240653406544065540656406574065840659406604066140662406634066440665406664066740668406694067040671406724067340674406754067640677406784067940680406814068240683406844068540686406874068840689406904069140692406934069440695406964069740698406994070040701407024070340704407054070640707407084070940710407114071240713407144071540716407174071840719407204072140722407234072440725407264072740728407294073040731407324073340734407354073640737407384073940740407414074240743407444074540746407474074840749407504075140752407534075440755407564075740758407594076040761407624076340764407654076640767407684076940770407714077240773407744077540776407774077840779407804078140782407834078440785407864078740788407894079040791407924079340794407954079640797407984079940800408014080240803408044080540806408074080840809408104081140812408134081440815408164081740818408194082040821408224082340824408254082640827408284082940830408314083240833408344083540836408374083840839408404084140842408434084440845408464084740848408494085040851408524085340854408554085640857408584085940860408614086240863408644086540866408674086840869408704087140872408734087440875408764087740878408794088040881408824088340884408854088640887408884088940890408914089240893408944089540896408974089840899409004090140902409034090440905409064090740908409094091040911409124091340914409154091640917409184091940920409214092240923409244092540926409274092840929409304093140932409334093440935409364093740938409394094040941409424094340944409454094640947409484094940950409514095240953409544095540956409574095840959409604096140962409634096440965409664096740968409694097040971409724097340974409754097640977409784097940980409814098240983409844098540986409874098840989409904099140992409934099440995409964099740998409994100041001410024100341004410054100641007410084100941010410114101241013410144101541016410174101841019410204102141022410234102441025410264102741028410294103041031410324103341034410354103641037410384103941040410414104241043410444104541046410474104841049410504105141052410534105441055410564105741058410594106041061410624106341064410654106641067410684106941070410714107241073410744107541076410774107841079410804108141082410834108441085410864108741088410894109041091410924109341094410954109641097410984109941100411014110241103411044110541106411074110841109411104111141112411134111441115411164111741118411194112041121411224112341124411254112641127411284112941130411314113241133411344113541136411374113841139411404114141142411434114441145411464114741148411494115041151411524115341154411554115641157411584115941160411614116241163411644116541166411674116841169411704117141172411734117441175411764117741178411794118041181411824118341184411854118641187411884118941190411914119241193411944119541196411974119841199412004120141202412034120441205412064120741208412094121041211412124121341214412154121641217412184121941220412214122241223412244122541226412274122841229412304123141232412334123441235412364123741238412394124041241412424124341244412454124641247412484124941250412514125241253412544125541256412574125841259412604126141262412634126441265412664126741268412694127041271412724127341274412754127641277412784127941280412814128241283412844128541286412874128841289412904129141292412934129441295412964129741298412994130041301413024130341304413054130641307413084130941310413114131241313413144131541316413174131841319413204132141322413234132441325413264132741328413294133041331413324133341334413354133641337413384133941340413414134241343413444134541346413474134841349413504135141352413534135441355413564135741358413594136041361413624136341364413654136641367413684136941370413714137241373413744137541376413774137841379413804138141382413834138441385413864138741388413894139041391413924139341394413954139641397413984139941400414014140241403414044140541406414074140841409414104141141412414134141441415414164141741418414194142041421414224142341424414254142641427414284142941430414314143241433414344143541436414374143841439414404144141442414434144441445414464144741448414494145041451414524145341454414554145641457414584145941460414614146241463414644146541466414674146841469414704147141472414734147441475414764147741478414794148041481414824148341484414854148641487414884148941490414914149241493414944149541496414974149841499415004150141502415034150441505415064150741508415094151041511415124151341514415154151641517415184151941520415214152241523415244152541526415274152841529415304153141532415334153441535415364153741538415394154041541415424154341544415454154641547415484154941550415514155241553415544155541556415574155841559415604156141562415634156441565415664156741568415694157041571415724157341574415754157641577415784157941580415814158241583415844158541586415874158841589415904159141592415934159441595415964159741598415994160041601416024160341604416054160641607416084160941610416114161241613416144161541616416174161841619416204162141622416234162441625416264162741628416294163041631416324163341634416354163641637416384163941640416414164241643416444164541646416474164841649416504165141652416534165441655416564165741658416594166041661416624166341664416654166641667416684166941670416714167241673416744167541676416774167841679416804168141682416834168441685416864168741688416894169041691416924169341694416954169641697416984169941700417014170241703417044170541706417074170841709417104171141712417134171441715417164171741718417194172041721417224172341724417254172641727417284172941730417314173241733417344173541736417374173841739417404174141742417434174441745417464174741748417494175041751417524175341754417554175641757417584175941760417614176241763417644176541766417674176841769417704177141772417734177441775417764177741778417794178041781417824178341784417854178641787417884178941790417914179241793417944179541796417974179841799418004180141802418034180441805418064180741808418094181041811418124181341814418154181641817418184181941820418214182241823418244182541826418274182841829418304183141832418334183441835418364183741838418394184041841418424184341844418454184641847418484184941850418514185241853418544185541856418574185841859418604186141862418634186441865418664186741868418694187041871418724187341874418754187641877418784187941880418814188241883418844188541886418874188841889418904189141892418934189441895418964189741898418994190041901419024190341904419054190641907419084190941910419114191241913419144191541916419174191841919419204192141922419234192441925419264192741928419294193041931419324193341934419354193641937419384193941940419414194241943419444194541946419474194841949419504195141952419534195441955419564195741958419594196041961419624196341964419654196641967419684196941970419714197241973419744197541976419774197841979419804198141982419834198441985419864198741988419894199041991419924199341994419954199641997419984199942000420014200242003420044200542006420074200842009420104201142012420134201442015420164201742018420194202042021420224202342024420254202642027420284202942030420314203242033420344203542036420374203842039420404204142042420434204442045420464204742048420494205042051420524205342054420554205642057420584205942060420614206242063420644206542066420674206842069420704207142072420734207442075420764207742078420794208042081420824208342084420854208642087420884208942090420914209242093420944209542096420974209842099421004210142102421034210442105421064210742108421094211042111421124211342114421154211642117421184211942120421214212242123421244212542126421274212842129421304213142132421334213442135421364213742138421394214042141421424214342144421454214642147421484214942150421514215242153421544215542156421574215842159421604216142162421634216442165421664216742168421694217042171421724217342174421754217642177421784217942180421814218242183421844218542186421874218842189421904219142192421934219442195421964219742198421994220042201422024220342204422054220642207422084220942210422114221242213422144221542216422174221842219422204222142222422234222442225422264222742228422294223042231422324223342234422354223642237422384223942240422414224242243422444224542246422474224842249422504225142252422534225442255422564225742258422594226042261422624226342264422654226642267422684226942270422714227242273422744227542276422774227842279422804228142282422834228442285422864228742288422894229042291422924229342294422954229642297422984229942300423014230242303423044230542306423074230842309423104231142312423134231442315423164231742318423194232042321423224232342324423254232642327423284232942330423314233242333423344233542336423374233842339423404234142342423434234442345423464234742348423494235042351423524235342354423554235642357423584235942360423614236242363423644236542366423674236842369423704237142372423734237442375423764237742378423794238042381423824238342384423854238642387423884238942390423914239242393423944239542396423974239842399424004240142402424034240442405424064240742408424094241042411424124241342414424154241642417424184241942420424214242242423424244242542426424274242842429424304243142432424334243442435424364243742438424394244042441424424244342444424454244642447424484244942450424514245242453424544245542456424574245842459424604246142462424634246442465424664246742468424694247042471424724247342474424754247642477424784247942480424814248242483424844248542486424874248842489424904249142492424934249442495424964249742498424994250042501425024250342504425054250642507425084250942510425114251242513425144251542516425174251842519425204252142522425234252442525425264252742528425294253042531425324253342534425354253642537425384253942540425414254242543425444254542546425474254842549425504255142552425534255442555425564255742558425594256042561425624256342564425654256642567425684256942570425714257242573425744257542576425774257842579425804258142582425834258442585425864258742588425894259042591425924259342594425954259642597425984259942600426014260242603426044260542606426074260842609426104261142612426134261442615426164261742618426194262042621426224262342624426254262642627426284262942630426314263242633426344263542636426374263842639426404264142642426434264442645426464264742648426494265042651426524265342654426554265642657426584265942660426614266242663426644266542666426674266842669426704267142672426734267442675426764267742678426794268042681426824268342684426854268642687426884268942690426914269242693426944269542696426974269842699427004270142702427034270442705427064270742708427094271042711427124271342714427154271642717427184271942720427214272242723427244272542726427274272842729427304273142732427334273442735427364273742738427394274042741427424274342744427454274642747427484274942750427514275242753427544275542756427574275842759427604276142762427634276442765427664276742768427694277042771427724277342774427754277642777427784277942780427814278242783427844278542786427874278842789427904279142792427934279442795427964279742798427994280042801428024280342804428054280642807428084280942810428114281242813428144281542816428174281842819428204282142822428234282442825428264282742828428294283042831428324283342834428354283642837428384283942840428414284242843428444284542846428474284842849428504285142852428534285442855428564285742858428594286042861428624286342864428654286642867428684286942870428714287242873428744287542876428774287842879428804288142882428834288442885428864288742888428894289042891428924289342894428954289642897428984289942900429014290242903429044290542906429074290842909429104291142912429134291442915429164291742918429194292042921429224292342924429254292642927429284292942930429314293242933429344293542936429374293842939429404294142942429434294442945429464294742948429494295042951429524295342954429554295642957429584295942960429614296242963429644296542966429674296842969429704297142972429734297442975429764297742978429794298042981429824298342984429854298642987429884298942990429914299242993429944299542996429974299842999430004300143002430034300443005430064300743008430094301043011430124301343014430154301643017430184301943020430214302243023430244302543026430274302843029430304303143032430334303443035430364303743038430394304043041430424304343044430454304643047430484304943050430514305243053430544305543056430574305843059430604306143062430634306443065430664306743068430694307043071430724307343074430754307643077430784307943080430814308243083430844308543086430874308843089430904309143092430934309443095430964309743098430994310043101431024310343104431054310643107431084310943110431114311243113431144311543116431174311843119431204312143122431234312443125431264312743128431294313043131431324313343134431354313643137431384313943140431414314243143431444314543146431474314843149431504315143152431534315443155431564315743158431594316043161431624316343164431654316643167431684316943170431714317243173431744317543176431774317843179431804318143182431834318443185431864318743188431894319043191431924319343194431954319643197431984319943200432014320243203432044320543206432074320843209432104321143212432134321443215432164321743218432194322043221432224322343224432254322643227432284322943230432314323243233432344323543236432374323843239432404324143242432434324443245432464324743248432494325043251432524325343254432554325643257432584325943260432614326243263432644326543266432674326843269432704327143272432734327443275432764327743278432794328043281432824328343284432854328643287432884328943290432914329243293432944329543296432974329843299433004330143302433034330443305433064330743308433094331043311433124331343314433154331643317433184331943320433214332243323433244332543326433274332843329433304333143332433334333443335433364333743338433394334043341433424334343344433454334643347433484334943350433514335243353433544335543356433574335843359433604336143362433634336443365433664336743368433694337043371433724337343374433754337643377433784337943380433814338243383433844338543386433874338843389433904339143392433934339443395433964339743398433994340043401434024340343404434054340643407434084340943410434114341243413434144341543416434174341843419434204342143422434234342443425434264342743428434294343043431434324343343434434354343643437434384343943440434414344243443434444344543446434474344843449434504345143452434534345443455434564345743458434594346043461434624346343464434654346643467434684346943470434714347243473434744347543476434774347843479434804348143482434834348443485434864348743488434894349043491434924349343494434954349643497434984349943500435014350243503435044350543506435074350843509435104351143512435134351443515435164351743518435194352043521435224352343524435254352643527435284352943530435314353243533435344353543536435374353843539435404354143542435434354443545435464354743548435494355043551435524355343554435554355643557435584355943560435614356243563435644356543566435674356843569435704357143572435734357443575435764357743578435794358043581435824358343584435854358643587435884358943590435914359243593435944359543596435974359843599436004360143602436034360443605436064360743608436094361043611436124361343614436154361643617436184361943620436214362243623436244362543626436274362843629436304363143632436334363443635436364363743638436394364043641436424364343644436454364643647436484364943650436514365243653436544365543656436574365843659436604366143662436634366443665436664366743668436694367043671436724367343674436754367643677436784367943680436814368243683436844368543686436874368843689436904369143692436934369443695436964369743698436994370043701437024370343704437054370643707437084370943710437114371243713437144371543716437174371843719437204372143722437234372443725437264372743728437294373043731437324373343734437354373643737437384373943740437414374243743437444374543746437474374843749437504375143752437534375443755437564375743758437594376043761437624376343764437654376643767437684376943770437714377243773437744377543776437774377843779437804378143782437834378443785437864378743788437894379043791437924379343794437954379643797437984379943800438014380243803438044380543806438074380843809438104381143812438134381443815438164381743818438194382043821438224382343824438254382643827438284382943830438314383243833438344383543836438374383843839438404384143842438434384443845438464384743848438494385043851438524385343854438554385643857438584385943860438614386243863438644386543866438674386843869438704387143872438734387443875438764387743878438794388043881438824388343884438854388643887438884388943890438914389243893438944389543896438974389843899439004390143902439034390443905439064390743908439094391043911439124391343914439154391643917439184391943920439214392243923439244392543926439274392843929439304393143932439334393443935439364393743938439394394043941439424394343944439454394643947439484394943950439514395243953439544395543956439574395843959439604396143962439634396443965439664396743968439694397043971439724397343974439754397643977439784397943980439814398243983439844398543986439874398843989439904399143992439934399443995439964399743998439994400044001440024400344004440054400644007440084400944010440114401244013440144401544016440174401844019440204402144022440234402444025440264402744028440294403044031440324403344034440354403644037440384403944040440414404244043440444404544046440474404844049440504405144052440534405444055440564405744058440594406044061440624406344064440654406644067440684406944070440714407244073440744407544076440774407844079440804408144082440834408444085440864408744088440894409044091440924409344094440954409644097440984409944100441014410244103441044410544106441074410844109441104411144112441134411444115441164411744118441194412044121441224412344124441254412644127441284412944130441314413244133441344413544136441374413844139441404414144142441434414444145441464414744148441494415044151441524415344154441554415644157441584415944160441614416244163441644416544166441674416844169441704417144172441734417444175441764417744178441794418044181441824418344184441854418644187441884418944190441914419244193441944419544196441974419844199442004420144202442034420444205442064420744208442094421044211442124421344214442154421644217442184421944220442214422244223442244422544226442274422844229442304423144232442334423444235442364423744238442394424044241442424424344244442454424644247442484424944250442514425244253442544425544256442574425844259442604426144262442634426444265442664426744268442694427044271442724427344274442754427644277442784427944280442814428244283442844428544286442874428844289442904429144292442934429444295442964429744298442994430044301443024430344304443054430644307443084430944310443114431244313443144431544316443174431844319443204432144322443234432444325443264432744328443294433044331443324433344334443354433644337443384433944340443414434244343443444434544346443474434844349443504435144352443534435444355443564435744358443594436044361443624436344364443654436644367443684436944370443714437244373443744437544376443774437844379443804438144382443834438444385443864438744388443894439044391443924439344394443954439644397443984439944400444014440244403444044440544406444074440844409444104441144412444134441444415444164441744418444194442044421444224442344424444254442644427444284442944430444314443244433444344443544436444374443844439444404444144442444434444444445444464444744448444494445044451444524445344454444554445644457444584445944460444614446244463444644446544466444674446844469444704447144472444734447444475444764447744478444794448044481444824448344484444854448644487444884448944490444914449244493444944449544496444974449844499445004450144502445034450444505445064450744508445094451044511445124451344514445154451644517445184451944520445214452244523445244452544526445274452844529445304453144532445334453444535445364453744538445394454044541445424454344544445454454644547445484454944550445514455244553445544455544556445574455844559445604456144562445634456444565445664456744568445694457044571445724457344574445754457644577445784457944580445814458244583445844458544586445874458844589445904459144592445934459444595445964459744598445994460044601446024460344604446054460644607446084460944610446114461244613446144461544616446174461844619446204462144622446234462444625446264462744628446294463044631446324463344634446354463644637446384463944640446414464244643446444464544646446474464844649446504465144652446534465444655446564465744658446594466044661446624466344664446654466644667446684466944670446714467244673446744467544676446774467844679446804468144682446834468444685446864468744688446894469044691446924469344694446954469644697446984469944700447014470244703447044470544706447074470844709447104471144712447134471444715447164471744718447194472044721447224472344724447254472644727447284472944730447314473244733447344473544736447374473844739447404474144742447434474444745447464474744748447494475044751447524475344754447554475644757447584475944760447614476244763447644476544766447674476844769447704477144772447734477444775447764477744778447794478044781447824478344784447854478644787447884478944790447914479244793447944479544796447974479844799448004480144802448034480444805448064480744808448094481044811448124481344814448154481644817448184481944820448214482244823448244482544826448274482844829448304483144832448334483444835448364483744838448394484044841448424484344844448454484644847448484484944850448514485244853448544485544856448574485844859448604486144862448634486444865448664486744868448694487044871448724487344874448754487644877448784487944880448814488244883448844488544886448874488844889448904489144892448934489444895448964489744898448994490044901449024490344904449054490644907449084490944910449114491244913449144491544916449174491844919449204492144922449234492444925449264492744928449294493044931449324493344934449354493644937449384493944940449414494244943449444494544946449474494844949449504495144952449534495444955449564495744958449594496044961449624496344964449654496644967449684496944970449714497244973449744497544976449774497844979449804498144982449834498444985449864498744988449894499044991449924499344994449954499644997449984499945000450014500245003450044500545006450074500845009450104501145012450134501445015450164501745018450194502045021450224502345024450254502645027450284502945030450314503245033450344503545036450374503845039450404504145042450434504445045450464504745048450494505045051450524505345054450554505645057450584505945060450614506245063450644506545066450674506845069450704507145072450734507445075450764507745078450794508045081450824508345084450854508645087450884508945090450914509245093450944509545096450974509845099451004510145102451034510445105451064510745108451094511045111451124511345114451154511645117451184511945120451214512245123451244512545126451274512845129451304513145132451334513445135451364513745138451394514045141451424514345144451454514645147451484514945150451514515245153451544515545156451574515845159451604516145162451634516445165451664516745168451694517045171451724517345174451754517645177451784517945180451814518245183451844518545186451874518845189451904519145192451934519445195451964519745198451994520045201452024520345204452054520645207452084520945210452114521245213452144521545216452174521845219452204522145222452234522445225452264522745228452294523045231452324523345234452354523645237452384523945240452414524245243452444524545246452474524845249452504525145252452534525445255452564525745258452594526045261452624526345264452654526645267452684526945270452714527245273452744527545276452774527845279452804528145282452834528445285452864528745288452894529045291452924529345294452954529645297452984529945300453014530245303453044530545306453074530845309453104531145312453134531445315453164531745318453194532045321453224532345324453254532645327453284532945330453314533245333453344533545336453374533845339453404534145342453434534445345453464534745348453494535045351453524535345354453554535645357453584535945360453614536245363453644536545366453674536845369453704537145372453734537445375453764537745378453794538045381453824538345384453854538645387453884538945390453914539245393453944539545396453974539845399454004540145402454034540445405454064540745408454094541045411454124541345414454154541645417454184541945420454214542245423454244542545426454274542845429454304543145432454334543445435454364543745438454394544045441454424544345444454454544645447454484544945450454514545245453454544545545456454574545845459454604546145462454634546445465454664546745468454694547045471454724547345474454754547645477454784547945480454814548245483454844548545486454874548845489454904549145492454934549445495454964549745498454994550045501455024550345504455054550645507455084550945510455114551245513455144551545516455174551845519455204552145522455234552445525455264552745528455294553045531455324553345534455354553645537455384553945540455414554245543455444554545546455474554845549455504555145552455534555445555455564555745558455594556045561455624556345564455654556645567455684556945570455714557245573455744557545576455774557845579455804558145582455834558445585455864558745588455894559045591455924559345594455954559645597455984559945600456014560245603456044560545606456074560845609456104561145612456134561445615456164561745618456194562045621456224562345624456254562645627456284562945630456314563245633456344563545636456374563845639456404564145642456434564445645456464564745648456494565045651456524565345654456554565645657456584565945660456614566245663456644566545666456674566845669456704567145672456734567445675456764567745678456794568045681456824568345684456854568645687456884568945690456914569245693456944569545696456974569845699457004570145702457034570445705457064570745708457094571045711457124571345714457154571645717457184571945720457214572245723457244572545726457274572845729457304573145732457334573445735457364573745738457394574045741457424574345744457454574645747457484574945750457514575245753457544575545756457574575845759457604576145762457634576445765457664576745768457694577045771457724577345774457754577645777457784577945780457814578245783457844578545786457874578845789457904579145792457934579445795457964579745798457994580045801458024580345804458054580645807458084580945810458114581245813458144581545816458174581845819458204582145822458234582445825458264582745828458294583045831458324583345834458354583645837458384583945840458414584245843458444584545846458474584845849458504585145852458534585445855458564585745858458594586045861458624586345864458654586645867458684586945870458714587245873458744587545876458774587845879458804588145882458834588445885458864588745888458894589045891458924589345894458954589645897458984589945900459014590245903459044590545906459074590845909459104591145912459134591445915459164591745918459194592045921459224592345924459254592645927459284592945930459314593245933459344593545936459374593845939459404594145942459434594445945459464594745948459494595045951459524595345954459554595645957459584595945960459614596245963459644596545966459674596845969459704597145972459734597445975459764597745978459794598045981459824598345984459854598645987459884598945990459914599245993459944599545996459974599845999460004600146002460034600446005460064600746008460094601046011460124601346014460154601646017460184601946020460214602246023460244602546026460274602846029460304603146032460334603446035460364603746038460394604046041460424604346044460454604646047460484604946050460514605246053460544605546056460574605846059460604606146062460634606446065460664606746068460694607046071460724607346074460754607646077460784607946080460814608246083460844608546086460874608846089460904609146092460934609446095460964609746098460994610046101461024610346104461054610646107461084610946110461114611246113461144611546116461174611846119461204612146122461234612446125461264612746128461294613046131461324613346134461354613646137461384613946140461414614246143461444614546146461474614846149461504615146152461534615446155461564615746158461594616046161461624616346164461654616646167461684616946170461714617246173461744617546176461774617846179461804618146182461834618446185461864618746188461894619046191461924619346194461954619646197461984619946200462014620246203462044620546206462074620846209462104621146212462134621446215462164621746218462194622046221462224622346224462254622646227462284622946230462314623246233462344623546236462374623846239462404624146242462434624446245462464624746248462494625046251462524625346254462554625646257462584625946260462614626246263462644626546266462674626846269462704627146272462734627446275462764627746278462794628046281462824628346284462854628646287462884628946290462914629246293462944629546296462974629846299463004630146302463034630446305463064630746308463094631046311463124631346314463154631646317463184631946320463214632246323463244632546326463274632846329463304633146332463334633446335463364633746338463394634046341463424634346344463454634646347463484634946350463514635246353463544635546356463574635846359463604636146362463634636446365463664636746368463694637046371463724637346374463754637646377463784637946380463814638246383463844638546386463874638846389463904639146392463934639446395463964639746398463994640046401464024640346404464054640646407464084640946410464114641246413464144641546416464174641846419464204642146422464234642446425464264642746428464294643046431464324643346434464354643646437464384643946440464414644246443464444644546446464474644846449464504645146452464534645446455464564645746458464594646046461464624646346464464654646646467464684646946470464714647246473464744647546476464774647846479464804648146482464834648446485464864648746488464894649046491464924649346494464954649646497464984649946500465014650246503465044650546506465074650846509465104651146512465134651446515465164651746518465194652046521465224652346524465254652646527465284652946530465314653246533465344653546536465374653846539465404654146542465434654446545465464654746548465494655046551465524655346554465554655646557465584655946560465614656246563465644656546566465674656846569465704657146572465734657446575465764657746578465794658046581465824658346584465854658646587465884658946590465914659246593465944659546596465974659846599466004660146602466034660446605466064660746608466094661046611466124661346614466154661646617466184661946620466214662246623466244662546626466274662846629466304663146632466334663446635466364663746638466394664046641466424664346644466454664646647466484664946650466514665246653466544665546656466574665846659466604666146662466634666446665466664666746668466694667046671466724667346674466754667646677466784667946680466814668246683466844668546686466874668846689466904669146692466934669446695466964669746698466994670046701467024670346704467054670646707467084670946710467114671246713467144671546716467174671846719467204672146722467234672446725467264672746728467294673046731467324673346734467354673646737467384673946740467414674246743467444674546746467474674846749467504675146752467534675446755467564675746758467594676046761467624676346764467654676646767467684676946770467714677246773467744677546776467774677846779467804678146782467834678446785467864678746788467894679046791467924679346794467954679646797467984679946800468014680246803468044680546806468074680846809468104681146812468134681446815468164681746818468194682046821468224682346824468254682646827468284682946830468314683246833468344683546836468374683846839468404684146842468434684446845468464684746848468494685046851468524685346854468554685646857468584685946860468614686246863468644686546866468674686846869468704687146872468734687446875468764687746878468794688046881468824688346884468854688646887468884688946890468914689246893468944689546896468974689846899469004690146902469034690446905469064690746908469094691046911469124691346914469154691646917469184691946920469214692246923469244692546926469274692846929469304693146932469334693446935469364693746938469394694046941469424694346944469454694646947469484694946950469514695246953469544695546956469574695846959469604696146962469634696446965469664696746968469694697046971469724697346974469754697646977469784697946980469814698246983469844698546986469874698846989469904699146992469934699446995469964699746998469994700047001470024700347004470054700647007470084700947010470114701247013470144701547016470174701847019470204702147022470234702447025470264702747028470294703047031470324703347034470354703647037470384703947040470414704247043470444704547046470474704847049470504705147052470534705447055470564705747058470594706047061470624706347064470654706647067470684706947070470714707247073470744707547076470774707847079470804708147082470834708447085470864708747088470894709047091470924709347094470954709647097470984709947100471014710247103471044710547106471074710847109471104711147112471134711447115471164711747118471194712047121471224712347124471254712647127471284712947130471314713247133471344713547136471374713847139471404714147142471434714447145471464714747148471494715047151471524715347154471554715647157471584715947160471614716247163471644716547166471674716847169471704717147172471734717447175471764717747178471794718047181471824718347184471854718647187471884718947190471914719247193471944719547196471974719847199472004720147202472034720447205472064720747208472094721047211472124721347214472154721647217472184721947220472214722247223472244722547226472274722847229472304723147232472334723447235472364723747238472394724047241472424724347244472454724647247472484724947250472514725247253472544725547256472574725847259472604726147262472634726447265472664726747268472694727047271472724727347274472754727647277472784727947280472814728247283472844728547286472874728847289472904729147292472934729447295472964729747298472994730047301473024730347304473054730647307473084730947310473114731247313473144731547316473174731847319473204732147322473234732447325473264732747328473294733047331473324733347334473354733647337473384733947340473414734247343473444734547346473474734847349473504735147352473534735447355473564735747358473594736047361473624736347364473654736647367473684736947370473714737247373473744737547376473774737847379473804738147382473834738447385473864738747388473894739047391473924739347394473954739647397473984739947400474014740247403474044740547406474074740847409474104741147412474134741447415474164741747418474194742047421474224742347424474254742647427474284742947430474314743247433474344743547436474374743847439474404744147442474434744447445474464744747448474494745047451474524745347454474554745647457474584745947460474614746247463474644746547466474674746847469474704747147472474734747447475474764747747478474794748047481474824748347484474854748647487474884748947490474914749247493474944749547496474974749847499475004750147502475034750447505475064750747508475094751047511475124751347514475154751647517475184751947520475214752247523475244752547526475274752847529475304753147532475334753447535475364753747538475394754047541475424754347544475454754647547475484754947550475514755247553475544755547556475574755847559475604756147562475634756447565475664756747568475694757047571475724757347574475754757647577475784757947580475814758247583475844758547586475874758847589475904759147592475934759447595475964759747598475994760047601476024760347604476054760647607476084760947610476114761247613476144761547616476174761847619476204762147622476234762447625476264762747628476294763047631476324763347634476354763647637476384763947640476414764247643476444764547646476474764847649476504765147652476534765447655476564765747658476594766047661476624766347664476654766647667476684766947670476714767247673476744767547676476774767847679476804768147682476834768447685476864768747688476894769047691476924769347694476954769647697476984769947700477014770247703477044770547706477074770847709477104771147712477134771447715477164771747718477194772047721477224772347724477254772647727477284772947730477314773247733477344773547736477374773847739477404774147742477434774447745477464774747748477494775047751477524775347754477554775647757477584775947760477614776247763477644776547766477674776847769477704777147772477734777447775477764777747778477794778047781477824778347784477854778647787477884778947790477914779247793477944779547796477974779847799478004780147802478034780447805478064780747808478094781047811478124781347814478154781647817478184781947820478214782247823478244782547826478274782847829478304783147832478334783447835478364783747838478394784047841478424784347844478454784647847478484784947850478514785247853478544785547856478574785847859478604786147862478634786447865478664786747868478694787047871478724787347874478754787647877478784787947880478814788247883478844788547886478874788847889478904789147892478934789447895478964789747898478994790047901479024790347904479054790647907479084790947910479114791247913479144791547916479174791847919479204792147922479234792447925479264792747928479294793047931479324793347934479354793647937479384793947940479414794247943479444794547946479474794847949479504795147952479534795447955479564795747958479594796047961479624796347964479654796647967479684796947970479714797247973479744797547976479774797847979479804798147982479834798447985479864798747988479894799047991479924799347994479954799647997479984799948000480014800248003480044800548006480074800848009480104801148012480134801448015480164801748018480194802048021480224802348024480254802648027480284802948030480314803248033480344803548036480374803848039480404804148042480434804448045480464804748048480494805048051480524805348054480554805648057480584805948060480614806248063480644806548066480674806848069480704807148072480734807448075480764807748078480794808048081480824808348084480854808648087480884808948090480914809248093480944809548096480974809848099481004810148102481034810448105481064810748108481094811048111481124811348114481154811648117481184811948120481214812248123481244812548126481274812848129481304813148132481334813448135481364813748138481394814048141481424814348144481454814648147481484814948150481514815248153481544815548156481574815848159481604816148162481634816448165481664816748168481694817048171481724817348174481754817648177481784817948180481814818248183481844818548186481874818848189481904819148192481934819448195481964819748198481994820048201482024820348204482054820648207482084820948210482114821248213482144821548216482174821848219482204822148222482234822448225482264822748228482294823048231482324823348234482354823648237482384823948240482414824248243482444824548246482474824848249482504825148252482534825448255482564825748258482594826048261482624826348264482654826648267482684826948270482714827248273482744827548276482774827848279482804828148282482834828448285482864828748288482894829048291482924829348294482954829648297482984829948300483014830248303483044830548306483074830848309483104831148312483134831448315483164831748318483194832048321483224832348324483254832648327483284832948330483314833248333483344833548336483374833848339483404834148342483434834448345483464834748348483494835048351483524835348354483554835648357483584835948360483614836248363483644836548366483674836848369483704837148372483734837448375483764837748378483794838048381483824838348384483854838648387483884838948390483914839248393483944839548396483974839848399484004840148402484034840448405484064840748408484094841048411484124841348414484154841648417484184841948420484214842248423484244842548426484274842848429484304843148432484334843448435484364843748438484394844048441484424844348444484454844648447484484844948450484514845248453484544845548456484574845848459484604846148462484634846448465484664846748468484694847048471484724847348474484754847648477484784847948480484814848248483484844848548486484874848848489484904849148492484934849448495484964849748498484994850048501485024850348504485054850648507485084850948510485114851248513485144851548516485174851848519485204852148522485234852448525485264852748528485294853048531485324853348534485354853648537485384853948540485414854248543485444854548546485474854848549485504855148552485534855448555485564855748558485594856048561485624856348564485654856648567485684856948570485714857248573485744857548576485774857848579485804858148582485834858448585485864858748588485894859048591485924859348594485954859648597485984859948600486014860248603486044860548606486074860848609486104861148612486134861448615486164861748618486194862048621486224862348624486254862648627486284862948630486314863248633486344863548636486374863848639486404864148642486434864448645486464864748648486494865048651486524865348654486554865648657486584865948660486614866248663486644866548666486674866848669486704867148672486734867448675486764867748678486794868048681486824868348684486854868648687486884868948690486914869248693486944869548696486974869848699487004870148702487034870448705487064870748708487094871048711487124871348714487154871648717487184871948720487214872248723487244872548726487274872848729487304873148732487334873448735487364873748738487394874048741487424874348744487454874648747487484874948750487514875248753487544875548756487574875848759487604876148762487634876448765487664876748768487694877048771487724877348774487754877648777487784877948780487814878248783487844878548786487874878848789487904879148792487934879448795487964879748798487994880048801488024880348804488054880648807488084880948810488114881248813488144881548816488174881848819488204882148822488234882448825488264882748828488294883048831488324883348834488354883648837488384883948840488414884248843488444884548846488474884848849488504885148852488534885448855488564885748858488594886048861488624886348864488654886648867488684886948870488714887248873488744887548876488774887848879488804888148882488834888448885488864888748888488894889048891488924889348894488954889648897488984889948900489014890248903489044890548906489074890848909489104891148912489134891448915489164891748918489194892048921489224892348924489254892648927489284892948930489314893248933489344893548936489374893848939489404894148942489434894448945489464894748948489494895048951489524895348954489554895648957489584895948960489614896248963489644896548966489674896848969489704897148972489734897448975489764897748978489794898048981489824898348984489854898648987489884898948990489914899248993489944899548996489974899848999490004900149002490034900449005490064900749008490094901049011490124901349014490154901649017490184901949020490214902249023490244902549026490274902849029490304903149032490334903449035490364903749038490394904049041490424904349044490454904649047490484904949050490514905249053490544905549056490574905849059490604906149062490634906449065490664906749068490694907049071490724907349074490754907649077490784907949080490814908249083490844908549086490874908849089490904909149092490934909449095490964909749098490994910049101491024910349104491054910649107491084910949110491114911249113491144911549116491174911849119491204912149122491234912449125491264912749128491294913049131491324913349134491354913649137491384913949140491414914249143491444914549146491474914849149491504915149152491534915449155491564915749158491594916049161491624916349164491654916649167491684916949170491714917249173491744917549176491774917849179491804918149182491834918449185491864918749188491894919049191491924919349194491954919649197491984919949200492014920249203492044920549206492074920849209492104921149212492134921449215492164921749218492194922049221492224922349224492254922649227492284922949230492314923249233492344923549236492374923849239492404924149242492434924449245492464924749248492494925049251492524925349254492554925649257492584925949260492614926249263492644926549266492674926849269492704927149272492734927449275492764927749278492794928049281492824928349284492854928649287492884928949290492914929249293492944929549296492974929849299493004930149302493034930449305493064930749308493094931049311493124931349314493154931649317493184931949320493214932249323493244932549326493274932849329493304933149332493334933449335493364933749338493394934049341493424934349344493454934649347493484934949350493514935249353493544935549356493574935849359493604936149362493634936449365493664936749368493694937049371493724937349374493754937649377493784937949380493814938249383493844938549386493874938849389493904939149392493934939449395493964939749398493994940049401494024940349404494054940649407494084940949410494114941249413494144941549416494174941849419494204942149422494234942449425494264942749428494294943049431494324943349434494354943649437494384943949440494414944249443494444944549446494474944849449494504945149452494534945449455494564945749458494594946049461494624946349464494654946649467494684946949470494714947249473494744947549476494774947849479494804948149482494834948449485494864948749488494894949049491494924949349494494954949649497494984949949500495014950249503495044950549506495074950849509495104951149512495134951449515495164951749518495194952049521495224952349524495254952649527495284952949530495314953249533495344953549536495374953849539495404954149542495434954449545495464954749548495494955049551495524955349554495554955649557495584955949560495614956249563495644956549566495674956849569495704957149572495734957449575495764957749578495794958049581495824958349584495854958649587495884958949590495914959249593495944959549596495974959849599496004960149602496034960449605496064960749608496094961049611496124961349614496154961649617496184961949620496214962249623496244962549626496274962849629496304963149632496334963449635496364963749638496394964049641496424964349644496454964649647496484964949650496514965249653496544965549656496574965849659496604966149662496634966449665496664966749668496694967049671496724967349674496754967649677496784967949680496814968249683496844968549686496874968849689496904969149692496934969449695496964969749698496994970049701497024970349704497054970649707497084970949710497114971249713497144971549716497174971849719497204972149722497234972449725497264972749728497294973049731497324973349734497354973649737497384973949740497414974249743497444974549746497474974849749497504975149752497534975449755497564975749758497594976049761497624976349764497654976649767497684976949770497714977249773497744977549776497774977849779497804978149782497834978449785497864978749788497894979049791497924979349794497954979649797497984979949800498014980249803498044980549806498074980849809498104981149812498134981449815498164981749818498194982049821498224982349824498254982649827498284982949830498314983249833498344983549836498374983849839498404984149842498434984449845498464984749848498494985049851498524985349854498554985649857498584985949860498614986249863498644986549866498674986849869498704987149872498734987449875498764987749878498794988049881498824988349884498854988649887498884988949890498914989249893498944989549896498974989849899499004990149902499034990449905499064990749908499094991049911499124991349914499154991649917499184991949920499214992249923499244992549926499274992849929499304993149932499334993449935499364993749938499394994049941499424994349944499454994649947499484994949950499514995249953499544995549956499574995849959499604996149962499634996449965499664996749968499694997049971499724997349974499754997649977499784997949980499814998249983499844998549986499874998849989499904999149992499934999449995499964999749998499995000050001500025000350004500055000650007500085000950010500115001250013500145001550016500175001850019500205002150022500235002450025500265002750028500295003050031500325003350034500355003650037500385003950040500415004250043500445004550046500475004850049500505005150052500535005450055500565005750058500595006050061500625006350064500655006650067500685006950070500715007250073500745007550076500775007850079500805008150082500835008450085500865008750088500895009050091500925009350094500955009650097500985009950100501015010250103501045010550106501075010850109501105011150112501135011450115501165011750118501195012050121501225012350124501255012650127501285012950130501315013250133501345013550136501375013850139501405014150142501435014450145501465014750148501495015050151501525015350154501555015650157501585015950160501615016250163501645016550166501675016850169501705017150172501735017450175501765017750178501795018050181501825018350184501855018650187501885018950190501915019250193501945019550196501975019850199502005020150202502035020450205502065020750208502095021050211502125021350214502155021650217502185021950220502215022250223502245022550226502275022850229502305023150232502335023450235502365023750238502395024050241502425024350244502455024650247502485024950250502515025250253502545025550256502575025850259502605026150262502635026450265502665026750268502695027050271502725027350274502755027650277502785027950280502815028250283502845028550286502875028850289502905029150292502935029450295502965029750298502995030050301503025030350304503055030650307503085030950310503115031250313503145031550316503175031850319503205032150322503235032450325503265032750328503295033050331503325033350334503355033650337503385033950340503415034250343503445034550346503475034850349503505035150352503535035450355503565035750358503595036050361503625036350364503655036650367503685036950370503715037250373503745037550376503775037850379503805038150382503835038450385503865038750388503895039050391503925039350394503955039650397503985039950400504015040250403504045040550406504075040850409504105041150412504135041450415504165041750418504195042050421504225042350424504255042650427504285042950430504315043250433504345043550436504375043850439504405044150442504435044450445504465044750448504495045050451504525045350454504555045650457504585045950460504615046250463504645046550466504675046850469504705047150472504735047450475504765047750478504795048050481504825048350484504855048650487504885048950490504915049250493504945049550496504975049850499505005050150502505035050450505505065050750508505095051050511505125051350514505155051650517505185051950520505215052250523505245052550526505275052850529505305053150532505335053450535505365053750538505395054050541505425054350544505455054650547505485054950550505515055250553505545055550556505575055850559505605056150562505635056450565505665056750568505695057050571505725057350574505755057650577505785057950580505815058250583505845058550586505875058850589505905059150592505935059450595505965059750598505995060050601506025060350604506055060650607506085060950610506115061250613506145061550616506175061850619506205062150622506235062450625506265062750628506295063050631506325063350634506355063650637506385063950640506415064250643506445064550646506475064850649506505065150652506535065450655506565065750658506595066050661506625066350664506655066650667506685066950670506715067250673506745067550676506775067850679506805068150682506835068450685506865068750688506895069050691506925069350694506955069650697506985069950700507015070250703507045070550706507075070850709507105071150712507135071450715507165071750718507195072050721507225072350724507255072650727507285072950730507315073250733507345073550736507375073850739507405074150742507435074450745507465074750748507495075050751507525075350754507555075650757507585075950760507615076250763507645076550766507675076850769507705077150772507735077450775507765077750778507795078050781507825078350784507855078650787507885078950790507915079250793507945079550796507975079850799508005080150802508035080450805508065080750808508095081050811508125081350814508155081650817508185081950820508215082250823508245082550826508275082850829508305083150832508335083450835508365083750838508395084050841508425084350844508455084650847508485084950850508515085250853508545085550856508575085850859508605086150862508635086450865508665086750868508695087050871508725087350874508755087650877508785087950880508815088250883508845088550886508875088850889508905089150892508935089450895508965089750898508995090050901509025090350904509055090650907509085090950910509115091250913509145091550916509175091850919509205092150922509235092450925509265092750928509295093050931509325093350934509355093650937509385093950940509415094250943509445094550946509475094850949509505095150952509535095450955509565095750958509595096050961509625096350964509655096650967509685096950970509715097250973509745097550976509775097850979509805098150982509835098450985509865098750988509895099050991509925099350994509955099650997509985099951000510015100251003510045100551006510075100851009510105101151012510135101451015510165101751018510195102051021510225102351024510255102651027510285102951030510315103251033510345103551036510375103851039510405104151042510435104451045510465104751048510495105051051510525105351054510555105651057510585105951060510615106251063510645106551066510675106851069510705107151072510735107451075510765107751078510795108051081510825108351084510855108651087510885108951090510915109251093510945109551096510975109851099511005110151102511035110451105511065110751108511095111051111511125111351114511155111651117511185111951120511215112251123511245112551126511275112851129511305113151132511335113451135511365113751138511395114051141511425114351144511455114651147511485114951150511515115251153511545115551156511575115851159511605116151162511635116451165511665116751168511695117051171511725117351174511755117651177511785117951180511815118251183511845118551186511875118851189511905119151192511935119451195511965119751198511995120051201512025120351204512055120651207512085120951210512115121251213512145121551216512175121851219512205122151222512235122451225512265122751228512295123051231512325123351234512355123651237512385123951240512415124251243512445124551246512475124851249512505125151252512535125451255512565125751258512595126051261512625126351264512655126651267512685126951270512715127251273512745127551276512775127851279512805128151282512835128451285512865128751288512895129051291512925129351294512955129651297512985129951300513015130251303513045130551306513075130851309513105131151312513135131451315513165131751318513195132051321513225132351324513255132651327513285132951330513315133251333513345133551336513375133851339513405134151342513435134451345513465134751348513495135051351513525135351354513555135651357513585135951360513615136251363513645136551366513675136851369513705137151372513735137451375513765137751378513795138051381513825138351384513855138651387513885138951390513915139251393513945139551396513975139851399514005140151402514035140451405514065140751408514095141051411514125141351414514155141651417514185141951420514215142251423514245142551426514275142851429514305143151432514335143451435514365143751438514395144051441514425144351444514455144651447514485144951450514515145251453514545145551456514575145851459514605146151462514635146451465514665146751468514695147051471514725147351474514755147651477514785147951480514815148251483514845148551486514875148851489514905149151492514935149451495514965149751498514995150051501515025150351504515055150651507515085150951510515115151251513515145151551516515175151851519515205152151522515235152451525515265152751528515295153051531515325153351534515355153651537515385153951540515415154251543515445154551546515475154851549515505155151552515535155451555515565155751558515595156051561515625156351564515655156651567515685156951570515715157251573515745157551576515775157851579515805158151582515835158451585515865158751588515895159051591515925159351594515955159651597515985159951600516015160251603516045160551606516075160851609516105161151612516135161451615516165161751618516195162051621516225162351624516255162651627516285162951630516315163251633516345163551636516375163851639516405164151642516435164451645516465164751648516495165051651516525165351654516555165651657516585165951660516615166251663516645166551666516675166851669516705167151672516735167451675516765167751678516795168051681516825168351684516855168651687516885168951690516915169251693516945169551696516975169851699517005170151702517035170451705517065170751708517095171051711517125171351714517155171651717517185171951720517215172251723517245172551726517275172851729517305173151732517335173451735517365173751738517395174051741517425174351744517455174651747517485174951750517515175251753517545175551756517575175851759517605176151762517635176451765517665176751768517695177051771517725177351774517755177651777517785177951780517815178251783517845178551786517875178851789517905179151792517935179451795517965179751798517995180051801518025180351804518055180651807518085180951810518115181251813518145181551816518175181851819518205182151822518235182451825518265182751828518295183051831518325183351834518355183651837518385183951840518415184251843518445184551846518475184851849518505185151852518535185451855518565185751858518595186051861518625186351864518655186651867518685186951870518715187251873518745187551876518775187851879518805188151882518835188451885518865188751888518895189051891518925189351894518955189651897518985189951900519015190251903519045190551906519075190851909519105191151912519135191451915519165191751918519195192051921519225192351924519255192651927519285192951930519315193251933519345193551936519375193851939519405194151942519435194451945519465194751948519495195051951519525195351954519555195651957519585195951960519615196251963519645196551966519675196851969519705197151972519735197451975519765197751978519795198051981519825198351984519855198651987519885198951990519915199251993519945199551996519975199851999520005200152002520035200452005520065200752008520095201052011520125201352014520155201652017520185201952020520215202252023520245202552026520275202852029520305203152032520335203452035520365203752038520395204052041520425204352044520455204652047520485204952050520515205252053520545205552056520575205852059520605206152062520635206452065520665206752068520695207052071520725207352074520755207652077520785207952080520815208252083520845208552086520875208852089520905209152092520935209452095520965209752098520995210052101521025210352104521055210652107521085210952110521115211252113521145211552116521175211852119521205212152122521235212452125521265212752128521295213052131521325213352134521355213652137521385213952140521415214252143521445214552146521475214852149521505215152152521535215452155521565215752158521595216052161521625216352164521655216652167521685216952170521715217252173521745217552176521775217852179521805218152182521835218452185521865218752188521895219052191521925219352194521955219652197521985219952200522015220252203522045220552206522075220852209522105221152212522135221452215522165221752218522195222052221522225222352224522255222652227522285222952230522315223252233522345223552236522375223852239522405224152242522435224452245522465224752248522495225052251522525225352254522555225652257522585225952260522615226252263522645226552266522675226852269522705227152272522735227452275522765227752278522795228052281522825228352284522855228652287522885228952290522915229252293522945229552296522975229852299523005230152302523035230452305523065230752308523095231052311523125231352314523155231652317523185231952320523215232252323523245232552326523275232852329523305233152332523335233452335523365233752338523395234052341523425234352344523455234652347523485234952350523515235252353523545235552356523575235852359523605236152362523635236452365523665236752368523695237052371523725237352374523755237652377523785237952380523815238252383523845238552386523875238852389523905239152392523935239452395523965239752398523995240052401524025240352404524055240652407524085240952410524115241252413524145241552416524175241852419524205242152422524235242452425524265242752428524295243052431524325243352434524355243652437524385243952440524415244252443524445244552446524475244852449524505245152452524535245452455524565245752458524595246052461524625246352464524655246652467524685246952470524715247252473524745247552476524775247852479524805248152482524835248452485524865248752488524895249052491524925249352494524955249652497524985249952500525015250252503525045250552506525075250852509525105251152512525135251452515525165251752518525195252052521525225252352524525255252652527525285252952530525315253252533525345253552536525375253852539525405254152542525435254452545525465254752548525495255052551525525255352554525555255652557525585255952560525615256252563525645256552566525675256852569525705257152572525735257452575525765257752578525795258052581525825258352584525855258652587525885258952590525915259252593525945259552596525975259852599526005260152602526035260452605526065260752608526095261052611526125261352614526155261652617526185261952620526215262252623526245262552626526275262852629526305263152632526335263452635526365263752638526395264052641526425264352644526455264652647526485264952650526515265252653526545265552656526575265852659526605266152662526635266452665526665266752668526695267052671526725267352674526755267652677526785267952680526815268252683526845268552686526875268852689526905269152692526935269452695526965269752698526995270052701527025270352704527055270652707527085270952710527115271252713527145271552716527175271852719527205272152722527235272452725527265272752728527295273052731527325273352734527355273652737527385273952740527415274252743527445274552746527475274852749527505275152752527535275452755527565275752758527595276052761527625276352764527655276652767527685276952770527715277252773527745277552776527775277852779527805278152782527835278452785527865278752788527895279052791527925279352794527955279652797527985279952800528015280252803528045280552806528075280852809528105281152812528135281452815528165281752818528195282052821528225282352824528255282652827528285282952830528315283252833528345283552836528375283852839528405284152842528435284452845528465284752848528495285052851528525285352854528555285652857528585285952860528615286252863528645286552866528675286852869528705287152872528735287452875528765287752878528795288052881528825288352884528855288652887528885288952890528915289252893528945289552896528975289852899529005290152902529035290452905529065290752908529095291052911529125291352914529155291652917529185291952920529215292252923529245292552926529275292852929529305293152932529335293452935529365293752938529395294052941529425294352944529455294652947529485294952950529515295252953529545295552956529575295852959529605296152962529635296452965529665296752968529695297052971529725297352974529755297652977529785297952980529815298252983529845298552986529875298852989529905299152992529935299452995529965299752998529995300053001530025300353004530055300653007530085300953010530115301253013530145301553016530175301853019530205302153022530235302453025530265302753028530295303053031530325303353034530355303653037530385303953040530415304253043530445304553046530475304853049530505305153052530535305453055530565305753058530595306053061530625306353064530655306653067530685306953070530715307253073530745307553076530775307853079530805308153082530835308453085530865308753088530895309053091530925309353094530955309653097530985309953100531015310253103531045310553106531075310853109531105311153112531135311453115531165311753118531195312053121531225312353124531255312653127531285312953130531315313253133531345313553136531375313853139531405314153142531435314453145531465314753148531495315053151531525315353154531555315653157531585315953160531615316253163531645316553166531675316853169531705317153172531735317453175531765317753178531795318053181531825318353184531855318653187531885318953190531915319253193531945319553196531975319853199532005320153202532035320453205532065320753208532095321053211532125321353214532155321653217532185321953220532215322253223532245322553226532275322853229532305323153232532335323453235532365323753238532395324053241532425324353244532455324653247532485324953250532515325253253532545325553256532575325853259532605326153262532635326453265532665326753268532695327053271532725327353274532755327653277532785327953280532815328253283532845328553286532875328853289532905329153292532935329453295532965329753298532995330053301533025330353304533055330653307533085330953310533115331253313533145331553316533175331853319533205332153322533235332453325533265332753328533295333053331533325333353334533355333653337533385333953340533415334253343533445334553346533475334853349533505335153352533535335453355533565335753358533595336053361533625336353364533655336653367533685336953370533715337253373533745337553376533775337853379533805338153382533835338453385533865338753388533895339053391533925339353394533955339653397533985339953400534015340253403534045340553406534075340853409534105341153412534135341453415534165341753418534195342053421534225342353424534255342653427534285342953430534315343253433534345343553436534375343853439534405344153442534435344453445534465344753448534495345053451534525345353454534555345653457534585345953460534615346253463534645346553466534675346853469534705347153472534735347453475534765347753478534795348053481534825348353484534855348653487534885348953490534915349253493534945349553496534975349853499535005350153502535035350453505535065350753508535095351053511535125351353514535155351653517535185351953520535215352253523535245352553526535275352853529535305353153532535335353453535535365353753538535395354053541535425354353544535455354653547535485354953550535515355253553535545355553556535575355853559535605356153562535635356453565535665356753568535695357053571535725357353574535755357653577535785357953580535815358253583535845358553586535875358853589535905359153592535935359453595535965359753598535995360053601536025360353604536055360653607536085360953610536115361253613536145361553616536175361853619536205362153622536235362453625536265362753628536295363053631536325363353634536355363653637536385363953640536415364253643536445364553646536475364853649536505365153652536535365453655536565365753658536595366053661536625366353664536655366653667536685366953670536715367253673536745367553676536775367853679536805368153682536835368453685536865368753688536895369053691536925369353694536955369653697536985369953700537015370253703537045370553706537075370853709537105371153712537135371453715537165371753718537195372053721537225372353724537255372653727537285372953730537315373253733537345373553736537375373853739537405374153742537435374453745537465374753748537495375053751537525375353754537555375653757537585375953760537615376253763537645376553766537675376853769537705377153772537735377453775537765377753778537795378053781537825378353784537855378653787537885378953790537915379253793537945379553796537975379853799538005380153802538035380453805538065380753808538095381053811538125381353814538155381653817538185381953820538215382253823538245382553826538275382853829538305383153832538335383453835538365383753838538395384053841538425384353844538455384653847538485384953850538515385253853538545385553856538575385853859538605386153862538635386453865538665386753868538695387053871538725387353874538755387653877538785387953880538815388253883538845388553886538875388853889538905389153892538935389453895538965389753898538995390053901539025390353904539055390653907539085390953910539115391253913539145391553916539175391853919539205392153922539235392453925539265392753928539295393053931539325393353934539355393653937539385393953940539415394253943539445394553946539475394853949539505395153952539535395453955539565395753958539595396053961539625396353964539655396653967539685396953970539715397253973539745397553976539775397853979539805398153982539835398453985539865398753988539895399053991539925399353994539955399653997539985399954000540015400254003540045400554006540075400854009540105401154012540135401454015540165401754018540195402054021540225402354024540255402654027540285402954030540315403254033540345403554036540375403854039540405404154042540435404454045540465404754048540495405054051540525405354054540555405654057540585405954060540615406254063540645406554066540675406854069540705407154072540735407454075540765407754078540795408054081540825408354084540855408654087540885408954090540915409254093540945409554096540975409854099541005410154102541035410454105541065410754108541095411054111541125411354114541155411654117541185411954120541215412254123541245412554126541275412854129541305413154132541335413454135541365413754138541395414054141541425414354144541455414654147541485414954150541515415254153541545415554156541575415854159541605416154162541635416454165541665416754168541695417054171541725417354174541755417654177541785417954180541815418254183541845418554186541875418854189541905419154192541935419454195541965419754198541995420054201542025420354204542055420654207542085420954210542115421254213542145421554216542175421854219542205422154222542235422454225542265422754228542295423054231542325423354234542355423654237542385423954240542415424254243542445424554246542475424854249542505425154252542535425454255542565425754258542595426054261542625426354264542655426654267542685426954270542715427254273542745427554276542775427854279542805428154282542835428454285542865428754288542895429054291542925429354294542955429654297542985429954300543015430254303543045430554306543075430854309543105431154312543135431454315543165431754318543195432054321543225432354324543255432654327543285432954330543315433254333543345433554336543375433854339543405434154342543435434454345543465434754348543495435054351543525435354354543555435654357543585435954360543615436254363543645436554366543675436854369543705437154372543735437454375543765437754378543795438054381543825438354384543855438654387543885438954390543915439254393543945439554396543975439854399544005440154402544035440454405544065440754408544095441054411544125441354414544155441654417544185441954420544215442254423544245442554426544275442854429544305443154432544335443454435544365443754438544395444054441544425444354444544455444654447544485444954450544515445254453544545445554456544575445854459544605446154462544635446454465544665446754468544695447054471544725447354474544755447654477544785447954480544815448254483544845448554486544875448854489544905449154492544935449454495544965449754498544995450054501545025450354504545055450654507545085450954510545115451254513545145451554516545175451854519545205452154522545235452454525545265452754528545295453054531545325453354534545355453654537545385453954540545415454254543545445454554546545475454854549545505455154552545535455454555545565455754558545595456054561545625456354564545655456654567545685456954570545715457254573545745457554576545775457854579545805458154582545835458454585545865458754588545895459054591545925459354594545955459654597545985459954600546015460254603546045460554606546075460854609546105461154612546135461454615546165461754618546195462054621546225462354624546255462654627546285462954630546315463254633546345463554636546375463854639546405464154642546435464454645546465464754648546495465054651546525465354654546555465654657546585465954660546615466254663546645466554666546675466854669546705467154672546735467454675546765467754678546795468054681546825468354684546855468654687546885468954690546915469254693546945469554696546975469854699547005470154702547035470454705547065470754708547095471054711547125471354714547155471654717547185471954720547215472254723547245472554726547275472854729547305473154732547335473454735547365473754738547395474054741547425474354744547455474654747547485474954750547515475254753547545475554756547575475854759547605476154762547635476454765547665476754768547695477054771547725477354774547755477654777547785477954780547815478254783547845478554786547875478854789547905479154792547935479454795547965479754798547995480054801548025480354804548055480654807548085480954810548115481254813548145481554816548175481854819548205482154822548235482454825548265482754828548295483054831548325483354834548355483654837548385483954840548415484254843548445484554846548475484854849548505485154852548535485454855548565485754858548595486054861548625486354864548655486654867548685486954870548715487254873548745487554876548775487854879548805488154882548835488454885548865488754888548895489054891548925489354894548955489654897548985489954900549015490254903549045490554906549075490854909549105491154912549135491454915549165491754918549195492054921549225492354924549255492654927549285492954930549315493254933549345493554936549375493854939549405494154942549435494454945549465494754948549495495054951549525495354954549555495654957549585495954960549615496254963549645496554966549675496854969549705497154972549735497454975549765497754978549795498054981549825498354984549855498654987549885498954990549915499254993549945499554996549975499854999550005500155002550035500455005550065500755008550095501055011550125501355014550155501655017550185501955020550215502255023550245502555026550275502855029550305503155032550335503455035550365503755038550395504055041550425504355044550455504655047550485504955050550515505255053550545505555056550575505855059550605506155062550635506455065550665506755068550695507055071550725507355074550755507655077550785507955080550815508255083550845508555086550875508855089550905509155092550935509455095550965509755098550995510055101551025510355104551055510655107551085510955110551115511255113551145511555116551175511855119551205512155122551235512455125551265512755128551295513055131551325513355134551355513655137551385513955140551415514255143551445514555146551475514855149551505515155152551535515455155551565515755158551595516055161551625516355164551655516655167551685516955170551715517255173551745517555176551775517855179551805518155182551835518455185551865518755188551895519055191551925519355194551955519655197551985519955200552015520255203552045520555206552075520855209552105521155212552135521455215552165521755218552195522055221552225522355224552255522655227552285522955230552315523255233552345523555236552375523855239552405524155242552435524455245552465524755248552495525055251552525525355254552555525655257552585525955260552615526255263552645526555266552675526855269552705527155272552735527455275552765527755278552795528055281552825528355284552855528655287552885528955290552915529255293552945529555296552975529855299553005530155302553035530455305553065530755308553095531055311553125531355314553155531655317553185531955320553215532255323553245532555326553275532855329553305533155332553335533455335553365533755338553395534055341553425534355344553455534655347553485534955350553515535255353553545535555356553575535855359553605536155362553635536455365553665536755368553695537055371553725537355374553755537655377553785537955380553815538255383553845538555386553875538855389553905539155392553935539455395553965539755398553995540055401554025540355404554055540655407554085540955410554115541255413554145541555416554175541855419554205542155422554235542455425554265542755428554295543055431554325543355434554355543655437554385543955440554415544255443554445544555446554475544855449554505545155452554535545455455554565545755458554595546055461554625546355464554655546655467554685546955470554715547255473554745547555476554775547855479554805548155482554835548455485554865548755488554895549055491554925549355494554955549655497554985549955500555015550255503555045550555506555075550855509555105551155512555135551455515555165551755518555195552055521555225552355524555255552655527555285552955530555315553255533555345553555536555375553855539555405554155542555435554455545555465554755548555495555055551555525555355554555555555655557555585555955560555615556255563555645556555566555675556855569555705557155572555735557455575555765557755578555795558055581555825558355584555855558655587555885558955590555915559255593555945559555596555975559855599556005560155602556035560455605556065560755608556095561055611556125561355614556155561655617556185561955620556215562255623556245562555626556275562855629556305563155632556335563455635556365563755638556395564055641556425564355644556455564655647556485564955650556515565255653556545565555656556575565855659556605566155662556635566455665556665566755668556695567055671556725567355674556755567655677556785567955680556815568255683556845568555686556875568855689556905569155692556935569455695556965569755698556995570055701557025570355704557055570655707557085570955710557115571255713557145571555716557175571855719557205572155722557235572455725557265572755728557295573055731557325573355734557355573655737557385573955740557415574255743557445574555746557475574855749557505575155752557535575455755557565575755758557595576055761557625576355764557655576655767557685576955770557715577255773557745577555776557775577855779557805578155782557835578455785557865578755788557895579055791557925579355794557955579655797557985579955800558015580255803558045580555806558075580855809558105581155812558135581455815558165581755818558195582055821558225582355824558255582655827558285582955830558315583255833558345583555836558375583855839558405584155842558435584455845558465584755848558495585055851558525585355854558555585655857558585585955860558615586255863558645586555866558675586855869558705587155872558735587455875558765587755878558795588055881558825588355884558855588655887558885588955890558915589255893558945589555896558975589855899559005590155902559035590455905559065590755908559095591055911559125591355914559155591655917559185591955920559215592255923559245592555926559275592855929559305593155932559335593455935559365593755938559395594055941559425594355944559455594655947559485594955950559515595255953559545595555956559575595855959559605596155962559635596455965559665596755968559695597055971559725597355974559755597655977559785597955980559815598255983559845598555986559875598855989559905599155992559935599455995559965599755998559995600056001560025600356004560055600656007560085600956010560115601256013560145601556016560175601856019560205602156022560235602456025560265602756028560295603056031560325603356034560355603656037560385603956040560415604256043560445604556046560475604856049560505605156052560535605456055560565605756058560595606056061560625606356064560655606656067560685606956070560715607256073560745607556076560775607856079560805608156082560835608456085560865608756088560895609056091560925609356094560955609656097560985609956100561015610256103561045610556106561075610856109561105611156112561135611456115561165611756118561195612056121561225612356124561255612656127561285612956130561315613256133561345613556136561375613856139561405614156142561435614456145561465614756148561495615056151561525615356154561555615656157561585615956160561615616256163561645616556166561675616856169561705617156172561735617456175561765617756178561795618056181561825618356184561855618656187561885618956190561915619256193561945619556196561975619856199562005620156202562035620456205562065620756208562095621056211562125621356214562155621656217562185621956220562215622256223562245622556226562275622856229562305623156232562335623456235562365623756238562395624056241562425624356244562455624656247562485624956250562515625256253562545625556256562575625856259562605626156262562635626456265562665626756268562695627056271562725627356274562755627656277562785627956280562815628256283562845628556286562875628856289562905629156292562935629456295562965629756298562995630056301563025630356304563055630656307563085630956310563115631256313563145631556316563175631856319563205632156322563235632456325563265632756328563295633056331563325633356334563355633656337563385633956340563415634256343563445634556346563475634856349563505635156352563535635456355563565635756358563595636056361563625636356364563655636656367563685636956370563715637256373563745637556376563775637856379563805638156382563835638456385563865638756388563895639056391563925639356394563955639656397563985639956400564015640256403564045640556406564075640856409564105641156412564135641456415564165641756418564195642056421564225642356424564255642656427564285642956430564315643256433564345643556436564375643856439564405644156442564435644456445564465644756448564495645056451564525645356454564555645656457564585645956460564615646256463564645646556466564675646856469564705647156472564735647456475564765647756478564795648056481564825648356484564855648656487564885648956490564915649256493564945649556496564975649856499565005650156502565035650456505565065650756508565095651056511565125651356514565155651656517565185651956520565215652256523565245652556526565275652856529565305653156532565335653456535565365653756538565395654056541565425654356544565455654656547565485654956550565515655256553565545655556556565575655856559565605656156562565635656456565565665656756568565695657056571565725657356574565755657656577565785657956580565815658256583565845658556586565875658856589565905659156592565935659456595565965659756598565995660056601566025660356604566055660656607566085660956610566115661256613566145661556616566175661856619566205662156622566235662456625566265662756628566295663056631566325663356634566355663656637566385663956640566415664256643566445664556646566475664856649566505665156652566535665456655566565665756658566595666056661566625666356664566655666656667566685666956670566715667256673566745667556676566775667856679566805668156682566835668456685566865668756688566895669056691566925669356694566955669656697566985669956700567015670256703567045670556706567075670856709567105671156712567135671456715567165671756718567195672056721567225672356724567255672656727567285672956730567315673256733567345673556736567375673856739567405674156742567435674456745567465674756748567495675056751567525675356754567555675656757567585675956760567615676256763567645676556766567675676856769567705677156772567735677456775567765677756778567795678056781567825678356784567855678656787567885678956790567915679256793567945679556796567975679856799568005680156802568035680456805568065680756808568095681056811568125681356814568155681656817568185681956820568215682256823568245682556826568275682856829568305683156832568335683456835568365683756838568395684056841568425684356844568455684656847568485684956850568515685256853568545685556856568575685856859568605686156862568635686456865568665686756868568695687056871568725687356874568755687656877568785687956880568815688256883568845688556886568875688856889568905689156892568935689456895568965689756898568995690056901569025690356904569055690656907569085690956910569115691256913569145691556916569175691856919569205692156922569235692456925569265692756928569295693056931569325693356934569355693656937569385693956940569415694256943569445694556946569475694856949569505695156952569535695456955569565695756958569595696056961569625696356964569655696656967569685696956970569715697256973569745697556976569775697856979569805698156982569835698456985569865698756988569895699056991569925699356994569955699656997569985699957000570015700257003570045700557006570075700857009570105701157012570135701457015570165701757018570195702057021570225702357024570255702657027570285702957030570315703257033570345703557036570375703857039570405704157042570435704457045570465704757048570495705057051570525705357054570555705657057570585705957060570615706257063570645706557066570675706857069570705707157072570735707457075570765707757078570795708057081570825708357084570855708657087570885708957090570915709257093570945709557096570975709857099571005710157102571035710457105571065710757108571095711057111571125711357114571155711657117571185711957120571215712257123571245712557126571275712857129571305713157132571335713457135571365713757138571395714057141571425714357144571455714657147571485714957150571515715257153571545715557156571575715857159571605716157162571635716457165571665716757168571695717057171571725717357174571755717657177571785717957180571815718257183571845718557186571875718857189571905719157192571935719457195571965719757198571995720057201572025720357204572055720657207572085720957210572115721257213572145721557216572175721857219572205722157222572235722457225572265722757228572295723057231572325723357234572355723657237572385723957240572415724257243572445724557246572475724857249572505725157252572535725457255572565725757258572595726057261572625726357264572655726657267572685726957270572715727257273572745727557276572775727857279572805728157282572835728457285572865728757288572895729057291572925729357294572955729657297572985729957300573015730257303573045730557306573075730857309573105731157312573135731457315573165731757318573195732057321573225732357324573255732657327573285732957330573315733257333573345733557336573375733857339573405734157342573435734457345573465734757348573495735057351573525735357354573555735657357573585735957360573615736257363573645736557366573675736857369573705737157372573735737457375573765737757378573795738057381573825738357384573855738657387573885738957390573915739257393573945739557396573975739857399574005740157402574035740457405574065740757408574095741057411574125741357414574155741657417574185741957420574215742257423574245742557426574275742857429574305743157432574335743457435574365743757438574395744057441574425744357444574455744657447574485744957450574515745257453574545745557456574575745857459574605746157462574635746457465574665746757468574695747057471574725747357474574755747657477574785747957480574815748257483574845748557486574875748857489574905749157492574935749457495574965749757498574995750057501575025750357504575055750657507575085750957510575115751257513575145751557516575175751857519575205752157522575235752457525575265752757528575295753057531575325753357534575355753657537575385753957540575415754257543575445754557546575475754857549575505755157552575535755457555575565755757558575595756057561575625756357564575655756657567575685756957570575715757257573575745757557576575775757857579575805758157582575835758457585575865758757588575895759057591575925759357594575955759657597575985759957600576015760257603576045760557606576075760857609576105761157612576135761457615576165761757618576195762057621576225762357624576255762657627576285762957630576315763257633576345763557636576375763857639576405764157642576435764457645576465764757648576495765057651576525765357654576555765657657576585765957660576615766257663576645766557666576675766857669576705767157672576735767457675576765767757678576795768057681576825768357684576855768657687576885768957690576915769257693576945769557696576975769857699577005770157702577035770457705577065770757708577095771057711577125771357714577155771657717577185771957720577215772257723577245772557726577275772857729577305773157732577335773457735577365773757738577395774057741577425774357744577455774657747577485774957750577515775257753577545775557756577575775857759577605776157762577635776457765577665776757768577695777057771577725777357774577755777657777577785777957780577815778257783577845778557786577875778857789577905779157792577935779457795577965779757798577995780057801578025780357804578055780657807578085780957810578115781257813578145781557816578175781857819578205782157822578235782457825578265782757828578295783057831578325783357834578355783657837578385783957840578415784257843578445784557846578475784857849578505785157852578535785457855578565785757858578595786057861578625786357864578655786657867578685786957870578715787257873578745787557876578775787857879578805788157882578835788457885578865788757888578895789057891578925789357894578955789657897578985789957900579015790257903579045790557906579075790857909579105791157912579135791457915579165791757918579195792057921579225792357924579255792657927579285792957930579315793257933579345793557936579375793857939579405794157942579435794457945579465794757948579495795057951579525795357954579555795657957579585795957960579615796257963579645796557966579675796857969579705797157972579735797457975579765797757978579795798057981579825798357984579855798657987579885798957990579915799257993579945799557996579975799857999580005800158002580035800458005580065800758008580095801058011580125801358014580155801658017580185801958020580215802258023580245802558026580275802858029580305803158032580335803458035580365803758038580395804058041580425804358044580455804658047580485804958050580515805258053580545805558056580575805858059580605806158062580635806458065580665806758068580695807058071580725807358074580755807658077580785807958080580815808258083580845808558086580875808858089580905809158092580935809458095580965809758098580995810058101581025810358104581055810658107581085810958110581115811258113581145811558116581175811858119581205812158122581235812458125581265812758128581295813058131581325813358134581355813658137581385813958140581415814258143581445814558146581475814858149581505815158152581535815458155581565815758158581595816058161581625816358164581655816658167581685816958170581715817258173581745817558176581775817858179581805818158182581835818458185581865818758188581895819058191581925819358194581955819658197581985819958200582015820258203582045820558206582075820858209582105821158212582135821458215582165821758218582195822058221582225822358224582255822658227582285822958230582315823258233582345823558236582375823858239582405824158242582435824458245582465824758248582495825058251582525825358254582555825658257582585825958260582615826258263582645826558266582675826858269582705827158272582735827458275582765827758278582795828058281582825828358284582855828658287582885828958290582915829258293582945829558296582975829858299583005830158302583035830458305583065830758308583095831058311583125831358314583155831658317583185831958320583215832258323583245832558326583275832858329583305833158332583335833458335583365833758338583395834058341583425834358344583455834658347583485834958350583515835258353583545835558356583575835858359583605836158362583635836458365583665836758368583695837058371583725837358374583755837658377583785837958380583815838258383583845838558386583875838858389583905839158392583935839458395583965839758398583995840058401584025840358404584055840658407584085840958410584115841258413584145841558416584175841858419584205842158422584235842458425584265842758428584295843058431584325843358434584355843658437584385843958440584415844258443584445844558446584475844858449584505845158452584535845458455584565845758458584595846058461584625846358464584655846658467584685846958470584715847258473584745847558476584775847858479584805848158482584835848458485584865848758488584895849058491584925849358494584955849658497584985849958500585015850258503585045850558506585075850858509585105851158512585135851458515585165851758518585195852058521585225852358524585255852658527585285852958530585315853258533585345853558536585375853858539585405854158542585435854458545585465854758548585495855058551585525855358554585555855658557585585855958560585615856258563585645856558566585675856858569585705857158572585735857458575585765857758578585795858058581585825858358584585855858658587585885858958590585915859258593585945859558596585975859858599586005860158602586035860458605586065860758608586095861058611586125861358614586155861658617586185861958620586215862258623586245862558626586275862858629586305863158632586335863458635586365863758638586395864058641586425864358644586455864658647586485864958650586515865258653586545865558656586575865858659586605866158662586635866458665586665866758668586695867058671586725867358674586755867658677586785867958680586815868258683586845868558686586875868858689586905869158692586935869458695586965869758698586995870058701587025870358704587055870658707587085870958710587115871258713587145871558716587175871858719587205872158722587235872458725587265872758728587295873058731587325873358734587355873658737587385873958740587415874258743587445874558746587475874858749587505875158752587535875458755587565875758758587595876058761587625876358764587655876658767587685876958770587715877258773587745877558776
  1. /* 许钟文修改的 标记 xzw
  2. 另外 所有"matter"字样已被我删除 原因:删除matterport信息
  3. */
  4. let highMapAddColor = 0//true
  5. let momentTourBlackNewType = false
  6. !function() {
  7. "use strict";
  8. function t(t, i) {
  9. return typeof t === i
  10. }
  11. function i(t, i) {
  12. return t instanceof i
  13. }
  14. function n(t) {
  15. return t && t.nodeType
  16. }
  17. function e(t) {
  18. return n(t) ? t : i(t, g) ? t[0] : void 0
  19. }
  20. function o(t, i, n) {
  21. return g.each(t, function(t, e) {
  22. n = i.call(e, n, t, e)
  23. }),
  24. n
  25. }
  26. function r(t, i, n) {
  27. var e, o, r;
  28. if (t === i)
  29. return !0;
  30. if (!t || !i || t.constructor !== i.constructor)
  31. return !1;
  32. for (e = 0,
  33. o = n.length; o > e; e += 1) {
  34. if (r = n[e],
  35. t[r] && y(t[r].equals) && !t[r].equals(i[r]))
  36. return !1;
  37. if (t[r] !== i[r])
  38. return !1
  39. }
  40. return !0
  41. }
  42. function s(t, i, n, e) {
  43. this.left = E(t),
  44. this.top = E(i),
  45. this.width = E(n),
  46. this.height = E(e),
  47. this.right = this.left + this.width,
  48. this.bottom = this.top + this.height
  49. }
  50. function h(t, i, n, e) {
  51. this.visible = t || 0,
  52. this.viewport = i || 0,
  53. this.possible = n || 0,
  54. this.rects = e && T({}, e) || null
  55. }
  56. function l(t, i) {
  57. this.els = t,
  58. this.viewport = i
  59. }
  60. function c(t, i, n) {
  61. var e;
  62. return g.inArray(n, q) >= 0 ? e = s.ofElement(t) : g.inArray(n, S) >= 0 && (e = h.of(t, i)),
  63. e ? e[n] : 0
  64. }
  65. function u(t, i) {
  66. return t.val - i.val
  67. }
  68. function a(t, i) {
  69. return i.val - t.val
  70. }
  71. function f(t) {
  72. var i = s.ofContent(t, !0)
  73. , n = s.ofViewport(t, !0)
  74. , e = i.width - n.width
  75. , o = i.height - n.height;
  76. this.content = i,
  77. this.viewport = n,
  78. this.width = 0 >= e ? null : n.left / e,
  79. this.height = 0 >= o ? null : n.top / o,
  80. this.left = n.left,
  81. this.top = n.top,
  82. this.right = i.right - n.right,
  83. this.bottom = i.bottom - n.bottom
  84. }
  85. function p(t) {
  86. this.el = t || window
  87. }
  88. function d(t, i) {
  89. this.context = t,
  90. this.viewport = i,
  91. this.init()
  92. }
  93. function v(t, i, n, e) {
  94. this.context = new l(t,i),
  95. this.property = n,
  96. this.descending = e,
  97. this.init()
  98. }
  99. function w(t) {
  100. t && t !== window && t !== document ? (this.context = t,
  101. this.$autoTarget = g(t)) : this.context = window,
  102. this.init()
  103. }
  104. var g = jQuery
  105. , m = g(window)
  106. , b = g(document)
  107. , T = g.extend
  108. , y = g.isFunction
  109. , k = Math.max
  110. , V = Math.min
  111. , E = Math.round
  112. , x = function() {
  113. var t = {}
  114. , i = 1;
  115. return function(n) {
  116. return n ? (t[n] || (t[n] = i,
  117. i += 1),
  118. t[n]) : 0
  119. }
  120. }();
  121. T(s.prototype, {
  122. equals: function(t) {
  123. return r(this, t, ["left", "top", "width", "height"])
  124. },
  125. area: function() {
  126. return this.width * this.height
  127. },
  128. relativeTo: function(t) {
  129. return new s(this.left - t.left,this.top - t.top,this.width,this.height)
  130. },
  131. intersection: function(t) {
  132. if (!i(t, s))
  133. return null;
  134. var n = k(this.left, t.left)
  135. , e = V(this.right, t.right)
  136. , o = k(this.top, t.top)
  137. , r = V(this.bottom, t.bottom)
  138. , h = e - n
  139. , l = r - o;
  140. return h >= 0 && l >= 0 ? new s(n,o,h,l) : null
  141. },
  142. envelope: function(t) {
  143. if (!i(t, s))
  144. return this;
  145. var n = V(this.left, t.left)
  146. , e = k(this.right, t.right)
  147. , o = V(this.top, t.top)
  148. , r = k(this.bottom, t.bottom)
  149. , h = e - n
  150. , l = r - o;
  151. return new s(n,o,h,l)
  152. }
  153. }),
  154. T(s, {
  155. ofContent: function(t, i) {
  156. 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())
  157. },
  158. ofViewport: function(t, i) {
  159. 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())
  160. },
  161. ofElement: function(t) {
  162. var i = g(t);
  163. if (!i.is(":visible"))
  164. return null;
  165. var n = i.offset();
  166. return new s(n.left,n.top,i.outerWidth(),i.outerHeight())
  167. }
  168. }),
  169. T(h.prototype, {
  170. equals: function(t) {
  171. return this.fracsEqual(t) && this.rectsEqual(t)
  172. },
  173. fracsEqual: function(t) {
  174. return r(this, t, ["visible", "viewport", "possible"])
  175. },
  176. rectsEqual: function(t) {
  177. return r(this.rects, t.rects, ["document", "element", "viewport"])
  178. }
  179. }),
  180. T(h, {
  181. of: function(t, i) {
  182. var e, o, r;
  183. return t = n(t) && s.ofElement(t) || t,
  184. i = n(i) && s.ofViewport(i) || i || s.ofViewport(),
  185. t instanceof s && (e = t.intersection(i)) ? (o = e.area(),
  186. r = V(t.width, i.width) * V(t.height, i.height),
  187. new h(o / t.area(),o / i.area(),o / r,{
  188. document: e,
  189. element: e.relativeTo(t),
  190. viewport: e.relativeTo(i)
  191. })) : new h
  192. }
  193. });
  194. var q = ["width", "height", "left", "right", "top", "bottom"]
  195. , S = ["possible", "visible", "viewport"];
  196. T(l.prototype, {
  197. sorted: function(t, i) {
  198. var n = this.viewport;
  199. return g.map(this.els, function(i) {
  200. return {
  201. el: i,
  202. val: c(i, n, t)
  203. }
  204. }).sort(i ? a : u)
  205. },
  206. best: function(t, i) {
  207. return this.els.length ? this.sorted(t, i)[0] : null
  208. }
  209. }),
  210. T(f.prototype, {
  211. equals: function(t) {
  212. return r(this, t, ["width", "height", "left", "top", "right", "bottom", "content", "viewport"])
  213. }
  214. }),
  215. T(p.prototype, {
  216. equals: function(t) {
  217. return r(this, t, ["el"])
  218. },
  219. scrollState: function() {
  220. return new f(this.el)
  221. },
  222. scrollTo: function(t, i, n) {
  223. var e = g(this.el === window ? "html,body" : this.el);
  224. t = t || 0,
  225. i = i || 0,
  226. n = isNaN(n) ? 1e3 : n,
  227. e.stop(!0).animate({
  228. scrollLeft: t,
  229. scrollTop: i
  230. }, n)
  231. },
  232. scroll: function(t, i, n) {
  233. var e = this.el === window ? m : g(this.el);
  234. t = t || 0,
  235. i = i || 0,
  236. this.scrollTo(e.scrollLeft() + t, e.scrollTop() + i, n)
  237. },
  238. scrollToRect: function(t, i, n, e) {
  239. i = i || 0,
  240. n = n || 0,
  241. this.scrollTo(t.left - i, t.top - n, e)
  242. },
  243. scrollToElement: function(t, i, n, e) {
  244. var o = s.ofElement(t).relativeTo(s.ofContent(this.el));
  245. this.scrollToRect(o, i, n, e)
  246. }
  247. });
  248. var C = {
  249. init: function() {
  250. this.callbacks = g.Callbacks("memory unique"),
  251. this.currVal = null,
  252. this.prevVal = null,
  253. this.checkProxy = g.proxy(this.check, this),
  254. this.autoCheck()
  255. },
  256. bind: function(t) {
  257. this.callbacks.add(t)
  258. },
  259. unbind: function(t) {
  260. t ? this.callbacks.remove(t) : this.callbacks.empty()
  261. },
  262. trigger: function() {
  263. this.callbacks.fireWith(this.context, [this.currVal, this.prevVal])
  264. },
  265. check: function(t) {
  266. var i = this.updatedValue(t);
  267. return void 0 !== i && (this.prevVal = this.currVal,
  268. this.currVal = i,
  269. this.trigger(),
  270. !0)
  271. },
  272. $autoTarget: m,
  273. autoEvents: "load resize scroll",
  274. autoCheck: function(t) {
  275. this.$autoTarget[t === !1 ? "off" : "on"](this.autoEvents, this.checkProxy)
  276. }
  277. };
  278. T(d.prototype, C, {
  279. updatedValue: function() {
  280. var t = h.of(this.context, this.viewport);
  281. return this.currVal && this.currVal.equals(t) ? void 0 : t
  282. }
  283. }),
  284. T(v.prototype, C, {
  285. updatedValue: function() {
  286. var t = this.context.best(this.property, this.descending);
  287. return t && (t = t.val > 0 ? t.el : null,
  288. this.currVal !== t) ? t : void 0
  289. }
  290. }),
  291. T(w.prototype, C, {
  292. updatedValue: function() {
  293. var t = new f(this.context);
  294. return this.currVal && this.currVal.equals(t) ? void 0 : t
  295. }
  296. });
  297. var L = function(t, i) {
  298. var n = [].slice
  299. , e = jQuery
  300. , o = e.extend
  301. , r = e.isFunction
  302. , s = o({}, i)
  303. , h = function(i, n, o, s) {
  304. return o = r(o) ? o.apply(i, n) : o,
  305. r(s[o]) ? s[o].apply(i, n) : void e.error('Method "' + o + '" does not exist on jQuery.' + t)
  306. }
  307. , l = function() {
  308. return h(this, n.call(arguments), s.defaultStatic, l)
  309. }
  310. , c = function(t) {
  311. return r(c[t]) ? c[t].apply(this, n.call(arguments, 1)) : h(this, n.call(arguments), s.defaultMethod, c)
  312. }
  313. , u = function(t) {
  314. t && (o(l, t.statics),
  315. o(c, t.methods)),
  316. l.modplug = u
  317. };
  318. u.prev = {
  319. statics: e[t],
  320. methods: e.fn[t]
  321. },
  322. u(i),
  323. e[t] = l,
  324. e.fn[t] = c
  325. }
  326. , M = "fracs";
  327. L(M, {
  328. statics: {
  329. version: "0.15.0",
  330. Rect: s,
  331. Fractions: h,
  332. Group: l,
  333. ScrollState: f,
  334. Viewport: p,
  335. FracsCallbacks: d,
  336. GroupCallbacks: v,
  337. ScrollStateCallbacks: w,
  338. fracs: function(t, i) {
  339. return h.of(t, i)
  340. }
  341. },
  342. methods: {
  343. content: function(t) {
  344. return this.length ? s.ofContent(this[0], t) : null
  345. },
  346. envelope: function() {
  347. return o(this, function(t) {
  348. var i = s.ofElement(this);
  349. return t ? t.envelope(i) : i
  350. })
  351. },
  352. fracs: function(i, n, o) {
  353. t(i, "string") || (o = n,
  354. n = i,
  355. i = null),
  356. y(n) || (o = n,
  357. n = null),
  358. o = e(o);
  359. var r = M + ".fracs." + x(o);
  360. return "unbind" === i ? this.each(function() {
  361. var t = g(this).data(r);
  362. t && t.unbind(n)
  363. }) : "check" === i ? this.each(function() {
  364. var t = g(this).data(r);
  365. t && t.check()
  366. }) : y(n) ? this.each(function() {
  367. var t = g(this)
  368. , i = t.data(r);
  369. i || (i = new d(this,o),
  370. t.data(r, i)),
  371. i.bind(n)
  372. }) : this.length ? h.of(this[0], o) : null
  373. },
  374. intersection: function() {
  375. return o(this, function(t) {
  376. var i = s.ofElement(this);
  377. return t ? t.intersection(i) : i
  378. })
  379. },
  380. max: function(t, i, n) {
  381. return y(i) || (n = i,
  382. i = null),
  383. n = e(n),
  384. i ? (new v(this,n,t,!0).bind(i),
  385. this) : this.pushStack(new l(this,n).best(t, !0).el)
  386. },
  387. min: function(t, i, n) {
  388. return y(i) || (n = i,
  389. i = null),
  390. n = e(n),
  391. i ? (new v(this,n,t).bind(i),
  392. this) : this.pushStack(new l(this,n).best(t).el)
  393. },
  394. rect: function() {
  395. return this.length ? s.ofElement(this[0]) : null
  396. },
  397. scrollState: function(i, n) {
  398. var e = M + ".scrollState";
  399. return t(i, "string") || (n = i,
  400. i = null),
  401. "unbind" === i ? this.each(function() {
  402. var t = g(this).data(e);
  403. t && t.unbind(n)
  404. }) : "check" === i ? this.each(function() {
  405. var t = g(this).data(e);
  406. t && t.check()
  407. }) : y(n) ? this.each(function() {
  408. var t = g(this)
  409. , i = t.data(e);
  410. i || (i = new w(this),
  411. t.data(e, i)),
  412. i.bind(n)
  413. }) : this.length ? new f(this[0]) : null
  414. },
  415. scroll: function(t, i, n) {
  416. return this.each(function() {
  417. new p(this).scroll(t, i, n)
  418. })
  419. },
  420. scrollTo: function(t, i, n, o) {
  421. return g.isNumeric(t) && (o = n,
  422. n = i,
  423. i = t,
  424. t = null),
  425. t = e(t),
  426. this.each(function() {
  427. t ? new p(this).scrollToElement(t, i, n, o) : new p(this).scrollTo(i, n, o)
  428. })
  429. },
  430. scrollToThis: function(t, i, n, o) {
  431. return o = new p(e(o)),
  432. o.scrollToElement(this[0], t, i, n),
  433. this
  434. },
  435. softLink: function(t, i, n, o) {
  436. return o = new p(e(o)),
  437. this.filter("a[href^=#]").each(function() {
  438. var e = g(this);
  439. e.on("click", function() {
  440. o.scrollToElement(g(e.attr("href"))[0], t, i, n)
  441. })
  442. })
  443. },
  444. sort: function(i, n, o) {
  445. return t(n, "boolean") || (o = n,
  446. n = null),
  447. o = e(o),
  448. this.pushStack(g.map(new l(this,o).sorted(i, !n), function(t) {
  449. return t.el
  450. }))
  451. },
  452. viewport: function(t) {
  453. return this.length ? s.ofViewport(this[0], t) : null
  454. }
  455. },
  456. defaultStatic: "fracs",
  457. defaultMethod: "fracs"
  458. })
  459. }();
  460. if ("undefined" == typeof jQuery)
  461. throw new Error("Bootstrap's JavaScript requires jQuery");
  462. +function(t) {
  463. "use strict";
  464. function e(e) {
  465. return this.each(function() {
  466. var o = t(this)
  467. , s = o.data("bs.tooltip")
  468. , n = "object" == typeof e && e;
  469. (s || "destroy" != e) && (s || o.data("bs.tooltip", s = new i(this,n)),
  470. "string" == typeof e && s[e]())
  471. })
  472. }
  473. var i = function(t, e) {
  474. this.type = this.options = this.enabled = this.timeout = this.hoverState = this.$element = null,
  475. this.init("tooltip", t, e)
  476. };
  477. i.VERSION = "3.2.0",
  478. i.DEFAULTS = {
  479. animation: !0,
  480. placement: "top",
  481. selector: !1,
  482. template: '<div class="tooltip" role="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>',
  483. trigger: "hover focus",
  484. title: "",
  485. delay: 0,
  486. html: !1,
  487. container: !1,
  488. viewport: {
  489. selector: "body",
  490. padding: 0
  491. }
  492. },
  493. i.prototype.init = function(e, i, o) {
  494. this.enabled = !0,
  495. this.type = e,
  496. this.$element = t(i),
  497. this.options = this.getOptions(o),
  498. this.$viewport = this.options.viewport && t(this.options.viewport.selector || this.options.viewport);
  499. for (var s = this.options.trigger.split(" "), n = s.length; n--; ) {
  500. var r = s[n];
  501. if ("click" == r)
  502. this.$element.on("click." + this.type, this.options.selector, t.proxy(this.toggle, this));
  503. else if ("manual" != r) {
  504. var a = "hover" == r ? "mouseenter" : "focusin"
  505. , l = "hover" == r ? "mouseleave" : "focusout";
  506. this.$element.on(a + "." + this.type, this.options.selector, t.proxy(this.enter, this)),
  507. this.$element.on(l + "." + this.type, this.options.selector, t.proxy(this.leave, this))
  508. }
  509. }
  510. this.options.selector ? this._options = t.extend({}, this.options, {
  511. trigger: "manual",
  512. selector: ""
  513. }) : this.fixTitle()
  514. }
  515. ,
  516. i.prototype.getDefaults = function() {
  517. return i.DEFAULTS
  518. }
  519. ,
  520. i.prototype.getOptions = function(e) {
  521. return e = t.extend({}, this.getDefaults(), this.$element.data(), e),
  522. e.delay && "number" == typeof e.delay && (e.delay = {
  523. show: e.delay,
  524. hide: e.delay
  525. }),
  526. e
  527. }
  528. ,
  529. i.prototype.getDelegateOptions = function() {
  530. var e = {}
  531. , i = this.getDefaults();
  532. return this._options && t.each(this._options, function(t, o) {
  533. i[t] != o && (e[t] = o)
  534. }),
  535. e
  536. }
  537. ,
  538. i.prototype.enter = function(e) {
  539. var i = e instanceof this.constructor ? e : t(e.currentTarget).data("bs." + this.type);
  540. return i || (i = new this.constructor(e.currentTarget,this.getDelegateOptions()),
  541. t(e.currentTarget).data("bs." + this.type, i)),
  542. clearTimeout(i.timeout),
  543. i.hoverState = "in",
  544. i.options.delay && i.options.delay.show ? void (i.timeout = setTimeout(function() {
  545. // "in" == i.hoverState && i.show()
  546. }, i.options.delay.show)) : i.show()
  547. }
  548. ,
  549. i.prototype.leave = function(e) {
  550. var i = e instanceof this.constructor ? e : t(e.currentTarget).data("bs." + this.type);
  551. return i || (i = new this.constructor(e.currentTarget,this.getDelegateOptions()),
  552. t(e.currentTarget).data("bs." + this.type, i)),
  553. clearTimeout(i.timeout),
  554. i.hoverState = "out",
  555. i.options.delay && i.options.delay.hide ? void (i.timeout = setTimeout(function() {
  556. "out" == i.hoverState && i.hide()
  557. }, i.options.delay.hide)) : i.hide()
  558. }
  559. ,
  560. i.prototype.show = function() {
  561. var e = t.Event("show.bs." + this.type);
  562. if (this.hasContent() && this.enabled) {
  563. this.$element.trigger(e);
  564. var i = t.contains(document.documentElement, this.$element[0]);
  565. if (e.isDefaultPrevented() || !i)
  566. return;
  567. var o = this
  568. , s = this.tip()
  569. , n = this.getUID(this.type);
  570. this.setContent(),
  571. s.attr("id", n),
  572. this.$element.attr("aria-describedby", n),
  573. this.options.animation && s.addClass("fade");
  574. var r = "function" == typeof this.options.placement ? this.options.placement.call(this, s[0], this.$element[0]) : this.options.placement
  575. , a = /\s?auto?\s?/i
  576. , l = a.test(r);
  577. l && (r = r.replace(a, "") || "top"),
  578. s.detach().css({
  579. top: 0,
  580. left: 0,
  581. display: "block"
  582. }).addClass(r).data("bs." + this.type, this),
  583. this.options.container ? s.appendTo(this.options.container) : s.insertAfter(this.$element);
  584. var p = this.getPosition()
  585. , h = s[0].offsetWidth
  586. , f = s[0].offsetHeight;
  587. if (l) {
  588. var u = r
  589. , c = this.$element.parent()
  590. , d = this.getPosition(c);
  591. 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,
  592. s.removeClass(u).addClass(r)
  593. }
  594. var g = this.getCalculatedOffset(r, p, h, f);
  595. this.applyPlacement(g, r);
  596. var y = function() {
  597. o.$element.trigger("shown.bs." + o.type),
  598. o.hoverState = null
  599. };
  600. t.support.transition && this.$tip.hasClass("fade") ? s.one("bsTransitionEnd", y).emulateTransitionEnd(150) : y()
  601. }
  602. }
  603. ,
  604. i.prototype.applyPlacement = function(e, i) {
  605. var o = this.tip()
  606. , s = o[0].offsetWidth
  607. , n = o[0].offsetHeight
  608. , r = parseInt(o.css("margin-top"), 10)
  609. , a = parseInt(o.css("margin-left"), 10);
  610. isNaN(r) && (r = 0),
  611. isNaN(a) && (a = 0),
  612. e.top = e.top + r,
  613. e.left = e.left + a,
  614. t.offset.setOffset(o[0], t.extend({
  615. using: function(t) {
  616. o.css({
  617. top: Math.round(t.top),
  618. left: Math.round(t.left)
  619. })
  620. }
  621. }, e), 0),
  622. o.addClass("in");
  623. var l = o[0].offsetWidth
  624. , p = o[0].offsetHeight;
  625. "top" == i && p != n && (e.top = e.top + n - p);
  626. var h = this.getViewportAdjustedDelta(i, e, l, p);
  627. h.left ? e.left += h.left : e.top += h.top;
  628. var f = h.left ? 2 * h.left - s + l : 2 * h.top - n + p
  629. , u = h.left ? "left" : "top"
  630. , c = h.left ? "offsetWidth" : "offsetHeight";
  631. o.offset(e),
  632. this.replaceArrow(f, o[0][c], u)
  633. }
  634. ,
  635. i.prototype.replaceArrow = function(t, e, i) {
  636. this.arrow().css(i, t ? 50 * (1 - t / e) + "%" : "")
  637. }
  638. ,
  639. i.prototype.setContent = function() {
  640. var t = this.tip()
  641. , e = this.getTitle();
  642. t.find(".tooltip-inner")[this.options.html ? "html" : "text"](e),
  643. t.removeClass("fade in top bottom left right")
  644. }
  645. ,
  646. i.prototype.hide = function() {
  647. function e() {
  648. "in" != i.hoverState && o.detach(),
  649. i.$element.trigger("hidden.bs." + i.type)
  650. }
  651. var i = this
  652. , o = this.tip()
  653. , s = t.Event("hide.bs." + this.type);
  654. if (this.$element.removeAttr("aria-describedby"),
  655. this.$element.trigger(s),
  656. !s.isDefaultPrevented())
  657. return o.removeClass("in"),
  658. t.support.transition && this.$tip.hasClass("fade") ? o.one("bsTransitionEnd", e).emulateTransitionEnd(150) : e(),
  659. this.hoverState = null,
  660. this
  661. }
  662. ,
  663. i.prototype.fixTitle = function() {
  664. var t = this.$element;
  665. (t.attr("title") || "string" != typeof t.attr("data-original-title")) && t.attr("data-original-title", t.attr("title") || "").attr("title", "")
  666. }
  667. ,
  668. i.prototype.hasContent = function() {
  669. return this.getTitle()
  670. }
  671. ,
  672. i.prototype.getPosition = function(e) {
  673. e = e || this.$element;
  674. var i = e[0]
  675. , o = "BODY" == i.tagName;
  676. return t.extend({}, "function" == typeof i.getBoundingClientRect ? i.getBoundingClientRect() : null, {
  677. scroll: o ? document.documentElement.scrollTop || document.body.scrollTop : e.scrollTop(),
  678. width: o ? t(window).width() : e.outerWidth(),
  679. height: o ? t(window).height() : e.outerHeight()
  680. }, o ? {
  681. top: 0,
  682. left: 0
  683. } : e.offset())
  684. }
  685. ,
  686. i.prototype.getCalculatedOffset = function(t, e, i, o) {
  687. return "bottom" == t ? {
  688. top: e.top + e.height,
  689. left: e.left + e.width / 2 - i / 2
  690. } : "top" == t ? {
  691. top: e.top - o,
  692. left: e.left + e.width / 2 - i / 2
  693. } : "left" == t ? {
  694. top: e.top + e.height / 2 - o / 2,
  695. left: e.left - i
  696. } : {
  697. top: e.top + e.height / 2 - o / 2,
  698. left: e.left + e.width
  699. }
  700. }
  701. ,
  702. i.prototype.getViewportAdjustedDelta = function(t, e, i, o) {
  703. var s = {
  704. top: 0,
  705. left: 0
  706. };
  707. if (!this.$viewport)
  708. return s;
  709. var n = this.options.viewport && this.options.viewport.padding || 0
  710. , r = this.getPosition(this.$viewport);
  711. if (/right|left/.test(t)) {
  712. var a = e.top - n - r.scroll
  713. , l = e.top + n - r.scroll + o;
  714. a < r.top ? s.top = r.top - a : l > r.top + r.height && (s.top = r.top + r.height - l)
  715. } else {
  716. var p = e.left - n
  717. , h = e.left + n + i;
  718. p < r.left ? s.left = r.left - p : h > r.width && (s.left = r.left + r.width - h)
  719. }
  720. return s
  721. }
  722. ,
  723. i.prototype.getTitle = function() {
  724. var t, e = this.$element, i = this.options;
  725. return t = e.attr("data-original-title") || ("function" == typeof i.title ? i.title.call(e[0]) : i.title)
  726. }
  727. ,
  728. i.prototype.getUID = function(t) {
  729. do
  730. t += ~~(1e6 * Math.random());
  731. while (document.getElementById(t));return t
  732. }
  733. ,
  734. i.prototype.tip = function() {
  735. return this.$tip = this.$tip || t(this.options.template)
  736. }
  737. ,
  738. i.prototype.arrow = function() {
  739. return this.$arrow = this.$arrow || this.tip().find(".tooltip-arrow")
  740. }
  741. ,
  742. i.prototype.validate = function() {
  743. this.$element[0].parentNode || (this.hide(),
  744. this.$element = null,
  745. this.options = null)
  746. }
  747. ,
  748. i.prototype.enable = function() {
  749. this.enabled = !0
  750. }
  751. ,
  752. i.prototype.disable = function() {
  753. this.enabled = !1
  754. }
  755. ,
  756. i.prototype.toggleEnabled = function() {
  757. this.enabled = !this.enabled
  758. }
  759. ,
  760. i.prototype.toggle = function(e) {
  761. var i = this;
  762. e && (i = t(e.currentTarget).data("bs." + this.type),
  763. i || (i = new this.constructor(e.currentTarget,this.getDelegateOptions()),
  764. t(e.currentTarget).data("bs." + this.type, i))),
  765. i.tip().hasClass("in") ? i.leave(i) : i.enter(i)
  766. }
  767. ,
  768. i.prototype.destroy = function() {
  769. clearTimeout(this.timeout),
  770. this.hide().$element.off("." + this.type).removeData("bs." + this.type)
  771. }
  772. ;
  773. var o = t.fn.tooltip;
  774. t.fn.tooltip = e,
  775. t.fn.tooltip.Constructor = i,
  776. t.fn.tooltip.noConflict = function() {
  777. return t.fn.tooltip = o,
  778. this
  779. }
  780. }(jQuery);
  781. !function(e, t, n) {
  782. "undefined" != typeof module && module.exports ? module.exports = n() : "function" == typeof define && define.amd ? define(n) : t[e] = n()
  783. }("Keen", this, function() {
  784. "use strict";
  785. function Keen() {
  786. return _init.apply(this, arguments)
  787. }
  788. function _init(e) {
  789. if (_isUndefined(e))
  790. throw new Error("Check out our JavaScript SDK Usage Guide: https://keen.io/docs/clients/javascript/usage-guide/");
  791. if (_isUndefined(e.projectId) || "String" !== _type(e.projectId) || e.projectId.length < 1)
  792. throw new Error("Please provide a projectId");
  793. this.configure(e)
  794. }
  795. function _extend(e) {
  796. for (var t = 1; t < arguments.length; t++)
  797. for (var n in arguments[t])
  798. e[n] = arguments[t][n];
  799. return e
  800. }
  801. function _isUndefined(e) {
  802. return void 0 === e
  803. }
  804. function _type(e) {
  805. var t = e && e.constructor ? e.constructor.toString() : void 0;
  806. return t ? t.match(/function (.*)\(/)[1] : "Null"
  807. }
  808. function _each(e, t, n) {
  809. var r;
  810. if (!e)
  811. return 0;
  812. if (n = n ? n : e,
  813. "array" === _type(e)) {
  814. for (r = 0; r < e.length; r++)
  815. if (t.call(n, e[r], r, e) === !1)
  816. return 0
  817. } else
  818. for (r in e)
  819. if (e.hasOwnProperty(r) && t.call(n, e[r], r, e) === !1)
  820. return 0;
  821. return 1
  822. }
  823. function _parse_params(e) {
  824. for (var t, n = {}, r = /\+/g, i = /([^&=]+)=?([^&]*)/g, o = function(e) {
  825. return decodeURIComponent(e.replace(r, " "))
  826. }, a = e.split("?")[1]; t = i.exec(a); )
  827. n[o(t[1])] = o(t[2]);
  828. return n
  829. }
  830. function _set_protocol(e) {
  831. switch (e) {
  832. case "http":
  833. return "http";
  834. case "auto":
  835. return location.protocol.replace(/:/g, "");
  836. case "https":
  837. case void 0:
  838. default:
  839. return "https"
  840. }
  841. }
  842. function _set_request_type(e) {
  843. var t = e || "jsonp"
  844. , n = !1;
  845. return ("Object" === _type(XMLHttpRequest) || "Function" === _type(XMLHttpRequest)) && "withCredentials"in new XMLHttpRequest && (n = !0),
  846. null == t || "xhr" == t ? n ? "xhr" : "jsonp" : t
  847. }
  848. function _build_url(e) {
  849. return this.client.endpoint + "/projects/" + this.client.projectId + e
  850. }
  851. function _uploadEvent(e, t, n, r, i) {
  852. var o = _build_url.apply(this, ["/events/" + e])
  853. , a = {};
  854. n = n !== !1,
  855. this.client.globalProperties && (a = this.client.globalProperties(e));
  856. for (var c in t)
  857. t.hasOwnProperty(c) && (a[c] = t[c]);
  858. switch (this.client.requestType) {
  859. case "xhr":
  860. _request.xhr.apply(this, ["POST", o, null, a, this.client.writeKey, n, r, i]);
  861. break;
  862. case "jsonp":
  863. var s = JSON.stringify(a)
  864. , l = Keen.Base64.encode(s);
  865. o = o + "?api_key=" + this.client.writeKey,
  866. o = o + "&data=" + l,
  867. o = o + "&modified=" + (new Date).getTime(),
  868. _request.jsonp.apply(this, [o, this.client.writeKey, r, i]);
  869. break;
  870. case "beacon":
  871. var s = JSON.stringify(a)
  872. , l = Keen.Base64.encode(s);
  873. o = o + "?api_key=" + encodeURIComponent(this.client.writeKey),
  874. o = o + "&data=" + encodeURIComponent(l),
  875. o = o + "&modified=" + encodeURIComponent((new Date).getTime()),
  876. o += "&c=clv1",
  877. _request.beacon.apply(this, [o, null, r, i])
  878. }
  879. }
  880. Keen.prototype.configure = function(e) {
  881. return e.host = _isUndefined(e.host) ? "api.keen.io/3.0" : e.host.replace(/.*?:\/\//g, ""),
  882. e.protocol = _set_protocol(e.protocol),
  883. e.requestType = _set_request_type(e.requestType),
  884. this.client = {
  885. projectId: e.projectId,
  886. writeKey: e.writeKey,
  887. readKey: e.readKey,
  888. globalProperties: null,
  889. endpoint: e.protocol + "://" + e.host,
  890. requestType: e.requestType
  891. },
  892. Keen.trigger("client", this, e),
  893. this.trigger("ready"),
  894. this
  895. }
  896. ;
  897. var _request = {
  898. xhr: function(e, t, n, r, i, o, a, c) {
  899. if (!i)
  900. return Keen.log("Please provide a writeKey for https://keen.io/project/" + this.client.projectId);
  901. var s = new XMLHttpRequest;
  902. if (s.onreadystatechange = function() {
  903. if (4 == s.readyState)
  904. if (s.status >= 200 && s.status < 300) {
  905. var e;
  906. try {
  907. e = JSON.parse(s.responseText)
  908. } catch (e) {
  909. Keen.log("Could not JSON parse HTTP response: " + s.responseText),
  910. c && c(s, e)
  911. }
  912. a && e && a(e)
  913. } else
  914. Keen.log("HTTP request failed."),
  915. c && c(s, null)
  916. }
  917. ,
  918. s.open(e, t, o),
  919. i && s.setRequestHeader("Authorization", i),
  920. r && s.setRequestHeader("Content-Type", "application/json"),
  921. n)
  922. for (var l in n)
  923. n.hasOwnProperty(l) && s.setRequestHeader(l, n[l]);
  924. var u = r ? JSON.stringify(r) : null;
  925. s.send(u)
  926. },
  927. jsonp: function(e, t, n, r) {
  928. if (!t)
  929. return Keen.log("Please provide a writeKey for https://keen.io/project/" + this.client.projectId);
  930. if (t && e.indexOf("api_key") < 0) {
  931. var i = e.indexOf("?") > 0 ? "&" : "?";
  932. e = e + i + "api_key=" + t
  933. }
  934. for (var o = "keenJSONPCallback" + (new Date).getTime(); o in window; )
  935. o += "a";
  936. var a = !1;
  937. window[o] = function(e) {
  938. a = !0,
  939. n && e && n(e),
  940. window[o] = void 0
  941. }
  942. ,
  943. e = e + "&jsonp=" + o;
  944. var c = document.createElement("script");
  945. c.id = "keen-jsonp",
  946. c.src = e,
  947. document.getElementsByTagName("head")[0].appendChild(c),
  948. c.onreadystatechange = function() {
  949. a === !1 && "loaded" === this.readyState && (a = !0,
  950. r && r())
  951. }
  952. ,
  953. c.onerror = function() {
  954. a === !1 && (a = !0,
  955. r && r())
  956. }
  957. },
  958. beacon: function(e, t, n, r) {
  959. if (t && e.indexOf("api_key") < 0) {
  960. var i = e.indexOf("?") > 0 ? "&" : "?";
  961. e = e + i + "api_key=" + t
  962. }
  963. var o = !1
  964. , a = document.createElement("img");
  965. a.onload = function() {
  966. if (o = !0,
  967. "naturalHeight"in this) {
  968. if (this.naturalHeight + this.naturalWidth === 0)
  969. return void this.onerror()
  970. } else if (this.width + this.height === 0)
  971. return void this.onerror();
  972. n && n({
  973. created: !0
  974. })
  975. }
  976. ,
  977. a.onerror = function() {
  978. o = !0,
  979. r && r()
  980. }
  981. ,
  982. a.src = e
  983. }
  984. }
  985. , Events = Keen.Events = {
  986. on: function(e, t) {
  987. this.listeners || (this.listeners = {});
  988. var n = this.listeners[e] || (this.listeners[e] = []);
  989. return n.push({
  990. callback: t
  991. }),
  992. this
  993. },
  994. off: function(e, t) {
  995. if (!e && !t)
  996. return this.listeners = void 0,
  997. delete this.listeners,
  998. this;
  999. for (var n = this.listeners[e] || [], r = n.length; r--; )
  1000. t && t == n[r].callback && this.listeners[e].splice(r, 1),
  1001. t && 0 != n.length || (this.listeners[e] = void 0,
  1002. delete this.listeners[e]);
  1003. return this
  1004. },
  1005. trigger: function(e) {
  1006. if (!this.listeners)
  1007. return this;
  1008. for (var t = Array.prototype.slice.call(arguments, 1), n = this.listeners[e] || [], r = 0; r < n.length; r++)
  1009. n[r].callback.apply(this, t);
  1010. return this
  1011. }
  1012. };
  1013. _extend(Keen.prototype, Events),
  1014. _extend(Keen, Events),
  1015. Keen.loaded = !0,
  1016. Keen.utils = {
  1017. each: _each,
  1018. extend: _extend,
  1019. parseParams: _parse_params
  1020. },
  1021. Keen.ready = function(e) {
  1022. Keen.loaded ? e() : Keen.on("ready", e)
  1023. }
  1024. ,
  1025. Keen.log = function(e) {
  1026. "object" == typeof console && console.log("[Keen IO]", e)
  1027. }
  1028. ;
  1029. var Plugins = Keen.Plugins = {};
  1030. Keen.prototype.addEvent = function() {
  1031. _uploadEvent.apply(this, arguments)
  1032. }
  1033. ,
  1034. Keen.prototype.addEventSync = function(e, t, n, r) {
  1035. _uploadEvent.apply(this, [e, t, !1, n, r])
  1036. }
  1037. ,
  1038. Keen.prototype.trackExternalLink = function(e, t, n, r, i) {
  1039. var o = e
  1040. , a = o.metaKey
  1041. , c = o.target
  1042. , s = !1
  1043. , l = function() {};
  1044. return void 0 === r && (r = 500),
  1045. "A" === c.nodeName ? l = function() {
  1046. a || s || (s = !0,
  1047. window.location = c.href)
  1048. }
  1049. : "FORM" === c.nodeName && (l = function() {
  1050. s || (s = !0,
  1051. c.submit())
  1052. }
  1053. ),
  1054. i && (l = function() {
  1055. s || (s = !0,
  1056. i())
  1057. }
  1058. ),
  1059. _uploadEvent.call(this, t, n, l, l),
  1060. setTimeout(function() {
  1061. l()
  1062. }, r),
  1063. !!a && void 0
  1064. }
  1065. ,
  1066. Keen.prototype.setGlobalProperties = function(e) {
  1067. if (!this.client)
  1068. return Keen.log("Check out our JavaScript SDK Usage Guide: https://keen.io/docs/clients/javascript/usage-guide/");
  1069. if (!e || "function" != typeof e)
  1070. throw new Error("Invalid value for global properties: " + e);
  1071. this.client.globalProperties = e
  1072. }
  1073. ,
  1074. Keen.Base64 = {
  1075. map: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",
  1076. encode: function(e) {
  1077. var t, n, r, i, o, a, c, s = "", l = 0, u = this.map;
  1078. for (e = this.utf8.encode(e); l < e.length; )
  1079. t = e.charCodeAt(l++),
  1080. n = e.charCodeAt(l++),
  1081. r = e.charCodeAt(l++),
  1082. i = t >> 2,
  1083. o = (3 & t) << 4 | n >> 4,
  1084. a = isNaN(n) ? 64 : (15 & n) << 2 | r >> 6,
  1085. c = isNaN(n) || isNaN(r) ? 64 : 63 & r,
  1086. s = s + u.charAt(i) + u.charAt(o) + u.charAt(a) + u.charAt(c);
  1087. return s
  1088. },
  1089. decode: function(e) {
  1090. var t, n, r, i, o, a, c, s = "", l = 0, u = this.map, f = String.fromCharCode;
  1091. for (e = e.replace(/[^A-Za-z0-9\+\/\=]/g, ""); l < e.length; )
  1092. t = u.indexOf(e.charAt(l++)),
  1093. n = u.indexOf(e.charAt(l++)),
  1094. r = u.indexOf(e.charAt(l++)),
  1095. i = u.indexOf(e.charAt(l++)),
  1096. o = t << 2 | n >> 4,
  1097. a = (15 & n) << 4 | r >> 2,
  1098. c = (3 & r) << 6 | i,
  1099. s = s + (f(o) + (64 != r ? f(a) : "")) + (64 != i ? f(c) : "");
  1100. return this.utf8.decode(s)
  1101. },
  1102. utf8: {
  1103. encode: function(e) {
  1104. for (var t, n = "", r = 0, i = String.fromCharCode; r < e.length; )
  1105. t = e.charCodeAt(r++),
  1106. 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);
  1107. return n
  1108. },
  1109. decode: function(e) {
  1110. for (var t, n, r = "", i = 0, o = String.fromCharCode; i < e.length; )
  1111. n = e.charCodeAt(i),
  1112. 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];
  1113. return r
  1114. }
  1115. }
  1116. },
  1117. "object" != typeof JSON && (JSON = {}),
  1118. function() {
  1119. function f(e) {
  1120. return 10 > e ? "0" + e : e
  1121. }
  1122. function quote(e) {
  1123. return escapable.lastIndex = 0,
  1124. escapable.test(e) ? '"' + e.replace(escapable, function(e) {
  1125. var t = meta[e];
  1126. return "string" == typeof t ? t : "\\u" + ("0000" + e.charCodeAt(0).toString(16)).slice(-4)
  1127. }) + '"' : '"' + e + '"'
  1128. }
  1129. function str(e, t) {
  1130. var n, r, i, o, a, c = gap, s = t[e];
  1131. switch (s && "object" == typeof s && "function" == typeof s.toJSON && (s = s.toJSON(e)),
  1132. "function" == typeof rep && (s = rep.call(t, e, s)),
  1133. typeof s) {
  1134. case "string":
  1135. return quote(s);
  1136. case "number":
  1137. return isFinite(s) ? String(s) : "null";
  1138. case "boolean":
  1139. case "null":
  1140. return String(s);
  1141. case "object":
  1142. if (!s)
  1143. return "null";
  1144. if (gap += indent,
  1145. a = [],
  1146. "[object Array]" === Object.prototype.toString.apply(s)) {
  1147. for (o = s.length,
  1148. n = 0; o > n; n += 1)
  1149. a[n] = str(n, s) || "null";
  1150. return i = 0 === a.length ? "[]" : gap ? "[\n" + gap + a.join(",\n" + gap) + "\n" + c + "]" : "[" + a.join(",") + "]",
  1151. gap = c,
  1152. i
  1153. }
  1154. if (rep && "object" == typeof rep)
  1155. for (o = rep.length,
  1156. n = 0; o > n; n += 1)
  1157. "string" == typeof rep[n] && (r = rep[n],
  1158. i = str(r, s),
  1159. i && a.push(quote(r) + (gap ? ": " : ":") + i));
  1160. else
  1161. for (r in s)
  1162. Object.prototype.hasOwnProperty.call(s, r) && (i = str(r, s),
  1163. i && a.push(quote(r) + (gap ? ": " : ":") + i));
  1164. return i = 0 === a.length ? "{}" : gap ? "{\n" + gap + a.join(",\n" + gap) + "\n" + c + "}" : "{" + a.join(",") + "}",
  1165. gap = c,
  1166. i
  1167. }
  1168. }
  1169. "function" != typeof Date.prototype.toJSON && (Date.prototype.toJSON = function() {
  1170. 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
  1171. }
  1172. ,
  1173. String.prototype.toJSON = Number.prototype.toJSON = Boolean.prototype.toJSON = function() {
  1174. return this.valueOf()
  1175. }
  1176. );
  1177. 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 = {
  1178. "\b": "\\b",
  1179. "\t": "\\t",
  1180. "\n": "\\n",
  1181. "\f": "\\f",
  1182. "\r": "\\r",
  1183. '"': '\\"',
  1184. "\\": "\\\\"
  1185. }, rep;
  1186. "function" != typeof JSON.stringify && (JSON.stringify = function(e, t, n) {
  1187. var r;
  1188. if (gap = "",
  1189. indent = "",
  1190. "number" == typeof n)
  1191. for (r = 0; n > r; r += 1)
  1192. indent += " ";
  1193. else
  1194. "string" == typeof n && (indent = n);
  1195. if (rep = t,
  1196. t && "function" != typeof t && ("object" != typeof t || "number" != typeof t.length))
  1197. throw new Error("JSON.stringify");
  1198. return str("", {
  1199. "": e
  1200. })
  1201. }
  1202. ),
  1203. "function" != typeof JSON.parse && (JSON.parse = function(text, reviver) {
  1204. function walk(e, t) {
  1205. var n, r, i = e[t];
  1206. if (i && "object" == typeof i)
  1207. for (n in i)
  1208. Object.prototype.hasOwnProperty.call(i, n) && (r = walk(i, n),
  1209. void 0 !== r ? i[n] = r : delete i[n]);
  1210. return reviver.call(e, t, i)
  1211. }
  1212. var j;
  1213. if (text = String(text),
  1214. cx.lastIndex = 0,
  1215. cx.test(text) && (text = text.replace(cx, function(e) {
  1216. return "\\u" + ("0000" + e.charCodeAt(0).toString(16)).slice(-4)
  1217. })),
  1218. /^[\],:{}\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, "")))
  1219. return j = eval("(" + text + ")"),
  1220. "function" == typeof reviver ? walk({
  1221. "": j
  1222. }, "") : j;
  1223. throw new SyntaxError("JSON.parse")
  1224. }
  1225. )
  1226. }(),
  1227. !function(e, t, n) {
  1228. "undefined" != typeof module && module.exports ? module.exports = n() : "function" == typeof define && define.amd ? define(n) : t[e] = n()
  1229. }("domready", Keen.utils, function(e) {
  1230. function t(e) {
  1231. for (d = 1; e = r.shift(); )
  1232. e()
  1233. }
  1234. 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]);
  1235. return o[l] && o[l](s, n = function() {
  1236. o.removeEventListener(s, n, i),
  1237. t()
  1238. }
  1239. , i),
  1240. c && o.attachEvent(u, n = function() {
  1241. /^c/.test(o[f]) && (o.detachEvent(u, n),
  1242. t())
  1243. }
  1244. ),
  1245. e = c ? function(t) {
  1246. self != top ? d ? t() : r.push(t) : function() {
  1247. try {
  1248. a.doScroll("left")
  1249. } catch (n) {
  1250. return setTimeout(function() {
  1251. e(t)
  1252. }, 50)
  1253. }
  1254. t()
  1255. }()
  1256. }
  1257. : function(e) {
  1258. d ? e() : r.push(e)
  1259. }
  1260. });
  1261. var loaded = window.Keen, cached = window._Keen || {}, clients, ready;
  1262. if (loaded && cached) {
  1263. clients = cached.clients || {},
  1264. ready = cached.ready || [];
  1265. for (var instance in clients)
  1266. if (clients.hasOwnProperty(instance)) {
  1267. var client = clients[instance];
  1268. for (var method in Keen.prototype)
  1269. Keen.prototype.hasOwnProperty(method) && (loaded.prototype[method] = Keen.prototype[method]);
  1270. if (loaded.Query = Keen.Query ? Keen.Query : function() {}
  1271. ,
  1272. loaded.Visualization = Keen.Visualization ? Keen.Visualization : function() {}
  1273. ,
  1274. client._config && (client.configure.call(client, client._config),
  1275. delete client._config),
  1276. client._setGlobalProperties) {
  1277. for (var globals = client._setGlobalProperties, i = 0; i < globals.length; i++)
  1278. client.setGlobalProperties.apply(client, globals[i]);
  1279. delete client._setGlobalProperties
  1280. }
  1281. if (client._addEvent) {
  1282. for (var queue = client._addEvent || [], i = 0; i < queue.length; i++)
  1283. client.addEvent.apply(client, queue[i]);
  1284. delete client._addEvent
  1285. }
  1286. var callback = client._on || [];
  1287. if (client._on) {
  1288. for (var i = 0; i < callback.length; i++)
  1289. client.on.apply(client, callback[i]);
  1290. client.trigger("ready"),
  1291. delete client._on
  1292. }
  1293. }
  1294. for (var i = 0; i < ready.length; i++) {
  1295. var callback = ready[i];
  1296. Keen.on("ready", function() {
  1297. callback()
  1298. })
  1299. }
  1300. }
  1301. return Keen.loaded && setTimeout(function() {
  1302. Keen.utils.domready(function() {
  1303. Keen.trigger("ready")
  1304. })
  1305. }, 0),
  1306. Keen
  1307. });
  1308. !function() {
  1309. var t = window.analytics = window.analytics || [];
  1310. if (!t.initialize) {
  1311. if (t.invoked)
  1312. return void (window.console && console.error && console.error("Segment snippet included twice."));
  1313. t.invoked = !0,
  1314. t.methods = ["trackSubmit", "trackClick", "trackLink", "trackForm", "pageview", "identify", "reset", "group", "track", "ready", "alias", "debug", "page", "once", "off", "on"],
  1315. t.factory = function(e) {
  1316. return function() {
  1317. var n = Array.prototype.slice.call(arguments);
  1318. return n.unshift(e),
  1319. t.push(n),
  1320. t
  1321. }
  1322. }
  1323. ;
  1324. for (var e = 0; e < t.methods.length; e++) {
  1325. var n = t.methods[e];
  1326. t[n] = t.factory(n)
  1327. }
  1328. t.load = function(t) {
  1329. var e = document.createElement("script");
  1330. e.type = "text/javascript",
  1331. e.async = !0,
  1332. e.src = ("https:" === document.location.protocol ? "https://" : "http://") + "cdn.segment.com/analytics.js/v1/" + t + "/analytics.min.js";
  1333. var n = document.getElementsByTagName("script")[0];
  1334. n.parentNode.insertBefore(e, n)
  1335. }
  1336. ,
  1337. t.SNIPPET_VERSION = "4.0.0"
  1338. }
  1339. }();
  1340. !function(i, e) {
  1341. "use strict";
  1342. var s = ""
  1343. , r = "?"
  1344. , o = "function"
  1345. , a = "undefined"
  1346. , n = "object"
  1347. , t = "major"
  1348. , d = "model"
  1349. , w = "name"
  1350. , l = "type"
  1351. , p = "vendor"
  1352. , m = "version"
  1353. , c = "architecture"
  1354. , u = "console"
  1355. , g = "mobile"
  1356. , f = "tablet"
  1357. , h = "smarttv"
  1358. , b = {
  1359. has: function(i, e) {
  1360. return e.toLowerCase().indexOf(i.toLowerCase()) !== -1
  1361. },
  1362. lowerize: function(i) {
  1363. return i.toLowerCase()
  1364. }
  1365. }
  1366. , y = {
  1367. rgx: function() {
  1368. for (var i, s, r, t, d, w, l, p = 0, m = arguments; p < m.length; p += 2) {
  1369. var c = m[p]
  1370. , u = m[p + 1];
  1371. if (typeof i === a) {
  1372. i = {};
  1373. for (t in u)
  1374. d = u[t],
  1375. typeof d === n ? i[d[0]] = e : i[d] = e
  1376. }
  1377. for (s = r = 0; s < c.length; s++)
  1378. if (w = c[s].exec(this.getUA())) {
  1379. for (t = 0; t < u.length; t++)
  1380. l = w[++r],
  1381. d = u[t],
  1382. 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;
  1383. break
  1384. }
  1385. if (w)
  1386. break
  1387. }
  1388. return i
  1389. },
  1390. str: function(i, s) {
  1391. for (var o in s)
  1392. if (typeof s[o] === n && s[o].length > 0) {
  1393. for (var a = 0; a < s[o].length; a++)
  1394. if (b.has(s[o][a], i))
  1395. return o === r ? e : o
  1396. } else if (b.has(s[o], i))
  1397. return o === r ? e : o;
  1398. return i
  1399. }
  1400. }
  1401. , v = {
  1402. browser: {
  1403. oldsafari: {
  1404. major: {
  1405. 1: ["/8", "/1", "/3"],
  1406. 2: "/4",
  1407. "?": "/"
  1408. },
  1409. version: {
  1410. "1.0": "/8",
  1411. 1.2: "/1",
  1412. 1.3: "/3",
  1413. "2.0": "/412",
  1414. "2.0.2": "/416",
  1415. "2.0.3": "/417",
  1416. "2.0.4": "/419",
  1417. "?": "/"
  1418. }
  1419. }
  1420. },
  1421. device: {
  1422. sprint: {
  1423. model: {
  1424. "Evo Shift 4G": "7373KT"
  1425. },
  1426. vendor: {
  1427. HTC: "APA",
  1428. Sprint: "Sprint"
  1429. }
  1430. }
  1431. },
  1432. os: {
  1433. windows: {
  1434. version: {
  1435. ME: "4.90",
  1436. "NT 3.11": "NT3.51",
  1437. "NT 4.0": "NT4.0",
  1438. 2e3: "NT 5.0",
  1439. XP: ["NT 5.1", "NT 5.2"],
  1440. Vista: "NT 6.0",
  1441. 7: "NT 6.1",
  1442. 8: "NT 6.2",
  1443. 8.1: "NT 6.3",
  1444. RT: "ARM"
  1445. }
  1446. }
  1447. }
  1448. }
  1449. , k = {
  1450. 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]],
  1451. 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]],
  1452. 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]],
  1453. 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]],
  1454. 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]]
  1455. }
  1456. , x = function(e) {
  1457. var r = e || (i && i.navigator && i.navigator.userAgent ? i.navigator.userAgent : s);
  1458. return this instanceof x ? (this.getBrowser = function() {
  1459. return y.rgx.apply(this, k.browser)
  1460. }
  1461. ,
  1462. this.getCPU = function() {
  1463. return y.rgx.apply(this, k.cpu)
  1464. }
  1465. ,
  1466. this.getDevice = function() {
  1467. return y.rgx.apply(this, k.device)
  1468. }
  1469. ,
  1470. this.getEngine = function() {
  1471. return y.rgx.apply(this, k.engine)
  1472. }
  1473. ,
  1474. this.getOS = function() {
  1475. return y.rgx.apply(this, k.os)
  1476. }
  1477. ,
  1478. this.getResult = function() {
  1479. return {
  1480. ua: this.getUA(),
  1481. browser: this.getBrowser(),
  1482. engine: this.getEngine(),
  1483. os: this.getOS(),
  1484. device: this.getDevice(),
  1485. cpu: this.getCPU()
  1486. }
  1487. }
  1488. ,
  1489. this.getUA = function() {
  1490. return r
  1491. }
  1492. ,
  1493. this.setUA = function(i) {
  1494. return r = i,
  1495. this
  1496. }
  1497. ,
  1498. void this.setUA(r)) : new x(e).getResult()
  1499. };
  1500. if (typeof exports !== a)
  1501. typeof module !== a && module.exports && (exports = module.exports = x),
  1502. exports.UAParser = x;
  1503. else if (i.UAParser = x,
  1504. typeof define === o && define.amd && define(function() {
  1505. return x
  1506. }),
  1507. typeof i.jQuery !== a) {
  1508. var A = i.jQuery
  1509. , _ = new x;
  1510. A.ua = _.getResult(),
  1511. A.ua.get = function() {
  1512. return _.getUA()
  1513. }
  1514. ,
  1515. A.ua.set = function(i) {
  1516. _.setUA(i);
  1517. var e = _.getResult();
  1518. for (var s in e)
  1519. A.ua[s] = e[s]
  1520. }
  1521. }
  1522. }(this);
  1523. window.Modernizr = function(n, e, t) {
  1524. function o(n) {
  1525. d.cssText = n
  1526. }
  1527. function r(n, e) {
  1528. return typeof n === e
  1529. }
  1530. var i, c, u, a = "2.8.2", f = {}, s = e.documentElement, l = "modernizr", p = e.createElement(l), d = p.style, y = ({}.toString,
  1531. {}), w = [], b = w.slice, v = {}.hasOwnProperty;
  1532. u = r(v, "undefined") || r(v.call, "undefined") ? function(n, e) {
  1533. return e in n && r(n.constructor.prototype[e], "undefined")
  1534. }
  1535. : function(n, e) {
  1536. return v.call(n, e)
  1537. }
  1538. ,
  1539. Function.prototype.bind || (Function.prototype.bind = function(n) {
  1540. var e = this;
  1541. if ("function" != typeof e)
  1542. throw new TypeError;
  1543. var t = b.call(arguments, 1)
  1544. , o = function() {
  1545. if (this instanceof o) {
  1546. var r = function() {};
  1547. r.prototype = e.prototype;
  1548. var i = new r
  1549. , c = e.apply(i, t.concat(b.call(arguments)));
  1550. return Object(c) === c ? c : i
  1551. }
  1552. return e.apply(n, t.concat(b.call(arguments)))
  1553. };
  1554. return o
  1555. }
  1556. ),
  1557. y.webgl = function() {
  1558. return !!n.WebGLRenderingContext
  1559. }
  1560. ;
  1561. for (var h in y)
  1562. u(y, h) && (c = h.toLowerCase(),
  1563. f[c] = y[h](),
  1564. w.push((f[c] ? "" : "no-") + c));
  1565. return f.addTest = function(n, e) {
  1566. if ("object" == typeof n)
  1567. for (var o in n)
  1568. u(n, o) && f.addTest(o, n[o]);
  1569. else {
  1570. if (n = n.toLowerCase(),
  1571. f[n] !== t)
  1572. return f;
  1573. e = "function" == typeof e ? e() : e,
  1574. "undefined" != typeof enableClasses && enableClasses && (s.className += " " + (e ? "" : "no-") + n),
  1575. f[n] = e
  1576. }
  1577. return f
  1578. }
  1579. ,
  1580. o(""),
  1581. p = i = null,
  1582. f._version = a,
  1583. f
  1584. }(this, this.document);
  1585. !function(e, t, a) {
  1586. "use strict";
  1587. function n(t, h, m) {
  1588. function H(a) {
  1589. var n = 0
  1590. , i = Ee.length;
  1591. if (Ce.old = e.extend({}, Ce),
  1592. Ie = we ? 0 : be[ge.horizontal ? "width" : "height"](),
  1593. ke = Be[ge.horizontal ? "width" : "height"](),
  1594. ze = we ? t : Pe[ge.horizontal ? "outerWidth" : "outerHeight"](),
  1595. Ee.length = 0,
  1596. Ce.start = 0,
  1597. Ce.end = q(ze - Ie, 0),
  1598. Re) {
  1599. n = Ne.length,
  1600. qe = Pe.children(ge.itemSelector),
  1601. Ne.length = 0;
  1602. 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;
  1603. ze = 0,
  1604. qe.each(function(t, a) {
  1605. var n = e(a)
  1606. , i = a.getBoundingClientRect()
  1607. , l = E(ge.horizontal ? i.width || i.right - i.left : i.height || i.bottom - i.top)
  1608. , d = c(n, ge.horizontal ? "marginLeft" : "marginTop")
  1609. , p = c(n, ge.horizontal ? "marginRight" : "marginBottom")
  1610. , h = l + d + p
  1611. , m = !d || !p
  1612. , g = {};
  1613. g.el = a,
  1614. g.size = m ? l : h,
  1615. g.half = g.size / 2,
  1616. g.start = ze + (m ? d : 0),
  1617. g.center = g.start - E(Ie / 2 - g.size / 2),
  1618. g.end = g.start - Ie + g.size,
  1619. t || (ze += s),
  1620. ze += h,
  1621. ge.horizontal || u || p && d && t > 0 && (ze -= N(d, p)),
  1622. t === v && (g.end += o,
  1623. ze += o,
  1624. f = m ? p : 0),
  1625. Ne.push(g),
  1626. r = g
  1627. }),
  1628. Pe[0].style[ge.horizontal ? "width" : "height"] = (l ? ze : ze - s - o) + "px",
  1629. ze -= f,
  1630. Ne.length ? (Ce.start = Ne[0][Me ? "center" : "start"],
  1631. Ce.end = Me ? r.center : ze > Ie ? r.end : Ce.start) : Ce.start = Ce.end = 0
  1632. }
  1633. if (Ce.center = E(Ce.end / 2 + Ce.start / 2),
  1634. Q(),
  1635. Se.length && ke > 0 && (ge.dynamicHandle ? (Te = Ce.start === Ce.end ? ke : E(ke * Ie / ze),
  1636. Te = d(Te, ge.minHandleSize, ke),
  1637. Se[0].style[ge.horizontal ? "width" : "height"] = Te + "px") : Te = Se[ge.horizontal ? "outerWidth" : "outerHeight"](),
  1638. xe.end = ke - Te,
  1639. it || j()),
  1640. !we && Ie > 0) {
  1641. var p = Ce.start
  1642. , h = "";
  1643. if (Re)
  1644. e.each(Ne, function(e, t) {
  1645. Me ? Ee.push(t.center) : t.start + t.size > p && p <= Ce.end && (p = t.start,
  1646. Ee.push(p),
  1647. p += Ie,
  1648. p > Ce.end && p < Ce.end + Ie && Ee.push(Ce.end))
  1649. });
  1650. else
  1651. for (; p - Ie < Ce.end; )
  1652. Ee.push(p),
  1653. p += Ie;
  1654. if (De[0] && i !== Ee.length) {
  1655. for (var m = 0; m < Ee.length; m++)
  1656. h += ge.pageBuilder.call(ye, m);
  1657. Ae = De.html(h).children(),
  1658. Ae.eq(Oe.activePage).addClass(ge.activeClass)
  1659. }
  1660. }
  1661. if (Oe.slideeSize = ze,
  1662. Oe.frameSize = Ie,
  1663. Oe.sbSize = ke,
  1664. Oe.handleSize = Te,
  1665. Re) {
  1666. a && null != ge.startAt && (W(ge.startAt),
  1667. ye[Le ? "toCenter" : "toStart"](ge.startAt));
  1668. var g = Ne[Oe.activeItem];
  1669. X(Le && g ? g.center : d(Ce.dest, Ce.start, Ce.end))
  1670. } else
  1671. a ? null != ge.startAt && X(ge.startAt, 1) : X(d(Ce.dest, Ce.start, Ce.end));
  1672. pe("load")
  1673. }
  1674. function X(e, t, a) {
  1675. if (Re && at.released && !a) {
  1676. var n = $(e)
  1677. , i = e > Ce.start && e < Ce.end;
  1678. Le ? (i && (e = Ne[n.centerItem].center),
  1679. Me && ge.activateMiddle && W(n.centerItem)) : i && (e = Ne[n.firstItem].start)
  1680. }
  1681. 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),
  1682. et.start = +new Date,
  1683. et.time = 0,
  1684. et.from = Ce.cur,
  1685. et.to = e,
  1686. et.delta = e - Ce.cur,
  1687. et.tweesing = at.tweese || at.init && !at.slidee,
  1688. et.immediate = !et.tweesing && (t || at.init && at.slidee || !ge.speed),
  1689. at.tweese = 0,
  1690. e !== Ce.dest && (Ce.dest = e,
  1691. pe("change"),
  1692. it || Y()),
  1693. K(),
  1694. Q(),
  1695. Z(),
  1696. F()
  1697. }
  1698. function Y() {
  1699. if (ye.initialized) {
  1700. if (!it)
  1701. return it = w(Y),
  1702. void (at.released && pe("moveStart"));
  1703. et.immediate ? Ce.cur = et.to : et.tweesing ? (et.tweeseDelta = et.to - Ce.cur,
  1704. 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),
  1705. Ce.cur = et.from + et.delta * e.easing[ge.easing](et.time / ge.speed, et.time, 0, 1, ge.speed)),
  1706. et.to === Ce.cur ? (Ce.cur = et.to,
  1707. at.tweese = it = 0) : it = w(Y),
  1708. pe("move"),
  1709. 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"),
  1710. !it && at.released && pe("moveEnd"),
  1711. j()
  1712. }
  1713. }
  1714. function j() {
  1715. 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,
  1716. xe.cur = d(E(xe.cur), xe.start, xe.end),
  1717. _e.hPos !== xe.cur && (_e.hPos = xe.cur,
  1718. f ? Se[0].style[f] = v + (ge.horizontal ? "translateX" : "translateY") + "(" + xe.cur + "px)" : Se[0].style[ge.horizontal ? "left" : "top"] = xe.cur + "px"))
  1719. }
  1720. function F() {
  1721. Ae[0] && _e.page !== Oe.activePage && (_e.page = Oe.activePage,
  1722. Ae.removeClass(ge.activeClass).eq(Oe.activePage).addClass(ge.activeClass),
  1723. pe("activePage", _e.page))
  1724. }
  1725. function M() {
  1726. tt.speed && Ce.cur !== (tt.speed > 0 ? Ce.end : Ce.start) || ye.stop(),
  1727. ot = at.init ? w(M) : 0,
  1728. tt.now = +new Date,
  1729. tt.pos = Ce.cur + (tt.now - tt.lastTime) / 1e3 * tt.speed,
  1730. X(at.init ? tt.pos : E(tt.pos)),
  1731. at.init || Ce.cur !== Ce.dest || pe("moveEnd"),
  1732. tt.lastTime = tt.now
  1733. }
  1734. function L(e, t, n) {
  1735. if ("boolean" === i(t) && (n = t,
  1736. t = a),
  1737. t === a)
  1738. X(Ce[e], n);
  1739. else {
  1740. if (Le && "center" !== e)
  1741. return;
  1742. var r = ye.getPos(t);
  1743. r && X(r[e], n, !Le)
  1744. }
  1745. }
  1746. function R(e) {
  1747. return null != e ? l(e) ? e >= 0 && e < Ne.length ? e : -1 : qe.index(e) : -1
  1748. }
  1749. function U(e) {
  1750. return R(l(e) && 0 > e ? e + Ne.length : e)
  1751. }
  1752. function W(e, t) {
  1753. var a = R(e);
  1754. return !(!Re || 0 > a) && ((_e.active !== a || t) && (qe.eq(Oe.activeItem).removeClass(ge.activeClass),
  1755. qe.eq(a).addClass(ge.activeClass),
  1756. _e.active = Oe.activeItem = a,
  1757. Z(),
  1758. pe("active", a)),
  1759. a)
  1760. }
  1761. function $(e) {
  1762. e = d(l(e) ? e : Ce.dest, Ce.start, Ce.end);
  1763. var t = {}
  1764. , a = Me ? 0 : Ie / 2;
  1765. if (!we)
  1766. for (var n = 0, i = Ee.length; i > n; n++) {
  1767. if (e >= Ce.end || n === Ee.length - 1) {
  1768. t.activePage = Ee.length - 1;
  1769. break
  1770. }
  1771. if (e <= Ee[n] + a) {
  1772. t.activePage = n;
  1773. break
  1774. }
  1775. }
  1776. if (Re) {
  1777. for (var r = !1, s = !1, o = !1, c = 0, u = Ne.length; u > c; c++)
  1778. if (r === !1 && e <= Ne[c].start + Ne[c].half && (r = c),
  1779. o === !1 && e <= Ne[c].center + Ne[c].half && (o = c),
  1780. c === u - 1 || e <= Ne[c].end + Ne[c].half) {
  1781. s = c;
  1782. break
  1783. }
  1784. t.firstItem = l(r) ? r : 0,
  1785. t.centerItem = l(o) ? o : t.firstItem,
  1786. t.lastItem = l(s) ? s : t.centerItem
  1787. }
  1788. return t
  1789. }
  1790. function Q(t) {
  1791. e.extend(Oe, $(t))
  1792. }
  1793. function Z() {
  1794. var e = Ce.dest <= Ce.start
  1795. , t = Ce.dest >= Ce.end
  1796. , a = (e ? 1 : 0) | (t ? 2 : 0);
  1797. if (_e.slideePosState !== a && (_e.slideePosState = a,
  1798. Je.is("button,input") && Je.prop("disabled", e),
  1799. Ke.is("button,input") && Ke.prop("disabled", t),
  1800. Je.add(Qe)[e ? "addClass" : "removeClass"](ge.disabledClass),
  1801. Ke.add($e)[t ? "addClass" : "removeClass"](ge.disabledClass)),
  1802. _e.fwdbwdState !== a && at.released && (_e.fwdbwdState = a,
  1803. Qe.is("button,input") && Qe.prop("disabled", e),
  1804. $e.is("button,input") && $e.prop("disabled", t)),
  1805. Re && null != Oe.activeItem) {
  1806. var n = 0 === Oe.activeItem
  1807. , i = Oe.activeItem >= Ne.length - 1
  1808. , r = (n ? 1 : 0) | (i ? 2 : 0);
  1809. _e.itemsButtonState !== r && (_e.itemsButtonState = r,
  1810. Ze.is("button,input") && Ze.prop("disabled", n),
  1811. Ge.is("button,input") && Ge.prop("disabled", i),
  1812. Ze[n ? "addClass" : "removeClass"](ge.disabledClass),
  1813. Ge[i ? "addClass" : "removeClass"](ge.disabledClass))
  1814. }
  1815. }
  1816. function G(e, t, a) {
  1817. if (e = U(e),
  1818. t = U(t),
  1819. e > -1 && t > -1 && e !== t && (!a || t !== e - 1) && (a || t !== e + 1)) {
  1820. qe.eq(e)[a ? "insertAfter" : "insertBefore"](Ne[t].el);
  1821. var n = t > e ? e : a ? t : t - 1
  1822. , i = e > t ? e : a ? t + 1 : t
  1823. , r = e > t;
  1824. 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)),
  1825. H()
  1826. }
  1827. }
  1828. function J(e, t) {
  1829. for (var a = 0, n = Ve[e].length; n > a; a++)
  1830. if (Ve[e][a] === t)
  1831. return a;
  1832. return -1
  1833. }
  1834. function K() {
  1835. at.released && !ye.isPaused && ye.resume()
  1836. }
  1837. function V(e) {
  1838. return E(d(e, xe.start, xe.end) / xe.end * (Ce.end - Ce.start)) + Ce.start
  1839. }
  1840. function _() {
  1841. at.history[0] = at.history[1],
  1842. at.history[1] = at.history[2],
  1843. at.history[2] = at.history[3],
  1844. at.history[3] = at.delta
  1845. }
  1846. function ee(e) {
  1847. at.released = 0,
  1848. at.source = e,
  1849. at.slidee = "slidee" === e
  1850. }
  1851. function te(t) {
  1852. var a = "touchstart" === t.type
  1853. , n = t.data.source
  1854. , i = "slidee" === n;
  1855. 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),
  1856. ee(n),
  1857. at.init = 0,
  1858. at.$source = e(t.target),
  1859. at.touch = a,
  1860. at.pointer = a ? t.originalEvent.touches[0] : t,
  1861. at.initX = at.pointer.pageX,
  1862. at.initY = at.pointer.pageY,
  1863. at.initPos = i ? Ce.cur : xe.cur,
  1864. at.start = +new Date,
  1865. at.time = 0,
  1866. at.path = 0,
  1867. at.delta = 0,
  1868. at.locked = 0,
  1869. at.history = [0, 0, 0, 0],
  1870. at.pathToLock = i ? a ? 30 : 10 : 0,
  1871. b.on(a ? z : I, ae),
  1872. ye.pause(1),
  1873. (i ? Pe : Se).addClass(ge.draggedClass),
  1874. pe("moveStart"),
  1875. i && (rt = setInterval(_, 10)))
  1876. }
  1877. function ae(e) {
  1878. if (at.released = "mouseup" === e.type || "touchend" === e.type,
  1879. at.pointer = at.touch ? e.originalEvent[at.released ? "changedTouches" : "touches"][0] : e,
  1880. at.pathX = at.pointer.pageX - at.initX,
  1881. at.pathY = at.pointer.pageY - at.initY,
  1882. at.path = D(A(at.pathX, 2) + A(at.pathY, 2)),
  1883. at.delta = ge.horizontal ? at.pathX : at.pathY,
  1884. at.released || !(at.path < 1)) {
  1885. if (!at.init) {
  1886. if (!(ge.horizontal ? x(at.pathX) > x(at.pathY) : x(at.pathX) < x(at.pathY)))
  1887. return ne();
  1888. at.init = 1
  1889. }
  1890. r(e),
  1891. !at.locked && at.path > at.pathToLock && at.slidee && (at.locked = 1,
  1892. at.$source.on(B, s)),
  1893. at.released && (ne(),
  1894. ge.releaseSwing && at.slidee && (at.swing = (at.delta - at.history[0]) / 40 * 300,
  1895. at.delta += at.swing,
  1896. at.tweese = x(at.swing) > 10)),
  1897. X(at.slidee ? E(at.initPos - at.delta) : V(at.initPos + at.delta))
  1898. }
  1899. }
  1900. function ne() {
  1901. clearInterval(rt),
  1902. at.released = !0,
  1903. b.off(at.touch ? z : I, ae),
  1904. (at.slidee ? Pe : Se).removeClass(ge.draggedClass),
  1905. setTimeout(function() {
  1906. at.$source.off(B, s)
  1907. }),
  1908. Ce.cur === Ce.dest && at.init && pe("moveEnd"),
  1909. ye.resume(1),
  1910. at.init = 0
  1911. }
  1912. function ie(t) {
  1913. return ~e.inArray(t.nodeName, k) || e(t).is(ge.interactive)
  1914. }
  1915. function re() {
  1916. ye.stop(),
  1917. b.off("mouseup", re)
  1918. }
  1919. function se(e) {
  1920. switch (r(e),
  1921. this) {
  1922. case $e[0]:
  1923. case Qe[0]:
  1924. ye.moveBy($e.is(this) ? ge.moveBy : -ge.moveBy),
  1925. b.on("mouseup", re);
  1926. break;
  1927. case Ze[0]:
  1928. ye.prev();
  1929. break;
  1930. case Ge[0]:
  1931. ye.next();
  1932. break;
  1933. case Je[0]:
  1934. ye.prevPage();
  1935. break;
  1936. case Ke[0]:
  1937. ye.nextPage()
  1938. }
  1939. }
  1940. function oe(e) {
  1941. return nt.curDelta = (ge.horizontal ? e.deltaY || e.deltaX : e.deltaY) || -e.wheelDelta,
  1942. nt.curDelta /= 1 === e.deltaMode ? 3 : 100,
  1943. Re ? (p = +new Date,
  1944. nt.last < p - nt.resetTime && (nt.delta = 0),
  1945. nt.last = p,
  1946. nt.delta += nt.curDelta,
  1947. x(nt.delta) < 1 ? nt.finalDelta = 0 : (nt.finalDelta = E(nt.delta / 1),
  1948. nt.delta %= 1),
  1949. nt.finalDelta) : nt.curDelta
  1950. }
  1951. function le(e) {
  1952. e.originalEvent[g] = ye;
  1953. var t = +new Date;
  1954. if (O + ge.scrollHijack > t && Ue[0] !== document && Ue[0] !== window)
  1955. return void (O = t);
  1956. if (ge.scrollBy && Ce.start !== Ce.end) {
  1957. var a = oe(e.originalEvent);
  1958. (ge.scrollTrap || a > 0 && Ce.dest < Ce.end || 0 > a && Ce.dest > Ce.start) && r(e, 1),
  1959. ye.slideBy(ge.scrollBy * a)
  1960. }
  1961. }
  1962. function ce(e) {
  1963. ge.clickBar && e.target === Be[0] && (r(e),
  1964. X(V((ge.horizontal ? e.pageX - Be.offset().left : e.pageY - Be.offset().top) - Te / 2)))
  1965. }
  1966. function de(e) {
  1967. if (ge.keyboardNavBy)
  1968. switch (e.which) {
  1969. case ge.horizontal ? 37 : 38:
  1970. r(e),
  1971. ye["pages" === ge.keyboardNavBy ? "prevPage" : "prev"]();
  1972. break;
  1973. case ge.horizontal ? 39 : 40:
  1974. r(e),
  1975. ye["pages" === ge.keyboardNavBy ? "nextPage" : "next"]()
  1976. }
  1977. }
  1978. function ue(e) {
  1979. return ie(this) ? void (e.originalEvent[g + "ignore"] = !0) : void (this.parentNode !== Pe[0] || e.originalEvent[g + "ignore"] || ye.activate(this))
  1980. }
  1981. function fe() {
  1982. this.parentNode === De[0] && ye.activatePage(Ae.index(this))
  1983. }
  1984. function ve(e) {
  1985. ge.pauseOnHover && ye["mouseenter" === e.type ? "pause" : "resume"](2)
  1986. }
  1987. function pe(e, t) {
  1988. if (Ve[e]) {
  1989. for (me = Ve[e].length,
  1990. T.length = 0,
  1991. he = 0; me > he; he++)
  1992. T.push(Ve[e][he]);
  1993. for (he = 0; me > he; he++)
  1994. T[he].call(ye, e, t)
  1995. }
  1996. }
  1997. 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 = {
  1998. start: 0,
  1999. center: 0,
  2000. end: 0,
  2001. cur: 0,
  2002. dest: 0
  2003. }, Be = e(ge.scrollBar).eq(0), Se = Be.children().eq(0), ke = 0, Te = 0, xe = {
  2004. start: 0,
  2005. end: 0,
  2006. cur: 0
  2007. }, De = e(ge.pagesBar), Ae = 0, Ee = [], qe = 0, Ne = [], Oe = {
  2008. firstItem: 0,
  2009. lastItem: 0,
  2010. centerItem: 0,
  2011. activeItem: null,
  2012. activePage: 0
  2013. }, 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 = {
  2014. released: 1
  2015. }, nt = {
  2016. last: 0,
  2017. delta: 0,
  2018. resetTime: 200
  2019. }, it = 0, rt = 0, st = 0, ot = 0;
  2020. we || (t = be[0]),
  2021. ye.initialized = 0,
  2022. ye.frame = t,
  2023. ye.slidee = Pe[0],
  2024. ye.pos = Ce,
  2025. ye.rel = Oe,
  2026. ye.items = Ne,
  2027. ye.pages = Ee,
  2028. ye.isPaused = 0,
  2029. ye.options = ge,
  2030. ye.dragging = at,
  2031. ye.reload = function() {
  2032. H()
  2033. }
  2034. ,
  2035. ye.getPos = function(e) {
  2036. if (Re) {
  2037. var t = R(e);
  2038. return -1 !== t && Ne[t]
  2039. }
  2040. var a = Pe.find(e).eq(0);
  2041. if (a[0]) {
  2042. var n = ge.horizontal ? a.offset().left - Pe.offset().left : a.offset().top - Pe.offset().top
  2043. , i = a[ge.horizontal ? "outerWidth" : "outerHeight"]();
  2044. return {
  2045. start: n,
  2046. center: n - Ie / 2 + i / 2,
  2047. end: n - Ie + i,
  2048. size: i
  2049. }
  2050. }
  2051. return !1
  2052. }
  2053. ,
  2054. ye.moveBy = function(e) {
  2055. tt.speed = e,
  2056. !at.init && tt.speed && Ce.cur !== (tt.speed > 0 ? Ce.end : Ce.start) && (tt.lastTime = +new Date,
  2057. tt.startPos = Ce.cur,
  2058. ee("button"),
  2059. at.init = 1,
  2060. pe("moveStart"),
  2061. y(ot),
  2062. M())
  2063. }
  2064. ,
  2065. ye.stop = function() {
  2066. "button" === at.source && (at.init = 0,
  2067. at.released = 1)
  2068. }
  2069. ,
  2070. ye.prev = function() {
  2071. ye.activate(null == Oe.activeItem ? 0 : Oe.activeItem - 1)
  2072. }
  2073. ,
  2074. ye.next = function() {
  2075. ye.activate(null == Oe.activeItem ? 0 : Oe.activeItem + 1)
  2076. }
  2077. ,
  2078. ye.prevPage = function() {
  2079. ye.activatePage(Oe.activePage - 1)
  2080. }
  2081. ,
  2082. ye.nextPage = function() {
  2083. ye.activatePage(Oe.activePage + 1)
  2084. }
  2085. ,
  2086. ye.slideBy = function(e, t) {
  2087. e && (Re ? ye[Le ? "toCenter" : "toStart"](d((Le ? Oe.centerItem : Oe.firstItem) + ge.scrollBy * e, 0, Ne.length)) : X(Ce.dest + e, t))
  2088. }
  2089. ,
  2090. ye.slideTo = function(e, t) {
  2091. X(e, t)
  2092. }
  2093. ,
  2094. ye.toStart = function(e, t) {
  2095. L("start", e, t)
  2096. }
  2097. ,
  2098. ye.toEnd = function(e, t) {
  2099. L("end", e, t)
  2100. }
  2101. ,
  2102. ye.toCenter = function(e, t) {
  2103. L("center", e, t)
  2104. }
  2105. ,
  2106. ye.getIndex = R,
  2107. ye.activate = function(e, t) {
  2108. var a = W(e);
  2109. ge.smart && a !== !1 && (Le ? ye.toCenter(a, t) : a >= Oe.lastItem ? ye.toStart(a, t) : a <= Oe.firstItem ? ye.toEnd(a, t) : K())
  2110. }
  2111. ,
  2112. ye.activatePage = function(e, t) {
  2113. l(e) && X(Ee[d(e, 0, Ee.length - 1)], t)
  2114. }
  2115. ,
  2116. ye.resume = function(e) {
  2117. ge.cycleBy && ge.cycleInterval && ("items" !== ge.cycleBy || Ne[0] && null != Oe.activeItem) && !(e < ye.isPaused) && (ye.isPaused = 0,
  2118. st ? st = clearTimeout(st) : pe("resume"),
  2119. st = setTimeout(function() {
  2120. switch (pe("cycle"),
  2121. ge.cycleBy) {
  2122. case "items":
  2123. ye.activate(Oe.activeItem >= Ne.length - 1 ? 0 : Oe.activeItem + 1);
  2124. break;
  2125. case "pages":
  2126. ye.activatePage(Oe.activePage >= Ee.length - 1 ? 0 : Oe.activePage + 1)
  2127. }
  2128. }, ge.cycleInterval))
  2129. }
  2130. ,
  2131. ye.pause = function(e) {
  2132. e < ye.isPaused || (ye.isPaused = e || 100,
  2133. st && (st = clearTimeout(st),
  2134. pe("pause")))
  2135. }
  2136. ,
  2137. ye.toggle = function() {
  2138. ye[st ? "pause" : "resume"]()
  2139. }
  2140. ,
  2141. ye.set = function(t, a) {
  2142. e.isPlainObject(t) ? e.extend(ge, t) : ge.hasOwnProperty(t) && (ge[t] = a)
  2143. }
  2144. ,
  2145. ye.add = function(t, a) {
  2146. var n = e(t);
  2147. Re ? (null == a || !Ne[0] || a >= Ne.length ? n.appendTo(Pe) : Ne.length && n.insertBefore(Ne[a].el),
  2148. null != Oe.activeItem && a <= Oe.activeItem && (_e.active = Oe.activeItem += n.length)) : Pe.append(n),
  2149. H()
  2150. }
  2151. ,
  2152. ye.remove = function(t) {
  2153. if (Re) {
  2154. var a = U(t);
  2155. if (a > -1) {
  2156. qe.eq(a).remove();
  2157. var n = a === Oe.activeItem;
  2158. null != Oe.activeItem && a < Oe.activeItem && (_e.active = --Oe.activeItem),
  2159. H(),
  2160. n && (_e.active = null,
  2161. ye.activate(Oe.activeItem))
  2162. }
  2163. } else
  2164. e(t).remove(),
  2165. H()
  2166. }
  2167. ,
  2168. ye.moveAfter = function(e, t) {
  2169. G(e, t, 1)
  2170. }
  2171. ,
  2172. ye.moveBefore = function(e, t) {
  2173. G(e, t)
  2174. }
  2175. ,
  2176. ye.on = function(e, t) {
  2177. if ("object" === i(e))
  2178. for (var a in e)
  2179. e.hasOwnProperty(a) && ye.on(a, e[a]);
  2180. else if ("function" === i(t))
  2181. for (var n = e.split(" "), r = 0, s = n.length; s > r; r++)
  2182. Ve[n[r]] = Ve[n[r]] || [],
  2183. -1 === J(n[r], t) && Ve[n[r]].push(t);
  2184. else if ("array" === i(t))
  2185. for (var o = 0, l = t.length; l > o; o++)
  2186. ye.on(e, t[o])
  2187. }
  2188. ,
  2189. ye.one = function(e, t) {
  2190. function a() {
  2191. t.apply(ye, arguments),
  2192. ye.off(e, a)
  2193. }
  2194. ye.on(e, a)
  2195. }
  2196. ,
  2197. ye.off = function(e, t) {
  2198. if (t instanceof Array)
  2199. for (var a = 0, n = t.length; n > a; a++)
  2200. ye.off(e, t[a]);
  2201. else
  2202. for (var i = e.split(" "), r = 0, s = i.length; s > r; r++)
  2203. if (Ve[i[r]] = Ve[i[r]] || [],
  2204. null == t)
  2205. Ve[i[r]].length = 0;
  2206. else {
  2207. var o = J(i[r], t);
  2208. -1 !== o && Ve[i[r]].splice(o, 1)
  2209. }
  2210. }
  2211. ,
  2212. ye.destroy = function() {
  2213. return Ue.add(Se).add(Be).add(De).add($e).add(Qe).add(Ze).add(Ge).add(Je).add(Ke).off("." + g),
  2214. b.off("keydown", de),
  2215. Ze.add(Ge).add(Je).add(Ke).removeClass(ge.disabledClass),
  2216. qe && null != Oe.activeItem && qe.eq(Oe.activeItem).removeClass(ge.activeClass),
  2217. De.empty(),
  2218. we || (be.off("." + g),
  2219. He.restore(),
  2220. Xe.restore(),
  2221. Ye.restore(),
  2222. je.restore(),
  2223. e.removeData(t, g)),
  2224. Ne.length = Ee.length = 0,
  2225. _e = {},
  2226. ye.initialized = 0,
  2227. ye
  2228. }
  2229. ,
  2230. ye.init = function() {
  2231. if (!ye.initialized) {
  2232. ye.on(m);
  2233. var e = ["overflow", "position"]
  2234. , t = ["position", "webkitTransform", "msTransform", "transform", "left", "top", "width", "height"];
  2235. He.save.apply(He, e),
  2236. Ye.save.apply(Ye, e),
  2237. Xe.save.apply(Xe, t),
  2238. je.save.apply(je, t);
  2239. var a = Se;
  2240. return we || (a = a.add(Pe),
  2241. be.css("overflow", "hidden"),
  2242. f || "static" !== be.css("position") || be.css("position", "relative")),
  2243. f ? v && a.css(f, v) : ("static" === Be.css("position") && Be.css("position", "relative"),
  2244. a.css({
  2245. position: "absolute"
  2246. })),
  2247. ge.forward && $e.on(S, se),
  2248. ge.backward && Qe.on(S, se),
  2249. ge.prev && Ze.on(B, se),
  2250. ge.next && Ge.on(B, se),
  2251. ge.prevPage && Je.on(B, se),
  2252. ge.nextPage && Ke.on(B, se),
  2253. Ue.on(C, le),
  2254. Be[0] && Be.on(B, ce),
  2255. Re && ge.activateOn && be.on(ge.activateOn + "." + g, "*", ue),
  2256. De[0] && ge.activatePageOn && De.on(ge.activatePageOn + "." + g, "*", fe),
  2257. We.on(P, {
  2258. source: "slidee"
  2259. }, te),
  2260. Se && Se.on(P, {
  2261. source: "handle"
  2262. }, te),
  2263. b.on("keydown", de),
  2264. we || (be.on("mouseenter." + g + " mouseleave." + g, ve),
  2265. be.on("scroll." + g, o)),
  2266. ye.initialized = 1,
  2267. H(!0),
  2268. ge.cycleBy && !we && ye[ge.startPaused ? "pause" : "resume"](),
  2269. ye
  2270. }
  2271. }
  2272. }
  2273. function i(e) {
  2274. 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
  2275. }
  2276. function r(e, t) {
  2277. e.preventDefault(),
  2278. t && e.stopPropagation()
  2279. }
  2280. function s(t) {
  2281. r(t, 1),
  2282. e(this).off(t.type, s)
  2283. }
  2284. function o() {
  2285. this.scrollLeft = 0,
  2286. this.scrollTop = 0
  2287. }
  2288. function l(e) {
  2289. return !isNaN(parseFloat(e)) && isFinite(e)
  2290. }
  2291. function c(e, t) {
  2292. return 0 | E(String(e.css(t)).replace(/[^\-0-9.]/g, ""))
  2293. }
  2294. function d(e, t, a) {
  2295. return t > e ? t : e > a ? a : e
  2296. }
  2297. function u(e) {
  2298. var t = {};
  2299. return t.style = {},
  2300. t.save = function() {
  2301. if (e && e.nodeType) {
  2302. for (var a = 0; a < arguments.length; a++)
  2303. t.style[arguments[a]] = e.style[arguments[a]];
  2304. return t
  2305. }
  2306. }
  2307. ,
  2308. t.restore = function() {
  2309. if (e && e.nodeType) {
  2310. for (var a in t.style)
  2311. t.style.hasOwnProperty(a) && (e.style[a] = t.style[a]);
  2312. return t
  2313. }
  2314. }
  2315. ,
  2316. t
  2317. }
  2318. 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;
  2319. b.on(C, function(e) {
  2320. var t = e.originalEvent[g]
  2321. , a = +new Date;
  2322. (!t || t.options.scrollHijack < a - O) && (O = a)
  2323. }),
  2324. function(e) {
  2325. function t(e) {
  2326. var t = (new Date).getTime()
  2327. , n = Math.max(0, 16 - (t - a))
  2328. , i = setTimeout(e, n);
  2329. return a = t,
  2330. i
  2331. }
  2332. w = e.requestAnimationFrame || e.webkitRequestAnimationFrame || t;
  2333. var a = (new Date).getTime()
  2334. , n = e.cancelAnimationFrame || e.webkitCancelAnimationFrame || e.clearTimeout;
  2335. y = function(t) {
  2336. n.call(e, t)
  2337. }
  2338. }(window),
  2339. function() {
  2340. function e(e) {
  2341. for (var n = 0, i = t.length; i > n; n++) {
  2342. var r = t[n] ? t[n] + e.charAt(0).toUpperCase() + e.slice(1) : e;
  2343. if (null != a.style[r])
  2344. return r
  2345. }
  2346. }
  2347. var t = ["", "webkit", "moz", "ms", "o"]
  2348. , a = document.createElement("div");
  2349. f = e("transform"),
  2350. v = e("perspective") ? "translateZ(0) " : ""
  2351. }(),
  2352. t[m] = n,
  2353. e.fn[h] = function(t, a) {
  2354. var r, s;
  2355. return e.isPlainObject(t) || (("string" === i(t) || t === !1) && (r = t === !1 ? "destroy" : t,
  2356. s = Array.prototype.slice.call(arguments, 1)),
  2357. t = {}),
  2358. this.each(function(i, o) {
  2359. var l = e.data(o, g);
  2360. l || r ? l && r && l[r] && l[r].apply(l, s) : l = e.data(o, g, new n(o,t,a).init())
  2361. })
  2362. }
  2363. ,
  2364. n.defaults = {
  2365. slidee: null,
  2366. horizontal: !1,
  2367. itemNav: null,
  2368. itemSelector: null,
  2369. smart: !1,
  2370. activateOn: null,
  2371. activateMiddle: !1,
  2372. scrollSource: null,
  2373. scrollBy: 0,
  2374. scrollHijack: 300,
  2375. scrollTrap: !1,
  2376. dragSource: null,
  2377. mouseDragging: !1,
  2378. touchDragging: !1,
  2379. releaseSwing: !1,
  2380. swingSpeed: .2,
  2381. elasticBounds: !1,
  2382. interactive: null,
  2383. scrollBar: null,
  2384. dragHandle: !1,
  2385. dynamicHandle: !1,
  2386. minHandleSize: 50,
  2387. clickBar: !1,
  2388. syncSpeed: .5,
  2389. pagesBar: null,
  2390. activatePageOn: null,
  2391. pageBuilder: function(e) {
  2392. return "<li>" + (e + 1) + "</li>"
  2393. },
  2394. forward: null,
  2395. backward: null,
  2396. prev: null,
  2397. next: null,
  2398. prevPage: null,
  2399. nextPage: null,
  2400. cycleBy: null,
  2401. cycleInterval: 5e3,
  2402. pauseOnHover: !1,
  2403. startPaused: !1,
  2404. moveBy: 300,
  2405. speed: 0,
  2406. easing: "swing",
  2407. startAt: null,
  2408. keyboardNavBy: null,
  2409. draggedClass: "dragged",
  2410. activeClass: "active",
  2411. disabledClass: "disabled"
  2412. }
  2413. }(jQuery, window);
  2414. !function e(t, i, n) {
  2415. function r(a, s) {
  2416. if (!i[a]) {
  2417. if (!t[a]) {
  2418. var l = "function" == typeof require && require;
  2419. if (!s && l)
  2420. return l(a, !0);
  2421. if (o)
  2422. return o(a, !0);
  2423. var c = new Error("Cannot find module '" + a + "'");
  2424. throw c.code = "MODULE_NOT_FOUND",
  2425. c
  2426. }
  2427. var h = i[a] = {
  2428. exports: {}
  2429. };
  2430. t[a][0].call(h.exports, function(e) {
  2431. var i = t[a][1][e];
  2432. return r(i ? i : e)
  2433. }, h, h.exports, e, t, i, n)
  2434. }
  2435. return i[a].exports
  2436. }
  2437. for (var o = "function" == typeof require && require, a = 0; a < n.length; a++)
  2438. r(n[a]);
  2439. return r
  2440. }({
  2441. 1: [function(e, t, i) {
  2442. (function(i) {
  2443. "use strict";
  2444. function n(e) {
  2445. this.player = null,
  2446. this.director = null,
  2447. this.modelManager = null,
  2448. this.container = null,
  2449. this.tagManager = null,
  2450. this.fadeInSpeed = e,
  2451. null !== this.fadeInSpeed && void 0 !== this.fadeInSpeed || (this.fadeInSpeed = 0)
  2452. }
  2453. var r = e("three")
  2454. , o = e("./util/logger")
  2455. , a = (e("./util/common"),
  2456. e("./enum/PlayerEvents"))
  2457. , s = e("./enum/DirectorEvents")
  2458. , l = e("./settings")
  2459. , c = e("./enum/Viewmode")
  2460. , h = (e("./enum/WarpStyle"),
  2461. e("./enum/BlackoutStyle"),
  2462. e("./enum/ModelManagerEvents"))
  2463. , u = e("./enum/tagEvents")
  2464. , d = e("./util/transitions")
  2465. , p = e("./util/lerp")
  2466. , f = new o(i);
  2467. //window.THREE = r;
  2468. n.prototype.init = function(e, t, i, n, r) {
  2469. window.app = this;
  2470. this.player = t,
  2471. this.director = e,
  2472. this.modelManager = i,
  2473. this.tagManager = n,
  2474. this.container = r,
  2475. this.updateModel(),
  2476. this.bindEvents()
  2477. }
  2478. ,
  2479. n.prototype.bindEvents = function() {
  2480. this.modelManager.on(h.ActiveModelChanged, this.updateModel.bind(this)),
  2481. this.player.on(a.ModeChanging, this.handlePlayerModeChanging.bind(this)),
  2482. this.player.on(a.ModeChanged, this.handlePlayerModeChanged.bind(this)),
  2483. this.player.on(a.ClosestPanoChanging, this.handleClosestPanoChanging.bind(this)),
  2484. this.player.on(a.StartInside, this.handleStartInside.bind(this)),
  2485. this.player.on(a.StartOutside, this.handleStartOutside.bind(this)),
  2486. this.player.on(a.WarpStarted, this.handleWarpStarted.bind(this)),
  2487. this.director.on(s.ActionInterrupted, this.handleActionInterruption.bind(this)),
  2488. this.tagManager.on(u.TagActivated, this.ontagActivated.bind(this)),
  2489. this.tagManager.on(u.TagNavigation, this.onNavigationTotag.bind(this))
  2490. }
  2491. ,
  2492. n.prototype.updateModel = function() {
  2493. //模型this.model
  2494. this.model = this.modelManager.getActiveModel()
  2495. }
  2496. ,
  2497. n.prototype.handleWarpStarted = function() {
  2498. this.hidePlayerReticule()
  2499. }
  2500. ,
  2501. n.prototype.ontagActivated = function() {
  2502. this.hidePlayerReticule()
  2503. }
  2504. ,
  2505. n.prototype.onNavigationTotag = function() {
  2506. this.hidePlayerReticule()
  2507. }
  2508. ,
  2509. n.prototype.handlePlayerModeChanging = function(e, t, i) {
  2510. var n = this.modelManager.getActiveModel()
  2511. , r = this.player.is360View(t, i) || this.director.tourIsPlaying ? 0 : l[t].markerOpacity;
  2512. n.fadePanoMarkers(r),
  2513. n.setMode(t)
  2514. }
  2515. ,
  2516. n.prototype.handlePlayerModeChanged = function(e, t) {
  2517. var i = this.modelManager.getActiveModel()
  2518. , n = t === c.PANORAMA ? r.DoubleSide : r.FrontSide;
  2519. i.setSide(n),
  2520. i.setMode(t)
  2521. }
  2522. ,
  2523. n.prototype.handleClosestPanoChanging = function(e, t, i) {
  2524. i !== c.TRANSITIONING && (e && !this.director.tourIsPlaying && e.hoverOff(i),
  2525. t && !this.director.tourIsPlaying && t.hoverOn(i))
  2526. }
  2527. ,
  2528. n.prototype.handleActionInterruption = function() {}
  2529. ,
  2530. n.prototype.handleStartInside = function(e) {
  2531. var t = l[this.player.mode]
  2532. , i = e ? 0 : t.transitionTime * t.skyboxOpacityLength;
  2533. this.fadeIn(this.fadeInSpeed),
  2534. this.model.alpha = 0,
  2535. this.model.skybox.material.uniforms.opacity.value = 1,
  2536. this.model.fadePanoMarkers(e ? 0 : t.markerOpacity);
  2537. var n = this.player.reticule;
  2538. d.start(p.property(n.material, "opacity", 0), i, null, 0, null, "retReOpac")
  2539. }
  2540. ,
  2541. n.prototype.handleStartOutside = function(e) {
  2542. this.fadeIn(e)
  2543. }
  2544. ,
  2545. n.prototype.fadeIn = function(e) {
  2546. null !== e && void 0 !== e || (e = 2e3,
  2547. f.warn("DisplayController.fadeIn -> no transition time specified, defaulting to 2000 ms.")),
  2548. $(this.container).fadeIn(e)
  2549. }
  2550. ,
  2551. n.prototype.hidePlayerReticule = function() {
  2552. this.player.reticule.hide()
  2553. }
  2554. ,
  2555. t.exports = n
  2556. }
  2557. ).call(this, "/js/DisplayController.js")
  2558. }
  2559. , {
  2560. "./enum/BlackoutStyle": 18,
  2561. "./enum/DirectorEvents": 23,
  2562. "./enum/tagEvents": 32,
  2563. "./enum/ModelManagerEvents": 33,
  2564. "./enum/PlayerEvents": 40,
  2565. "./enum/Viewmode": 51,
  2566. "./enum/WarpStyle": 52,
  2567. "./settings": 166,
  2568. "./util/common": 185,
  2569. "./util/lerp": 188,
  2570. "./util/logger": 189,
  2571. "./util/transitions": 195,
  2572. three: 217
  2573. }],
  2574. 2: [function(e, t, i) {
  2575. "use strict";
  2576. function n() {
  2577. this.baseStartTime = performance.timing.navigationStart,
  2578. this.loadingStartTime = null,
  2579. this.waitingStartTime = null,
  2580. this.appReadyTime = null
  2581. }
  2582. n.prototype.setBaseStartTime = function(e) {
  2583. this.baseStartTime = e || Date.now()
  2584. }
  2585. ,
  2586. n.prototype.setWaitingStartTime = function(e) {
  2587. this.waitingStartTime = e || Date.now()
  2588. }
  2589. ,
  2590. n.prototype.setLoadingStartTime = function(e) {
  2591. this.loadingStartTime = e || Date.now()
  2592. }
  2593. ,
  2594. n.prototype.setAppReadyTime = function(e) {
  2595. this.appReadyTime = e || Date.now()
  2596. }
  2597. ,
  2598. n.prototype.calcFullLoadingTime = function() {
  2599. var e = this.appReadyTime - this.baseStartTime;
  2600. return this.waitingStartTime && (e -= this.loadingStartTime - this.waitingStartTime),
  2601. e
  2602. }
  2603. ,
  2604. t.exports = n
  2605. }
  2606. , {}],
  2607. 3: [function(e, t, i) {
  2608. (function(i) {
  2609. "use strict";
  2610. function n() {
  2611. return 100 * Math.random()
  2612. }
  2613. var r = e("./util/logger")
  2614. , o = e("./util/browser")
  2615. , a = new r(i)
  2616. , s = window.MP_AB_TESTS = window.MP_AB_TESTS || {
  2617. initialized: !1,
  2618. init: function(e, t) {
  2619. if (t = t || {},
  2620. !this.initialized) {
  2621. this.initialized = !0,
  2622. o.valueFromHash("tilegen") && (t.tilegen = 1 === o.valueFromHash("tilegen", 0)),
  2623. o.valueFromHash("imgopt") && (t.imgopt = 1 === o.valueFromHash("imgopt", 0));
  2624. for (var i in e) {
  2625. var r = i.match("^sc_tilegen_([0-9]+)$");
  2626. r && (s.tilegen = n() < parseInt(r[1]));
  2627. var l = i.match("^sc_imgopt_([0-9]+)$");
  2628. l && (s.imgopt = n() < parseInt(l[1]))
  2629. }
  2630. for (var c in t)
  2631. s[c] = t[c],
  2632. a.debug("A/B override:", c, s[c])
  2633. }
  2634. },
  2635. changeIfTileGenerating: function(e) {
  2636. return s.tilegen && (e += e.indexOf("?") === -1 ? "?" : "&",
  2637. e += ""),
  2638. e
  2639. },
  2640. changeIfImageOptimzing: function(e) {
  2641. return s.imgopt && e.indexOf("imgopt=1") === -1 && (e += e.indexOf("?") === -1 ? "?" : "&",
  2642. e += ""),
  2643. e
  2644. },
  2645. tilegen: !1,
  2646. imgopt: !1
  2647. };
  2648. t.exports = s
  2649. }
  2650. ).call(this, "/js/ab.js")
  2651. }
  2652. , {
  2653. "./util/browser": 182,
  2654. "./util/logger": 189
  2655. }],
  2656. 4: [function(e, t, i) {
  2657. (function(i) {
  2658. "use strict";
  2659. function n() {
  2660. return {
  2661. addons: [{
  2662. name: "keen:ua_parser",
  2663. input: {
  2664. ua_string: "user_agent"
  2665. },
  2666. output: "parsed_user_agent"
  2667. }]
  2668. }
  2669. }
  2670. function r(e, t, i, n) {
  2671. function r(t) {
  2672. l[t.sid] = !0;
  2673. var i = t.billboard.media && t.billboard.media.type
  2674. , n = {
  2675. tag_id: t.sid,
  2676. tags_visited: Object.keys(l).length,
  2677. tag_count: Object.keys(e.tags).length,
  2678. tag_view_count: ++E,
  2679. has_media: !!i
  2680. };
  2681. i && (n.media_type = i),
  2682. u("tag_opened", n)
  2683. }
  2684. var l = {}
  2685. , h = Date.now() - N
  2686. , f = null;
  2687. n && (f = Date.now() - window.navigationStart);
  2688. var g;
  2689. try {
  2690. g = /* e.data.player_options.highlight_reel && */ e.heroLocations.length > 0
  2691. } catch (e) {
  2692. g = !1
  2693. }
  2694. var v, A = e.supportsVR;
  2695. A || (v = "VR disabled at the model/account level",
  2696. 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"))),
  2697. u("model_loaded", {
  2698. duration: h,
  2699. duration_from_navigation_start: f,
  2700. has_hlr: g,
  2701. has_vr: A,
  2702. vr_reason: v
  2703. });
  2704. var I = 0;
  2705. e.panos.forEach(function(e) {
  2706. e.on("enter", function() {
  2707. c("pano_viewed", {
  2708. pano_id: e.id,
  2709. pano_view_count: ++I,
  2710. alignment_type: e.alignmentType,
  2711. interaction_source: O,
  2712. navigation_source: p
  2713. })
  2714. })
  2715. });
  2716. var E = 0;
  2717. for (var T in e.tags)
  2718. e.tags[T].billboard.on(M.OPENED, r.bind(this, e.tags[T]));
  2719. t.on("tour_auto", function(e) {
  2720. p = "tour_" + e
  2721. }),
  2722. t.on("tour_manual", function(e) {
  2723. O = "gui-" + e,
  2724. p = "tour_manual"
  2725. }),
  2726. i.on(C.InteractionKey, function() {
  2727. t.mode === y.TRANSITIONING || t.flying || d(C.InteractionKey)
  2728. }),
  2729. i.on(C.InteractionDirect, function() {
  2730. t.mode === y.TRANSITIONING || t.flying || d(C.InteractionDirect)
  2731. }),
  2732. o(t),
  2733. a(),
  2734. s()
  2735. }
  2736. function o(e) {
  2737. I.on(T.OPENED, function() {
  2738. c("showcase_share_intent", {
  2739. pano_id: e.currentPano && e.currentPano.id
  2740. })
  2741. }),
  2742. I.on(T.LINK_CLICKED, function(t) {
  2743. c("showcase_share_action", {
  2744. channel: t.channel,
  2745. pano_id: e.currentPano && e.currentPano.id
  2746. })
  2747. }),
  2748. E.on(x.ORIGIN_LINK_CLICKED, function() {
  2749. c("showcase_share_origin_link_clicked")
  2750. })
  2751. }
  2752. function a() {}
  2753. function s() {
  2754. b.on(S.OPENED, c.bind(this, "showcase_gui", {
  2755. gui_action: "click_vr_button"
  2756. })),
  2757. b.on(S.LAUNCH, function(e) {
  2758. c("showcase_gui", {
  2759. gui_action: "launch_vr",
  2760. vr_platform: e.vr_platform,
  2761. vr_app: e.vr_app
  2762. })
  2763. }),
  2764. b.on(S.PREV, c.bind(this, "showcase_gui", {
  2765. gui_action: "vr_modal_prev"
  2766. })),
  2767. b.on(S.NEXT, function(e) {
  2768. c("showcase_gui", {
  2769. gui_action: e.nextAction
  2770. })
  2771. }),
  2772. b.on(S.CLOSED, c.bind(this, "showcase_gui", {
  2773. gui_action: "vr_modal_close"
  2774. })),
  2775. b.on(S.falseICECHOSEN, function(e) {
  2776. c("showcase_gui", {
  2777. gui_action: e.name + " "
  2778. })
  2779. }),
  2780. b.on(S.STORE, function(e) {
  2781. c("showcase_gui", {
  2782. gui_action: "launch_store",
  2783. store: e
  2784. })
  2785. })
  2786. }
  2787. function l(e, t) {
  2788. if (f)
  2789. try {
  2790. f.addEvent(e, v.extendObject({
  2791. host: window.location.host,
  2792. keen: n(),
  2793. user_agent: "${keen.user_agent}",
  2794. referrer: {
  2795. url: v.normalizeUrl(document.referrer),
  2796. domain: v.domainFromUrl(document.referrer),
  2797. url_original: document.referrer
  2798. },
  2799. embedded: m.inIframe(),
  2800. is_mobile: m.isMobile(),
  2801. version: "2.25.6-0-gd87e5b1"
  2802. }, t))
  2803. } catch (e) {
  2804. P.warn("analytics.report -> client.addEvent() error (is there blocking software installed?). Error message: " + e)
  2805. }
  2806. }
  2807. function c(e, t) {
  2808. if (t = t || {},
  2809. L)
  2810. try {
  2811. window.analytics.track(e, v.extendObject(t, B), {
  2812. context: {
  2813. app: {
  2814. name: "showcase",
  2815. version: "2.25.6-0-gd87e5b1"
  2816. },
  2817. screen: {
  2818. width: window.screen.width,
  2819. height: window.screen.height,
  2820. density: window.devicePixelRatio
  2821. }
  2822. }
  2823. })
  2824. } catch (t) {
  2825. console.warn("Failed to send data to segment for " + e)
  2826. }
  2827. }
  2828. function h(e, t) {
  2829. if (t = t || {},
  2830. navigator.sendBeacon && L)
  2831. try {
  2832. navigator.sendBeacon("https://api.segment.io/v1/t", JSON.stringify({
  2833. event: e,
  2834. anonymousId: window.analytics.user().anonymousId(),
  2835. properties: v.extendObject(t, B),
  2836. writeKey: L,
  2837. sentAt: Date.now(),
  2838. type: "track",
  2839. context: {
  2840. userAgent: m.userAgent(),
  2841. library: {
  2842. name: "showcase-beacon",
  2843. version: "2.25.6-0-gd87e5b1"
  2844. },
  2845. app: {
  2846. name: "showcase",
  2847. version: "2.25.6-0-gd87e5b1"
  2848. }
  2849. }
  2850. }))
  2851. } catch (e) {
  2852. console.warn("Failed to send async segment request")
  2853. }
  2854. }
  2855. function u(e, t) {
  2856. t = t || {},
  2857. c(e, t)
  2858. }
  2859. function d(e, t) {
  2860. O = e === C.InteractionGui ? "gui-" + t : e,
  2861. p = "self_guided"
  2862. }
  2863. var p, f, g = (e("three"),
  2864. e("./util/ajax"),
  2865. e("./ab")), m = e("./util/browser"), v = e("./util/common"), A = e("./settings"), y = (e("./localization/localize"),
  2866. 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"),
  2867. "direct"), L = null, D = !1, N = null, B = null, F = v.uuid4();
  2868. t.exports = {
  2869. report: function(e, t, i, n) {
  2870. l("Session starts", {
  2871. model: e,
  2872. status: t,
  2873. loadtime: Date.now() - (N || Date.now()),
  2874. loadtime_from_navigation_start: i ? Date.now() - window.navigationStart : null,
  2875. autoplay: i,
  2876. quickstart: n,
  2877. ab_tilegen: g.tilegen,
  2878. ab_imgopt: g.imgopt
  2879. })
  2880. },
  2881. impression: function(e) {
  2882. e = e || {};
  2883. var t = void 0 === e.isVisible || e.isVisible
  2884. , i = (void 0 !== e.immediate && e.immediate,
  2885. window.location.search.substr(1).split("&"));
  2886. u("impression", {
  2887. visible: t,
  2888. url_params: i
  2889. })
  2890. },
  2891. initKeen: function(e) {
  2892. return e.token && e.appId ? void (f = new Keen({
  2893. projectId: e.appId,
  2894. writeKey: e.token,
  2895. readKey: "",
  2896. requestType: "xhr"
  2897. })) : void P.warn("no keen token/appId")
  2898. },
  2899. initSegment: function(e) {
  2900. return e.token ? (L = e.token,
  2901. window.analytics.load(e.token),
  2902. B = {
  2903. model_id: e.model,
  2904. start_source: e.startSource,
  2905. autoplay: e.autoplay,
  2906. quickstart: e.quickstart,
  2907. language_tag: A.languageTag,
  2908. is_mobile: m.isMobile(),
  2909. iframe: m.inIframe(),
  2910. aspect_ratio: m.aspectRatio(),
  2911. session_id: F,
  2912. window: {
  2913. width: $("#player").width(),
  2914. height: $("#player").height()
  2915. },
  2916. platform: {
  2917. browser: {
  2918. name: $.ua.browser.name,
  2919. major: $.ua.browser.major,
  2920. version: $.ua.browser.version
  2921. },
  2922. os: {
  2923. name: $.ua.os.name,
  2924. version: $.ua.os.version
  2925. },
  2926. device: {
  2927. vendor: $.ua.device.vendor,
  2928. model: $.ua.device.model,
  2929. type: $.ua.device.type
  2930. }
  2931. }
  2932. },
  2933. D = Math.random() < A.analytics.sessionTrackingRate,
  2934. P.debug("tracking sample rate = " + A.analytics.sessionTrackingRate),
  2935. void P.debug("tracking this session = " + D)) : void P.warn("no segment token")
  2936. },
  2937. sessionStart: function(e) {
  2938. P.debug("analytics user_session_start"),
  2939. c("session_started"),
  2940. N = Date.now(),
  2941. window.addEventListener("unload", function() {
  2942. h("session_ended", {
  2943. duration: Date.now() - N
  2944. })
  2945. })
  2946. },
  2947. modelLoaded: function(e, t, i, n) {
  2948. r(e, t, i, n)
  2949. },
  2950. loadComplete: function(e) {
  2951. var t = {
  2952. time_to_app_start: e
  2953. };
  2954. c("load_times", t)
  2955. },
  2956. track: function(e, t) {
  2957. D && (P.debug('analytics.track("' + e + '", ' + JSON.stringify(t) + " )"),
  2958. c(e, t))
  2959. },
  2960. trackAlways: function(e, t) {
  2961. P.debug('analytics.trackAlways("' + e + '", ' + JSON.stringify(t) + " )"),
  2962. c(e, t)
  2963. },
  2964. getSessionId: function() {
  2965. return F
  2966. },
  2967. updateInteraction: d
  2968. }
  2969. }
  2970. ).call(this, "/js/analytics.js")
  2971. }
  2972. , {
  2973. "./ab": 3,
  2974. "./enum/ControlEvents": 21,
  2975. "./enum/PlayerEvents": 40,
  2976. "./enum/VROption": 47,
  2977. "./enum/VRPlatforms": 49,
  2978. "./enum/Viewmode": 51,
  2979. "./gui/sharing/ShareEvents": 76,
  2980. "./gui/sharing/modal": 77,
  2981. "./gui/title/TitleEvents": 80,
  2982. "./gui/title/titleBar": 82,
  2983. "./gui/vr/vrEvent": 85,
  2984. "./gui/vr/vrModal": 87,
  2985. "./localization/localize": 108,
  2986. "./tag/Billboard/BillboardEvent": 120,
  2987. "./settings": 166,
  2988. "./util/ajax": 181,
  2989. "./util/browser": 182,
  2990. "./util/common": 185,
  2991. "./util/logger": 189,
  2992. three: 217
  2993. }],
  2994. 5: [function(e, t, i) {
  2995. "use strict";
  2996. function n() {
  2997. r.PerspectiveCamera.call(this, a.clampVFOV(o.dollhouseFOV), $("#player").width() / $("#player").height(), o.dollhouseNear, o.dollhouseFar),
  2998. this.controls = null
  2999. }
  3000. var r = e("three")
  3001. , o = e("../constants")
  3002. , a = e("../util/cameraLight");
  3003. n.prototype = Object.create(r.PerspectiveCamera.prototype),
  3004. n.prototype.updateAspect = function(e) {
  3005. this.aspect = e,
  3006. this.updateProjectionMatrix()
  3007. }
  3008. ,
  3009. t.exports = n
  3010. }
  3011. , {
  3012. "../constants": 8,
  3013. "../util/cameraLight": 184,
  3014. three: 217
  3015. }],
  3016. 6: [function(e, t, i) {
  3017. "use strict";
  3018. function n() {
  3019. var e = $("#player").width() / $("#player").height();
  3020. r.OrthographicCamera.call(this, -o.orthoBase, o.orthoBase, o.orthoBase / e, -o.orthoBase / e, o.orthoNear, o.orthoFar),
  3021. this.controls = null,
  3022. this.updateAspect(e)
  3023. }
  3024. var r = e("three")
  3025. , o = e("../constants");
  3026. n.prototype = Object.create(r.OrthographicCamera.prototype),
  3027. n.prototype.updateAspect = function(e) {
  3028. this.aspect = e,
  3029. this.top = o.orthoBase / e,
  3030. this.bottom = -o.orthoBase / e,
  3031. this.updateProjectionMatrix()
  3032. }
  3033. ,
  3034. t.exports = n
  3035. }
  3036. , {
  3037. "../constants": 8,
  3038. three: 217
  3039. }],
  3040. 7: [function(e, t, i) {
  3041. "use strict";
  3042. function n() {
  3043. r.PerspectiveCamera.call(this, a.clampVFOV(o.insideFOV), $("#player").width() / $("#player").height(), o.insideNear, o.insideFar),
  3044. this.controls = null
  3045. }
  3046. var r = e("three")
  3047. , o = e("../settings")
  3048. , a = e("../util/cameraLight");
  3049. n.prototype = Object.create(r.PerspectiveCamera.prototype),
  3050. n.prototype.updateAspect = function(e) {
  3051. this.aspect = e,
  3052. this.updateProjectionMatrix()
  3053. }
  3054. ,
  3055. t.exports = n
  3056. }
  3057. , {
  3058. "../settings": 166,
  3059. "../util/cameraLight": 184,
  3060. three: 217
  3061. }],
  3062. 8: [function(e, t, i) {
  3063. "use strict";
  3064. t.exports = {
  3065. signedUrlDefaultExpireTime: 24e4,
  3066. signedUrlCheckInterval: 1e4,
  3067. signedUrlRefreshBuffer: 15e3,
  3068. dollhouseFOV: 70,
  3069. dollhouseNear: 1,
  3070. dollhouseFar: 5e3,
  3071. insideFOV: 70,
  3072. insideFOVMax: 120,
  3073. insideNear: .1,
  3074. insideFar: 5e3,
  3075. insideLookSpeed: .12,
  3076. insideLookLimitUp: 40,
  3077. insideLookLimitDown: -40,
  3078. orthoNear: 1,
  3079. orthoFar: 5e3,
  3080. orthoBase: 10,
  3081. narrowLandscapeHeight: 290,
  3082. reallyNarrowLandscapeHeight: 250,
  3083. visionTilingStartDate: new Date("8/26/2016"),
  3084. visionTilingStartVersion: "1.1.407.13667",
  3085. windowHeightHighQualityThreshold: 900,
  3086. tourStepDelayDefault: 3500,
  3087. tourStepDelaySlideShow: 5e3,
  3088. workshopApsect: 9 / 16,
  3089. highQualityMaxZoom: 2,
  3090. ultraHighQualityMaxZoom: 3
  3091. }
  3092. }
  3093. , {}],
  3094. 9: [function(e, t, i) {
  3095. "use strict";
  3096. function n() {
  3097. this.activeControl = null,
  3098. this.controls = {},
  3099. this.cameras = {}
  3100. }
  3101. var r = e("./PanoramaControls")
  3102. , o = e("./DollhouseControls")
  3103. , a = e("./FloorplanControls")
  3104. , s = e("../cameras/PanoramaCamera")
  3105. , l = e("../cameras/DollhouseCamera")
  3106. , c = e("../cameras/FloorplanCamera")
  3107. , h = e("events").EventEmitter
  3108. , u = e("../enum/ControlEvents")
  3109. , d = e("../enum/ModelManagerEvents")
  3110. , p = e("../enum/Viewmode")
  3111. , f = e("../settings");
  3112. n.prototype = Object.create(h.prototype),
  3113. n.prototype.init = function(e, t) {
  3114. this.setUpControls(),
  3115. this.bindEvents(e, t)
  3116. }
  3117. ,
  3118. n.prototype.activateControls = function(e) {
  3119. this.activeControl && (this.activeControl.reset(),
  3120. this.activeControl.enabled = !1),
  3121. this.controls[e] && (this.controls[e].enabled = !0),
  3122. this.activeControl = this.controls[e]
  3123. }
  3124. ,
  3125. n.prototype.setUpControls = function() {
  3126. var e = {}
  3127. , t = {}
  3128. , i = [p.PANORAMA, p.DOLLHOUSE, p.FLOORPLAN]
  3129. , n = [s, l, c]
  3130. , h = [r, o, a];
  3131. i.forEach(function(i, r) {
  3132. e[i] = new n[r],
  3133. t[i] = new h[r](e[i]),
  3134. t[i].on(u.Move, this.emit.bind(this, u.Move)),
  3135. t[i].on(u.InputStart, this.emit.bind(this, u.InputStart)),
  3136. t[i].on(u.InteractionDirect, this.emit.bind(this, u.InteractionDirect)),
  3137. t[i].on(u.InteractionKey, this.emit.bind(this, u.InteractionKey)),
  3138. t[i].on(u.Pinch, this.emit.bind(this, u.Pinch)),
  3139. t[i].on(u.Scroll, this.emit.bind(this, u.Scroll))
  3140. }
  3141. .bind(this)),
  3142. this.controls = t,
  3143. this.cameras = e
  3144. }
  3145. ,
  3146. n.prototype.bindEvents = function(e, t) {
  3147. e.addEventListener("mousemove", this.onMouseMove.bind(this)),
  3148. e.addEventListener("mousedown", this.onMouseDown.bind(this)),
  3149. e.addEventListener("mouseup", this.onMouseUp.bind(this)),
  3150. e.addEventListener("mouseover", this.onMouseOver.bind(this)),
  3151. f.useWheel && (e.addEventListener("mousewheel", this.onMouseWheel.bind(this),{ passive: false }),
  3152. e.addEventListener("DOMMouseScroll", this.onMouseWheel.bind(this))),
  3153. e.addEventListener("touchstart", this.onTouchStart.bind(this)),
  3154. e.addEventListener("touchmove", this.onTouchMove.bind(this)),
  3155. e.addEventListener("touchend", this.onTouchEnd.bind(this)),
  3156. e.addEventListener("contextmenu", function(e) {
  3157. e.preventDefault()
  3158. }),
  3159. e.addEventListener("pointerdown", this.onPointerDown.bind(this)),
  3160. e.addEventListener("pointermove", this.onPointerMove.bind(this)),
  3161. e.addEventListener("pointerup", this.onPointerUp.bind(this)),
  3162. e.addEventListener("pointerout", this.onPointerCancel.bind(this)),
  3163. e.addEventListener("pointercancel", this.onPointerCancel.bind(this)),
  3164. document.addEventListener("keydown", this.onKeyDown.bind(this)),
  3165. document.addEventListener("keyup", this.onKeyUp.bind(this)),
  3166. t.on(d.ActiveModelChanged, function(e) {
  3167. this.setModelForControls(e.model)
  3168. }
  3169. .bind(this))
  3170. }
  3171. ,
  3172. n.prototype.setModelForControls = function(e) {
  3173. this.controls[p.DOLLHOUSE].setZoomBounds(e.boundingBox);
  3174. var t = e.boundingBox.clone().expandByScalar(f.modelBoundsPadding);
  3175. [p.DOLLHOUSE, p.FLOORPLAN].forEach(function(e) {
  3176. this.controls[e].setBounds(t)
  3177. }
  3178. .bind(this))
  3179. }
  3180. ,
  3181. n.prototype.onMouseDown = function(e) {
  3182. e.preventDefault(),
  3183. this.activeControl && this.activeControl.onMouseDown(e)
  3184. }
  3185. ,
  3186. n.prototype.onMouseMove = function(e) {
  3187. e.preventDefault(),
  3188. this.activeControl && this.activeControl.onMouseMove(e)
  3189. }
  3190. ,
  3191. n.prototype.onMouseUp = function(e) {
  3192. e.preventDefault(),
  3193. this.activeControl && this.activeControl.onMouseUp(e)
  3194. }
  3195. ,
  3196. n.prototype.onMouseOver = function(e) {
  3197. e.preventDefault(),
  3198. this.activeControl && this.activeControl.onMouseOver(e)
  3199. }
  3200. ,
  3201. n.prototype.onMouseWheel = function(e) {
  3202. e.preventDefault(),
  3203. this.activeControl && this.activeControl.onMouseWheel(e)
  3204. }
  3205. ,
  3206. n.prototype.onTouchStart = function(e) {
  3207. e.preventDefault(),
  3208. this.activeControl && this.activeControl.onTouchStart(e);
  3209. var hotList = $('#hotListWrap')[0];
  3210. hotList.classList.remove('hotListActive');
  3211. $('#hotListContent ul .active').removeClass('active');
  3212. if($('#hotList')&&$('#hotList')[0]) $('#hotList')[0].classList.remove('active')
  3213. }
  3214. ,
  3215. n.prototype.onTouchMove = function(e) {
  3216. e.preventDefault(),
  3217. this.activeControl && this.activeControl.onTouchMove(e)
  3218. }
  3219. ,
  3220. n.prototype.onTouchEnd = function(e) {
  3221. e.preventDefault(),
  3222. this.activeControl && this.activeControl.onTouchEnd(e)
  3223. }
  3224. ,
  3225. n.prototype.onPointerDown = function(e) {
  3226. if (e.preventDefault(),
  3227. this.activeControl)
  3228. switch (e.pointerType) {
  3229. case "mouse":
  3230. this.activeControl.onMouseDown(e);
  3231. break;
  3232. default:
  3233. this.activeControl.onPointerDown(e)
  3234. }
  3235. }
  3236. ,
  3237. n.prototype.onPointerMove = function(e) {
  3238. if (e.preventDefault(),
  3239. this.activeControl)
  3240. switch (e.pointerType) {
  3241. case "mouse":
  3242. this.activeControl.onMouseMove(e);
  3243. break;
  3244. default:
  3245. this.activeControl.onPointerMove(e)
  3246. }
  3247. }
  3248. ,
  3249. n.prototype.onPointerUp = function(e) {
  3250. if (e.preventDefault(),
  3251. this.activeControl)
  3252. switch (e.pointerType) {
  3253. case "mouse":
  3254. this.activeControl.onMouseUp(e);
  3255. break;
  3256. default:
  3257. this.activeControl.onPointerUp(e)
  3258. }
  3259. }
  3260. ,
  3261. n.prototype.onPointerCancel = function(e) {
  3262. e.preventDefault(),
  3263. this.activeControl && "mouse" !== e.pointerType && this.activeControl.onPointerUp(e)
  3264. }
  3265. ,
  3266. n.prototype.onKeyDown = function(e) {
  3267. e.metaKey || e.ctrlKey || (e.preventDefault(),
  3268. this.activeControl && this.activeControl.onKeyDown(e))
  3269. }
  3270. ,
  3271. n.prototype.onKeyUp = function(e) {
  3272. e.preventDefault(),
  3273. this.activeControl && this.activeControl.onKeyUp(e)
  3274. }
  3275. ,
  3276. t.exports = n
  3277. }
  3278. , {
  3279. "../cameras/DollhouseCamera": 5,
  3280. "../cameras/FloorplanCamera": 6,
  3281. "../cameras/PanoramaCamera": 7,
  3282. "../enum/ControlEvents": 21,
  3283. "../enum/ModelManagerEvents": 33,
  3284. "../enum/Viewmode": 51,
  3285. "../settings": 166,
  3286. "./DollhouseControls": 10,
  3287. "./FloorplanControls": 11,
  3288. "./PanoramaControls": 13,
  3289. events: 202
  3290. }],
  3291. 10: [function(e, t, i) {
  3292. "use strict";
  3293. function n(e) {
  3294. a.call(this, e),
  3295. this.minPolarAngle = o.dollhouseDefault.minPolarAngle,
  3296. this.maxPolarAngle = o.dollhouseDefault.maxPolarAngle,
  3297. this.minDistance = o.dollhouseDefault.minDistance,
  3298. this.maxDistance = o.dollhouseDefault.maxDistance,
  3299. this.adjustedMinDistance = this.minDistance,
  3300. this.adjustedMaxDistance = this.maxDistance
  3301. }
  3302. var r = e("three")
  3303. , o = e("../settings")
  3304. , a = e("./OutsideControls");
  3305. n.prototype = Object.create(a.prototype),
  3306. n.prototype.pan = function(e, t) {
  3307. this.camera.updateMatrix();
  3308. var i = this.camera.position.clone().sub(this.target).length();
  3309. i *= Math.tan(this.camera.fov / 2 * Math.PI / 180),
  3310. this.panLeft(2 * e * i / $("#player").height()),
  3311. this.panUp(-2 * t * i / $("#player").height())
  3312. }
  3313. ,
  3314. n.prototype.updateZoom = function() {
  3315. var e = this.offset.length();
  3316. return e * this.scale
  3317. }
  3318. ,
  3319. n.prototype.setZoomBounds = function(e) {
  3320. var t = e.min.distanceTo(e.max);
  3321. this.adjustedMinDistance = Math.max(Math.min(t / 2, o.dollhouseDefault.minDistance), 0),
  3322. this.adjustedMaxDistance = Math.min(Math.max(t, o.dollhouseDefault.maxDistance), o.skyboxRadius),
  3323. this.minDistance = this.adjustedMinDistance,
  3324. this.maxDistance = this.adjustedMaxDistance
  3325. }
  3326. ,
  3327. n.prototype.resetRanges = function(e, t) {
  3328. e ? (this.minDistance = Math.min(e, this.minDistance),
  3329. this.maxDistance = Math.max(e, this.maxDistance)) : (this.minDistance = this.adjustedMinDistance,
  3330. this.maxDistance = this.adjustedMaxDistance),
  3331. t ? (this.minPolarAngle = r.Math.degToRad(-15),
  3332. this.maxPolarAngle = r.Math.degToRad(89.9)) : (this.minPolarAngle = o.dollhouseDefault.minPolarAngle,
  3333. this.maxPolarAngle = o.dollhouseDefault.maxPolarAngle)
  3334. }
  3335. ,
  3336. n.prototype.toJSON = function() {
  3337. return a.prototype.toJSON.call(this)
  3338. }
  3339. ,
  3340. t.exports = n
  3341. }
  3342. , {
  3343. "../settings": 166,
  3344. "./OutsideControls": 12,
  3345. three: 217
  3346. }],
  3347. 11: [function(e, t, i) {
  3348. "use strict";
  3349. function n(e) {
  3350. a.call(this, e),
  3351. this.minDistance = 15,
  3352. this.maxDistance = 50,
  3353. this.noRotateUpDown = !0,
  3354. this.minPolarAngle = 0,
  3355. this.maxPolarAngle = 0,
  3356. this.mouseActions[l.LEFT] = s.PAN,
  3357. this.mouseActions[l.MIDDLE] = s.DOLLY,
  3358. this.mouseActions[l.RIGHT] = s.ROTATE,
  3359. this.touchActions[1] = s.PAN,
  3360. this.touchActions[2] = s.ROTATE_DOLLY,
  3361. this.absoluteScale = 1,
  3362. this.currentScale = 1
  3363. }
  3364. var r = e("three")
  3365. , o = e("../settings")
  3366. , a = e("./OutsideControls")
  3367. , s = e("../enum/ControlActions")
  3368. , l = e("../enum/MouseButton")
  3369. , c = e("../util/math")
  3370. , h = e("../util/browser");
  3371. n.prototype = Object.create(a.prototype),
  3372. n.prototype.zoomToContain = function(e) {
  3373. this.absoluteScale = this.getDefaultAbsoluteScale(e);
  3374. this.currentScale = this.absoluteScale
  3375. }
  3376. ,
  3377. n.prototype.getDefaultAbsoluteScale = function(modelSize) {
  3378. var t = Math.max(modelSize.x, modelSize.z)
  3379. , i = Math.min(modelSize.x, modelSize.z)
  3380. , n = Math.max(t, i * this.camera.aspect)
  3381. , r = Math.max(i, t * this.camera.aspect);
  3382. var absoluteScale = (h.aspectRatio() < 1 ? r : n) / 2 / o.orthoBase * 1.2
  3383. return absoluteScale
  3384. },
  3385. n.prototype.rotateToView = function(modelSize, direction) {
  3386. let i = 0, n = h.aspectRatio() < 1 //是否模型尺寸显“细长”
  3387. if(_settings.floorPlanAngle ){//规定了cadImage旋转值的话 (0是无效的,将不设置)
  3388. i = parseFloat(_settings.floorPlanAngle)
  3389. }else{
  3390. let r = modelSize.x < modelSize.z; //是否视口为“窄屏”
  3391. if(n === r) //“细长” 且 “窄屏”,说明模型尺寸比例与视口比例匹配,相机坐标只需要调转“前”“后”
  3392. {
  3393. if(direction.z > 0) //(第一种情况)相机是否位于背面。 注:在默认情况下webgl的相机朝向-z, direction.z > 0 说明相机视野已经偏向+z,说明相机位于模型“背面”
  3394. {
  3395. i = Math.PI; //经度上做180度轨道角位移,使相机移到静止模型的“前面”
  3396. }
  3397. //(第二种情况) 不做处理
  3398. }
  3399. else if(direction.x > 0)
  3400. {
  3401. i = Math.PI / 2;
  3402. }
  3403. else
  3404. {
  3405. i = -Math.PI / 2;
  3406. }
  3407. }
  3408. this.rotateLeft(i);
  3409. this.update(0);
  3410. }
  3411. ,
  3412. n.prototype.rotateToAngle = function(angle){//add 旋转到特定角度
  3413. this.rotateLeft(angle + this.lon);
  3414. this.update(0);
  3415. }
  3416. ,
  3417. n.prototype.pan = function(e, t) {
  3418. this.camera.updateMatrix(),
  3419. this.panLeft(e * (this.camera.right - this.camera.left) / $("#player").width()),
  3420. this.panUp(-t * (this.camera.top - this.camera.bottom) / $("#player").height())
  3421. }
  3422. ,
  3423. n.prototype.updateZoom = function() {
  3424. return this.absoluteScale *= this.scale - .03 * this.keyboardZoomSpeed,
  3425. this.absoluteScale = Math.max(o.zoomNearLimit, Math.min(this.absoluteScale, o.zoomFarLimit)),
  3426. this.currentScale = .8 * this.currentScale + .2 * this.absoluteScale,
  3427. this.camera.left = -o.orthoBase * this.currentScale,
  3428. this.camera.right = o.orthoBase * this.currentScale,
  3429. this.camera.top = o.orthoBase * this.currentScale / this.camera.aspect,
  3430. this.camera.bottom = -o.orthoBase * this.currentScale / this.camera.aspect,
  3431. this.camera.updateProjectionMatrix(),
  3432. this.offset.length()
  3433. }
  3434. ,
  3435. n.prototype.toJSON = function() {
  3436. var e = new r.Quaternion
  3437. , t = (new r.Quaternion).setFromAxisAngle(new r.Vector3(0,1,0), r.Math.degToRad(90))
  3438. , i = new r.Quaternion;
  3439. return function() {
  3440. var n = a.prototype.toJSON.call(this);
  3441. return e.copy(n.camera_quaternion),
  3442. i.copy(t),
  3443. i.multiply(e),
  3444. n.camera_quaternion.x = c.toPrecision(i.x, 4),
  3445. n.camera_quaternion.y = c.toPrecision(i.y, 4),
  3446. n.camera_quaternion.z = c.toPrecision(i.z, 4),
  3447. n.camera_quaternion.w = c.toPrecision(i.w, 4),
  3448. n.ortho_zoom = c.toPrecision(this.currentScale * this.camera.aspect, 4),
  3449. n
  3450. }
  3451. }(),
  3452. t.exports = n
  3453. }
  3454. , {
  3455. "../enum/ControlActions": 20,
  3456. "../enum/MouseButton": 34,
  3457. "../settings": 166,
  3458. "../util/browser": 182,
  3459. "../util/math": 190,
  3460. "./OutsideControls": 12,
  3461. three: 217
  3462. }],
  3463. 12: [function(e, t, i) {
  3464. "use strict";
  3465. function n(e) {
  3466. this.camera = e,
  3467. this.camera.controls = this,
  3468. this.enabled = !1,
  3469. this.target = new r.Vector3,
  3470. this.targetBounds = new r.Box3,
  3471. this.zoomSpeed = 1,
  3472. this.minDistance = 0,
  3473. this.maxDistance = 1 / 0,
  3474. this.noRotateUpDown = !1,
  3475. this.rotateSpeed = 1,
  3476. this.keyboardZoomSpeed = 0,
  3477. this.keyPanSpeed = 7,
  3478. this.autoRotate = !1,
  3479. this.autoRotateSpeed = 2,
  3480. this.autoPan = !1,
  3481. this.autoPanPosition = new r.Vector3,
  3482. this.minPolarAngle = r.Math.degToRad(25),
  3483. this.maxPolarAngle = r.Math.degToRad(65),
  3484. this.rotationAcceleration = new r.Vector2,
  3485. this.rotationSpeed = new r.Vector2,
  3486. this.panAcceleration = new r.Vector2,
  3487. this.panSpeed = new r.Vector2,
  3488. this.rotateStart = new r.Vector2,
  3489. this.rotateEnd = new r.Vector2,
  3490. this.rotateDelta = new r.Vector2,
  3491. this.panStart = new r.Vector2,
  3492. this.panEnd = new r.Vector2,
  3493. this.panDelta = new r.Vector2,
  3494. this.panOffset = new r.Vector3,
  3495. this.offset = new r.Vector3,
  3496. this.dollyStart = new r.Vector2,
  3497. this.dollyEnd = new r.Vector2,
  3498. this.dollyDelta = new r.Vector2,
  3499. this.phiDelta = 0,
  3500. this.thetaDelta = 0,
  3501. this.scale = 1,
  3502. this.panVector = new r.Vector3,
  3503. this.lastPosition = new r.Vector3,
  3504. this.state = c.NONE,
  3505. this.mouseActions = {},
  3506. this.mouseActions[h.LEFT] = c.ROTATE,
  3507. this.mouseActions[h.MIDDLE] = c.DOLLY,
  3508. this.mouseActions[h.RIGHT] = c.PAN,
  3509. this.touchActions = {},
  3510. this.touchActions[1] = c.ROTATE,
  3511. this.touchActions[2] = c.PAN_DOLLY,
  3512. this.lastMoveTime = 0,
  3513. this.pointersLimit = 2,
  3514. this.pointers = []
  3515. }
  3516. var r = e("three")
  3517. , o = e("../settings")
  3518. , a = e("../util/common")
  3519. , s = e("../util/math")
  3520. , l = e("../enum/Vectors")
  3521. , c = e("../enum/ControlActions")
  3522. , h = e("../enum/MouseButton")
  3523. , u = e("../enum/Keys")
  3524. , d = e("../enum/ControlEvents")
  3525. , p = e("events").EventEmitter
  3526. , f = 1e-6;
  3527. n.prototype = Object.create(p.prototype),
  3528. n.prototype.setBounds = function(e) {
  3529. this.targetBounds = e
  3530. }
  3531. ,
  3532. n.prototype.isEngaged = function() {
  3533. return this.state !== c.NONE
  3534. }
  3535. ,
  3536. n.prototype.rotateLeft = function(e) {
  3537. void 0 === e && (e = this.getAutoRotationAngle()),
  3538. this.thetaDelta -= e
  3539. }
  3540. ,
  3541. n.prototype.rotateUp = function(e) {
  3542. this.noRotateUpDown || (void 0 === e && (e = this.getAutoRotationAngle()),
  3543. this.phiDelta -= e)
  3544. }
  3545. ,
  3546. n.prototype.panLeft = function(e) {
  3547. var t = this.camera.matrix.elements;
  3548. this.panOffset.set(t[0], 0, t[2]).normalize(),
  3549. this.panOffset.multiplyScalar(-e),
  3550. this.panVector.add(this.panOffset)
  3551. }
  3552. ,
  3553. n.prototype.panUp = function(e) {
  3554. var t = this.camera.matrix.elements;
  3555. this.panOffset.set(t[4], 0, t[6]).normalize(),
  3556. this.panOffset.multiplyScalar(-e),
  3557. this.panVector.add(this.panOffset)
  3558. }
  3559. ,
  3560. n.prototype.startRotating = function(e, t) {
  3561. e && this.navRotationAcc("x", e),
  3562. t && this.navRotationAcc("y", t)
  3563. }
  3564. ,
  3565. n.prototype.stopRotating = function(e) {
  3566. e && (this.rotationSpeed.x = this.rotationSpeed.y = 0),
  3567. this.navRotationAcc("x", 0),
  3568. this.navRotationAcc("y", 0)
  3569. }
  3570. ,
  3571. n.prototype.setAutoPanPosition = function(e, t) {
  3572. var i = new r.Vector3
  3573. , n = new r.Vector3;
  3574. return function(e, t) {
  3575. i.copy(this.camera.position),
  3576. void 0 === e && null === e || i.setX(e),
  3577. void 0 === t && null === t || i.setZ(t);
  3578. var r = this.camera.position.distanceTo(this.target)
  3579. , o = l.FORWARD.clone().applyQuaternion(this.camera.quaternion);
  3580. this.targetClamped = !1,
  3581. n.copy(i).addScaledVector(o, r),
  3582. this.targetBounds.containsPoint(n) || (this.targetBounds.clampPoint(n, n),
  3583. i.copy(n).addScaledVector(o, -r),
  3584. this.targetClamped = !0),
  3585. this.autoPanPosition.x = i.x,
  3586. this.autoPanPosition.z = i.z,
  3587. this.autoPan && this.stopAutoPanning()
  3588. }
  3589. }(),
  3590. n.prototype.stopAutoPanning = function() {
  3591. var e = this.autoPan;
  3592. this.autoPan = !1,
  3593. this.emit(this.targetClamped ? d.AutoPanClamped : e ? d.AutoPanInterrupt : d.AutoPanComplete)
  3594. }
  3595. ,
  3596. n.prototype.dollyIn = function(e) {
  3597. void 0 === e && (e = this.getZoomScale()),
  3598. this.scale /= e
  3599. }
  3600. ,
  3601. n.prototype.dollyOut = function(e) {
  3602. void 0 === e && (e = this.getZoomScale()),
  3603. this.scale *= e
  3604. }
  3605. ,
  3606. n.prototype.updatePan = function(e) {
  3607. if (this.panSpeed.multiplyScalar(1 - o.panFriction).addScaledVector(this.panAcceleration, o.panAccelerationOutside * e),
  3608. this.pan(-this.panSpeed.x, this.panSpeed.y),
  3609. this.autoPan) {
  3610. var t = (new r.Vector3).copy(this.autoPanPosition).sub(this.camera.position);
  3611. t.setY(0).clampLength(0, 50 * e),
  3612. this.target.add(t),
  3613. this.camera.position.add(t),
  3614. this.autoPanPosition.x === this.camera.position.x && this.autoPanPosition.z === this.camera.position.z && (this.autoPan = !1,
  3615. this.stopAutoPanning())
  3616. }
  3617. }
  3618. ,
  3619. n.prototype.update = function(e) {
  3620. e || (e = 1 / 60)
  3621. var friction = Math.min(1, o.rotationFriction * e * 60) //add 如果deltaTime > 1/ 60 (比较卡),就增加rotationFriction, 以防止转动过久
  3622. this.rotationSpeed.multiplyScalar(1 - friction).addScaledVector(this.rotationAcceleration, o.rotationAccelerationOutside * e),
  3623. this.rotateLeft(-this.rotationSpeed.x),
  3624. this.noRotateUpDown || this.rotateUp(this.rotationSpeed.y),
  3625. this.updatePan(e);
  3626. var t = this.camera.position;
  3627. this.offset.copy(t).sub(this.target);
  3628. var i = Math.atan2(this.offset.x, this.offset.z)
  3629. , n = Math.atan2(Math.sqrt(this.offset.x * this.offset.x + this.offset.z * this.offset.z), this.offset.y);
  3630. this.autoRotate && this.rotateLeft(this.getAutoRotationAngle()),
  3631. i += this.thetaDelta,
  3632. n += this.phiDelta,
  3633. n = Math.max(this.minPolarAngle, Math.min(this.maxPolarAngle, n)),
  3634. n = Math.max(f, Math.min(Math.PI - f, n));
  3635. var r = this.updateZoom();
  3636. r = Math.max(this.minDistance, Math.min(this.maxDistance, r)),
  3637. this.target.add(this.panVector),
  3638. this.targetBounds.clampPoint(this.target, this.target),
  3639. this.offset.x = r * Math.sin(n) * Math.sin(i),
  3640. this.offset.y = r * Math.cos(n),
  3641. this.offset.z = r * Math.sin(n) * Math.cos(i),
  3642. t.copy(this.target).add(this.offset),
  3643. this.camera.lookAt(this.target),
  3644. this.thetaDelta = 0,
  3645. this.phiDelta = 0,
  3646. this.scale = 1,
  3647. this.panVector.set(0, 0, 0),
  3648. this.lastPosition.distanceTo(this.camera.position) > 0 && this.lastPosition.copy(this.camera.position)
  3649. }
  3650. ,
  3651. n.prototype.getAutoRotationAngle = function() {
  3652. return 2 * Math.PI / 60 / 60 * this.autoRotateSpeed
  3653. }
  3654. ,
  3655. n.prototype.getZoomScale = function() {
  3656. return Math.pow(.95, this.zoomSpeed)
  3657. }
  3658. ,
  3659. n.prototype.onMouseDown = function(e) {
  3660. if (this.enabled) {
  3661. switch (e.preventDefault(),
  3662. this.stopAutoPanning(),
  3663. this.mouseDown = !0,
  3664. this.state = this.mouseActions[e.button],
  3665. this.state) {
  3666. case c.ROTATE:
  3667. this.rotateStart.set(e.clientX, this.noRotateUpDown ? 0 : e.clientY),
  3668. this.rotationSpeed.set(0, 0);
  3669. break;
  3670. case c.DOLLY:
  3671. this.dollyStart.set(e.clientX, e.clientY);
  3672. break;
  3673. case c.PAN:
  3674. this.panStart.set(e.clientX, e.clientY)
  3675. }
  3676. this.emit(d.InputStart, "mouse")
  3677. }
  3678. }
  3679. ,
  3680. n.prototype.onMouseMove = function(e) {
  3681. if (this.enabled && this.mouseDown && 0 !== e.buttons) {
  3682. switch (e.preventDefault(),
  3683. this.state) {
  3684. case c.ROTATE:
  3685. this.rotateEnd.set(e.clientX, this.noRotateUpDown ? 0 : e.clientY),
  3686. this.rotateDelta.subVectors(this.rotateEnd, this.rotateStart),
  3687. this.rotateLeft(2 * Math.PI * this.rotateDelta.x / $("#player").width() * this.rotateSpeed),
  3688. this.rotateUp(2 * Math.PI * this.rotateDelta.y / $("#player").height() * this.rotateSpeed),
  3689. this.rotateStart.copy(this.rotateEnd);
  3690. break;
  3691. case c.DOLLY:
  3692. this.dollyEnd.set(e.clientX, e.clientY),
  3693. this.dollyDelta.subVectors(this.dollyEnd, this.dollyStart);
  3694. var t = this.dollyDelta.y > 0 ? this.dollyIn : this.dollyOut;
  3695. t.call(this),
  3696. this.dollyStart.copy(this.dollyEnd);
  3697. break;
  3698. case c.PAN:
  3699. this.panEnd.set(e.clientX, e.clientY),
  3700. this.panDelta.subVectors(this.panEnd, this.panStart),
  3701. this.pan(this.panDelta.x, this.panDelta.y),
  3702. this.panStart.copy(this.panEnd)
  3703. }
  3704. this.emit(d.Move, "mouse"),
  3705. this.lastMoveTime = e.timeStamp,
  3706. this.update()
  3707. }
  3708. }
  3709. ,
  3710. n.prototype.onMouseUp = function(e) {
  3711. this.enabled && (this.mouseDown = !1,
  3712. this.state = c.NONE,
  3713. "mouseover" !== e.type && (e.timeStamp > this.lastMoveTime + 100 ? (this.rotationSpeed.set(0, 0),
  3714. this.rotationAcceleration.set(0, 0)) : this.rotationAcceleration.set(-this.rotateDelta.x, this.rotateDelta.y),
  3715. this.update(),
  3716. this.rotationAcceleration.set(0, 0),
  3717. this.rotateDelta.set(0, 0)))
  3718. }
  3719. ,
  3720. n.prototype.onMouseOver = function(e) {
  3721. 0 !== e.which && 0 !== e.buttons || this.onMouseUp(e)
  3722. }
  3723. ,
  3724. n.prototype.onMouseWheel = function(e) {
  3725. if (this.enabled && o.useWheel) {
  3726. this.emit(d.Move, "wheel");
  3727. var t = e.wheelDelta || -e.detail
  3728. , i = t > 0 ? this.dollyOut : this.dollyIn;
  3729. i.call(this),
  3730. this.update()
  3731. }
  3732. }
  3733. ,
  3734. n.prototype.onKeyDown = function(e) {
  3735. this.enabled && (e.metaKey || e.ctrlKey || (e.preventDefault(),
  3736. this.handleKeyDown(e.which)))
  3737. }
  3738. ,
  3739. n.prototype.navRotationAcc = function(e, t) {
  3740. "y" === e ? this.noRotateUpDown ? this.keyboardZoomSpeed = t : this.rotationAcceleration.y = t : this.rotationAcceleration.x = t
  3741. }
  3742. ,
  3743. n.prototype.navPanAcc = function(e, t) {
  3744. this.stopAutoPanning(),
  3745. this.panAcceleration[e] = t
  3746. }
  3747. ,
  3748. n.prototype.handleKeyDown = function(e) {
  3749. var t = !0;
  3750. switch (e) {
  3751. case u.UPARROW:
  3752. case u.I:
  3753. this.navRotationAcc("y", 1);
  3754. break;
  3755. case u.DOWNARROW:
  3756. case u.K:
  3757. this.navRotationAcc("y", -1);
  3758. break;
  3759. case u.LEFTARROW:
  3760. case u.J:
  3761. this.navRotationAcc("x", -1);
  3762. break;
  3763. case u.RIGHTARROW:
  3764. case u.L:
  3765. this.navRotationAcc("x", 1);
  3766. break;
  3767. case u.W:
  3768. this.navPanAcc("y", 1);
  3769. break;
  3770. case u.S:
  3771. this.navPanAcc("y", -1);
  3772. break;
  3773. case u.A:
  3774. this.navPanAcc("x", -1);
  3775. break;
  3776. case u.D:
  3777. this.navPanAcc("x", 1);
  3778. break;
  3779. default:
  3780. t = !1
  3781. }
  3782. t && this.emit(d.Move, "key")
  3783. }
  3784. ,
  3785. n.prototype.onKeyUp = function(e) {
  3786. this.enabled && (e.preventDefault(),
  3787. e.stopPropagation(),
  3788. this.handleKeyUp(e.which))
  3789. }
  3790. ,
  3791. n.prototype.handleKeyUp = function(e) {
  3792. switch (e) {
  3793. case u.I:
  3794. case u.K:
  3795. case u.UPARROW:
  3796. case u.DOWNARROW:
  3797. this.keyboardZoomSpeed = 0,
  3798. this.rotationAcceleration.y = 0;
  3799. break;
  3800. case u.J:
  3801. case u.L:
  3802. case u.LEFTARROW:
  3803. case u.RIGHTARROW:
  3804. this.rotationAcceleration.x = 0;
  3805. break;
  3806. case u.S:
  3807. case u.W:
  3808. this.panAcceleration.y = 0;
  3809. break;
  3810. case u.A:
  3811. case u.D:
  3812. this.panAcceleration.x = 0
  3813. }
  3814. }
  3815. ,
  3816. n.prototype.onTouchStart = function(e) {
  3817. if (this.enabled || this.state === c.NONE) {
  3818. e.preventDefault(),
  3819. e.stopPropagation(),
  3820. this.stopAutoPanning();
  3821. var t = function() {
  3822. if (2 === e.touches.length) {
  3823. var t = e.touches[0].pageX - e.touches[1].pageX
  3824. , i = e.touches[0].pageY - e.touches[1].pageY;
  3825. this.dollyStart.set(t, i)
  3826. }
  3827. }
  3828. .bind(this)
  3829. , i = function() {
  3830. this.panStart.set(a.average(e.touches, "pageX"), a.average(e.touches, "pageY"))
  3831. }
  3832. .bind(this)
  3833. , n = function() {
  3834. this.rotateStart.set(a.average(e.touches, "pageX"), a.average(e.touches, "pageY"))
  3835. }
  3836. .bind(this);
  3837. switch (this.state = this.touchActions[e.touches.length],
  3838. this.state) {
  3839. case c.PAN_DOLLY:
  3840. t();
  3841. case c.PAN:
  3842. i();
  3843. break;
  3844. case c.ROTATE_DOLLY:
  3845. t();
  3846. case c.ROTATE:
  3847. n()
  3848. }
  3849. this.rotationSpeed.set(0, 0),
  3850. this.emit(d.InputStart, "touch")
  3851. }
  3852. }
  3853. ,
  3854. n.prototype.onTouchMove = function(e) {
  3855. if (this.enabled && this.state !== c.NONE) {
  3856. e.preventDefault(),
  3857. e.stopPropagation();
  3858. var t = function() {
  3859. var t = e.touches[0].pageX - e.touches[1].pageX
  3860. , i = e.touches[0].pageY - e.touches[1].pageY;
  3861. this.dollyEnd.set(t, i);
  3862. var n = this.dollyStart.length() - this.dollyEnd.length();
  3863. n > 0 ? this.dollyOut(1 + n / 500) : this.dollyIn(1 - n / 500),
  3864. this.dollyStart.copy(this.dollyEnd)
  3865. }
  3866. .bind(this)
  3867. , i = function() {
  3868. this.panEnd.set(a.average(e.touches, "pageX"), a.average(e.touches, "pageY")),
  3869. this.panDelta.subVectors(this.panEnd, this.panStart),
  3870. this.pan(this.panDelta.x, this.panDelta.y),
  3871. this.panStart.copy(this.panEnd),
  3872. this.rotateDelta.set(0, 0)
  3873. }
  3874. .bind(this)
  3875. , n = function() {
  3876. this.rotateEnd.set(a.average(e.touches, "pageX"), a.average(e.touches, "pageY")),
  3877. this.rotateDelta.subVectors(this.rotateEnd, this.rotateStart),
  3878. this.rotateLeft(2 * Math.PI * this.rotateDelta.x / $("#player").width() * this.rotateSpeed),
  3879. this.rotateUp(2 * Math.PI * this.rotateDelta.y / $("#player").height() * this.rotateSpeed),
  3880. this.rotateStart.copy(this.rotateEnd)
  3881. }
  3882. .bind(this)
  3883. , r = function() {
  3884. if (2 === e.touches.length) {
  3885. var i = window.devicePixelRatio || 1
  3886. , r = e.touches[1].pageX - e.touches[0].pageX
  3887. , s = e.touches[1].pageY - e.touches[0].pageY
  3888. , l = Math.sqrt(r * r + s * s)
  3889. , h = Math.abs(this.dollyStart.length() - l);
  3890. if (h > o.input.touchMoveThreshold * i)
  3891. this.state = c.DOLLY,
  3892. t();
  3893. else {
  3894. var u = a.average(e.touches, "pageX")
  3895. , d = a.average(e.touches, "pageY")
  3896. , p = this.rotateDelta.set(u, d).sub(this.rotateStart).length();
  3897. p > o.input.touchMoveThreshold && (this.state = c.ROTATE,
  3898. this.rotateStart.set(u, d),
  3899. n())
  3900. }
  3901. }
  3902. }
  3903. .bind(this);
  3904. switch (this.state) {
  3905. case c.PAN_DOLLY:
  3906. t();
  3907. case c.PAN:
  3908. i();
  3909. break;
  3910. case c.ROTATE_DOLLY:
  3911. r();
  3912. break;
  3913. case c.DOLLY:
  3914. t();
  3915. break;
  3916. case c.ROTATE:
  3917. n();
  3918. break;
  3919. default:
  3920. this.state = c.NONE
  3921. }
  3922. this.lastMoveTime = e.timeStamp,
  3923. this.emit(d.Move, "touch")
  3924. }
  3925. }
  3926. ,
  3927. n.prototype.onTouchEnd = function(e) {
  3928. this.enabled && (this.state === c.ROTATE && (e.timeStamp > this.lastMoveTime + 100 ? (this.rotationSpeed.set(0, 0),
  3929. this.rotationAcceleration.set(0, 0)) : this.rotationAcceleration.set(-this.rotateDelta.x, this.rotateDelta.y)),
  3930. this.state = c.NONE,
  3931. this.update(),
  3932. this.rotationAcceleration.set(0, 0),
  3933. this.rotateDelta.set(0, 0))
  3934. }
  3935. ,
  3936. n.prototype.onPointerDown = function(e) {
  3937. this.enabled && ("touch" === e.pointerType && (this.pointers.length < this.pointersLimit && this.pointers.push({
  3938. id: e.pointerId,
  3939. pageX: e.pageX,
  3940. pageY: e.pageY
  3941. }),
  3942. e.touches = this.pointers,
  3943. this.onTouchStart(e)),
  3944. this.emit(d.InputStart, "pointer"))
  3945. }
  3946. ,
  3947. n.prototype.onPointerMove = function(e) {
  3948. this.enabled && "touch" === e.pointerType && (this.pointers.forEach(function(t) {
  3949. e.pointerId === t.id && (t.pageX = e.pageX,
  3950. t.pageY = e.pageY)
  3951. }),
  3952. e.touches = this.pointers,
  3953. this.onTouchMove(e))
  3954. }
  3955. ,
  3956. n.prototype.onPointerUp = function(e) {
  3957. this.enabled && "touch" === e.pointerType && (this.pointers.forEach(function(t, i) {
  3958. e.pointerId === t.id && this.pointers.splice(i, 1)
  3959. }
  3960. .bind(this)),
  3961. e.touches = this.pointers,
  3962. this.onTouchEnd(e))
  3963. }
  3964. ,
  3965. n.prototype.reset = function() {
  3966. this.state = c.NONE,
  3967. this.stopAutoPanning(),
  3968. this.rotationSpeed.set(0, 0),
  3969. this.rotationAcceleration.set(0, 0),
  3970. this.panSpeed.set(0, 0),
  3971. this.panAcceleration.set(0, 0)
  3972. }
  3973. ,
  3974. n.prototype.toJSON = function() {
  3975. var e = {
  3976. camera_position: {
  3977. x: s.toPrecision(this.camera.position.x, 4),
  3978. y: s.toPrecision(this.camera.position.y, 4),
  3979. z: s.toPrecision(this.camera.position.z, 4)
  3980. },
  3981. camera_quaternion: {
  3982. x: s.toPrecision(this.camera.quaternion.x, 4),
  3983. y: s.toPrecision(this.camera.quaternion.y, 4),
  3984. z: s.toPrecision(this.camera.quaternion.z, 4),
  3985. w: s.toPrecision(this.camera.quaternion.w, 4)
  3986. }
  3987. };
  3988. return e
  3989. }
  3990. ,
  3991. t.exports = n
  3992. }
  3993. , {
  3994. "../enum/ControlActions": 20,
  3995. "../enum/ControlEvents": 21,
  3996. "../enum/Keys": 30,
  3997. "../enum/MouseButton": 34,
  3998. "../enum/Vectors": 50,
  3999. "../settings": 166,
  4000. "../util/common": 185,
  4001. "../util/math": 190,
  4002. events: 202,
  4003. three: 217
  4004. }],
  4005. 13: [function(e, t, i) {
  4006. (function(i) {
  4007. "use strict";
  4008. function n(e) {
  4009. this.camera = e,
  4010. this.camera.controls = this,
  4011. this.target = new r.Vector3(0,0,0),
  4012. this.lookVector = new r.Vector3,
  4013. this.lookSpeed = .05,
  4014. this.rotationAcc = new r.Vector2,
  4015. this.rotationSpeed = new r.Vector2,
  4016. this.lat = 0,
  4017. this.lon = 0,
  4018. this.phi = 0,
  4019. this.theta = 0,
  4020. this.enabled = !1,
  4021. this.locked = !1,
  4022. this.pointer = new r.Vector2(0,0),
  4023. this.rotationHistory = [],
  4024. this.rotationDifference = new r.Vector2,
  4025. this.pointerDragOn = !1,
  4026. this.pointerDragStart = new r.Vector2(0,0),
  4027. this.pinchDistance = 0,
  4028. this.moveStart = new r.Vector2,
  4029. this.moveTolerance = .01,
  4030. this.pointersLimit = 2,
  4031. this.pointers = []
  4032. }
  4033. var r = e("three")
  4034. , o = e("../util/logger")
  4035. , a = e("../settings")
  4036. , s = e("../util/common")
  4037. , l = e("../util/math")
  4038. , c = (e("../enum/Vectors"),
  4039. e("../enum/MouseButton"))
  4040. , h = e("../enum/Keys")
  4041. , u = e("../enum/ControlEvents")
  4042. , d = e("events").EventEmitter;
  4043. new o(i);
  4044. n.prototype = Object.create(d.prototype),
  4045. n.prototype.usable = function() {
  4046. return this.enabled && !this.locked
  4047. }
  4048. ,
  4049. /* n.prototype.lookAt = function(e) {
  4050. var t = this.camera.position.clone().sub(e)
  4051. , i = Math.atan(t.z / t.x);
  4052. i += t.x < 0 ? Math.PI : 0,
  4053. i += t.x > 0 && t.z < 0 ? 2 * Math.PI : 0,
  4054. this.lon = r.Math.radToDeg(i) + 180;
  4055. var n = Math.sqrt(t.x * t.x + t.z * t.z)
  4056. , o = Math.atan(t.y / n);
  4057. this.lat = -r.Math.radToDeg(o)
  4058. }
  4059. */
  4060. n.prototype.lookAt = function(aim, dir) {
  4061. var t = dir || this.camera.position.clone().sub(aim); //aim所指点的笛卡尔坐标系
  4062. var i = Math.atan(t.z / t.x);
  4063. i += t.x < 0 ? Math.PI : 0;
  4064. i += t.x > 0 && t.z < 0 ? 2 * Math.PI : 0;
  4065. this.lon = r.Math.radToDeg(i) + 180;
  4066. var n = Math.sqrt(t.x * t.x + t.z * t.z),
  4067. o = Math.atan(t.y / n);
  4068. this.lat = -r.Math.radToDeg(o);
  4069. }
  4070. ,
  4071. n.prototype.startRotationFrom = function(e, t) {
  4072. l.convertScreenPositionToNDC(e, t, this.pointer),
  4073. this.pointerDragOn = !0,
  4074. this.pointerDragStart.copy(this.pointer),
  4075. this.moveStart.copy(this.pointer),
  4076. this.rotationHistory = [],
  4077. this.rotationSpeed.set(0, 0)
  4078. }
  4079. ,
  4080. n.prototype.onMouseOver = function(e) {
  4081. !this.pointerDragOn || 0 !== e.which && 0 !== e.buttons || this.onMouseUp(e)
  4082. }
  4083. ,
  4084. n.prototype.onTouchStart = function(e) {
  4085. if (this.usable()) {
  4086. switch (e.preventDefault(),
  4087. e.stopPropagation(),
  4088. e.touches.length) {
  4089. case 1:
  4090. this.startRotationFrom(e.touches[0].clientX, e.touches[0].clientY);
  4091. break;
  4092. case 2:
  4093. var t = (e.touches[0].clientX - e.touches[1].clientX) / $("#player").width()
  4094. , i = (e.touches[0].clientY - e.touches[1].clientY) / $("#player").height();
  4095. this.pinchDistance = Math.sqrt(t * t + i * i)
  4096. }
  4097. SoundManager.pause('tour') // 周恩光 点击场景时停止语音
  4098. this.emit(u.InputStart, "touch")
  4099. }
  4100. }
  4101. ,
  4102. n.prototype.onPointerDown = function(e) {
  4103. this.usable() && "touch" === e.pointerType && (this.pointers.length < this.pointersLimit && this.pointers.push({
  4104. id: e.pointerId,
  4105. clientX: e.clientX,
  4106. clientY: e.clientY
  4107. }),
  4108. e.touches = this.pointers,
  4109. this.onTouchStart(e),
  4110. this.emit(u.InputStart, "pointer"))
  4111. }
  4112. ,
  4113. n.prototype.onMouseDown = function(e) {
  4114. if (this.usable()) {
  4115. switch (e.preventDefault(),
  4116. e.stopPropagation(),
  4117. e.button) {
  4118. case c.LEFT:
  4119. this.startRotationFrom(e.clientX, e.clientY)
  4120. }
  4121. SoundManager.pause('tour') // 周恩光 点击场景时停止语音
  4122. this.emit(u.InputStart, "mouse")
  4123. }
  4124. }
  4125. ,
  4126. n.prototype.updateRotation = function() {
  4127. if (this.usable() && this.pointerDragOn) {
  4128. var e = new r.Vector3(this.pointerDragStart.x,this.pointerDragStart.y,-1).unproject(this.camera)
  4129. , t = new r.Vector3(this.pointer.x,this.pointer.y,-1).unproject(this.camera)
  4130. , i = Math.sqrt(e.x * e.x + e.z * e.z)
  4131. , n = Math.sqrt(t.x * t.x + t.z * t.z)
  4132. , o = Math.atan2(e.y, i)
  4133. , a = Math.atan2(t.y, n);
  4134. this.rotationDifference.y = r.Math.radToDeg(o - a),
  4135. e.y = 0,
  4136. t.y = 0;
  4137. var s = Math.acos(e.dot(t) / e.length() / t.length());
  4138. isNaN(s) || (this.rotationDifference.x = r.Math.radToDeg(s),
  4139. this.pointerDragStart.x < this.pointer.x && (this.rotationDifference.x *= -1)),
  4140. this.pointerDragStart.copy(this.pointer)
  4141. }
  4142. }
  4143. ,
  4144. n.prototype.onMouseMove = function(e) {
  4145. this.usable() && (l.convertScreenPositionToNDC(e.clientX, e.clientY, this.pointer),
  4146. 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"))
  4147. }
  4148. ,
  4149. n.prototype.onTouchMove = function(e) {
  4150. if (this.usable())
  4151. switch (this.emit(u.Move, "touch"),
  4152. e.touches.length) {
  4153. case 1:
  4154. l.convertScreenPositionToNDC(e.touches[0].clientX, e.touches[0].clientY, this.pointer);
  4155. break;
  4156. case 2:
  4157. var t = (e.touches[0].clientX - e.touches[1].clientX) / $("#player").width()
  4158. , i = (e.touches[0].clientY - e.touches[1].clientY) / $("#player").height()
  4159. , n = this.pinchDistance - Math.sqrt(t * t + i * i);
  4160. Math.abs(n) > .01 && (this.emit(u.InteractionDirect),
  4161. this.emit(u.Pinch, n),
  4162. this.pinchDistance -= n)
  4163. }
  4164. }
  4165. ,
  4166. n.prototype.onPointerMove = function(e) {
  4167. this.usable() && "touch" === e.pointerType && (this.pointers.forEach(function(t) {
  4168. e.pointerId === t.id && (t.clientX = e.clientX,
  4169. t.clientY = e.clientY)
  4170. }),
  4171. e.touches = this.pointers,
  4172. this.onTouchMove(e))
  4173. }
  4174. ,
  4175. n.prototype.endRotation = function() {
  4176. this.pointerDragOn = !1;
  4177. var e = s.averageVectors(this.rotationHistory);
  4178. this.rotationSpeed.set(e.x * a.rotationAfterMoveMultiplier, e.y * a.rotationAfterMoveMultiplier)
  4179. }
  4180. ,
  4181. n.prototype.onTouchEnd = function(e) {
  4182. this.usable() && (e.preventDefault(),
  4183. e.stopPropagation(),
  4184. this.endRotation())
  4185. }
  4186. ,
  4187. n.prototype.onMouseUp = function(e) {
  4188. this.usable() && (e.preventDefault(),
  4189. e.stopPropagation(),
  4190. this.endRotation())
  4191. }
  4192. ,
  4193. n.prototype.onPointerUp = function(e) {
  4194. this.usable() && "touch" === e.pointerType && (this.pointers.forEach(function(t, i) {
  4195. e.pointerId === t.id && this.pointers.splice(i, 1)
  4196. }
  4197. .bind(this)),
  4198. e.touches = this.pointers,
  4199. this.onTouchEnd(e))
  4200. }
  4201. ,
  4202. n.prototype.update = function(e) {
  4203. this.lon,
  4204. this.lat;
  4205. for (this.updateRotation(),
  4206. this.rotationHistory.push(this.rotationDifference.clone()); this.rotationHistory.length > a.rotationAfterMoveHistoryCount; )
  4207. this.rotationHistory.shift();
  4208. this.lon += this.rotationDifference.x,
  4209. this.lat += this.rotationDifference.y,
  4210. this.rotationDifference.set(0, 0)
  4211. //改
  4212. var friction = Math.min(1, a.rotationFriction * e * 60) //如果deltaTime > 1/ 60 (比较卡),就增加rotationFriction, 以防止转动过久
  4213. this.rotationSpeed.x = this.rotationSpeed.x * (1 - friction) + this.rotationAcc.x * a.rotationAccelerationInside,
  4214. this.rotationSpeed.y = this.rotationSpeed.y * (1 - friction) + this.rotationAcc.y * a.rotationAccelerationInside,
  4215. this.lon += this.rotationSpeed.x * e,
  4216. this.lat += this.rotationSpeed.y * e
  4217. //this.lat = Math.max(a.insideLookLimitDown, Math.min(a.insideLookLimitUp, this.lat)),
  4218. var insideLookLimitDown = a.insideLookLimitDown - a.insideFOV/2 + this.camera.fov / 2
  4219. var insideLookLimitUp = a.insideLookLimitUp + a.insideFOV/2 - this.camera.fov / 2
  4220. 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 );
  4221. this.phi = r.Math.degToRad(90 - this.lat),
  4222. this.theta = r.Math.degToRad(this.lon),
  4223. this.lookVector.x = Math.sin(this.phi) * Math.cos(this.theta),
  4224. this.lookVector.y = Math.cos(this.phi),
  4225. this.lookVector.z = Math.sin(this.phi) * Math.sin(this.theta),
  4226. this.target.copy(this.lookVector).add(this.camera.position),
  4227. this.camera.lookAt(this.target)
  4228. }
  4229. ,
  4230. n.prototype.onMouseWheel = function(e) {
  4231. if (this.usable()) {
  4232. var t = e.wheelDelta || -e.detail;
  4233. this.emit(u.InteractionDirect),
  4234. this.emit(u.Scroll, t)
  4235. }
  4236. }
  4237. ,
  4238. n.prototype.onKeyDown = function(e) {
  4239. this.usable() && (e.metaKey || e.ctrlKey || (e.preventDefault(),
  4240. this.handleKeyDown(e.which)))
  4241. }
  4242. ,
  4243. n.prototype.handleKeyDown = function(e) {
  4244. var t = function(e, t) {
  4245. this.rotationAcc[e] = t
  4246. }
  4247. .bind(this);
  4248. this.emit(u.InteractionKey);
  4249. var i = !0;
  4250. switch (e) {
  4251. case h.LEFTARROW:
  4252. case h.J:
  4253. t("x", -1);
  4254. break;
  4255. case h.RIGHTARROW:
  4256. case h.L:
  4257. t("x", 1);
  4258. break;
  4259. case h.I:
  4260. t("y", 1);
  4261. break;
  4262. case h.K:
  4263. t("y", -1);
  4264. break;
  4265. default:
  4266. i = !1
  4267. }
  4268. i && this.emit(u.Move, "key")
  4269. }
  4270. ,
  4271. n.prototype.onKeyUp = function(e) {
  4272. this.usable() && (e.preventDefault(),
  4273. e.stopPropagation(),
  4274. this.handleKeyUp(e.which))
  4275. }
  4276. ,
  4277. n.prototype.handleKeyUp = function(e) {
  4278. switch (e) {
  4279. case h.LEFTARROW:
  4280. case h.J:
  4281. case h.RIGHTARROW:
  4282. case h.L:
  4283. this.rotationAcc.x = 0;
  4284. break;
  4285. case h.I:
  4286. case h.K:
  4287. this.rotationAcc.y = 0
  4288. }
  4289. }
  4290. ,
  4291. n.prototype.startRotating = function(e, t) {
  4292. e && (this.rotationAcc.x = e),
  4293. t && (this.rotationAcc.y = t)
  4294. }
  4295. ,
  4296. n.prototype.stopRotating = function(e) {
  4297. e && (this.rotationSpeed.x = this.rotationSpeed.y = 0),
  4298. this.rotationAcc.set(0, 0)
  4299. }
  4300. ,
  4301. n.prototype.reset = function() {
  4302. this.pointerDragOn = !1,
  4303. this.rotationAcc.set(0, 0),
  4304. this.rotationSpeed.set(0, 0),
  4305. this.pointers = []
  4306. }
  4307. ,
  4308. n.prototype.toJSON = function() {
  4309. var e = {
  4310. camera_position: {
  4311. x: l.toPrecision(this.camera.position.x, 4),
  4312. y: l.toPrecision(this.camera.position.y, 4),
  4313. z: l.toPrecision(this.camera.position.z, 4)
  4314. },
  4315. camera_quaternion: {
  4316. x: l.toPrecision(this.camera.quaternion.x, 4),
  4317. y: l.toPrecision(this.camera.quaternion.y, 4),
  4318. z: l.toPrecision(this.camera.quaternion.z, 4),
  4319. w: l.toPrecision(this.camera.quaternion.w, 4)
  4320. }
  4321. };
  4322. return e
  4323. }
  4324. ,
  4325. n.prototype.setStateFromJSON = function(e) {
  4326. this.camera.position.copy(e.camera_position),
  4327. this.camera.quaternion.copy(e.camera_quaternion)
  4328. }
  4329. ,
  4330. t.exports = n
  4331. }
  4332. ).call(this, "/js/controls/PanoramaControls.js")
  4333. }
  4334. , {
  4335. "../enum/ControlEvents": 21,
  4336. "../enum/Keys": 30,
  4337. "../enum/MouseButton": 34,
  4338. "../enum/Vectors": 50,
  4339. "../settings": 166,
  4340. "../util/common": 185,
  4341. "../util/logger": 189,
  4342. "../util/math": 190,
  4343. events: 202,
  4344. three: 217
  4345. }],
  4346. 14: [function(e, t, i) {
  4347. (function(i) {
  4348. "use strict";
  4349. var n = e("three")
  4350. , r = e("../enum/Viewmode")
  4351. , o = e("../util/logger")
  4352. , a = new o(i);
  4353. t.exports = {
  4354. serialize: function(e) {
  4355. return encodeURI(JSON.stringify(e))
  4356. },
  4357. deserialize: function(e) {
  4358. function t(e) {
  4359. function t(e, t) {
  4360. return e && "number" == typeof t && !isNaN(t)
  4361. }
  4362. return e.reduce(t, !0)
  4363. }
  4364. try {
  4365. var i = JSON.parse(decodeURI(e))
  4366. , o = {
  4367. mode: r.fromInt(i.camera_mode),
  4368. panoId: i.scan_id,
  4369. position: (new n.Vector3).copy(i.camera_position),
  4370. quaternion: (new n.Quaternion).copy(i.camera_quaternion),
  4371. zoom: i.ortho_zoom,
  4372. floorVisibility: i.floor_visibility
  4373. }
  4374. , s = o.position;
  4375. t([s.x, s.y, s.z]) || o.position.set(0, 0, 0);
  4376. var l = o.quaternion;
  4377. return t([l.x, l.y, l.z, l.w]) || o.quaternion.set(0, 0, 0, 1),
  4378. o
  4379. } catch (i) {
  4380. a.debug("Not able to parse start location as JSON; falling back to old array style parsing");
  4381. try {
  4382. var c = e.split(",")
  4383. , h = {
  4384. x: parseFloat(c[2]),
  4385. y: parseFloat(c[3]),
  4386. z: parseFloat(c[4])
  4387. }
  4388. , u = {
  4389. x: parseFloat(c[5]),
  4390. y: parseFloat(c[6]),
  4391. z: parseFloat(c[7]),
  4392. w: parseFloat(c[8])
  4393. };
  4394. return t([h.x, h.y, h.z]) || (h.x = 0,
  4395. h.y = 0,
  4396. h.z = 0),
  4397. t([u.x, u.y, u.z, u.w]) || (u.x = 0,
  4398. u.y = 0,
  4399. u.z = 0,
  4400. u.w = 1),
  4401. {
  4402. mode: r.fromInt(c[0]),
  4403. panoId: c[1],
  4404. position: (new n.Vector3).copy(h),
  4405. quaternion: (new n.Quaternion).copy(u)
  4406. }
  4407. } catch (t) {
  4408. a.warn('Invalid start override, ignoring: "' + e + '"', t.message)
  4409. }
  4410. }
  4411. return null
  4412. }
  4413. }
  4414. }
  4415. ).call(this, "/js/controls/serializer.js")
  4416. }
  4417. , {
  4418. "../enum/Viewmode": 51,
  4419. "../util/logger": 189,
  4420. three: 217
  4421. }],
  4422. 15: [function(e, t, i) {
  4423. (function(i) {
  4424. "use strict";
  4425. function n() {
  4426. this.endlessLoop = a.warp.loop,
  4427. this.clock = new r.Clock(!0),
  4428. this.model = null,
  4429. this.player = null,
  4430. this.currentItem = null,
  4431. this.destinationItem = null,
  4432. this.tourIsPlaying = !1,
  4433. this.transitionStage = y.None,
  4434. this.nextFunc = null,
  4435. this.onTheBus = !1,
  4436. this.tourInProgress = !1,
  4437. this.reachSource = null,
  4438. this.interrupted = !1,
  4439. this.nItems = 0,
  4440. this.walkingSectionPaused = !1
  4441. }
  4442. var r = e("three")
  4443. , o = e("./util/logger")
  4444. , a = e("./settings")
  4445. , s = e("./util/transitions")
  4446. , l = e("events").EventEmitter
  4447. , c = e("./enum/Viewmode")
  4448. , h = e("./analytics")
  4449. , u = e("./enum/WarpStyle")
  4450. , s = e("./util/transitions")
  4451. , d = (e("./model/ModelManager"),
  4452. e("./enum/ModelManagerEvents"))
  4453. , p = e("./enum/DirectorEvents")
  4454. , f = e("./enum/PlayerEvents")
  4455. , g = (e("./enum/ControlEvents"),
  4456. e("./enum/BlackoutStyle"))
  4457. , m = e("./enum/PathDiscardMode")
  4458. , v = e("./enum/PathDisplayMode")
  4459. , A = (e("./player"),
  4460. new o(i))
  4461. , y = Object.freeze({
  4462. None: 0,
  4463. Moving: 1,
  4464. Aiming: 2,
  4465. Interlude: 3
  4466. })
  4467. , C = Object.freeze({
  4468. Forward: 1,
  4469. NoChange: 0,
  4470. Backwards: -1
  4471. })
  4472. , I = s.getUniqueId();
  4473. n.prototype = Object.create(l.prototype),
  4474. n.prototype.init = function(e, t) {
  4475. this.player = e,
  4476. this.modelManager = t,
  4477. this.updateModel(),
  4478. this.resetAll(),
  4479. this.bindEvents()
  4480. }
  4481. ,
  4482. n.prototype.resetAll = function() {
  4483. if (this.currentItem = null,
  4484. this.destinationItem = null,
  4485. this.tourIsPlaying = !1,
  4486. //this.bgmReplay(),//xzw
  4487. this.transitionStage = y.None,
  4488. this.nextFunc = null,
  4489. this.onTheBus = !1,
  4490. this.reachSource = null,
  4491. this.interrupted = !1,
  4492. this.model) {
  4493. var e = a.path.typ === u.WALK ? u.WALK : u.STD;
  4494. this.defaultWarpStyle = this.model.data.hasOwnProperty("player_options") && this.model.data.player_options && this.model.data.player_options.fast_transitions === !1 ? e : u.BLACK
  4495. } else
  4496. this.defaultWarpStyle = u.BLACK,
  4497. A.warn('No model yet, choosing "' + this.defaultWarpStyle + '" transitions');
  4498. this.resetSpecialTransition()
  4499. }
  4500. ,
  4501. n.prototype.updateModel = function() {
  4502. this.model = this.modelManager.getActiveModel(),
  4503. this.nItems = this.model.heroLocations.length
  4504. }
  4505. ,
  4506. n.prototype.bindEvents = function() {
  4507. this.modelManager.on(d.ActiveModelChanged, this.updateModel.bind(this)),
  4508. this.player.on(f.WarpInterruptedWithFlyTo, this.checkAndHandleWalkingtourInterruption.bind(this)),
  4509. this.player.on(f.Move, this.handlePlayerMove.bind(this)),
  4510. this.player.on(f.PanoChosen, this.handlePlayerPanoChosen.bind(this)),
  4511. this.player.on(f.ModeChanged, this.handlePlayerModeChanged.bind(this)),
  4512. this.player.on(f.InputStart, this.handlePlayerInputStart.bind(this)),
  4513. this.player.on(f.FlyingStarted, this.handlePlayerFlyingStarted.bind(this)),
  4514. this.player.once(f.Move, function() {
  4515. s.cancelById(I)
  4516. })
  4517. }
  4518. ,
  4519. n.prototype.checkAndHandleWalkingtourInterruption = function(e) {//快速停止。 改:去掉判断nextWarpStyle,因为这个属性改乱了,导致点击停止按钮不执行
  4520. return /* e === u.WALK && ( */this.interrupt(g.NONE),
  4521. this.pauseWalkingSection(),
  4522. this.player.fastForwardActivePanoFlight(),
  4523. !0/* ) */
  4524. }
  4525. ,
  4526. n.prototype.handlePlayerMove = function(e) {
  4527. this.transitionStage === y.Interlude && this.interrupt(g.NONE),
  4528. this.emit("update.controls")
  4529. }
  4530. ,
  4531. n.prototype.handlePlayerPanoChosen = function(e, t) {
  4532. this.intermediateState() || e.id === t.id || (this.onTheBus = !1,
  4533. this.emit("update.controls"))
  4534. }
  4535. ,
  4536. n.prototype.handlePlayerModeChanged = function(e, t) {
  4537. this.intermediateState() || e === t || (this.onTheBus = !1,
  4538. this.emit("update.controls"))
  4539. }
  4540. ,
  4541. n.prototype.handlePlayerInputStart = function(e) {
  4542. this.transitionStage === y.Interlude && this.interrupt(g.NONE)
  4543. }
  4544. ,
  4545. n.prototype.handlePlayerFlyingStarted = function() {
  4546. this.clearWalkingSectionPaused()
  4547. }
  4548. ,
  4549. n.prototype.describe = function() {
  4550. return {
  4551. nItems: this.nItems,
  4552. currentItem: this.currentItem,
  4553. destinationItem: this.destinationItem,
  4554. tourIsPlaying: this.tourIsPlaying,
  4555. onTheBus: this.onTheBus,
  4556. endlessLoop: this.endlessLoop,
  4557. viewMode: this.player.mode,
  4558. inTransition: this._inTransition(),
  4559. transitionStage: this.transitionStage,
  4560. tourInProgress: this.tourInProgress
  4561. }
  4562. }
  4563. ,
  4564. n.prototype._inTransition = function() {
  4565. return this.player.flying || this.player.isWarping() || this.player.isWaitingToWarp() || this.player.mode === c.TRANSITIONING || this.tourIsPlaying
  4566. }
  4567. ,
  4568. n.prototype.bounceable = function() {
  4569. var e = this.clock.getDelta();
  4570. return this.isInterrupted() || e < .9 && e > .01 || this.player.flying && !this.player.isWarping()
  4571. }
  4572. ,
  4573. n.prototype.itemCompare = function(item1, item2, type){//add
  4574. if(type == 'equal'){//==
  4575. return item1 && item2 && item1[0] == item2[0] && item1[1] == item2[1]
  4576. }else if(type == 'less'){//<
  4577. return item1 && item2 && (item1[0] < item2[0]) || (item1[0] == item2[0] && item1[1] < item2[1])
  4578. }
  4579. }
  4580. n.prototype.currentMoveDirection = function() {
  4581. //return null === this.currentItem || void 0 === this.currentItem ? y.Forward : this.destinationItem === this.currentItem ? y.NoChange : this.destinationItem > this.currentItem ? y.Forward : y.Backwards
  4582. 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
  4583. }
  4584. ,
  4585. n.prototype.clearPath = function() {
  4586. this._inTransition() || this.player.path.discardPathObject()
  4587. }
  4588. ,
  4589. n.prototype.allFloors = function() {
  4590. this.model.toggleAllFloors()
  4591. }
  4592. ,
  4593. n.prototype.actionComplete = function(e) {
  4594. if (this.interrupted = !1,
  4595. this.transitionStage = y.None,
  4596. this.resetSpecialTransition(),
  4597. null !== this.destinationItem && this.setCurrentItem(this.destinationItem),
  4598. this.tourIsPlaying || (this.player.disablePreRendering(),
  4599. this.player.mode === c.PANORAMA && this.player.currentPano.isAligned() && this.model.fadePanoMarkers()),
  4600. this.emit("update.controls"),
  4601. this.nextFunc) {
  4602. var t = this.nextFunc;
  4603. this.nextFunc = null,
  4604. t()
  4605. }
  4606. }
  4607. ,
  4608. n.prototype.awaitCompletion = function(e, t) {
  4609. this.nextFunc = t,
  4610. e()
  4611. }
  4612. ,
  4613. n.prototype.updateSuccessFunction = function(e) {
  4614. this.nextFunc = e
  4615. }
  4616. ,
  4617. n.prototype.interrupt = function(e, t) {
  4618. return !!this.wouldInterrupt() && (this.tourIsPlaying && (this.player.zoomEnabled = this.wasZoomEnabled),
  4619. this.tourIsPlaying = !1,
  4620. //this.bgmReplay(),//xzw
  4621. this.interrupted = !0,
  4622. this.nextFunc = null,
  4623. this.emit(p.ActionInterrupted),
  4624. null !== e && void 0 !== e || (e = g.BEGINNING),
  4625. this.player.interruptAndFastForward(e, t),
  4626. !0)
  4627. }
  4628. ,
  4629. n.prototype.wouldInterrupt = function() {
  4630. return this.transitionStage !== y.None
  4631. }
  4632. ,
  4633. n.prototype.intermediateState = function() {
  4634. return this.transitionStage !== y.None
  4635. }
  4636. ,
  4637. n.prototype.isInterrupted = function() {
  4638. return this.interrupted
  4639. }
  4640. ,
  4641. n.prototype.pauseWalkingSection = function() {
  4642. this.walkingSectionPaused = !0
  4643. }
  4644. ,
  4645. n.prototype.clearWalkingSectionPaused = function() {
  4646. this.walkingSectionPaused = !1
  4647. }
  4648. ,
  4649. n.prototype.autoTour = function() {
  4650. var e = Date.now();
  4651. this.model.auxDataPromise.then(function() {
  4652. e = Date.now() - e;
  4653. var t = a.warp.auto
  4654. , i = this.model.data && this.model.data.player_options /* && this.model.data.player_options.highlight_reel */;
  4655. t >= 0 && this.model.heroCount() > 1 && i && s.trigger({
  4656. duration: Math.max(1e3 * Math.min(300, t) - e, 0),
  4657. done: function() {
  4658. this.playTour()
  4659. }
  4660. .bind(this),
  4661. name: "_atr",
  4662. id: I
  4663. })
  4664. }
  4665. .bind(this))
  4666. }
  4667. ,
  4668. n.prototype.atDestinationPano = function() {
  4669. if (!this.player.currentPano || null === this.destinationItem)
  4670. return !1;
  4671. var e = this.player.currentPano.id;
  4672. if (void 0 === e)
  4673. return !1;
  4674. var t = this.model.heroLocations;
  4675. //return null !== this.destinationItem && void 0 !== t[this.destinationItem] && e === t[this.destinationItem].panoId
  4676. var destination = this.destinationItem && this.model.getHeroDescriptorByIndex(this.destinationItem)
  4677. return destination && destination.panoId == e
  4678. }
  4679. ,
  4680. n.prototype.redirectToItem = function(e, t) {
  4681. if (null === e || void 0 === e)
  4682. return void A.warn("Director.redirectToItem() -> Redirecting to null item.");
  4683. if (!this.wouldInterrupt())
  4684. return void A.warn("Director.redirectToItem() -> Director cannot redirect if there is nothing to interrupt.");
  4685. if (this.player.mode === c.TRANSITIONING)
  4686. return void A.debug("Director.redirectToItem() -> Cannot redirect while transitioning.");
  4687. A.debug("Director.redirectToItem() -> Redirecting to " + e + " via " + t);
  4688. var i = function() {
  4689. s.setTimeout(function() {
  4690. this.setDestinationItem(e),
  4691. this.goToDestination(!0, g.BEGINNING, a.warp.warpInterruptionRedirectTime, !1)
  4692. }
  4693. .bind(this), 0)
  4694. }
  4695. .bind(this);
  4696. this.interrupt(g.END, 0),
  4697. this.updateSuccessFunction(i)
  4698. }
  4699. ,
  4700. n.prototype.useSpecialTransition = function(e) {
  4701. void 0 !== e && this.defaultWarpStyle !== u.BLACK && A.debug("useSpecialTransition(): " + e),
  4702. this.nextWarpStyle = u.BLACK
  4703. }
  4704. ,
  4705. n.prototype.resetSpecialTransition = function() {
  4706. this.nextWarpStyle = this.defaultWarpStyle
  4707. }
  4708. ,
  4709. n.prototype.arrivedAtDestination = function(e) {
  4710. if (this.player.flying || this.player.isWarping())
  4711. A.warn("Cannot advance to interlude or aiming while player is flying or warping.");
  4712. else {
  4713. this.transitionStage = y.Aiming;
  4714. var t = this.tourIsPlaying ? this.tourInterlude.bind(this, this.nextItem(this.currentItem)) : null;
  4715. this.player.model.fadePanoMarkers(0),
  4716. this.awaitCompletion(function() {
  4717. this.resetSpecialTransition(),
  4718. e ? this.player.aimTourCamera(this.destinationItem, v.Retain, v.Slow, this.actionComplete.bind(this)) : this.actionComplete()
  4719. }
  4720. .bind(this), t)
  4721. }
  4722. }
  4723. ,
  4724. n.prototype.goToDestination = function(e, t, i, n) {
  4725. //音频
  4726. var musicInfo = this.model.heroLocations[this.destinationItem[0]].musicInfo
  4727. if(musicInfo && musicInfo.music && !e){
  4728. let src = musicInfo.music.includes(g_Prefix.slice(-10)) ? musicInfo.music : g_Prefix + musicInfo.music;
  4729. let audioObj = SoundManager.list.find(e=>e.name == 'tour')
  4730. let audioSrc1 = common.getFileNameFromUrl(audioObj.src);
  4731. let audioSrc2 = common.getFileNameFromUrl(src)
  4732. if(audioSrc1 == audioSrc2){//应该是继续播放该folder
  4733. if(this.destinationItem[1] == 0){//从头开始播放 因为可能暂停后然后再点该缩略图播
  4734. SoundManager.play('tour',null,0) // currentTime = 0;
  4735. }else if( audioObj.audio.paused && audioObj.audio.currentTime < audioObj.audio.duration ){//未播完
  4736. SoundManager.play('tour')//继续播。为什么会有暂停的情况?如果手动切换到bgm了呢?
  4737. }
  4738. }else{//很可能是该folder的起始
  4739. SoundManager.play('tour', manage.dealURL(src))
  4740. }
  4741. } else if(e) {
  4742. // 手动导览不播放音频,并暂停之前的语音
  4743. SoundManager.pause('tour')
  4744. }
  4745. if (this.onTheBus = !0,
  4746. this.emit("update.controls"),
  4747. this.player.updateLastView(),
  4748. !n && this.atDestinationPano()){
  4749. /*
  4750. // 原地旋转时, 写到_warpCameraAim里,因那有时间
  4751. var r = this.model.getHeroDescriptorByIndex(this.destinationItem)
  4752. if(r.zoom && r.zoom != this.player.zoomLevel){//add
  4753. this.player.smoothZoomFovTo(null, r.zoom, a.warp.teleportTime) //瞬间过渡的时间
  4754. } */
  4755. return void this.arrivedAtDestination(!0);
  4756. }
  4757. if (this.player.flying || this.player.isWarping())
  4758. A.warn("Cannot go to new destination while player is flying or warping.");
  4759. else {
  4760. var r = this.model.getHeroDescriptorByIndex(this.destinationItem)
  4761. , o = null
  4762. , a1 = null;
  4763. if (r.isPano()) {
  4764. //var s = 0 === this.destinationItem || e ? u.BLACK : this.nextWarpStyle;
  4765. //var walk = window.DATA.black ? 'black' : 'walk';
  4766. //若是点击item,直接瞬间过渡。
  4767. var s = e ? 'black' : this.getMomentTour(this.destinationItem)
  4768. a1 = this.player.warpToPanoByHeroIndex.bind(this.player, this.destinationItem, v.Show, m.Slow, s, true, i, this.actionComplete.bind(this)),
  4769. o = this.arrivedAtDestination.bind(this, !0)
  4770. if(s=='black' && r.zoom && r.zoom != this.player.zoomLevel){//add
  4771. this.player.smoothZoomFovTo(null, r.zoom, a.warp.teleportTime) //瞬间过渡的时间
  4772. }
  4773. } else{
  4774. a1 = this.player.warpToNonPanoByHeroIndex.bind(this.player, this.destinationItem, this.actionComplete.bind(this)),
  4775. o = this.arrivedAtDestination.bind(this, !1);
  4776. }
  4777. this.transitionStage = y.Moving,
  4778. this.model.fadePanoMarkers(0),
  4779. this.awaitCompletion(function() {
  4780. a1();
  4781. }
  4782. .bind(this), o),
  4783. this.emit("update.controls")
  4784. }
  4785. }
  4786. ,
  4787. n.prototype.tourInterlude = function() {
  4788. if (h.trackAlways("reach_highlight", {
  4789. reach_source: this.reachSource
  4790. }),
  4791. this.model.fadePanoMarkers(0),
  4792. this.emit("update.controls"),
  4793. this.tourIsPlaying)
  4794. return this.atEndOfTour() && !this.endlessLoop ? (this.tourInProgress = !1,
  4795. // 周恩光 播完最后一段语音
  4796. void this.awaitCompletion(function() {
  4797. this.transitionStage = y.Interlude,
  4798. this.player.tourInterlude(this.nextItem(this.currentItem),this.actionComplete.bind(this))
  4799. }
  4800. .bind(this), function(){
  4801. this.currentItem = [0,0],
  4802. this.stopTour(true),
  4803. this.emit(p.TourEnd)
  4804. }.bind(this)),
  4805. void (this.player.mode === c.PANORAMA && this.model.fadePanoMarkers(a.panorama.markerOpacity))) : void this.awaitCompletion(function() {
  4806. this.transitionStage = y.Interlude,
  4807. this.player.tourInterlude(this.nextItem(this.currentItem),this.actionComplete.bind(this))
  4808. }
  4809. .bind(this), this.goNext.bind(this))
  4810. }
  4811. ,
  4812. n.prototype.playTour = function() {
  4813. if (!this.bounceable())
  4814. return this.tourIsPlaying ? void A.info("tour is already playing")
  4815. : void (
  4816. this.wouldInterrupt() || (
  4817. this.player.emit("tour_auto", this.defaultWarpStyle),
  4818. this.tourInProgress = !0,
  4819. this.reachSource = "play",
  4820. this.tourIsPlaying = !0,
  4821. this.wasZoomEnabled = this.player.zoomEnabled,
  4822. this.player.zoomEnabled = !1,
  4823. this.resetSpecialTransition(),
  4824. this.emit("update.controls"),
  4825. this.emit(p.TourStart),
  4826. this.player.enablePreRendering(),
  4827. this.walkingSectionPaused
  4828. ? (
  4829. this.clearWalkingSectionPaused(),
  4830. this.goToDestination())
  4831. : /* this.goNext() */ (this.tourAdvance(0) ,this.goToDestination())
  4832. )
  4833. )
  4834. }
  4835. ,
  4836. /* n.prototype.bgmReplay = function() {//xzw add 结束tour后可能要继续播放背景音乐
  4837. } */
  4838. n.prototype.stopTour = function(isAutoStop) {//停止导览 isAutoStop 希望仅在飞完结束自动停止时的stopTour不停止tourSound, 这样才能完整播放tourSound. 不过似乎会在倒数第二个片段点击按钮停止导览时也视作自动结束的(执行this.interrupt() )。
  4839. SoundManager.pause('tour'), // 周恩光 自动导览暂停时同时停止语音
  4840. this.isInterrupted() || this.transitionStage === y.Moving && this.checkAndHandleWalkingtourInterruption(this.nextWarpStyle) || (this.tourIsPlaying && (this.player.zoomEnabled = this.wasZoomEnabled),
  4841. this.tourIsPlaying = !1,
  4842. this.interrupt(),
  4843. this.clearWalkingSectionPaused(),
  4844. this.resetSpecialTransition(),
  4845. this.emit("update.controls"))
  4846. }
  4847. ,
  4848. n.prototype.endTourProgress = function() {
  4849. this.tourInProgress = !1,
  4850. this.emit("update.controls"),
  4851. this.emit(p.TourEnd)
  4852. }
  4853. ,
  4854. n.prototype.goToHighlight = function(e) {
  4855. if (this.wouldInterrupt())
  4856. this.itemCompare(this.destinationItem,e,'equal') ? this.interrupt() : this.redirectToItem(e, "goToHighlight");
  4857. else {
  4858. if (A.debug("<tour.goto " + e + ">"),
  4859. this.isInterrupted())
  4860. return;
  4861. this.clearWalkingSectionPaused(),
  4862. this.setDestinationItem(e),
  4863. this.useSpecialTransition("Hilight")
  4864. this.goToDestination(true),//add true
  4865. h.trackAlways("reach_highlight", {
  4866. reach_source: "thumb"
  4867. })
  4868. }
  4869. }
  4870. ,
  4871. n.prototype.prevHighlight = function() {
  4872. this.bounceable() || (this.player.emit("tour_manual", "prev"),
  4873. this.interrupt(g.BEGINNING) || this.isInterrupted() || (this.clearWalkingSectionPaused(),
  4874. this.reachSource = "prev",
  4875. this.goPrev()))
  4876. }
  4877. ,
  4878. n.prototype.nextHighlight = function() {
  4879. this.bounceable() || (this.player.emit("tour_manual", "next"),
  4880. this.interrupt(g.BEGINNING) || this.isInterrupted() || (this.clearWalkingSectionPaused(),
  4881. this.reachSource = "next",
  4882. this.goNext()))
  4883. }
  4884. ,
  4885. n.prototype.changeMode = function(e) {
  4886. var t = $.Deferred()
  4887. , i = t.resolve.bind(t)
  4888. , n = t.reject.bind(t);
  4889. this.emit(p.StartModeChange);
  4890. var r = function() {
  4891. return this.clearWalkingSectionPaused(),
  4892. !!this.wouldInterrupt() && (this.interrupt(),
  4893. !0)
  4894. }
  4895. .bind(this);
  4896. if (!r()) {
  4897. switch (e) {
  4898. case c.PANORAMA:
  4899. 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);
  4900. break;
  4901. case c.DOLLHOUSE:
  4902. case c.FLOORPLAN:
  4903. this.player.flyToNewMode({
  4904. mode: e
  4905. }).done(i).fail(n);
  4906. break;
  4907. case c.OUTDOOR:
  4908. 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)
  4909. }
  4910. return t.promise()
  4911. }
  4912. }
  4913. ,
  4914. n.prototype.atEndOfTour = function() {
  4915. //return this.currentItem >= this.nItems - 1
  4916. var end = this.currentItem && this.currentItem[0] >= this.nItems - 1;
  4917. if(end){
  4918. var heroLocations = this.model.heroLocations[this.nItems-1].heroLocations
  4919. if(heroLocations){
  4920. end = this.currentItem[1] >= heroLocations.length - 1
  4921. }
  4922. }
  4923. return end;
  4924. }
  4925. ,
  4926. n.prototype.firstDestination = function() {
  4927. //return 0 < this.nItems ? 0 : null
  4928. return 0 < this.nItems ? [0,0]: null
  4929. }
  4930. ,
  4931. n.prototype.finalDestination = function() {
  4932. //return 0 < this.nItems ? this.nItems - 1 : null
  4933. return 0 < this.nItems ? [this.nItems - 1,0]: null
  4934. }
  4935. ,
  4936. n.prototype.goPrev = function() {
  4937. this.tourAdvance(-1)
  4938. }
  4939. ,
  4940. n.prototype.goNext = function() {
  4941. this.tourAdvance(1)
  4942. }
  4943. ,
  4944. n.prototype.setDestinationItem = function(e) {
  4945. this.destinationItem = e,
  4946. this.emit("update.controls")
  4947. }
  4948. ,
  4949. n.prototype.setCurrentItem = function(e) {
  4950. this.currentItem = e,
  4951. this.emit("update.controls")
  4952. }
  4953. ,
  4954. n.prototype.nextItem = function(currentItem) {
  4955. //return null === e ? this.firstDestination() : e >= this.nItems - 1 ? this.endlessLoop ? this.firstDestination() : null : e + 1
  4956. if(currentItem == void 0)return this.firstDestination()
  4957. var currentLocation = this.model.heroLocations[currentItem[0]];
  4958. var currentChildNum = currentLocation.heroLocations ? currentLocation.heroLocations.length : 1
  4959. var item;
  4960. if(this.currentItem[1] >= currentChildNum - 1){//子目录中最后一个
  4961. item = [currentItem[0] + 1, 0] //结果可能超出nItems
  4962. }else{
  4963. item = [currentItem[0] , currentItem[1]+1]
  4964. }
  4965. if(item[0] >= this.nItems ){
  4966. item = this.firstDestination()
  4967. }
  4968. return item;
  4969. //暂时不理会endlessLoop,默认为false
  4970. }
  4971. ,
  4972. n.prototype.prevItem = function(currentItem) {
  4973. //return null === e ? this.firstDestination() : e < 0 ? this.endlessLoop ? this.lastDestination() : null : e - 1
  4974. if(currentItem == void 0)return this.firstDestination()
  4975. var item;
  4976. var lastLocation = this.model.heroLocations[currentItem[0]-1];
  4977. if(!lastLocation) return this.finalDestination()//[-1, 0]//this.setDestinationItem([-1, 0]) //结果小于0
  4978. else{
  4979. var lastChildNum = lastLocation.heroLocations ? lastLocation.heroLocations.length : 1
  4980. if(this.currentItem[1] == 0){//子目录中第一个
  4981. return [currentItem[0] - 1, lastChildNum-1]
  4982. }else{
  4983. return [currentItem[0], currentItem[1]-1]
  4984. }
  4985. }
  4986. }
  4987. ,
  4988. n.prototype.tourAdvance = function(e) {//e是1或-1
  4989. A.debug("tourAdvance(" + e + ")")
  4990. if(null === this.currentItem || void 0 === this.currentItem){
  4991. this.setDestinationItem(this.firstDestination())
  4992. }else{
  4993. var item = this.currentItem
  4994. if(e == 1){
  4995. item = this.nextItem(this.currentItem)
  4996. }else if(e == -1){
  4997. item = this.prevItem(this.currentItem)
  4998. }
  4999. this.setDestinationItem(item)
  5000. }
  5001. if(this.itemCompare(this.destinationItem, this.finalDestination(), 'equal')[0] < 0 ){
  5002. this.useSpecialTransition("reverse-looping to end")
  5003. }else if(this.itemCompare(this.destinationItem, this.firstDestination(), 'equal')){
  5004. this.useSpecialTransition("looping back to start")
  5005. }
  5006. /* var momentTour = this.getMomentTour(this.destinationItem);
  5007. if ( "black" === momentTour) { // 方奕卓 瞬间过渡, 相机缩放至1
  5008. var zoomLevel = this.player.zoomLevel;
  5009. this.player.zoomEnabled = true;
  5010. var zoom = function(e, d) {
  5011. this.player.zoomTo((1-e)*zoomLevel, true)
  5012. }.bind(this)
  5013. s.start(zoom, 1500, function(){
  5014. }, 0, d.easeOutQuad, "zoom")
  5015. } */
  5016. this.goToDestination()
  5017. }
  5018. ,
  5019. n.prototype.getMomentTour = function(destinationItem) {//add
  5020. var wholeMomentTour = window.DATA.momentTour || "walk"; //最外层
  5021. if(!destinationItem) return wholeMomentTour
  5022. else{
  5023. var currentLocation = this.model.getHeroDescriptorByIndex(destinationItem)//最内层。 如果有使用最内层
  5024. if(currentLocation.momentTour)return currentLocation.momentTour;
  5025. var currentLocation_ = this.model.heroLocations[destinationItem[0]];
  5026. return currentLocation_.momentTour || wholeMomentTour; //若中间层或最内层有就使用,否则使用最外层
  5027. }
  5028. }
  5029. ,
  5030. t.exports = n
  5031. }
  5032. ).call(this, "/js/director.js")
  5033. }
  5034. , {
  5035. "./analytics": 4,
  5036. "./enum/BlackoutStyle": 18,
  5037. "./enum/ControlEvents": 21,
  5038. "./enum/DirectorEvents": 23,
  5039. "./enum/ModelManagerEvents": 33,
  5040. "./enum/PathDiscardMode": 38,
  5041. "./enum/PathDisplayMode": 39,
  5042. "./enum/PlayerEvents": 40,
  5043. "./enum/Viewmode": 51,
  5044. "./enum/WarpStyle": 52,
  5045. "./model/ModelManager": 140,
  5046. "./player": 155,
  5047. "./settings": 166,
  5048. "./util/logger": 189,
  5049. "./util/transitions": 195,
  5050. events: 202,
  5051. three: 217
  5052. }],
  5053. 16: [function(e, t, i) {
  5054. "use strict";
  5055. var n = e("three")
  5056. , r = e("./enum/Viewmode")
  5057. , o = (e("./settings"),
  5058. e("./util/transitions"))
  5059. , a = e("./enum/PlayerEvents")
  5060. , s = new n.ShaderPass(n.HorizontalBlurShader)
  5061. , l = new n.ShaderPass(n.VerticalBlurShader);
  5062. l.renderToScreen = !0;
  5063. var c = $("#player").width() / $("#player").height();
  5064. isNaN(c) && (c = 1);
  5065. //initTransitionPass(n)
  5066. var h = {
  5067. currentBlur: 0,
  5068. aspect: c,
  5069. blurStrength: 1,
  5070. hblurPass: s,
  5071. vblurPass: l,
  5072. transitionMaskPass : new n.TransitionPass()
  5073. ,
  5074. bindEvents: function(e) {
  5075. e.on(a.ModeChanged, function(e, t) {
  5076. e === r.PANORAMA && (o.cancel(h.blur),
  5077. o.cancel(h.addBlur),
  5078. o.start(h.removeBlur, 500, null, 0, null, "deblur"))
  5079. })
  5080. },
  5081. blur: function(e) {
  5082. h.currentBlur = e;
  5083. var t = e * h.blurStrength;
  5084. l.uniforms.v.value = t / 512 * h.aspect,
  5085. s.uniforms.h.value = t / 512
  5086. },
  5087. addBlur: function(e) {
  5088. e = Math.max(e, h.currentBlur),
  5089. h.blur(e)
  5090. },
  5091. removeBlur: function(e) {
  5092. e = Math.min(1 - e, h.currentBlur),
  5093. h.blur(e)
  5094. }
  5095. };
  5096. h.blur(0),
  5097. t.exports = h
  5098. }
  5099. , {
  5100. "./enum/PlayerEvents": 40,
  5101. "./enum/Viewmode": 51,
  5102. "./settings": 166,
  5103. "./util/transitions": 195,
  5104. three: 217
  5105. }],
  5106. 17: [function(e, t, i) {
  5107. "use strict";
  5108. t.exports = {
  5109. UNKNOWN: 0,
  5110. ALIGNED: 1,
  5111. UNALIGNED: 2,
  5112. PLACED: 3
  5113. }
  5114. }
  5115. , {}],
  5116. 18: [function(e, t, i) {
  5117. "use strict";
  5118. t.exports = {
  5119. NONE: 0,
  5120. MIDDLE: 1,
  5121. END: 2,
  5122. BEGINNING: 3,
  5123. FADEIN: 4
  5124. }
  5125. }
  5126. , {}],
  5127. 19: [function(e, t, i) {
  5128. "use strict";
  5129. var n = e("three");
  5130. t.exports = {
  5131. newBlue: new n.Color(4967932),
  5132. altBlue: new n.Color(47355),
  5133. tagDefault: new n.Color(223357),
  5134. classicBlue: new n.Color(53759),
  5135. mpYellow: new n.Color(16502016),
  5136. mpOrange: new n.Color(16428055),
  5137. mpBlue: new n.Color(12096),
  5138. mpLtGrey: new n.Color(13751252),
  5139. mpDkGrey: new n.Color(10000019),
  5140. mpRed: new n.Color(12525854),
  5141. mpOrangeDesat: new n.Color(16764529),
  5142. mpBlueDesat: new n.Color(4034734),
  5143. mpRedDesat: new n.Color(14705505),
  5144. white: new n.Color(16777215),
  5145. black: new n.Color(0),
  5146. _desat: function(e, t) {
  5147. var i = t || .3
  5148. , r = (new n.Color).copy(e).getHSL();
  5149. return (new n.Color).setHSL(r.h, r.s * (1 - i), r.l)
  5150. },
  5151. _darken: function(e, t) {
  5152. var i = t || .2
  5153. , r = e.getHSL();
  5154. return (new n.Color).setHSL(r.h, r.s, r.l * (1 - i))
  5155. }
  5156. }
  5157. }
  5158. , {
  5159. three: 217
  5160. }],
  5161. 20: [function(e, t, i) {
  5162. "use strict";
  5163. t.exports = {
  5164. NONE: -1,
  5165. ROTATE: 0,
  5166. DOLLY: 1,
  5167. PAN: 2,
  5168. ROTATE_DOLLY: 3,
  5169. PAN_DOLLY: 4
  5170. }
  5171. }
  5172. , {}],
  5173. 21: [function(e, t, i) {
  5174. "use strict";
  5175. t.exports = {
  5176. Move: "move",
  5177. InteractionDirect: "interaction.direct",
  5178. InteractionKey: "interaction.key",
  5179. InteractionGui: "interaction.gui",
  5180. FlyInDirection: "fly.direction",
  5181. InputStart: "input.start",
  5182. Pinch: "input.pinch",
  5183. Scroll: "input.scroll",
  5184. AutoPanInterrupt: "autopan.interrupt",
  5185. AutoPanComplete: "autopan.complete",
  5186. AutoPanClamped: "autopan.clamped",
  5187. LongTap: "longtap"
  5188. }
  5189. }
  5190. , {}],
  5191. 22: [function(e, t, i) {
  5192. "use strict";
  5193. t.exports = Object.freeze({
  5194. FORWARD: "FORWARD",
  5195. LEFT: "LEFT",
  5196. RIGHT: "RIGHT",
  5197. BACK: "BACK",
  5198. UP: "UP",
  5199. DOWN: "DOWN"
  5200. })
  5201. }
  5202. , {}],
  5203. 23: [function(e, t, i) {
  5204. "use strict";
  5205. t.exports = {
  5206. ActionInterrupted: "action.interrupted",
  5207. TourStart: "tour.start",
  5208. TourEnd: "tour.end",
  5209. StartModeChange: "mode.startChange"
  5210. }
  5211. }
  5212. , {}],
  5213. 24: [function(e, t, i) {
  5214. "use strict";
  5215. t.exports = Object.freeze({
  5216. None: 0,
  5217. Queued: 1,
  5218. ForceQueued: 2,
  5219. Downloading: 3,
  5220. Downloaded: 4,
  5221. DownloadFailed: 5
  5222. })
  5223. }
  5224. , {}],
  5225. 25: [function(e, t, i) {
  5226. "use strict";
  5227. t.exports = {
  5228. GL_TEXTURE_CUBE_MAP_POSITIVE_X: 0,
  5229. GL_TEXTURE_CUBE_MAP_NEGATIVE_X: 1,
  5230. GL_TEXTURE_CUBE_MAP_POSITIVE_Y: 2,
  5231. GL_TEXTURE_CUBE_MAP_NEGATIVE_Y: 3,
  5232. GL_TEXTURE_CUBE_MAP_POSITIVE_Z: 4,
  5233. GL_TEXTURE_CUBE_MAP_NEGATIVE_Z: 5
  5234. }
  5235. }
  5236. , {}],
  5237. 26: [function(e, t, i) {
  5238. "use strict";
  5239. t.exports = {
  5240. Texture2D: 0,
  5241. TextureCube: 1
  5242. }
  5243. }
  5244. , {}],
  5245. 27: [function(e, t, i) {
  5246. "use strict";
  5247. t.exports = {
  5248. SMALL: "small",
  5249. LARGE: "large"
  5250. }
  5251. }
  5252. , {}],
  5253. 28: [function(e, t, i) {
  5254. "use strict";
  5255. var n = e("./Viewmode")
  5256. , r = {
  5257. LANDING: {},
  5258. NAVIGATION: "navigation",
  5259. MORE_HELP: "moreHelp",
  5260. TOUR_INTERACTION: {}
  5261. };
  5262. r.LANDING[n.PANORAMA] = "panorama.landing",
  5263. r.LANDING[n.OUTDOOR] = "outdoor.landing",
  5264. r.LANDING[n.DOLLHOUSE] = "dollhouse.landing",
  5265. r.LANDING[n.FLOORPLAN] = "floorplan.landing",
  5266. r.TOUR_INTERACTION.standard = "standard.tour",
  5267. r.TOUR_INTERACTION[n.OUTDOOR] = "outdoor.tour",
  5268. r.TOUR_INTERACTION[n.FLOORPLAN] = "floorplan.tour",
  5269. t.exports = r
  5270. }
  5271. , {
  5272. "./Viewmode": 51
  5273. }],
  5274. 29: [function(e, t, i) {
  5275. "use strict";
  5276. var n = {
  5277. UP: 1,
  5278. DOWN: -1,
  5279. LEFT: "L",
  5280. RIGHT: "R",
  5281. FORWARD: "F",
  5282. BACK: "B",
  5283. reverse: {},
  5284. opposite: function(e) {
  5285. return this.reverse[e.toString()]
  5286. }
  5287. };
  5288. !function() {
  5289. n.reverse[n.UP] = n.DOWN,
  5290. n.reverse[n.DOWN] = n.UP,
  5291. n.reverse[n.LEFT] = n.RIGHT,
  5292. n.reverse[n.RIGHT] = n.LEFT,
  5293. n.reverse[n.FORWARD] = n.BACK,
  5294. n.reverse[n.BACK] = n.FORWARD
  5295. }(),
  5296. t.exports = n
  5297. }
  5298. , {}],
  5299. 30: [function(e, t, i) {
  5300. "use strict";
  5301. var n = e("../util/browser")
  5302. , r = {
  5303. ZERO: 48,
  5304. ONE: 49,
  5305. TWO: 50,
  5306. THREE: 51,
  5307. FOUR: 52,
  5308. FIVE: 53,
  5309. SIX: 54,
  5310. SEVEN: 55,
  5311. EIGHT: 56,
  5312. NINE: 57,
  5313. LEFTARROW: 37,
  5314. UPARROW: 38,
  5315. RIGHTARROW: 39,
  5316. DOWNARROW: 40,
  5317. A: 65,
  5318. B: 66,
  5319. C: 67,
  5320. D: 68,
  5321. E: 69,
  5322. F: 70,
  5323. G: 71,
  5324. H: 72,
  5325. I: 73,
  5326. J: 74,
  5327. K: 75,
  5328. L: 76,
  5329. M: 77,
  5330. N: 78,
  5331. O: 79,
  5332. P: 80,
  5333. Q: 81,
  5334. R: 82,
  5335. S: 83,
  5336. T: 84,
  5337. U: 85,
  5338. V: 86,
  5339. W: 87,
  5340. X: 88,
  5341. Y: 89,
  5342. Z: 90,
  5343. SPACE: 32,
  5344. RETURN: 13,
  5345. SEMICOLON: 186,
  5346. PLUSEQUALS: 187,
  5347. DASHUNDERSCORE: 189,
  5348. OPENBRACKET: 219
  5349. };
  5350. n.detectFirefox() && (r.SEMICOLON = 59,
  5351. r.PLUSEQUALS = 61,
  5352. r.DASHUNDERSCORE = 173),
  5353. t.exports = r
  5354. }
  5355. , {
  5356. "../util/browser": 182
  5357. }],
  5358. 31: [function(e, t, i) {
  5359. "use strict";
  5360. t.exports = {
  5361. EN_US: "en-US",
  5362. ES_MX: "es-MX",
  5363. FR_FR: "fr-FR",
  5364. DE_DE: "de-DE",
  5365. RU_RU: "ru-RU",
  5366. CN_CN: "cn-CN",
  5367. JP_JP: "jp-JP"
  5368. }
  5369. }
  5370. , {}],
  5371. 32: [function(e, t, i) {
  5372. "use strict";
  5373. t.exports = {
  5374. TagActivated: "tag.activated",
  5375. TagDismissed: "tag.dismissed",
  5376. TagNavigation: "tag.navigation"
  5377. }
  5378. }
  5379. , {}],
  5380. 33: [function(e, t, i) {
  5381. "use strict";
  5382. t.exports = {
  5383. ModelAdded: "model-added",
  5384. ActiveModelChanged: "active-model-changed"
  5385. }
  5386. }
  5387. , {}],
  5388. 34: [function(e, t, i) {
  5389. "use strict";
  5390. t.exports = {
  5391. LEFT: 0,
  5392. MIDDLE: 1,
  5393. RIGHT: 2
  5394. }
  5395. }
  5396. , {}],
  5397. 35: [function(e, t, i) {
  5398. "use strict";
  5399. t.exports = {
  5400. PanoRenderComplete: "panorama.render.complete",
  5401. TileRenderFailure: "panorama.tile.render.failed",
  5402. TileRenderSuccess: "panorama.tile.render.success",
  5403. TileUploadAttempted: "panorama.tile.upload.attempted",
  5404. UploadAttemptedForAllTiles: "panorama.upload.attempted.all.tiles",
  5405. ZoomLevelRenderStarted: "panorama.zoom.render.started"
  5406. }
  5407. }
  5408. , {}],
  5409. 36: [function(e, t, i) {
  5410. "use strict";
  5411. t.exports = {
  5412. BASE: 1,
  5413. STANDARD: 2,
  5414. HIGH: 3,
  5415. ULTRAHIGH: 4
  5416. }
  5417. }
  5418. , {}],
  5419. 37: [function(e, t, i) {
  5420. "use strict";
  5421. t.exports = {
  5422. LoadComplete: "panorama.load.complete",
  5423. LoadFailed: "panorama.load.failed",
  5424. TileLoaded: "panorama.tile.loaded"
  5425. }
  5426. }
  5427. , {}],
  5428. 38: [function(e, t, i) {
  5429. "use strict";
  5430. t.exports = Object.freeze({
  5431. Standard: 0,
  5432. Slow: 1,
  5433. Retain: 2
  5434. })
  5435. }
  5436. , {}],
  5437. 39: [function(e, t, i) {
  5438. "use strict";
  5439. t.exports = Object.freeze({
  5440. Show: 0,
  5441. Hide: 1,
  5442. Retain: 2
  5443. })
  5444. }
  5445. , {}],
  5446. 40: [function(e, t, i) {
  5447. "use strict";
  5448. t.exports = {
  5449. Move: "move",
  5450. MoveComplete: "move.complete",
  5451. ModeChanged: "mode.changed",
  5452. ModeChanging: "mode.changing",
  5453. PanoChosen: "pano.chosen",
  5454. ClosestPanoChanging: "closest.pano.changing",
  5455. WarpStarted: "warp.started",
  5456. WarpInterrupted: "warp.interrupted",
  5457. WarpEnded: "warp.ended",
  5458. FlyinFinished: "flyin.finished",
  5459. FlyingStarted: "flying.started",
  5460. FlyingInterrupted: "flying.interrupted",
  5461. FlyingEnded: "flying.ended",
  5462. Ready: "ready",
  5463. StartInside: "start.inside",
  5464. StartOutside: "start.outside",
  5465. ViewChanged: "view.changed",
  5466. WarpInterruptedWithFlyTo: "warp.interrupted.flyto",
  5467. InputStart: "input.start"
  5468. }
  5469. }
  5470. , {}],
  5471. 41: [function(e, t, i) {
  5472. "use strict";
  5473. t.exports = Object.freeze({
  5474. DEFAULT: 0,
  5475. PANOMARKERS: 1,
  5476. RETICULE: 2,
  5477. TAG: 3
  5478. })
  5479. }
  5480. , {}],
  5481. 42: [function(e, t, i) {
  5482. "use strict";
  5483. t.exports = {
  5484. visibleFloor: 1,
  5485. ghostFloor: 3,
  5486. boundingSkybox: 1,
  5487. panoMarker: 2,
  5488. reticule: 3,
  5489. tagStem: 4,
  5490. tagDisc: 5,
  5491. ribbon: 100
  5492. }
  5493. }
  5494. , {}],
  5495. 43: [function(e, t, i) {
  5496. "use strict";
  5497. t.exports = {
  5498. ContextCreated: "scene-renderer-context-created",
  5499. AfterRender: "after-render",
  5500. MemoryUsageUpdated: "scene-renderer-memory-usage-updated"
  5501. }
  5502. }
  5503. , {}],
  5504. 44: [function(e, t, i) {
  5505. "use strict";
  5506. t.exports = {
  5507. IDLE: "idle",
  5508. BROWSE: "browse",
  5509. EXAMINE: "examine"
  5510. }
  5511. }
  5512. , {}],
  5513. 45: [function(e, t, i) {
  5514. "use strict";
  5515. t.exports = {
  5516. TileDownloadSuccess: "tiledownloader.download.success",
  5517. TileDownloadFailure: "tiledownloader.download.failure",
  5518. PanoDownloadComplete: "tiledownloader.pano.download.complete"
  5519. }
  5520. }
  5521. , {}],
  5522. 46: [function(e, t, i) {
  5523. "use strict";
  5524. t.exports = {
  5525. CardboardAndroid: "googlevr",
  5526. GearVR: "gearvr",
  5527. CardboardIOS: "googlevrios",
  5528. Cardboard: "googlevr"
  5529. }
  5530. }
  5531. , {}],
  5532. 47: [function(e, t, i) {
  5533. "use strict";
  5534. t.exports = {
  5535. NONE: 0,
  5536. CONTEXTUAL: 1,
  5537. ANDROID: 2
  5538. }
  5539. }
  5540. , {}],
  5541. 48: [function(e, t, i) {
  5542. "use strict";
  5543. var n = {
  5544. Title: 0,
  5545. Cardboard: 1
  5546. }
  5547. , r = {
  5548. Title: 0,
  5549. Cardboard: 1,
  5550. Gear: 2
  5551. };
  5552. !function() {
  5553. [n, r].forEach(function(e) {
  5554. e.pageCount = Object.keys(e).length
  5555. })
  5556. }(),
  5557. t.exports.ios = n,
  5558. t.exports.standard = r
  5559. }
  5560. , {}],
  5561. 49: [function(e, t, i) {
  5562. "use strict";
  5563. t.exports = {
  5564. Android: "android",
  5565. IOS: "ios",
  5566. Desktop: "desktop",
  5567. UnsupportedAndroid: "android-unsupported"
  5568. }
  5569. }
  5570. , {}],
  5571. 50: [function(e, t, i) {
  5572. "use strict";
  5573. var n = e("three");
  5574. t.exports = {
  5575. UP: new n.Vector3(0,1,0),
  5576. DOWN: new n.Vector3(0,-1,0),
  5577. LEFT: new n.Vector3(-1,0,0),
  5578. RIGHT: new n.Vector3(1,0,0),
  5579. FORWARD: new n.Vector3(0,0,-1),
  5580. BACK: new n.Vector3(0,0,1)
  5581. }
  5582. }
  5583. , {
  5584. three: 217
  5585. }],
  5586. 51: [function(e, t, i) {
  5587. "use strict";
  5588. var n = e("../exception/ViewmodeConvertException")
  5589. , r = e("./coreViewmodes")
  5590. , o = e("../util/common")
  5591. , a = {
  5592. MESH: "mesh",
  5593. OUTDOOR: "outdoor",
  5594. TRANSITIONING: "transitioning",
  5595. toInt: function(e) {
  5596. switch (e) {
  5597. case this.PANORAMA:
  5598. return 1;
  5599. case this.DOLLHOUSE:
  5600. return 2;
  5601. case this.FLOORPLAN:
  5602. return 3;
  5603. case this.OUTDOOR:
  5604. return 4;
  5605. case this.TRANSITIONING:
  5606. return -1
  5607. }
  5608. throw new n("No known conversion for Viewmode to int for mode: " + e)
  5609. },
  5610. fromInt: function(e) {
  5611. switch (e) {
  5612. case "1":
  5613. case 1:
  5614. return this.PANORAMA;
  5615. case "2":
  5616. case 2:
  5617. return this.DOLLHOUSE;
  5618. case "3":
  5619. case 3:
  5620. return this.FLOORPLAN;
  5621. case "4":
  5622. case 4:
  5623. return this.OUTDOOR
  5624. }
  5625. throw new n("No known conversion for int to viewmode for int: " + e)
  5626. },
  5627. convertWorkshopModeInt: function(e) {
  5628. switch (e) {
  5629. case "0":
  5630. case 0:
  5631. case undefined: //xzw add
  5632. return this.PANORAMA;
  5633. case "1":
  5634. case 1:
  5635. return this.FLOORPLAN;
  5636. case "2":
  5637. case 2:
  5638. return this.DOLLHOUSE;
  5639. case "3":
  5640. case 3:
  5641. return this.MESH
  5642. }
  5643. throw new n("No known conversion for Workshop int to viewmode for int: " + e)
  5644. }
  5645. };
  5646. o.extendObject(a, r),
  5647. t.exports = a
  5648. }
  5649. , {
  5650. "../exception/ViewmodeConvertException": 58,
  5651. "../util/common": 185,
  5652. "./coreViewmodes": 54
  5653. }],
  5654. 52: [function(e, t, i) {
  5655. "use strict";
  5656. t.exports = {
  5657. BLACK: "black",
  5658. STD: "std",
  5659. WALK: "walk"
  5660. }
  5661. }
  5662. , {}],
  5663. 53: [function(e, t, i) {
  5664. "use strict";
  5665. t.exports = {
  5666. ZoomIn: "zoom.in",
  5667. ZoomOut: "zoom.out",
  5668. ZoomMax: "zoom.max",
  5669. ZoomMin: "zoom.min"
  5670. }
  5671. }
  5672. , {}],
  5673. 54: [function(e, t, i) {
  5674. "use strict";
  5675. t.exports = {
  5676. PANORAMA: "panorama",
  5677. DOLLHOUSE: "dollhouse",
  5678. FLOORPLAN: "floorplan"
  5679. }
  5680. }
  5681. , {}],
  5682. 55: [function(e, t, i) {
  5683. "use strict";
  5684. function n(e) {
  5685. this.message = e
  5686. }
  5687. t.exports = n
  5688. }
  5689. , {}],
  5690. 56: [function(e, t, i) {
  5691. "use strict";
  5692. function n(e) {
  5693. r.call(this, e)
  5694. }
  5695. var r = e("./BasicException");
  5696. n.prototype = Object.create(r.prototype),
  5697. t.exports = n
  5698. }
  5699. , {
  5700. "./BasicException": 55
  5701. }],
  5702. 57: [function(e, t, i) {
  5703. "use strict";
  5704. function n(e) {
  5705. r.call(this, e)
  5706. }
  5707. var r = e("./BasicException");
  5708. n.prototype = Object.create(r.prototype),
  5709. t.exports = n
  5710. }
  5711. , {
  5712. "./BasicException": 55
  5713. }],
  5714. 58: [function(e, t, i) {
  5715. "use strict";
  5716. function n(e) {
  5717. r.call(this, e)
  5718. }
  5719. var r = e("./BasicException");
  5720. n.prototype = Object.create(r.prototype),
  5721. t.exports = n
  5722. }
  5723. , {
  5724. "./BasicException": 55
  5725. }],
  5726. 59: [function(e, t, i) {
  5727. (function(i) {
  5728. "use strict";
  5729. function n(e) {
  5730. var t = {};
  5731. if (e) {
  5732. var i = e.flags;
  5733. if (i)
  5734. for (var n in i)
  5735. i.hasOwnProperty(n) && (t[i[n]] = !0);
  5736. return t
  5737. }
  5738. return l.debug("Feature flags -> parseFeatureFlags: rawData is null."),
  5739. null
  5740. }
  5741. var r = e("./util/ajax")
  5742. , o = e("./util/showcase")
  5743. , a = e("./util/logger")
  5744. , s = ""
  5745. , l = new a(i)
  5746. , c = {};
  5747. t.exports = {
  5748. loadFeatureFlags: function(e) {
  5749. var t = $.Deferred();
  5750. return r.get(e.urlBase + s, {
  5751. responseType: "json",
  5752. prefetchFrom: "user",
  5753. auth: o.getAuthorizationHeader()
  5754. }).done(function(e) {
  5755. c = n(e),
  5756. c ? t.resolve(c) : t.reject("loading-failed")
  5757. }).fail(function() {
  5758. l.debug("Retrieval of feature flags failed."),
  5759. t.reject("loading-failed")
  5760. }),
  5761. t.promise()
  5762. },
  5763. getFlags: function() {
  5764. return c
  5765. },
  5766. updateDependentSettings: function(e, t) {
  5767. e = e || c,
  5768. e.labels && (t.labels.enabled = !0),
  5769. e.zooming && !t.zoom.forceOff && (t.zoom.enabled = !0),
  5770. e.showcase_sdk && (t.sdkInit = !0),
  5771. e.mobile_highq_override && (t.tiling.mobileHighQualityOverride = !0),
  5772. e.showcase_webvr && (t.vr.allowWebVR = !0),
  5773. e.uhql && (t.tiling.allowUltraHighResolution = !0),
  5774. e.hide_sc_sharing && (t.share.enabled = !1)
  5775. }
  5776. }
  5777. }
  5778. ).call(this, "/js/featureflags.js")
  5779. }
  5780. , {
  5781. "./util/ajax": 181,
  5782. "./util/logger": 189,
  5783. "./util/showcase": 193
  5784. }],
  5785. 60: [function(e, t, i) {
  5786. "use strict";
  5787. var n = (e("../util/common"),
  5788. {
  5789. status: 0,
  5790. set: function(e) {
  5791. if (isNaN(e))
  5792. return !1;
  5793. var t = $('.progressbar');
  5794. 0 > e && (e = 0);
  5795. e > 100 && (e = 100);
  5796. var width = parseInt(t.css('width').replace("px",""))/100; //获取进度条总长度除以100
  5797. var barperc = e*width;
  5798. var perc = Math.round(e);
  5799. var labelpos = (parseInt(barperc)-15);
  5800. t.find('.bar').css('width',barperc); //已经再跑颜色的百分比
  5801. t.find('.label').css('left', labelpos); //上面跟着的字的百分比
  5802. t.find('.perc').text(perc+'%'); //具体数字的百分比
  5803. this.status = e
  5804. },
  5805. done: function(e) {
  5806. return e || this.status ? (this.status = null,
  5807. this.set(100)) : this
  5808. }
  5809. });
  5810. t.exports.circleLoader = n
  5811. }
  5812. , {
  5813. "../util/common": 185
  5814. }],
  5815. 61: [function(e, t, i) {
  5816. "use strict";
  5817. t.exports = Object.freeze({
  5818. CLOSE: "modal.closer.close"
  5819. })
  5820. }
  5821. , {}],
  5822. 62: [function(e, t, i) {
  5823. "use strict";
  5824. function n(e, t) {
  5825. t && (t.stopPropagation(),
  5826. t.preventDefault()),
  5827. e && this.emit(l.CLOSE, e),
  5828. g.reset()
  5829. }
  5830. function r(e, t) {
  5831. function i() {
  5832. var t = e.offsetHeight >= $("#player").height() && e.offsetWidth >= $("#player").width();
  5833. t !== f && (f = t,
  5834. t ? (e.classList.add("closeByFooter"),
  5835. h.classList.add("closeByFooter")) : (e.classList.remove("closeByFooter"),
  5836. h.classList.remove("closeByFooter")))
  5837. }
  5838. t ? setTimeout(i, o.guiAnimationSpeed) : i()
  5839. }
  5840. var o = e("../../settings")
  5841. , a = (e("../../tag/Media/MediaEvent"),
  5842. e("../../util/browser"))
  5843. , s = e("../../util/common")
  5844. , l = e("./ModalCloserEvent")
  5845. , c = e("events").EventEmitter
  5846. , h = document.getElementsByClassName("footer")[0]
  5847. , u = h.querySelectorAll(".close")[0]
  5848. , d = null
  5849. , p = null
  5850. , f = null
  5851. , g = (a.isMobile(),
  5852. {
  5853. open: function(e) {
  5854. e && (r(e),
  5855. d && u.removeEventListener("click", d, !0),
  5856. d = n.bind(this, e.id),
  5857. u.addEventListener("click", d, !0),
  5858. p && window.removeEventListener("resize", p, !0),
  5859. p = r.bind(this, e),
  5860. window.addEventListener("resize", p, !0))
  5861. },
  5862. reset: function() {
  5863. h.classList.remove("closeByFooter"),
  5864. u.removeEventListener("click", d, !0),
  5865. window.removeEventListener("resize", p, !0),
  5866. d = p = f = null
  5867. }
  5868. });
  5869. s.extendObject(g, c.prototype),
  5870. t.exports = g
  5871. }
  5872. , {
  5873. "../../tag/Media/MediaEvent": 131,
  5874. "../../settings": 166,
  5875. "../../util/browser": 182,
  5876. "../../util/common": 185,
  5877. "./ModalCloserEvent": 61,
  5878. events: 202
  5879. }],
  5880. 63: [function(e, t, i) {
  5881. "use strict";
  5882. function n(e, t, i) {
  5883. var n = new r.GUI({
  5884. width: 400
  5885. })
  5886. , u = n.addFolder("Flydown from Dollhouse");
  5887. u.add(h.flydown, "movementEasing", Object.keys(a)),
  5888. u.add(h.flydown, "movementDelay", 0, 1).step(.01),
  5889. u.add(h.flydown, "rotationEasing", Object.keys(a)),
  5890. u.add(h.flydown, "rotationDelay", 0, 1).step(.01),
  5891. u.add(h.flydown, "modelTextureDelay", 0, 1).step(.01),
  5892. u.add(h.flydown, "skyboxDelay", 0, 1).step(.01),
  5893. u.add(h.dollhouseDefault, "minPolarAngle", 0, o.Math.degToRad(50)),
  5894. u.add(h.dollhouseDefault, "maxPolarAngle", o.Math.degToRad(50), o.Math.degToRad(170));
  5895. var d = n.addFolder("Transition between panos");
  5896. d.add(h.transition, "blur", 0, 10).onFinishChange(function() {}),
  5897. d.add(h.transition, "flySpeed", 0, 10).step(.01).onFinishChange(function() {
  5898. h.transition.flyTime = 0,
  5899. d.__controllers.forEach(function(e) {
  5900. e.updateDisplay()
  5901. })
  5902. }),
  5903. d.add(h.transition, "flyTime", 0, 5e3).onFinishChange(function() {
  5904. h.transition.flySpeed = 0,
  5905. d.__controllers.forEach(function(e) {
  5906. e.updateDisplay()
  5907. })
  5908. }),
  5909. d.add(h.transition, "aimTime", 500, 2500).step(50),
  5910. d.add(h.transition, "aimSlowFactor", 1, 3).step(.1),
  5911. d.add(h.transition, "movementEasing", Object.keys(a));
  5912. var p = n.addFolder("Path Display");
  5913. p.add(h.path, "opacity", 0, 1).step(.01).onFinishChange(function() {}),
  5914. p.add(h.path, "height", 0, .2).step(.01).onFinishChange(function() {}),
  5915. p.add(h.path, "outsideHeight", 0, 2).step(.01).onFinishChange(function() {}),
  5916. p.add(h.path, "ribbonWidth", .01, .35).step(.01).onFinishChange(function() {}),
  5917. p.add(h.path, "waypointRadius", .01, 1.2).step(.01).onFinishChange(function() {}),
  5918. p.add(h.path, "waypointPulse", 0, 3600).step(20).onFinishChange(function() {}),
  5919. p.add(h.path, "waypointIndoorRadius", .01, 1.2).step(.01).onFinishChange(function() {}),
  5920. p.add(h.path, "fadeInTime", 0, 1200).step(10).onFinishChange(function() {}),
  5921. p.add(h.path, "fadeOutTime", 0, 1200).step(10).onFinishChange(function() {}),
  5922. p.add(h.path, "color", Object.keys(l)).onFinishChange(function() {
  5923. h.path.color = l[h.path.color],
  5924. h.path.colorUp = l._desat(h.path.color),
  5925. h.path.colorDown = l.darken(h.path.color)
  5926. }),
  5927. p.add(h, "reticuleColor", Object.keys(l)).onFinishChange(function() {
  5928. h.reticuleColor = l[h.reticuleColor]
  5929. });
  5930. var f = n.addFolder("Warping")
  5931. , g = f.addFolder("Warp/Teleport");
  5932. g.add(h.warp, "softPushDist", 0, 2).onFinishChange(function() {}),
  5933. g.add(h.warp, "softPushEnd", 0, 1).step(.01).onFinishChange(function() {}),
  5934. g.add(h.warp, "softBendAngle", 0, 45).onFinishChange(function() {}),
  5935. g.add(h.warp, "softBendTilt", 0, 45).onFinishChange(function() {}),
  5936. g.add(h.warp, "softBendEnd", 0, 1).step(.01).onFinishChange(function() {}),
  5937. g.add(h.warp, "burnsAngle", 0, 30).onFinishChange(function() {}),
  5938. g.add(h.warp, "minBurnsAngle", 0, 10).onFinishChange(function() {}),
  5939. g.add(h.warp, "brakeStrength", 1, 8).onFinishChange(function() {}),
  5940. g.add(h.warp, "minBrakeAngle", 0, 5).step(.01).onFinishChange(function() {}),
  5941. g.add(h.warp, "maxBrakeAngle", 0, 5).step(.01).onFinishChange(function() {}),
  5942. g.add(h.path, "mapGuides").onFinishChange(function() {}),
  5943. g.add(h.warp, "teleportTime", 0, 5e3).step(10).onFinishChange(function() {}),
  5944. g.add(h.warp, "outsideTime", 0, 5e3).step(10).onFinishChange(function() {}),
  5945. g.add(h.path, "typ", Object.keys(c)).onFinishChange(function() {
  5946. h.path.typ = c[h.path.typ]
  5947. }),
  5948. g.add(h.warp, "loop").onChange(function() {}).onFinishChange(function() {
  5949. t.endlessLoop = h.warp.loop
  5950. }),
  5951. g.add(h.warp, "walkSlideShowThreshhold", 1, 1e4).step(1).onFinishChange(function() {}),
  5952. g.add(h.warp, "walkExtraPanosDistance", 0, 3).step(.1).onFinishChange(function() {}),
  5953. g.add(h.transition, "fastForwardFactor", 1, 10).step(1).onFinishChange(function() {});
  5954. var m = f.addFolder("Long Warp Only");
  5955. m.add(h.warp, "minWarpTime", 0, 5e3).step(10).onFinishChange(function() {
  5956. h.warp.flySpeed = 0,
  5957. m.__controllers.forEach(function(e) {
  5958. e.updateDisplay()
  5959. })
  5960. }),
  5961. m.add(h.warp, "timePerMeter", 0, 5e3).step(10).onFinishChange(function() {}),
  5962. m.add(h.warp, "lookAheadMax", .01, 1).step(.01).onFinishChange(function() {}),
  5963. m.add(h.warp, "lookAheadDist", .01, 4).step(.01).onFinishChange(function() {}),
  5964. m.add(h.warp, "maxTurnPerSec", 0, 720).step(1).onFinishChange(function() {}),
  5965. m.add(h.warp, "maxAimPerSec", 0, 720).step(1).onFinishChange(function() {}),
  5966. m.add(h.warp, "turnFriction", 0, 1).step(.01).onFinishChange(function() {}),
  5967. m.add(h.warp, "walkDelay", 0, 2e3).step(10).onFinishChange(function() {}),
  5968. m.add(h.transition, "flytimeMaxDistanceThreshold", 0, 25).step(10).onFinishChange(function() {}),
  5969. m.add(h.warp, "walkMaxDist", 0, 100).step(1).onFinishChange(function() {});
  5970. var v = n.addFolder("Warp Esoterica");
  5971. v.add(h.warp, "nearPanoDist", .01, 12).step(0).onFinishChange(function() {}),
  5972. v.add(h.warp, "blur", .01, 1).onFinishChange(function() {}),
  5973. v.add(h.warp, "flySpeed", 0, 10).step(.01).onFinishChange(function() {
  5974. h.warp.minWarpTime = 0,
  5975. v.__controllers.forEach(function(e) {
  5976. e.updateDisplay()
  5977. })
  5978. }),
  5979. v.add(h.warp, "showBunny").onFinishChange(function() {}),
  5980. v.add(h.warp, "fastTime", 0, 2500).step(10).onFinishChange(function() {}),
  5981. v.add(h.warp, "movementEasing", Object.keys(a));
  5982. var A = n.addFolder("Misc");
  5983. A.add(h, "dollhouseFOV", 10, 180).onChange(function() {
  5984. i.cameras[s.DOLLHOUSE].fov = h.dollhouseFOV
  5985. }),
  5986. A.add(h, "insideFOV", 10, 180).onChange(function() {
  5987. i.cameras[s.PANORAMA].fov = h.insideFOV
  5988. }),
  5989. A.add(h, "insideLookSpeed", .01, .3).step(.01).onChange(function() {}),
  5990. A.add(h, "rotationAccelerationInside", .1, 10).step(.1).onChange(function() {}),
  5991. A.add(h, "rotationAccelerationOutside", .1, 10).step(.1).onChange(function() {});
  5992. var y = n.addFolder("Navigation");
  5993. y.add(h.navigation, "panoScores").onFinishChange(function() {
  5994. h.navigation.panoScores || e.panos.forEach(function(e) {
  5995. e.floor.remove(e.text3d),
  5996. e.text3d = null
  5997. })
  5998. }),
  5999. y.add(h.navigation, "mouseDirection"),
  6000. y.add(h.navigation, "filterStrictness", 0, 1),
  6001. y.add(h.navigation, "angleFactor", -60, 0),
  6002. y.add(h.navigation, "directionFactor", 1, 20),
  6003. y.add(h.navigation, "distanceFactor", -5, 5),
  6004. y.add(h.navigation, "optionalityFactor", .1, 10);
  6005. var C = n.addFolder("tags")
  6006. , I = C.addFolder("Tag Creation");
  6007. I.add(h.tags.pole, "enabled").name("poleEnabled"),
  6008. I.add(h.tags.pole, "height", 0, 2.5).step(.01).name("poleHeight"),
  6009. I.add(h.tags.pole, "width", 1, 10).step(1).name("poleWidth"),
  6010. I.add(h.tags.pole, "opacity", .1, 1).step(.1).name("poleOpacity");
  6011. var E = C.addFolder("Visibility");
  6012. E.add(h.tags.visibility, "anyDistance"),
  6013. E.add(h.tags.visibility, "visibleDistance", .1, 30).step(.1),
  6014. E.add(h.tags.visibility, "cameraClearance", 0, 1).step(.01),
  6015. E.add(h.tags.visibility, "hideViaFloor"),
  6016. E.add(h.tags.visibility, "hideOffScreenDisc").name("hideEdgeDisc"),
  6017. E.add(h.tags.visibility, "hideOffScreenObject").name("hideEdgeObject");
  6018. var b = C.addFolder("Disc Parameters");
  6019. b.add(h.tags.disc.scale, "nearBound", .1, 10).step(.1),
  6020. b.add(h.tags.disc.scale, "farBound", .1, 20).step(.1).listen(),
  6021. b.add(h.tags.disc.scale, "linkFarBound").onChange(function(e) {
  6022. e && (h.tags.disc.scale.farBound = h.tags.visibility.visibleDistance * (1 - h.tags.disc.scale.linkPercent / 100))
  6023. }),
  6024. b.add(h.tags.disc.scale, "linkPercent", 0, 100).step(1).onChange(function(e) {
  6025. h.tags.disc.scale.linkFarBound && (h.tags.disc.scale.farBound = h.tags.visibility.visibleDistance * (1 - e / 100))
  6026. }),
  6027. b.add(h.tags.disc.scale, "maxSize", 40, 200).step(1),
  6028. b.add(h.tags.disc.scale, "minSize", 20, 100).step(1),
  6029. b.add(h.tags.disc.scale, "responsiveness", 0, 100).step(1);
  6030. var w = C.addFolder("Navigate");
  6031. w.add(h.tags.navigate, "nearestPano").name("nearestPano"),
  6032. w.add(h.tags.navigate, "lineOfSight").name("lineOfSight"),
  6033. w.add(h.tags.navigate, "reactivate").name("reactivate"),
  6034. w.add(h.tags.navigate, "aimAt", ["disc", "object", "pole", "nothing"]).name("aim at"),
  6035. w.add(h.tags.navigate, "tiltTolerance", 0, 50).step(1),
  6036. w.add(h.tags.navigate, "rotateSpeedFactor", 0, 5).step(.1);
  6037. var _ = n.addFolder("Debug");
  6038. _.add(h, "wireframe").onFinishChange(function() {
  6039. e.chunks.forEach(function(t) {
  6040. t.material && (t.wireframeTwin || (t.wireframeTwin = new o.WireframeHelper(t),
  6041. t.wireframeTwin.material.depthWrite = !1,
  6042. t.wireframeTwin.material.depthTest = !1,
  6043. t.wireframeTwin.material.opacity = .5,
  6044. t.wireframeTwin.material.transparent = !0),
  6045. h.wireframe ? e.add(t.wireframeTwin) : e.remove(t.wireframeTwin))
  6046. })
  6047. }),
  6048. _.add(h, "skyboxWireframe").onFinishChange(function() {
  6049. h.skyboxWireframe ? (e.skybox.wireframe = new o.WireframeHelper(e.skybox),
  6050. e.add(e.skybox.wireframe)) : (e.remove(e.skybox.wireframe),
  6051. e.skybox.wireframe = null)
  6052. }),
  6053. _.add(h, "showSweeps").onFinishChange(function() {
  6054. e.setSweepVisibility(h.showSweeps)
  6055. }),
  6056. _.add(h, "showMesh").onFinishChange(function() {
  6057. e.chunks.forEach(function(e) {
  6058. e.visible = h.showMesh
  6059. })
  6060. }),
  6061. _.add(h, "showFloors").onFinishChange(function() {
  6062. e.floors.forEach(function(e) {
  6063. e.collider.children.forEach(function(e) {
  6064. e.material.visible = h.showFloors
  6065. })
  6066. })
  6067. }),
  6068. _.add(h, "showSkyboxes").onFinishChange(function() {
  6069. e.panos.forEach(function(e) {
  6070. e.skyboxMesh.visible = h.showSkyboxes
  6071. })
  6072. }),
  6073. _.add(h, "showNeighbors").onChange(function() {}),
  6074. _.add(e, "alpha", 0, 1)
  6075. }
  6076. var r = e("../lib/dat.gui")
  6077. , o = e("three")
  6078. , a = e("../util/easing")
  6079. , s = e("../enum/Viewmode")
  6080. , l = e("../enum/Colors")
  6081. , c = e("../enum/WarpStyle")
  6082. , h = e("../settings");
  6083. e("../tag/tag");
  6084. r.GUI.prototype.removeFolder = function(e) {
  6085. var t = this.__folders[e];
  6086. t && (t.close(),
  6087. this.__ul.removeChild(t.domElement.parentNode),
  6088. delete this.__folders[e],
  6089. this.onResize())
  6090. }
  6091. ,
  6092. t.exports.toggle = n
  6093. }
  6094. , {
  6095. "../enum/Colors": 19,
  6096. "../enum/Viewmode": 51,
  6097. "../enum/WarpStyle": 52,
  6098. "../lib/dat.gui": 93,
  6099. "../tag/tag": 123,
  6100. "../settings": 166,
  6101. "../util/easing": 186,
  6102. three: 217
  6103. }],
  6104. 64: [function(e, t, i) {
  6105. (function(i) {
  6106. "use strict";
  6107. function n(e, t, i, n) {
  6108. $(".gui-error .error-problem-text").text(e),
  6109. $(".gui-error .error-solution-text").text(t),
  6110. $(".gui-error .error-explanation").text(i),
  6111. $(".gui-error .error-actions").html(n),
  6112. $(window).resize(),
  6113. $(".gui-error").fadeIn(),
  6114. $("#bottom-logo").fadeIn()
  6115. }
  6116. function r(e) {
  6117. 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("");
  6118. n(e, h.ERROR_BROWSER_SOLUTION, h.ERROR_BROWSER_EXPLANATION, t),
  6119. s.isMobile() || $("[rel=tiletip]").tooltip({
  6120. placement: "bottom",
  6121. delay: {
  6122. show: 50,
  6123. hide: 0
  6124. },
  6125. trigger: "hover",
  6126. viewport: {
  6127. selector: "body",
  6128. padding: 10
  6129. }
  6130. })
  6131. }
  6132. function o() {
  6133. var e = s.isMobile() ? "" : '<span class="link install-browser">' + h.ERROR_GENERIC_ACTIONS_2 + "</span>" + h.ERROR_GENERIC_ACTIONS_3
  6134. , t = [h.ERROR_GENERIC_ACTIONS_1, e,].join("");
  6135. n(h.ERROR_GENERIC_PROBLEM, h.ERROR_GENERIC_SOLUTION, "", t),
  6136. s.isMobile() || $(".install-browser").on("click touchstart", function(e) {
  6137. e.preventDefault(),
  6138. e.stopPropagation(),
  6139. r(" ")
  6140. })
  6141. }
  6142. function a(e) {
  6143. if ($("head title").text(c.pageTitle),
  6144. $("#gui-message, #gui-loading, #nprogress, #gui-thumb, #bottom-logo").hide(),
  6145. $("#gui-loading").fadeOut(250),
  6146. $("#quick-blackout").hide(),
  6147. l.track("showcase_error", {
  6148. error_key: e
  6149. }),
  6150. h.locale || h.init(),
  6151. "webgl-unsupported" === e)
  6152. s.isMobile() ? o() : r(h.ERROR_WEBGL_UNSUPPORTED_PROBLEM);
  6153. else if ("webgl-ios" === e)
  6154. 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>.");
  6155. else if ("webgl-safari" === e)
  6156. 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>.");
  6157. else if ("webgl-generic" === e)
  6158. o();
  6159. else if ("missing-urls" === e)
  6160. n(h.ERROR_MISSING_URLS_PROBLEM, "", h.ERROR_MISSING_URLS_EXPLANATION);
  6161. else if ("loading-failed" === e)
  6162. 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>.");
  6163. else {
  6164. if ("loading-failed-maintenance" !== e)
  6165. return void d.error("Unhandled error: " + e);
  6166. n(h.ERROR_MAINTENANCE_PROBLEM, h.ERROR_MAINTENANCE_SOLUTION)
  6167. }
  6168. }
  6169. var s = e("./../util/browser")
  6170. , l = e("./../analytics")
  6171. , c = e("./../settings")
  6172. , h = e("../localization/localize")
  6173. , u = e("./../util/logger")
  6174. , d = new u(i)
  6175. , p = '"https://support.port.com/hc/articles/208220058"';
  6176. t.exports.error = a
  6177. }
  6178. ).call(this, "/js/gui/error.js")
  6179. }
  6180. , {
  6181. "../localization/localize": 108,
  6182. "./../analytics": 4,
  6183. "./../settings": 166,
  6184. "./../util/browser": 182,
  6185. "./../util/logger": 189
  6186. }],
  6187. 65: [function(e, t, i) {
  6188. (function(i) {
  6189. "use strict";
  6190. function n() {
  6191. Ue = [],
  6192. je.floors.visible && Ue.push(".gui-floor", ".gui-floor-title"),
  6193. Ue.push(".hideTarget", ".pinTop.right")
  6194. }
  6195. function r() {
  6196. for (var e in je)
  6197. if (je.hasOwnProperty(e)) {
  6198. var t = je[e];
  6199. if (!t.visible)
  6200. for (var i = 0; i < t.elements.length; i++)
  6201. $(t.elements[i]).hide()
  6202. }
  6203. je.highlight.visible && $(".pinBottom").addClass("highlightExists"),
  6204. je.tourControls.visible === !1 && $("#drawer").addClass("fullWidth"),
  6205. n()
  6206. }
  6207. function o(e, t) {
  6208. var i = !K.isMobile() && Q.zoom.enabled && t.mode === _e.PANORAMA && !e.tourIsPlaying;
  6209. $("#gui-zoomin").toggle(i),
  6210. $("#gui-zoomout").toggle(i)
  6211. }
  6212. function a() {
  6213. c(),
  6214. $(".pinBottom").toggleClass("open"),
  6215. $("#drawer").toggleClass("open"),
  6216. $(".footer").toggleClass("open"),
  6217. $("#drawer").hasClass("open") ? ($("#pullTab .icon").attr("data-original-title", Re.CLOSE_HIGHLIGHTS),
  6218. Ze("highlights")) : ($("#pullTab .icon").attr("data-original-title", Re.OPEN_HIGHLIGHTS),
  6219. ie.resetDrawer()),
  6220. setTimeout(function() {
  6221. $("#pullTab").toggleClass("opened");
  6222. }, $("#drawer").hasClass("open") ? 0 : Q.highlightAnimationDuration),
  6223. $(".pinBottom").hasClass("open") && s($(".vr-popup")) && $(".vr-popup").is(":visible") && Ae.dismiss()
  6224. }
  6225. function s(e) {
  6226. var t;
  6227. "none" !== e.css("display") ? t = e.position().top + e.outerHeight() : (e.attr("style", "visibility: hidden"),
  6228. t = e.position().top + e.outerHeight(),
  6229. e.attr("style", "display: none"));
  6230. var i = $("#player").outerHeight()
  6231. , n = i - 130;
  6232. return n < t + 25
  6233. }
  6234. function l(e) {
  6235. "touchstart" === e.type && e.preventDefault(),
  6236. e.stopPropagation()
  6237. }
  6238. function c() {
  6239. W && (W.reload(),
  6240. W.init())
  6241. }
  6242. function h(e) {
  6243. ne.show(e),
  6244. r()
  6245. }
  6246. function u(e) {
  6247. ne.progress(e)
  6248. }
  6249. function d(e, t, i) {
  6250. var n = t.player;
  6251. $("#gui-thumb").fadeOut(2500),
  6252. ne.hide(function() {
  6253. Ge = !1
  6254. }),
  6255. me.init(e, i),
  6256. de.finishSetup(Object.keys(e.tags).length),
  6257. i.on(Te.IMAGE_OPENED, Ze.bind(this, "tag"));
  6258. var s = function() {
  6259. i.dismissExaminedTag(),
  6260. i.disableHovering()
  6261. };
  6262. Ae.on(ye.OPENED, s),
  6263. Ce.on(Me.OPENED, s),
  6264. he.on(ue.OPENED, s),
  6265. fe.on(ge.OPENED, s);
  6266. var l = i.enableHovering.bind(i);
  6267. if (Ae.on(ye.CLOSED, l),
  6268. Ce.on(Me.CLOSED, l),
  6269. he.on(ue.CLOSED, l),
  6270. fe.on(ge.CLOSED, l),
  6271. Q.labels.enabled && Object.keys(e.labels).length,
  6272. e.floors.length <= 1 || !je.floors.visible ? je.floors.visible = !1 : (y(e, t),
  6273. C(e.currentFloor, n.mode)),
  6274. getQueryVariable('m') === '372'&& (je.floors.visible = 1, y(e,t)),
  6275. r(),
  6276. o(t, t.player),
  6277. $("#gui").fadeIn(1500),
  6278. je.highlight.visible && (2 !== Q.startHighlights || e.has360Views) && setTimeout(function() {
  6279. a(),
  6280. (!e.has360Views && 1 !== Q.startHighlights || e.has360Views && 0 === Q.startHighlights) && setTimeout(a, 2e3)
  6281. }, 2e3),
  6282. !K.isMobile())
  6283. for (var c = ["a", "#title-toggle", ".next-button", ".prev-button", ".gui-floor", ".meta-toggle", ".thumbImg", "logo-button"], h = 0; h < c.length; h++)
  6284. $(c[h]).addClass("hasHover");
  6285. O(e),
  6286. de.setupToggling();
  6287. //xzw:
  6288. window.editHotPanel && editHotPanel();
  6289. //czj
  6290. navBorderRadius(e);
  6291. //czj 编辑界面
  6292. //window.EditingInterface && new EditingInterface(n.sceneRenderer);
  6293. window.EditTools && new EditTools(n.sceneRenderer);
  6294. }
  6295. function navBorderRadius(e){
  6296. var pullTab = $("#pullTab"),
  6297. mobileRadius = {
  6298. "bottom":{"border-bottom-left-radius":"10px","border-bottom-right-radius":"10px"},
  6299. "top":{"border-top-left-radius":"10px","border-top-right-radius":"10px"}
  6300. },
  6301. topRadius = {
  6302. "bottom":{"border-top-right-radius":"10px","border-bottom-right-radius":"10px"},
  6303. "top":{"border-bottom-left-radius":"10px","border-top-left-radius":"10px"}
  6304. };
  6305. function BorderRadius(bottom,top){
  6306. $("#gui-modes-map > div:visible:last").css(bottom);
  6307. if(pullTab.is(':visible')){
  6308. $(".viewContainer > div:visible:first").css(top);
  6309. }else{
  6310. $("#gui-modes-map > div:visible:first").css(top);
  6311. }
  6312. }
  6313. if(/Android|webOS|iPhone|iPod|BlackBerry/i.test(navigator.userAgent)){
  6314. BorderRadius(mobileRadius.bottom,mobileRadius.top);
  6315. }else{
  6316. BorderRadius(topRadius.bottom,topRadius.top);
  6317. }
  6318. //判断someData里面是否有special字段,如果有就会处理这些特殊的大场景
  6319. if(window.DATA.model.special || window.DATA.special){
  6320. window.specialScene && specialScene.special().afterImplement();
  6321. }
  6322. }
  6323. function p(e) {
  6324. e || (e = 0),
  6325. We = !1,
  6326. window.setTimeout(function() {
  6327. We || (ze = !0,
  6328. $("#gui-spinner").stop(!0, !0).show())
  6329. }
  6330. .bind(this), e)
  6331. }
  6332. function f() {
  6333. $("#gui-spinner").stop(!0, !0),
  6334. $("#gui-spinner").fadeOut(1e3),
  6335. We = !0,
  6336. ze = !1
  6337. }
  6338. function g(e, t) {
  6339. var i = e.mode
  6340. , n = t || e.currentPano;
  6341. $("#gui-modes-dollhouse").toggleClass("active", i === _e.DOLLHOUSE),
  6342. $("#gui-modes-floorplan").toggleClass("active", i === _e.FLOORPLAN),
  6343. $("#gui-modes-inside").toggleClass("active", i === _e.PANORAMA),
  6344. i === _e.PANORAMA ? ($("#view-controllers").slideUp(500),
  6345. Q.show360Views.enabled && !n.isAligned() ? (
  6346. $(".gui-floor").addClass("hidden"),
  6347. $("#gui-modes-outside").addClass("desktop-only")) : (
  6348. $(".gui-floor").removeClass("hidden"),
  6349. $("#gui-modes-outside").removeClass("desktop-only")),
  6350. $("#gui-modes-outside").removeClass("hidden")) : i !== _e.TRANSITIONING && (f(),
  6351. Be = i,
  6352. $("#gui-modes-outside").addClass("hidden"),
  6353. e.model.has360Views && $(".gui-floor").removeClass("hidden"),
  6354. $("#view-controllers").is(":visible") || $("#view-controllers").slideDown(Q.guiAnimationSpeed))
  6355. }
  6356. function m(e, t) {
  6357. var i = t.player;
  6358. $("#gui-modes-inside").on("mousedown touchstart", function(e) {
  6359. l(e),
  6360. J.updateInteraction(Se.InteractionGui, "inside-button"),
  6361. J.track("USER", {
  6362. event_type: "showcase_gui",
  6363. gui_action: "click_inside_mode_button"
  6364. }),
  6365. t.changeMode(_e.PANORAMA);
  6366. }),
  6367. $("#gui-modes-outside").find("a").on("click", function(e) {
  6368. l(e),
  6369. J.track("showcase_gui", {
  6370. gui_action: "click_outside_mode_button"
  6371. }),
  6372. t.changeMode(Be)
  6373. }),
  6374. $("#gui-modes-floorplan").on("click", function(e) {
  6375. SoundManager.pause('tour')
  6376. l(e),
  6377. i.mode !== _e.FLOORPLAN && (J.track("showcase_gui", {
  6378. gui_action: "click_floorplan_mode_button"
  6379. }),
  6380. t.changeMode(_e.FLOORPLAN));
  6381. }),
  6382. $("#gui-modes-dollhouse").on("click", function(e) {
  6383. SoundManager.pause('tour')
  6384. l(e),
  6385. i.mode !== _e.DOLLHOUSE && (J.track("showcase_gui", {
  6386. gui_action: "click_dollhouse_mode_button"
  6387. }),
  6388. t.changeMode(_e.DOLLHOUSE));
  6389. })
  6390. $("#gui-modes-inside").on("click", function() {
  6391. SoundManager.pause('tour')
  6392. })
  6393. }
  6394. function v(e, t) {
  6395. function i() {
  6396. document.getElementById("vr").classList.remove("hidden"),
  6397. Q.vr.allowWebVR ? K.getVRDisplay().then(function(e) {
  6398. K.supportsFullscreen() ? n(e) : (De.warn("Unable to use WebVR when full screen is not supported"),
  6399. $(".improper-embed").toggleClass("hidden", !1),
  6400. r())
  6401. }, function(e) {
  6402. r()
  6403. }) : r()
  6404. }
  6405. function n(i) {
  6406. De.info(i.displayName + " detected, VR button activates WebVR experience"),
  6407. Ie.init(e.data, t, i, q),
  6408. Ie.on(Ee.OPENED, Ze.bind(gui, "vr")),
  6409. Ie.on(Ee.SHOW_TERMS, fe.show.bind(fe))
  6410. }
  6411. function r() {
  6412. De.info("WebVR support not found, VR button activates native app VR modal"),
  6413. Ae.init(e.data, q),
  6414. Ae.on(ye.OPENED, function() {
  6415. var e = document.getElementById("vr-modal");
  6416. return function() {
  6417. Ze("vr"),
  6418. le.open(e)
  6419. }
  6420. }()),
  6421. Ae.on(ye.CLOSED, le.reset)
  6422. }
  6423. if (Q.vr.enabled && e.supportsVR && !K.valueFromHash("mls", 0)){
  6424. /*********************** 方奕卓 VR功能事件监听 ********************/
  6425. K.isMobile() && $('#vr').css('display', ''); // 显示vr功能按钮
  6426. switch (Q.vr.option) {
  6427. case Pe.CONTEXTUAL:
  6428. i();
  6429. break;
  6430. case Pe.ANDROID:
  6431. K.detectAndroid() && i();
  6432. break;
  6433. case Pe.NONE:
  6434. }
  6435. }
  6436. }
  6437. function A(e, t) {
  6438. $("#play").on("mousedown touchstart", function(e) {
  6439. l(e);
  6440. Ze("tour");
  6441. ve.play();
  6442. J.trackAlways("showcase_gui", {
  6443. gui_action: "play_highlights"
  6444. })
  6445. }),
  6446. window.startAndPlay = function(e) {
  6447. // l(e);
  6448. Ze("tour");
  6449. ve.play();
  6450. J.trackAlways("showcase_gui", {
  6451. gui_action: "play_highlights"
  6452. })
  6453. };
  6454. $("#pause").on("mousedown touchstart", function(e) {
  6455. l(e),
  6456. ve.pause(),
  6457. J.trackAlways("showcase_gui", {
  6458. gui_action: "pause_highlights"
  6459. })
  6460. }),
  6461. $("#gui-zoomin").find("a").on("click", function(e) {
  6462. l(e),
  6463. t.player.zoomInIncrementally()
  6464. }),
  6465. $("#gui-zoomout").find("a").on("click", function(e) {
  6466. l(e),
  6467. t.player.zoomOutIncrementally()
  6468. })
  6469. }
  6470. function y(e, t) {
  6471. for (var i = $(".gui-floor"), n = 0; n < e.floors.length; n++) {
  6472. if(getQueryVariable('m') === '372') continue;
  6473. var r = $('<div class="floorChoice" data-index="' + n + '"></div>').text(e.floors.get(n).name);
  6474. $(".gui-floor").find(".container").prepend(r)
  6475. //cxz 本来一开始是prepend 后来改了append 按顺序插入
  6476. }
  6477. i.find(".container").prepend('<div class="floorChoice darkGlass allFloorBtn" data-index="all" style="display:none">' + Re.FLOOR_ALL + "</div>"),
  6478. i.on("click", function(e) {
  6479. l(e),
  6480. Ze("floor"),
  6481. i.toggleClass("open")
  6482. }),
  6483. $(".floorChoice").on("click", function(e) {
  6484. l(e);
  6485. var n = $(this).data("index");
  6486. "all" !== n ? (J.updateInteraction(Se.InteractionGui, "floor-control"),
  6487. t.player.gotoFloor(n),
  6488. J.track("showcase_gui", {
  6489. gui_action: "click_floor_select_button",
  6490. interaction_source: "gui"
  6491. })) : (J.updateInteraction(Se.InteractionGui, "floor-control"),
  6492. Ze("move"),
  6493. t.allFloors(),
  6494. J.track("showcase_gui", {
  6495. gui_action: "click_toggle_all_floors_button",
  6496. interaction_source: "gui"
  6497. })),
  6498. i.removeClass("open")
  6499. })
  6500. }
  6501. function C(e, t) {
  6502. 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()),
  6503. e.model.allFloorsVisible ? ($(".gui-floor-title").text(Re.FLOOR_ALL),
  6504. $(".gui-floor-number").text(Re.FLOOR_ALL),
  6505. $(".floorChoice").removeClass("active"),
  6506. $('.floorChoice[data-index="all"]').addClass("active")) : ($(".gui-floor-title").text(e.name),
  6507. $(".gui-floor-number").text(" " + (e.floorIndex + 1)),
  6508. $(".floorChoice").removeClass("active"),
  6509. $(".floorChoice[data-index=" + e.floorIndex + "]").addClass("active")))
  6510. }
  6511. function I(e) {
  6512. return e.describe().inTransition
  6513. }
  6514. function b(e, t, i) {
  6515. Fe = e.heroLocations.length;
  6516. var n = '<li class="thumbImg" data-index=""><img src=""></li>'
  6517. , r = 100 / Fe + "%"
  6518. , o = $("#thumb-container")
  6519. , a = $("#progressBar");
  6520. $("#status").find(".totalSteps").text(Fe);
  6521. for (var s = 0; s < Fe; s++) {
  6522. var c = e.heroLocations[s]
  6523. , h = $(n);
  6524. var thumbUrl
  6525. if(c.heroLocations){//有子项,选第一张截图
  6526. thumbUrl = manage.dealURL(c.heroLocations[0].thumbUrl)//.replace('https://','').replace('http://','')
  6527. }else{
  6528. thumbUrl = manage.dealURL(c.thumbUrl)//.replace('https://','').replace('http://','')
  6529. }
  6530. h.attr("data-index", s)
  6531. je.highlight.visible && h.find("img").attr("src", thumbUrl)
  6532. if (c.name) {
  6533. var u = $('<div class="overlay"></div>').text(c.name);
  6534. h.prepend(u)
  6535. }
  6536. if (e.has360Views && c.cameraMode === _e.PANORAMA) {
  6537. var d = e.panos.get(c.panoId)
  6538. , p = d && !d.isAligned()
  6539. , 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>';
  6540. h.prepend(f)
  6541. }
  6542. o.append(h),
  6543. a.append('<div class="step" data-idx="' + s + '" style="width:' + r + '"></div>')
  6544. }
  6545. j = 144 * Fe,
  6546. Y = 111 * Fe,
  6547. $(".thumbImg").on("mouseover", function() {
  6548. I(t) || i.showPathToHeroLocation([$(this).data("index"),0])//改
  6549. }),
  6550. $(".thumbImg").on("mouseout", function() {
  6551. t.clearPath()
  6552. }),
  6553. $(".thumbImg").on("click", function(e) {
  6554. l(e);
  6555. var i = $(this);
  6556. J.updateInteraction(Se.InteractionGui, "thumbnail"),
  6557. J.trackAlways("showcase_gui", {
  6558. gui_action: "click_highlight"
  6559. }),
  6560. t.goToHighlight([i.data("index"),0])
  6561. //改
  6562. }),
  6563. $(".previous").find("a").on("click", function(e) {
  6564. l(e),
  6565. J.trackAlways("showcase_gui", {
  6566. gui_action: "prev_highlight"
  6567. }),
  6568. t.prevHighlight()
  6569. }),
  6570. $(".next").find("a").on("click", function(e) {
  6571. l(e),
  6572. J.trackAlways("showcase_gui", {
  6573. gui_action: "next_highlight"
  6574. }),
  6575. t.nextHighlight()
  6576. }),
  6577. $("#drawer").on("mouseleave", function(e) {
  6578. l(e);
  6579. var t;
  6580. try {
  6581. t = new MouseEvent("mouseup",{
  6582. clientX: e.clientX,
  6583. clientY: e.clientY,
  6584. screenX: e.screenX,
  6585. screenY: e.screenY
  6586. })
  6587. } catch (i) {
  6588. t = document.createEvent("MouseEvents"),
  6589. 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)
  6590. }
  6591. document.dispatchEvent(t)
  6592. }),
  6593. W = new Sly($("#scrollFrame"),{
  6594. horizontal: !0,
  6595. itemNav: "centered",
  6596. smart: !0,
  6597. scrollTrap: !0,
  6598. scrollBy: 1,
  6599. mouseDragging: !0,
  6600. touchDragging: !0,
  6601. speed: 300,
  6602. dragHandle: !0,
  6603. dynamicHandle: !0,
  6604. clickBar: !0,
  6605. scrollBar: $("#scroller"),
  6606. activateOn: null
  6607. }).init(),
  6608. W.on("active", function(e, t) {
  6609. Ve = t,
  6610. Ze("tour"),
  6611. $(".step").removeClass("active"),
  6612. $("#status").find(".curIdx").text(t + 1);
  6613. for (var i = 0; i <= t; i++)
  6614. $("#progressBar").find("[data-idx='" + i + "']").addClass("active")
  6615. }),
  6616. w()
  6617. }
  6618. function w() {
  6619. var e = $("#player").width() - 20
  6620. , t = $("#scroller")
  6621. , i = $("#drawer")
  6622. , n = $(".pinBottom");
  6623. if ($("#player").width() < 488 || $("#player").height() < 488)
  6624. t.addClass("hidden"),
  6625. i.addClass("noScroll"),
  6626. n.addClass("noScroll");
  6627. else {
  6628. var r = j > e
  6629. , o = !i.hasClass("noScroll")
  6630. , a = r !== o;
  6631. a && (t.toggleClass("hidden"),
  6632. i.toggleClass("noScroll"),
  6633. n.toggleClass("noScroll"))
  6634. }
  6635. }
  6636. function _(e) {
  6637. je.tourControls.visible = true//e.tour_buttons && K.valueFromHash("gt", 1),
  6638. je.coBrand.visible = e.presented_by && 1 !== Q.specialEdition && Q.brand && !K.valueFromHash("mls", !1),
  6639. je.highlight.visible = /* e.highlight_reel && */ 1 !== Q.specialEdition && Q.showHighlights
  6640. }
  6641. function T(e) {
  6642. function t(t, i) {
  6643. return !!e.player_options[t] && e[i || t]
  6644. }
  6645. $(".model-title").text(e.name);
  6646. var i = Q.pageTitle;
  6647. // 2 !== K.valueFromHash("mls", 0) && (i = e.name + " - " + i),
  6648. 2 !== K.valueFromHash("mls", 0) && e.name && (i = e.name),
  6649. // document.title = i ,
  6650. K.isMobile() ? $("#gui-fullscreen").css("display", "none") : ($("[rel=tooltip]").tooltip({
  6651. delay: {
  6652. show: 50,
  6653. hide: 0
  6654. },
  6655. trigger: "hover",
  6656. html: !1,
  6657. viewport: {
  6658. selector: "body",
  6659. padding: 10
  6660. }
  6661. }),
  6662. K.inIframe() && document.getElementsByClassName("pinBottom-container")[0].classList.add("embed")),
  6663. // 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"),
  6664. de.populate({
  6665. name: t("model_name", "name"),
  6666. coBrand: t("presented_by"),
  6667. description: t("model_summary", "summary") || "暂无内容",
  6668. contactName: t("contact_name"),
  6669. address: t("address"),
  6670. phone: t("contact_phone"),
  6671. formattedPhone: e.formatted_contact_phone,
  6672. email: t("contact_email"),
  6673. url: t("external_url"),
  6674. socialSharing: e.enable_social_sharing && e.is_public
  6675. })
  6676. }
  6677. function x(e, t, i, n, r, o) {
  6678. function a() {
  6679. o.setLoadingStartTime(),
  6680. H(),
  6681. r ? (re.showMessage(t, i, je.coBrand.visible),
  6682. l()) : h(l)
  6683. }
  6684. var s = $.Deferred()
  6685. , l = s.resolve.bind(s);
  6686. return Ge = !0,
  6687. O(e),
  6688. e.data.player_options && _(e.data.player_options),
  6689. 1 === Q.specialEdition && $("body").addClass("specialEdition"),
  6690. Re.localizeGUI(),
  6691. T(e.data),
  6692. r || $(".quick").addClass("hidden"),
  6693. //e.data.image && !r && E(e.data.image),
  6694. n ? (J.impression(),
  6695. a()) : (o.setWaitingStartTime(),
  6696. oe.show(r, a)),
  6697. s
  6698. }
  6699. function S(e, t, i, n, r, a, s) {
  6700. q = s,
  6701. e.outsideAllowed() || $("#gui-modes-outside").addClass("invisible"),
  6702. e.supportedModes[_e.PANORAMA] || $("#gui-modes-inside").addClass("invisible"),
  6703. ae.init(),
  6704. re.init(e, a),
  6705. Oe.init(e, t, n),
  6706. $(".icon").on("mouseover", function() {
  6707. t.player && t.player.reticule.hide()
  6708. }),
  6709. m(e, t),
  6710. A(e, t),
  6711. e.data.enable_social_sharing && e.data.is_public && Q.share.enabled && (Ce.init(window.DATA.name/* e.data.name */),
  6712. Ce.on(Me.OPENED, function() {
  6713. var e = document.getElementById("share-modal");
  6714. return function() {
  6715. Ze("share"),
  6716. le.open(e)
  6717. }
  6718. }()),
  6719. Ce.on(Me.CLOSED, le.reset)),
  6720. e.heroLocations.length > 0 ? b(e, t, i) : (je.highlight.visible = !1,
  6721. je.tourControls.visible = !1),
  6722. de.on(pe.OPEN_INFO, Ze.bind(this, "info")),
  6723. z(),
  6724. g(i),
  6725. v(e, r),
  6726. e.on("floor.changed", C),
  6727. e.on("waiting", R.bind(this, e)),
  6728. e.on("waiting-done", P.bind(this, e)),
  6729. i.on(xe.ModeChanged, function(e, n) {
  6730. g(i),
  6731. o(t, i),
  6732. n === _e.PANORAMA && i.currentPano && !i.currentPano.isAligned() && (n = _e.OUTDOOR),
  6733. he.updateMode(n)
  6734. }),
  6735. n.on(Se.Move, Ze.bind(this, "move")),
  6736. i.on(xe.Ready, function() {
  6737. ie.init(n, i, i.tagManager, t),
  6738. i.on(xe.ModeChanged, function(e, t) {
  6739. e !== t && $(".vr-popup").is(":visible") && Ae.dismiss()
  6740. })
  6741. }),
  6742. i.on(xe.PanoChosen, function(e, t) {
  6743. g(i, t),
  6744. he.updateMode(t && !t.isAligned() ? _e.OUTDOOR : _e.PANORAMA)
  6745. }),
  6746. le.on(ce.CLOSE, function(e) {
  6747. switch (e) {
  6748. case "vr-modal":
  6749. Ae.dismiss();
  6750. break;
  6751. case "share-modal":
  6752. Ce.hide();
  6753. break;
  6754. case "terms-modal":
  6755. fe.hide()
  6756. }
  6757. });
  6758. var l = $("#play").eq(0)
  6759. , c = $("#pause").eq(0)
  6760. , h = $(".pinBottom").toArray()
  6761. , u = $("#drawer").eq(0)
  6762. , d = $("#playHead").eq(0)
  6763. , p = $("#progressBar").eq(0)
  6764. , f = $("#thumb-container").eq(0)
  6765. , y = f.children()
  6766. , I = p.children();
  6767. t.on("update.controls", function() {
  6768. var n = t.describe();
  6769. n.tourIsPlaying || i.isWarping() ? (je.tourControls.visible && (l.hide(),
  6770. c.show()),
  6771. n.tourInProgress && (h.forEach(function(e) {
  6772. e.classList.add("playing")
  6773. }),
  6774. u.addClass("playing"),
  6775. d.addClass("playing"))) : (je.tourControls.visible && (l.show(),
  6776. c.hide()),
  6777. n.tourInProgress || (ve.stopTour(),
  6778. h.forEach(function(e) {
  6779. e.classList.remove("playing")
  6780. }),
  6781. u.removeClass("playing"),
  6782. d.removeClass("playing")));
  6783. var r, a, s;
  6784. if (null !== n.currentItem) {
  6785. var p, f;
  6786. $("#status").find(".curIdx").text(n.currentItem[0] + 1),
  6787. n.onTheBus ? (p = "active",
  6788. f = "recent") : (f = "active",
  6789. p = "recent");
  6790. var g = null === n.destinationItem || n.currentItem[0] === n.destinationItem[0];
  6791. for (r = 0; r < e.heroLocations.length; r += 1)
  6792. s = y.eq(r),
  6793. a = I.eq(r),
  6794. s.removeClass(f),
  6795. a.removeClass(f),
  6796. n.onTheBus && r === n.destinationItem[0] ? (s.addClass(p),
  6797. a.addClass(p),
  6798. W.activate(r)) : n.onTheBus && g && r === n.currentItem[0] ? (s.addClass(p),
  6799. a.addClass(p)) : (s.removeClass(p),
  6800. a.removeClass(p))
  6801. } else
  6802. for (r = 0; r < e.heroLocations.length; r += 1)
  6803. s = y.eq(r),
  6804. a = I.eq(r),
  6805. s.removeClass("active recent"),
  6806. a.removeClass("active recent");
  6807. o(t, i)
  6808. }),
  6809. document.addEventListener("keydown", function(n) {
  6810. switch (J.updateInteraction(Se.InteractionKey),
  6811. n.which) {
  6812. case we.ZERO:
  6813. Q.debug && e.toggleAlpha();
  6814. break;
  6815. case we.NINE:
  6816. Q.debug && se.toggle();
  6817. break;
  6818. case we.ONE:
  6819. i.isInMode(_e.TRANSITIONING) || t.changeMode(_e.PANORAMA);
  6820. break;
  6821. case we.TWO:
  6822. e.outsideAllowed() && !i.isInMode(_e.DOLLHOUSE, _e.TRANSITIONING) && t.changeMode(_e.DOLLHOUSE);
  6823. break;
  6824. case we.THREE:
  6825. e.outsideAllowed() && !i.isInMode(_e.FLOORPLAN, _e.TRANSITIONING) && t.changeMode(_e.FLOORPLAN);
  6826. break;
  6827. case we.FOUR:
  6828. i.isInMode(_e.TRANSITIONING) || t.changeMode(_e.OUTDOOR);
  6829. break;
  6830. case we.SPACE:
  6831. je.tourControls.visible && ($("#playHead").hasClass("playing") || Ze("tour"));
  6832. break;
  6833. case we.RETURN:
  6834. Q.debug && e.toggleExplodeUp();
  6835. break;
  6836. case we.P:
  6837. k();
  6838. break;
  6839. case we.U:
  6840. B();
  6841. break;
  6842. case we.X:
  6843. Q.debug && e.toggleExplode();
  6844. break;
  6845. case we.PLUSEQUALS:
  6846. t.player.activatePersistentZooming(!0),
  6847. ie.hideUi();
  6848. break;
  6849. case we.DASHUNDERSCORE:
  6850. t.player.activatePersistentZooming(!1),
  6851. ie.hideUi();
  6852. break;
  6853. case we.SEVEN:
  6854. De.info("Zoom level: " + t.player.zoomLevel + ", FOV: " + t.player.zoomFov);
  6855. break;
  6856. case we.EIGHT:
  6857. t.player.decreaseZoomSpeed();
  6858. break;
  6859. case we.NINE:
  6860. t.player.increaseZoomSpeed()
  6861. }
  6862. return i && i.reticule.hide(),
  6863. !0
  6864. }
  6865. .bind(this)),
  6866. document.addEventListener("keyup", function(e) {
  6867. switch (e.which) {
  6868. case we.PLUSEQUALS:
  6869. t.player.deactivatePersistentZooming();
  6870. break;
  6871. case we.DASHUNDERSCORE:
  6872. t.player.deactivatePersistentZooming()
  6873. }
  6874. }
  6875. .bind(this)),
  6876. F(e),
  6877. L(e, t.player),
  6878. M(i),
  6879. te.setAutoPlay(e.heroCount()),
  6880. he.init(i, a.mode),
  6881. he.on(ue.OPENED, Ze.bind(this, "help")),
  6882. fe.init(),
  6883. fe.on(ge.OPENED, function() {
  6884. var e = document.getElementById("terms-modal");
  6885. return function() {
  6886. Ze("terms"),
  6887. le.open(e)
  6888. }
  6889. }()),
  6890. fe.on(ge.CLOSED, le.reset),
  6891. Q.quickstart.enabled || re.delayLanding(a.mode).then(re.showMessage.bind(this, i, t, je.coBrand.visible)),
  6892. (Q.quickstart.enabled || i.model.outsideAllowed()) && ie.init(n, i, i.tagManager, t),
  6893. Q.profiling.enabled && se.show(),
  6894. ve.init(t)
  6895. }
  6896. function M(e) {
  6897. var t = function(e, t) {
  6898. $(e).find("a").each(function(e, i) {
  6899. t ? $(i).removeClass("buttonZoomDisabled").addClass("buttonZoomEnabled") : $(i).addClass("buttonZoomDisabled").removeClass("buttonZoomEnabled"),
  6900. i.style.pointerEvents = t ? "auto" : "none"
  6901. })
  6902. }
  6903. , i = function() {
  6904. e.zoomLevel >= Q.zoom.max ? t("#gui-zoomin", !1) : t("#gui-zoomin", !0),
  6905. e.zoomLevel <= Q.zoom.min ? t("#gui-zoomout", !1) : t("#gui-zoomout", !0)
  6906. };
  6907. e.on(Ne.ZoomMax, function() {
  6908. t("#gui-zoomin", !1),
  6909. t("#gui-zoomout", !0)
  6910. }),
  6911. e.on(Ne.ZoomMin, function() {
  6912. t("#gui-zoomin", !0),
  6913. t("#gui-zoomout", !1)
  6914. }),
  6915. e.on(Ne.ZoomIn, function() {
  6916. t("#gui-zoomout", !0)
  6917. }),
  6918. e.on(Ne.ZoomOut, function() {
  6919. t("#gui-zoomin", !0)
  6920. }),
  6921. i()
  6922. }
  6923. function R(e) {
  6924. O(e)
  6925. }
  6926. function P(e) {
  6927. O(e)
  6928. }
  6929. function O(e) {
  6930. var t = e.waitQueue.length;
  6931. t <= 0 ? f() : Ge || p(Q.modelComponentLoadSpinnerDelay)
  6932. }
  6933. function L(e, t) {
  6934. He = {
  6935. gui: null,
  6936. visible: !1,
  6937. model: e,
  6938. player: t
  6939. }
  6940. }
  6941. function D(e, t) {
  6942. function i() {
  6943. var i = t.toJSON();
  6944. n.linkToLocation = window.location.protocol + "//" + window.location.host + window.location.pathname + "?m=" + e.sid + "&start=" + be.serialize(i),
  6945. t.tagManager.activeTag && (n.linkToLocation += "&tag=" + t.tagManager.activeTag.sid)
  6946. }
  6947. var n = {}
  6948. , r = new Le.GUI({
  6949. autoPlace: !0,
  6950. width: "60%"
  6951. });
  6952. i(),
  6953. t.on(xe.ViewChanged, i),
  6954. r.add(n, "linkToLocation").name(Re.LINK_TO_LOCATION).listen(),
  6955. r.domElement.id = "datLinks";
  6956. var o = [].slice.call(r.domElement.querySelectorAll(".property-name"));
  6957. return o.forEach(function(e) {
  6958. if (!K.detectSafari()) {
  6959. var t = document.createElement("button");
  6960. t.classList.add("btn-deep-link"),
  6961. t.innerText = Re.MENU_COPY,
  6962. e.nextSibling.appendChild(t);
  6963. var i = function() {
  6964. alert(Re.LINK_ALERT_COPY),
  6965. t.hide()
  6966. };
  6967. t.addEventListener("click", function(e) {
  6968. try {
  6969. var t = e.target.parentNode.childNodes[0];
  6970. t.select();
  6971. var n = document.execCommand("copy");
  6972. t.blur(),
  6973. n || i()
  6974. } catch (e) {
  6975. i()
  6976. }
  6977. })
  6978. }
  6979. }),
  6980. $(r.__closeButton).hide(),
  6981. r
  6982. }
  6983. function N(e) {
  6984. He.gui || (He.gui = D(He.model, He.player)),
  6985. He.visible = e,
  6986. e ? $(He.gui.domElement).show() : $(He.gui.domElement).hide()
  6987. }
  6988. function B() {
  6989. N(!He.visible)
  6990. }
  6991. function F(e) {
  6992. ke = {
  6993. gui: null,
  6994. visible: !1,
  6995. model: e
  6996. }
  6997. }
  6998. function V(e) {
  6999. var t = new Le.GUI;
  7000. return t.add(Q, "showSweeps").name("Show sweeps").onFinishChange(function() {
  7001. e.setSweepVisibility(Q.showSweeps)
  7002. }),
  7003. t.add(Q, "rotationAccelerationInside", .1, 10).name("Rotation speed").step(.1),
  7004. t.add(Q.transition, "flyTime", 0, 5e3).name("Transition time").onFinishChange(function() {
  7005. Q.transition.flySpeed = 0,
  7006. t.__controllers.forEach(function(e) {
  7007. e.updateDisplay()
  7008. })
  7009. }),
  7010. t.add(Q.path, "opacity", 0, 1).name("Path opacity"),
  7011. $(t.__closeButton).hide(),
  7012. t
  7013. }
  7014. function U(e) {
  7015. ke.gui || (ke.gui = V(ke.model)),
  7016. ke.visible = e,
  7017. e ? $(ke.gui.domElement).show() : $(ke.gui.domElement).hide()
  7018. }
  7019. function k() {
  7020. U(!ke.visible)
  7021. }
  7022. function H() {
  7023. function e(e) {
  7024. e.target === t || $.contains(t, e.target) || e.target === i || $.contains(i, e.target) || e.target === n || $.contains(n, e.target)/* || e.preventDefault()*/
  7025. }
  7026. $("body").css("touch-action", "none"),
  7027. $("#gui-parent").find("*:not(#tag-billboards)").on("touchmove", function(e) {
  7028. // e.preventDefault()
  7029. });
  7030. var t = document.getElementById("terms-text")
  7031. , i = document.getElementById("more-help-wrapper")
  7032. , n = (document.getElementById("navigation-help-wrapper"),
  7033. document.getElementById("help-dialog"),
  7034. document.getElementById("tag-billboards"));
  7035. Q.useWheel && (document.body.addEventListener("mousewheel", e, { passive: false }),
  7036. document.body.addEventListener("DOMMouseScroll", e)),
  7037. $("#terms-text, #more-help-wrapper, #navigation-help-wrapper").off("touchmove").on("touchmove", function(e) {
  7038. e.stopPropagation()
  7039. })
  7040. }
  7041. function G(e, t) {
  7042. for (var i = []; e; )
  7043. i.push(e),
  7044. e = e.parentNode;
  7045. for (; t && i.indexOf(t) === -1; )
  7046. t = t.parentNode;
  7047. return t
  7048. }
  7049. function z() {
  7050. var e, t = function(t) {
  7051. e = 0 === t.button || 1 === t.which ? t.target : null
  7052. }, i = function(t) {
  7053. e !== t.target && (e = G(e, t.target));
  7054. var i = document.getElementById("gui-parent");
  7055. if (G(i, e) !== i && (e = null),
  7056. e) {
  7057. var n;
  7058. try {
  7059. n = new MouseEvent("click",t)
  7060. } catch (e) {
  7061. n = document.createEvent("MouseEvents"),
  7062. 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)
  7063. }
  7064. n.syntheticClick = !0,
  7065. e.dispatchEvent(n),
  7066. e = null
  7067. }
  7068. };
  7069. document.body.addEventListener("mousedown", t, !0),
  7070. document.body.addEventListener("mouseup", i, !0),
  7071. document.getElementById("gui-parent").addEventListener("click", function(e) {
  7072. e.syntheticClick || (e.stopPropagation(),
  7073. "A" === e.target.nodeName && e.preventDefault())
  7074. }, !0)
  7075. }
  7076. var W, j, Y, X, Z, q, K = (e("three"),
  7077. e("../util/ajax"),
  7078. e("../util/browser")), Q = e("../settings"), J = e("../analytics"), ee = (e("../util/transitions"),
  7079. e("../util/camera"),
  7080. e("../util/logger")), te = (e("../objects/Snapshot"),
  7081. 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"),
  7082. e("../tag/Media/MediaEvent")), xe = (e("../enum/PathDiscardMode"),
  7083. e("../enum/PathDisplayMode"),
  7084. e("../enum/DirectorEvents"),
  7085. e("../enum/PlayerEvents")), Se = e("../enum/ControlEvents"), Me = e("./sharing/ShareEvents"), Re = e("../localization/localize"), Pe = (e("../enum/Vectors"),
  7086. e("../enum/WarpStyle"),
  7087. e("../enum/AlignmentType"),
  7088. e("../enum/VROption")), Oe = e("./konami"), Le = e("../lib/dat.gui"), De = new ee(i), Ne = (e("../util/showcase"),
  7089. e("../enum/ZoomEvents")), Be = _e.DOLLHOUSE, Fe = 0, Ve = 0, Ue = [".hideTarget"], ke = null, He = null, Ge = !1, ze = !1, We = !1, je = {
  7090. coBrand: {
  7091. visible: !0,
  7092. elements: [".co-brand", "#loaderCoBrand"]
  7093. },
  7094. help: {
  7095. visible: !0,
  7096. elements: [".nav-help", "#nav-help"]
  7097. },
  7098. tourControls: {
  7099. visible: !0,
  7100. elements: [".next", ".previous", "#play"]
  7101. },
  7102. highlight: {
  7103. visible: !0,
  7104. elements: ["#drawer", "#pullTab"]
  7105. },
  7106. share: {
  7107. visible: !0,
  7108. elements: [".socialButton", "#share"]
  7109. },
  7110. fullScreen: {
  7111. visible: !0,
  7112. elements: ["#gui-fullscreen"]
  7113. },
  7114. floors: {
  7115. visible: !0,
  7116. elements: [".gui-floor"]
  7117. }
  7118. }, Ye = function() {
  7119. var e = document.getElementById("drawer");
  7120. return function() {
  7121. $("#player").height() < 400 && e.classList.contains("open") && a()
  7122. }
  7123. }(), Xe = function() {
  7124. var e = document.getElementById("meta-info");
  7125. return function() {
  7126. $("#player").height() < 400 && e.classList.contains("expand") && de.toggleMeta(!0)
  7127. }
  7128. }(), Ze = function(e) {
  7129. function t() {
  7130. u.classList.contains("expand") && de.toggleMeta(!0)
  7131. }
  7132. function i() {
  7133. fe.hide()
  7134. }
  7135. function n() {
  7136. he.close()
  7137. }
  7138. function r() {
  7139. Ae.dismiss()
  7140. }
  7141. function o() {
  7142. p.hasClass("open") && a(!0)
  7143. }
  7144. function l() {
  7145. Ce.hide()
  7146. }
  7147. function c() {
  7148. f.hasClass("open") && f.removeClass("open")
  7149. }
  7150. function h() {
  7151. d.classList.contains("fadeIn") && (d.classList.contains("landing") ? re.dismissModal() : d.classList.contains("tour") && ve.dismissModal())
  7152. }
  7153. var u = document.getElementById("meta-info")
  7154. , d = document.getElementById("interaction-modal")
  7155. , p = $("#drawer").eq(0)
  7156. , f = $(".gui-floor").eq(0)
  7157. , g = $(".vr-popup").eq(0);
  7158. return function(e) {
  7159. switch (e) {
  7160. case "info":
  7161. i(),
  7162. n(),
  7163. Ye(),
  7164. l(),
  7165. c(),
  7166. r(),
  7167. h();
  7168. break;
  7169. case "terms":
  7170. t(),
  7171. n(),
  7172. o(),
  7173. l(),
  7174. c(),
  7175. r(),
  7176. h();
  7177. break;
  7178. case "help":
  7179. t(),
  7180. i(),
  7181. l(),
  7182. c(),
  7183. r(),
  7184. h();
  7185. break;
  7186. case "vr":
  7187. t(),
  7188. i(),
  7189. l(),
  7190. c(),
  7191. n(),
  7192. h(),
  7193. s(g) && o();
  7194. break;
  7195. case "highlights":
  7196. Xe(),
  7197. i(),
  7198. l(),
  7199. c();
  7200. break;
  7201. case "share":
  7202. t(),
  7203. i(),
  7204. n(),
  7205. c(),
  7206. r(),
  7207. h();
  7208. break;
  7209. case "floor":
  7210. i(),
  7211. l(),
  7212. r();
  7213. break;
  7214. case "view":
  7215. c(),
  7216. l(),
  7217. i(),
  7218. r();
  7219. break;
  7220. case "tour":
  7221. i(),
  7222. l(),
  7223. c(),
  7224. r();
  7225. break;
  7226. case "move":
  7227. i(),
  7228. l(),
  7229. c(),
  7230. r();
  7231. break;
  7232. case "resize":
  7233. t(),
  7234. Ye(),
  7235. c();
  7236. break;
  7237. case "tag":
  7238. i(),
  7239. n(),
  7240. l(),
  7241. c(),
  7242. r()
  7243. }
  7244. }
  7245. }();
  7246. $(document).on("fullscreenchange webkitfullscreenchange mozfullscreenchange MSFullscreenChange", function(e) {
  7247. $("#gui-fullscreen").toggle(!K.isFullscreen()),
  7248. $("#gui-fullscreen-exit").toggle(!!K.isFullscreen()),
  7249. setTimeout(function() {
  7250. $(".icon:visible").hide().show(0)
  7251. }, 100)
  7252. }),
  7253. $("#gui-fullscreen").find("a").on("click", function(e) {
  7254. l(e),
  7255. K.requestFullscreen($("body")[0]),
  7256. J.track("showcase_gui", {
  7257. gui_action: "click_enter_fullscreen",
  7258. interaction_source: "gui"
  7259. })
  7260. //czj
  7261. //W.reload()
  7262. }),
  7263. $("#gui-fullscreen-exit").find("a").on("click", function(e) {
  7264. l(e),
  7265. K.exitFullscreen(),
  7266. J.track("showcase_gui", {
  7267. gui_action: "click_exit_fullscreen",
  7268. interaction_source: "gui"
  7269. })
  7270. })
  7271. $(window).on("resize", function(e) {
  7272. var t = e.target.innerHeight
  7273. , i = e.target.innerWidth;
  7274. t === X && i === Z || (je.highlight.visible && w(),
  7275. Ze("resize"),
  7276. $(".pinTop.right").removeClass("hideUnderMeta"),
  7277. c(),
  7278. X = t,
  7279. Z = i)
  7280. }).resize(),
  7281. K.supportsFullscreen() || $("#gui-fullscreen").hide(),
  7282. $("#pullTab").on("click", function(e) {
  7283. l(e),
  7284. $("#drawer").hasClass("open") ? (J.trackAlways("showcase_gui", {
  7285. gui_action: "hide_highlight_reel"
  7286. }),
  7287. $(this).addClass("open").children("img").attr("src","static/images/auto.png")) : (J.trackAlways("showcase_gui", {
  7288. gui_action: "show_highlight_reel"
  7289. }),
  7290. $(this).removeClass("open").children("img").attr("src","static/images/auto-suspend.png"));
  7291. a()
  7292. });
  7293. /***********************方奕卓 热点列表事件监听 ************************/
  7294. if(window.DATA.showHotListSta) {
  7295. $('#hotList').css('display', '');
  7296. $('#hotList').on('click',function(e){
  7297. l(e);
  7298. var hotList = $('#hotListWrap')[0];
  7299. var isActive = hotList.classList.contains('hotListActive');
  7300. if(isActive){
  7301. hotList.classList.remove('hotListActive');
  7302. this.classList.remove('active')
  7303. }else{
  7304. hotList.classList.add('hotListActive');
  7305. this.classList.add('active')
  7306. }
  7307. }),
  7308. $('#hotListContent ul').on('mouseover', function(e){
  7309. if(browser.isMobile()) return
  7310. l(e);
  7311. var target = e.target;
  7312. var hotList = document.getElementById('hotListWrap');
  7313. if(target.tagName === 'SPAN'){
  7314. var targetParent = target.parentElement.parentElement;
  7315. if(target.offsetWidth + 150 >= targetParent.clientWidth){
  7316. hotList.style.width = target.offsetWidth + 150 + 'px';
  7317. }else{
  7318. hotList.style.width = '';
  7319. }
  7320. }else if(target.tagName === 'LI'){
  7321. var targetParent = target.parentElement;
  7322. if(target.children[0].offsetWidth + 150 >= targetParent.clientWidth){
  7323. hotList.style.width = target.children[0].offsetWidth + 150 + 'px';
  7324. }else{
  7325. hotList.style.width = ''
  7326. }
  7327. }else {
  7328. hotList.style.width = '';
  7329. }
  7330. });
  7331. $('#hotListContent ul').on('click', function(e){
  7332. l(e);
  7333. this.preElem && this.preElem.classList.remove('active');
  7334. if(e.target.tagName === 'SPAN'){
  7335. e.stopPropagation();//阻止事件冒泡即可
  7336. e.target.parentElement.classList.add('active');
  7337. e.target.parentElement.hot && e.target.parentElement.hot.examine(window.player,true); // 打开热点
  7338. this.preElem = e.target.parentElement;
  7339. }else{
  7340. e.target.classList.add('active');
  7341. e.target.hot && e.target.hot.examine(window.player,true); // 打开热点
  7342. this.preElem = e.target;
  7343. }
  7344. })
  7345. $('#hotListClose').on('click', function(e){
  7346. l(e);
  7347. var hotList = $('#hotListWrap')[0];
  7348. hotList.classList.remove('hotListActive');
  7349. $('#hotListContent ul .active').removeClass('active');
  7350. if($('#hotList')&&$('#hotList')[0]) $('#hotList')[0].classList.remove('active')
  7351. })
  7352. }
  7353. /*****************************************************************/
  7354. $("#more-menu-button").on("click", function(e) {
  7355. l(e);
  7356. var t = $("#more-menu");
  7357. t.toggleClass("open")
  7358. }),
  7359. t.exports.init = S,
  7360. t.exports.startLoading = x,
  7361. t.exports.endLoading = d,
  7362. t.exports.onProgress = u
  7363. }
  7364. ).call(this, "/js/gui/gui.js")
  7365. }
  7366. , {
  7367. "../analytics": 4,
  7368. "../controls/serializer": 14,
  7369. "../enum/AlignmentType": 17,
  7370. "../enum/BlackoutStyle": 18,
  7371. "../enum/ControlEvents": 21,
  7372. "../enum/DirectorEvents": 23,
  7373. "../enum/Keys": 30,
  7374. "../enum/PathDiscardMode": 38,
  7375. "../enum/PathDisplayMode": 39,
  7376. "../enum/PlayerEvents": 40,
  7377. "../enum/VROption": 47,
  7378. "../enum/Vectors": 50,
  7379. "../enum/Viewmode": 51,
  7380. "../enum/WarpStyle": 52,
  7381. "../enum/ZoomEvents": 53,
  7382. "../lib/dat.gui": 93,
  7383. "../localization/localize": 108,
  7384. "../tag/Media/MediaEvent": 131,
  7385. "../objects/Snapshot": 153,
  7386. "../settings": 166,
  7387. "../util/ajax": 181,
  7388. "../util/browser": 182,
  7389. "../util/camera": 183,
  7390. "../util/logger": 189,
  7391. "../util/showcase": 193,
  7392. "../util/transitions": 195,
  7393. "./closer/ModalCloserEvent": 61,
  7394. "./closer/modalCloser": 62,
  7395. "./help/HelpEvent": 66,
  7396. "./help/help": 67,
  7397. "./helpManager": 68,
  7398. "./immersiveMode": 69,
  7399. "./konami": 70,
  7400. "./landingScreen": 71,
  7401. "./loadingScreen": 72,
  7402. "./memoryUsage": 73,
  7403. "./playButton": 74,
  7404. "./populateModal": 75,
  7405. "./sharing/ShareEvents": 76,
  7406. "./sharing/modal": 77,
  7407. "./terms/TermsEvent": 78,
  7408. "./terms/terms": 79,
  7409. "./title/TitleEvents": 80,
  7410. "./title/tagToggle": 81,
  7411. "./title/titleBar": 82,
  7412. "./tourInteraction": 84,
  7413. "./vr/vrEvent": 85,
  7414. "./vr/vrModal": 87,
  7415. "./webvr/WebVrEvent": 88,
  7416. "./webvr/webVRgui": 89,
  7417. three: 217
  7418. }],
  7419. 66: [function(e, t, i) {
  7420. "use strict";
  7421. t.exports = Object.freeze({
  7422. OPENED: "help.opened",
  7423. CLOSED: "help.closed"
  7424. })
  7425. }
  7426. , {}],
  7427. 67: [function(e, t, i) {
  7428. "use strict";
  7429. function n() {
  7430. g.on("click", function(e) {
  7431. if (S && S !== l.TRANSITIONING) {
  7432. var t = window.getComputedStyle(y).getPropertyValue("opacity") > 0;
  7433. t && !M ? R.close() : r()
  7434. }
  7435. }),
  7436. w.on("click", function(e) {
  7437. R.close()
  7438. }),
  7439. E.on("click", function(e) {
  7440. S && S !== l.TRANSITIONING && (s(),
  7441. o())
  7442. }),
  7443. b.on("click", function(e) {
  7444. s(),
  7445. a()
  7446. })
  7447. }
  7448. function r() {
  7449. S && S !== l.TRANSITIONING && (M = !0,
  7450. setTimeout(function() {
  7451. M = !1
  7452. }, d.help.modalStayDuration),
  7453. R.emit(h.OPENED),
  7454. m.addClass("open " + S),
  7455. g.addClass("open"),
  7456. s(),
  7457. o(),
  7458. y.style.removeProperty ? y.style.removeProperty("display") : y.style.removeAttribute("display"),
  7459. y.classList.add("fadeIn"))
  7460. }
  7461. function o() {
  7462. E.addClass("underline-tab"),
  7463. u.fill(_, c.NAVIGATION, S),
  7464. m.addClass(S)
  7465. }
  7466. function a() {
  7467. b.addClass("underline-tab"),
  7468. u.fill(T, c.MORE_HELP),
  7469. m.addClass("more-help")
  7470. }
  7471. function s(e, t) {
  7472. m.removeClass("more-help " + l.PANORAMA + " " + l.DOLLHOUSE + " " + l.FLOORPLAN + " " + l.OUTDOOR),
  7473. I.forEach(function(e) {
  7474. e.classList.remove("underline-tab")
  7475. })
  7476. }
  7477. var l = e("../../enum/Viewmode")
  7478. , c = e("../../enum/HelpModalType")
  7479. , h = e("./HelpEvent")
  7480. , u = (e("../helpManager"),
  7481. e("./../populateModal"))
  7482. , d = e("../../settings")
  7483. , p = e("../../util/common")
  7484. , f = e("events").EventEmitter
  7485. , g = $(".footer-help").eq(0)
  7486. , m = $("#help-dialog").eq(0)
  7487. , v = document.querySelector("#quick-logo")
  7488. , A = document.querySelector("#loaderCoBrand")
  7489. , y = document.querySelector("#help-dialog")
  7490. , C = document.querySelector(".footer")
  7491. , I = $(".help-tabs").children().toArray()
  7492. , E = $(".navigation-tab").eq(0)
  7493. , b = $(".more-help-tab").eq(0)
  7494. , w = ($("#interaction-modal").eq(0).find(".interaction").toArray(),
  7495. m.find(".close").eq(0))
  7496. , _ = m.find(".interactions").toArray()
  7497. , T = m.find(".ui-instructions").toArray()
  7498. , x = l.PANORAMA
  7499. , S = l.PANORAMA
  7500. , M = !1
  7501. , R = {
  7502. init: function(e, t) {
  7503. S = t,
  7504. x = t,
  7505. [y, A, v, C].forEach(function(e) {
  7506. e.classList.add(u.deviceType)
  7507. }),
  7508. n()
  7509. },
  7510. close: function() {
  7511. if (m.hasClass("open") && (this.emit(h.CLOSED),
  7512. g.removeClass("open"),
  7513. m.removeClass("open"),
  7514. y.classList.contains("fadeIn"))) {
  7515. y.classList.remove("fadeIn");
  7516. var e = S === l.TRANSITIONING ? x : S;
  7517. u.clear(_, c.NAVIGATION, e)
  7518. }
  7519. },
  7520. updateMode: function(e) {
  7521. x = S,
  7522. S = e
  7523. }
  7524. };
  7525. p.extendObject(R, f.prototype),
  7526. t.exports = R
  7527. }
  7528. , {
  7529. "../../enum/HelpModalType": 28,
  7530. "../../enum/Viewmode": 51,
  7531. "../../settings": 166,
  7532. "../../util/common": 185,
  7533. "../helpManager": 68,
  7534. "./../populateModal": 75,
  7535. "./HelpEvent": 66,
  7536. events: 202
  7537. }],
  7538. 68: [function(e, t, i) {
  7539. (function(i) {
  7540. "use strict";
  7541. var n = e("../util/browser")
  7542. , r = e("./../util/logger")
  7543. , o = e("./../settings")
  7544. , a = new r(i)
  7545. , s = function() {
  7546. var e;
  7547. try {
  7548. return e = window.localStorage.getItem("visitCount") || "0",
  7549. e = (parseFloat(e) + 1).toString(),
  7550. window.localStorage.setItem("visitCount", e),
  7551. a.debug("visitCount = " + e),
  7552. e
  7553. } catch (t) {
  7554. e = "1",
  7555. a.debug("couldn't set local storage")
  7556. }
  7557. }()
  7558. , l = !1;
  7559. t.exports = {
  7560. isHelpDisabled: function() {
  7561. return "0" === n.valueFromHash("help", null) || l
  7562. },
  7563. isLargeHelpEnabled: function() {
  7564. return ("1" === s || "1" === n.valueFromHash("help", null)) && !this.isHelpDisabled()
  7565. },
  7566. isSmallHelpEnabled: function() {
  7567. return "2" === n.valueFromHash("help", null) && !this.isHelpDisabled()
  7568. },
  7569. isHelpEnabled: function() {
  7570. return this.isLargeHelpEnabled() || this.isSmallHelpEnabled()
  7571. },
  7572. setAutoPlay: function(e) {
  7573. l = o.warp.auto >= 0 && e > 1
  7574. }
  7575. }
  7576. }
  7577. ).call(this, "/js/gui/helpManager.js")
  7578. }
  7579. , {
  7580. "../util/browser": 182,
  7581. "./../settings": 166,
  7582. "./../util/logger": 189
  7583. }],
  7584. 69: [function(e, t, i) {
  7585. "use strict";
  7586. function n(e, t, i, n) {
  7587. F = n,
  7588. r(e, t, i, F),
  7589. o(),
  7590. N = t.mode
  7591. }
  7592. function r(e, t, i, n) {
  7593. [C.PANORAMA, C.DOLLHOUSE, C.FLOORPLAN].forEach(function(t) {
  7594. e.controls[t].on(v.Move, a),
  7595. e.controls[t].on(v.LongTap, c)
  7596. }),
  7597. M.on("mousewheel DOMMouseScroll", a),
  7598. i.on(m.TagActivated, a),
  7599. i.on(m.TagNavigation, a),
  7600. t.on(A.FlyingEnded, s),
  7601. t.on(A.ModeChanging, function(e, t) {
  7602. B = t !== C.PANORAMA && e !== C.PANORAMA
  7603. }),
  7604. t.on(A.ModeChanged, function(e, i) {
  7605. N = t.mode,
  7606. i !== C.TRANSITIONING ? l() : a("modeChange")
  7607. }),
  7608. n.on(y.TourStart, function() {
  7609. L = !0,
  7610. a()
  7611. }),
  7612. n.on(y.TourEnd, function() {
  7613. L = !1,
  7614. l()
  7615. }),
  7616. n.on(y.ActionInterrupted, function() {
  7617. L = !1
  7618. }),
  7619. R.addEventListener("touchend", function() {
  7620. $("#pullTab").hasClass("opened") && !L && l()
  7621. }, !0)
  7622. }
  7623. function o() {
  7624. p.isMobile() ? (b.forEach(function(e) {
  7625. e.classList.add("mobile")
  7626. }),
  7627. w.click(l)) : (b.forEach(function(e) {
  7628. e.addEventListener("mouseleave", function() {
  7629. !M.is(":hover") && b[0].classList.contains("detectHover") && l()
  7630. }, !0)
  7631. }),
  7632. M.mouseleave(function() {
  7633. b[0].classList.contains("detectHover") && l()
  7634. }))
  7635. }
  7636. function a(e) {
  7637. D || d(e) && _.hasClass("playing") || (clearTimeout(O),
  7638. P = !0,
  7639. g.close(),
  7640. h(e),
  7641. N !== C.DOLLHOUSE && N !== C.FLOORPLAN && (x.hasClass("expand") && !S.hasClass("closed") || 2 === p.valueFromHash("title", 1) ,
  7642. _.hasClass("playing") || (b.forEach(function(e) {
  7643. e.classList.add("detectHover")
  7644. }),
  7645. O = setTimeout(l, f.immersive.timeToShowAgain))))
  7646. }
  7647. function s() {
  7648. _.hasClass("playing") || (clearTimeout(O),
  7649. O = setTimeout(l, f.immersive.timeToShowAgain))
  7650. }
  7651. function l() {
  7652. clearTimeout(O),
  7653. P = !1,
  7654. I.forEach(function(e) {
  7655. e.classList.remove("drawerOpen")
  7656. }),
  7657. L || E.forEach(function(e) {
  7658. e.classList.remove("duringTour")
  7659. }),
  7660. b.forEach(function(e) {
  7661. e.classList.remove("detectHover")
  7662. })
  7663. }
  7664. function c() {
  7665. P ? l() : a(),
  7666. D = !0,
  7667. setTimeout(function() {
  7668. D = !1
  7669. }, f.immersive.uiStayDuration)
  7670. }
  7671. function h(e) {
  7672. !d(e) && L ? E.forEach(function(e) {
  7673. e.classList.remove("drawerOpen"),
  7674. e.classList.add("duringTour")
  7675. }) : _.hasClass("open") ? E.forEach(function(e) {
  7676. e.classList.remove("duringTour"),
  7677. e.classList.add("drawerOpen")
  7678. }) : B || N === C.FLOORPLAN || N === C.DOLLHOUSE || E.forEach(function(e) {
  7679. e.classList.add("fadeOut")
  7680. })
  7681. }
  7682. function u() {
  7683. T.hasClass("duringTour") || (L = !1,
  7684. a("gui"),
  7685. l())
  7686. }
  7687. function d(e) {
  7688. return "mouse" === e || "touch" === e || "key" === e || "gui" === e
  7689. }
  7690. var p = e("../util/browser")
  7691. , f = e("../settings")
  7692. , g = e("./help/help")
  7693. , m = e("../enum/tagEvents")
  7694. , v = e("../enum/ControlEvents")
  7695. , A = e("../enum/PlayerEvents")
  7696. , y = e("../enum/DirectorEvents")
  7697. , A = e("../enum/PlayerEvents")
  7698. , C = e("../enum/Viewmode")
  7699. , I = $(".pinTop.left, .pinBottom-container, #drawer-container, #drawer, .footer").toArray()
  7700. , E = $(".pinBottom-container, #drawer-container, .footer").toArray()
  7701. , b = $("#hover-bottom, #hover-top").toArray()
  7702. , w = ($("#pullTab").eq(0),
  7703. $("#playHead").eq(0),
  7704. $(".pinBottom-container").eq(0))
  7705. , _ = $("#drawer").eq(0)
  7706. , T = $("#drawer-container").eq(0)
  7707. , x = $("#meta-info").eq(0)
  7708. , S = $(".pinTop.left").eq(0)
  7709. , M = $("#player").eq(0)
  7710. , R = document.getElementById("pullTab")
  7711. , P = !1
  7712. , O = null
  7713. , L = !1
  7714. , D = !1
  7715. , N = null
  7716. , B = !1
  7717. , F = null;
  7718. t.exports.init = n,
  7719. t.exports.hideUi = a,
  7720. t.exports.resetDrawer = u
  7721. }
  7722. , {
  7723. "../enum/ControlEvents": 21,
  7724. "../enum/DirectorEvents": 23,
  7725. "../enum/tagEvents": 32,
  7726. "../enum/PlayerEvents": 40,
  7727. "../enum/Viewmode": 51,
  7728. "../settings": 166,
  7729. "../util/browser": 182,
  7730. "./help/help": 67
  7731. }],
  7732. 70: [function(e, t, i) {
  7733. (function(i) {
  7734. "use strict";
  7735. function n(e, t, i) {
  7736. l.debug("konami has the modelInstance");
  7737. var n = [];
  7738. $(window).on("keydown", function(e) {
  7739. n.push(e.which),
  7740. n.length > o.secretPanelWord.length && n.shift(),
  7741. s.equalLists(n, o.secretPanelWord) && (l.debug("Developer mode active."),
  7742. o.debug = !0)
  7743. }),
  7744. $(window).on("keydown", function n(r) {
  7745. o.debug && 72 === r.which && (e && i ? (a.toggle(e, t, i),
  7746. $(window).off("keydown", n)) : console.warn("sorry we're not ready yet"))
  7747. })
  7748. }
  7749. var r = e("./../util/logger")
  7750. , o = e("./../settings")
  7751. , a = e("./debug")
  7752. , s = e("./../util/common")
  7753. , l = (e("./gui"),
  7754. new r(i));
  7755. o.console && $("body").append('<div id="debug-console"></div>'),
  7756. t.exports.init = n
  7757. }
  7758. ).call(this, "/js/gui/konami.js")
  7759. }
  7760. , {
  7761. "./../settings": 166,
  7762. "./../util/common": 185,
  7763. "./../util/logger": 189,
  7764. "./debug": 63,
  7765. "./gui": 65
  7766. }],
  7767. 71: [function(e, t, i) {
  7768. "use strict";
  7769. function n(e, t) {
  7770. E = t.mode === p.PANORAMA && t.pano && !t.pano.isAligned() ? p.OUTDOOR : t.mode
  7771. }
  7772. function r(e) {
  7773. var t = $.Deferred();
  7774. e || t.resolve();
  7775. var i = c.startupFlyinDelay;
  7776. return e === p.PANORAMA && (i += c.dollhouse.transitionTime),
  7777. setTimeout(t.resolve.bind(t), i),
  7778. t
  7779. }
  7780. function o(e, t, i) {
  7781. var n = 0;
  7782. c.quickstart.enabled && (a(i),
  7783. n = c.quickstart.showTextDelay + c.quickstart.fadeOutDelay);
  7784. var r = function() {
  7785. e.once(g.Move, l),
  7786. t.once(f.TourStart, l)
  7787. };
  7788. s(n, r)
  7789. }
  7790. function a(e) {
  7791. return /* e && (y.addClass("quick-brand"), //quick-brand样式有问题 会遮住屏幕
  7792. v.before(y),
  7793. A = $(".quick-brand").toArray()),*/
  7794. m.addClass("fadeOut"),
  7795. setTimeout(function() {
  7796. A.forEach(function(e) {
  7797. e.classList.add("fadeIn")
  7798. })
  7799. }, c.quickstart.showTextDelay),
  7800. setTimeout(function() {
  7801. A.forEach(function(e) {
  7802. e.classList.add("fadeOut")
  7803. })
  7804. }, c.quickstart.fadeOutDelay),
  7805. !0
  7806. }
  7807. function s(e, t) {
  7808. setTimeout(function() {
  7809. if (h.isHelpEnabled()) {
  7810. if (t(),
  7811. u.init(),
  7812. C.addClass("fadeIn landing " + u.deviceType),
  7813. h.isSmallHelpEnabled())
  7814. return void C.addClass("small");
  7815. u.fill(I, d.LANDING[E]),
  7816. C.addClass(E)
  7817. }
  7818. }, e)
  7819. //csz 用户引导界面
  7820. var helpData = {
  7821. "pc":["static/images/pc_step1.png","static/images/pc_step2.png","static/images/pc_step3.png"],
  7822. "mobile":["static/images/phone_step1.png","static/images/phone_step2.png","static/images/phone_step3.png"]
  7823. }
  7824. var navIcon = $(".nav-icon .icon");
  7825. if(/Android|webOS|iPhone|iPod|BlackBerry/i.test(navigator.userAgent)) navIcon.attr("src",helpData.mobile[0]);
  7826. function paging(id){
  7827. id.on("click",function(){
  7828. var navPage = null;
  7829. $(this).attr("data-id") == "plus" ? navPage = +navIcon.attr("data-page")+1 : navPage = +navIcon.attr("data-page")-1;
  7830. if(navPage > 3 || navPage < 1) return false
  7831. console.log('123-',navPage);
  7832. if(/Android|webOS|iPhone|iPod|BlackBerry/i.test(navigator.userAgent)){
  7833. navIcon.attr({"data-page":navPage,"src":helpData.mobile[navPage - 1]});
  7834. }else{
  7835. navIcon.attr({"data-page":navPage,"src":helpData.pc[navPage - 1]});
  7836. }
  7837. })
  7838. };
  7839. paging($(".next-button"));
  7840. paging($(".prev-button"));
  7841. }
  7842. function l() {
  7843. u.clear(I, d.LANDING[E]),
  7844. C.removeClass("fadeIn")
  7845. }
  7846. var c = e("../settings")
  7847. , h = (e("./help/help"),
  7848. e("./helpManager"))
  7849. , u = e("./populateModal")
  7850. , d = e("../enum/HelpModalType")
  7851. , p = e("../enum/Viewmode")
  7852. , f = e("../enum/DirectorEvents")
  7853. , g = e("../enum/PlayerEvents")
  7854. , m = $("#quick-blackout").eq(0)
  7855. , v = $("#quick-logo").eq(0)
  7856. , A = $(".quick-brand").toArray()
  7857. , y = $("#loaderCoBrand").eq(0)
  7858. , C = $("#interaction-modal").eq(0)
  7859. , I = C.find(".interaction").toArray()
  7860. , E = ($("#model-title, .pinBottom-container, #drawer-container, #drawer, .footer").toArray(),
  7861. "");
  7862. t.exports.delayLanding = r,
  7863. t.exports.showMessage = o,
  7864. t.exports.init = n,
  7865. t.exports.dismissModal = l
  7866. }
  7867. , {
  7868. "../enum/DirectorEvents": 23,
  7869. "../enum/HelpModalType": 28,
  7870. "../enum/PlayerEvents": 40,
  7871. "../enum/Viewmode": 51,
  7872. "../settings": 166,
  7873. "./help/help": 67,
  7874. "./helpManager": 68,
  7875. "./populateModal": 75
  7876. }],
  7877. 72: [function(e, t, i) {
  7878. "use strict";
  7879. var n = e("./circleLoader").circleLoader;
  7880. t.exports = {
  7881. element: $("#gui-loading"),
  7882. hide: function(e) {
  7883. n.done(),
  7884. this.element.fadeOut(1500, e)
  7885. },
  7886. show: function(e) {
  7887. this.element.fadeIn(500, function() {
  7888. this.element.css("display", "table"),
  7889. e && e()
  7890. }
  7891. .bind(this))
  7892. },
  7893. progress: function(e) {
  7894. n.set(e)
  7895. }
  7896. }
  7897. }
  7898. , {
  7899. "./circleLoader": 60
  7900. }],
  7901. 73: [function(e, t, i) {
  7902. "use strict";
  7903. var n = e("../settings")
  7904. , r = $("#memory-info")
  7905. , o = r.find("#memory-gpu")
  7906. , a = !1;
  7907. t.exports = {
  7908. show: function() {
  7909. n.profiling.enabled && (r.show(),
  7910. a = !0)
  7911. },
  7912. hide: function() {
  7913. r.hide(),
  7914. a = !1
  7915. },
  7916. toggle: function() {
  7917. a ? this.hide() : this.show()
  7918. },
  7919. update: function(e) {
  7920. n.profiling.enabled && o.text(Math.floor(e / 1e6) + "MB")
  7921. }
  7922. }
  7923. }
  7924. , {
  7925. "../settings": 166
  7926. }],
  7927. 74: [function(e, t, i) {
  7928. "use strict";
  7929. var n = e("../util/browser")
  7930. , r = e("../analytics");
  7931. e("../settings");
  7932. t.exports = {
  7933. show: function(e, t) {
  7934. $("#gui-message").fadeOut(500, function() {
  7935. t()
  7936. })
  7937. }
  7938. }
  7939. }
  7940. , {
  7941. "../analytics": 4,
  7942. "../settings": 166,
  7943. "../util/browser": 182
  7944. }],
  7945. 75: [function(e, t, i) {
  7946. "use strict";
  7947. function n(e, t, i, n) {
  7948. function r(e) {
  7949. return e.classList.contains(a)
  7950. }
  7951. var o = i ? this.assets[t][i][this.deviceType] : this.assets[t][this.deviceType];
  7952. //for (var a in o) {
  7953. //var s = e.find(r);
  7954. //for (var l in o[a]) {
  7955. //var c = o[a][l];
  7956. //if ("top-info" === l || "bottom-info" === l) {
  7957. //var h = n ? c : "";
  7958. //czj 注释掉第一次打开的用户引导
  7959. //s.querySelector("." + l).textContent = h
  7960. //} else {
  7961. //var u = n ? c : "";
  7962. //, d = s.querySelector("." + l);
  7963. //d.src = u,
  7964. //n ? d.classList.remove("hidden") : d.classList.add("hidden")
  7965. //}
  7966. //}
  7967. //}
  7968. //var p = Array.prototype.slice.call(e[0].parentElement.querySelectorAll("hr"));
  7969. // p.forEach(function(e) {
  7970. // n ? e.classList.remove("hidden") : e.classList.add("hidden")
  7971. // })
  7972. }
  7973. var r = e("../util/browser")
  7974. , o = e("../localization/localize")
  7975. , a = e("../enum/HelpModalType")
  7976. , s = (e("../enum/HelpModalSize"),
  7977. e("../enum/Viewmode"));
  7978. t.exports = {
  7979. init: function() {
  7980. if (!this.hasInitialized) {
  7981. this.hasInitialized = !0,
  7982. this.deviceType = r.isMobile() ? "mobile" : "desktop",
  7983. this.assets = {},
  7984. this.assets[a.LANDING[s.PANORAMA]] = {
  7985. desktop: {
  7986. left: {
  7987. "top-info": o.ROTATE,
  7988. "big-image": "static/images/nav_help_mouse_drag_left.png",
  7989. keyboard: "static/images/nav_help_keyboard_left_right.png"
  7990. },
  7991. middle: {
  7992. "top-info": o.MOVE,
  7993. "big-image": "static/images/nav_help_mouse_click.png",
  7994. keyboard: "static/images/nav_help_keyboard_up_down.png"
  7995. },
  7996. right: {
  7997. "top-info": o.ZOOM,
  7998. "big-image": "static/images/nav_help_mouse_zoom.png",
  7999. keyboard: "static/images/nav_help_zoom_keys.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_tap.png"
  8010. },
  8011. right: {
  8012. "top-info": o.ZOOM,
  8013. "big-image": "static/images/nav_help_gesture_pinch.png"
  8014. }
  8015. }
  8016. },
  8017. this.assets[a.LANDING[s.OUTDOOR]] = JSON.parse(JSON.stringify(this.assets[a.LANDING[s.PANORAMA]])),
  8018. this.assets[a.LANDING[s.DOLLHOUSE]] = {
  8019. desktop: {
  8020. left: {
  8021. "top-info": o.ROTATE,
  8022. "big-image": "static/images/nav_help_mouse_drag_left.png",
  8023. keyboard: "static/images/nav_help_keyboard_left_right.png"
  8024. },
  8025. middle: {
  8026. "top-info": o.MOVE,
  8027. "big-image": "static/images/nav_help_mouse_position_right.png"
  8028. }
  8029. },
  8030. mobile: {
  8031. left: {
  8032. "top-info": o.ROTATE,
  8033. "big-image": "static/images/nav_help_gesture_drag.png"
  8034. },
  8035. middle: {
  8036. "top-info": o.MOVE,
  8037. "big-image": "static/images/nav_help_gesture_position_two_finger.png"
  8038. }
  8039. }
  8040. },
  8041. this.assets[a.LANDING[s.FLOORPLAN]] = {
  8042. desktop: {
  8043. left: {
  8044. "top-info": o.MOVE,
  8045. "big-image": "static/images/nav_help_mouse_position_left.png"
  8046. },
  8047. middle: {
  8048. "top-info": o.ROTATE,
  8049. "big-image": "static/images/nav_help_mouse_drag_right.png",
  8050. keyboard: "static/images/nav_help_keyboard_left_right.png"
  8051. }
  8052. },
  8053. mobile: {
  8054. left: {
  8055. "top-info": o.MOVE,
  8056. "big-image": "static/images/nav_help_gesture_position.png"
  8057. },
  8058. middle: {
  8059. "top-info": o.ROTATE,
  8060. "big-image": "static/images/nav_help_gesture_drag_two_finger.png"
  8061. }
  8062. }
  8063. };
  8064. var e = {
  8065. "top-info": o.INSIDE,
  8066. "big-image": "static/images/nav_help_click_inside.png",
  8067. keyboard: "static/images/nav_help_inside_key.png"
  8068. };
  8069. this.assets[a.LANDING[s.OUTDOOR]].desktop.middle = e,
  8070. this.assets[a.LANDING[s.DOLLHOUSE]].desktop.right = e,
  8071. this.assets[a.LANDING[s.FLOORPLAN]].desktop.right = e;
  8072. var t = {
  8073. "top-info": o.INSIDE,
  8074. "big-image": "static/images/nav_help_tap_inside.png"
  8075. };
  8076. this.assets[a.LANDING[s.OUTDOOR]].mobile.middle = t,
  8077. this.assets[a.LANDING[s.DOLLHOUSE]].mobile.right = t,
  8078. this.assets[a.LANDING[s.FLOORPLAN]].mobile.right = t,
  8079. this.assets[a.NAVIGATION] = {},
  8080. this.assets[a.NAVIGATION][s.PANORAMA] = {
  8081. desktop: {
  8082. left: {
  8083. "top-info": o.HELP_DESKTOP_PANORAMA_1A,
  8084. "bottom-info": o.HELP_DESKTOP_PANORAMA_1B,
  8085. "big-image": "static/images/nav_help_mouse_drag_left.png",
  8086. keyboard: "static/images/nav_help_keyboard_left_right.png"
  8087. },
  8088. middle: {
  8089. "top-info": o.HELP_DESKTOP_PANORAMA_2A,
  8090. "bottom-info": o.HELP_DESKTOP_PANORAMA_2B,
  8091. "big-image": "static/images/nav_help_mouse_click.png",
  8092. keyboard: "static/images/nav_help_keyboard_up_down.png"
  8093. },
  8094. right: {
  8095. "top-info": o.HELP_DESKTOP_PANORAMA_3A,
  8096. "bottom-info": o.HELP_DESKTOP_PANORAMA_3B,
  8097. "big-image": "static/images/nav_help_mouse_zoom.png",
  8098. keyboard: "static/images/nav_help_zoom_keys.png"
  8099. }
  8100. },
  8101. mobile: {
  8102. left: {
  8103. "top-info": o.HELP_MOBILE_PANORAMA_1,
  8104. "big-image": "static/images/nav_help_gesture_drag.png"
  8105. },
  8106. middle: {
  8107. "top-info": o.HELP_MOBILE_PANORAMA_2,
  8108. "big-image": "static/images/nav_help_gesture_tap.png"
  8109. },
  8110. right: {
  8111. "top-info": o.HELP_MOBILE_3,
  8112. "big-image": "static/images/nav_help_gesture_pinch.png"
  8113. }
  8114. }
  8115. },
  8116. this.assets[a.NAVIGATION][s.DOLLHOUSE] = {
  8117. desktop: {
  8118. left: {
  8119. "top-info": o.HELP_DESKTOP_DOLLHOUSE_1A,
  8120. "bottom-info": o.HELP_DESKTOP_DOLLHOUSE_1B,
  8121. "big-image": "static/images/nav_help_mouse_drag_left.png",
  8122. keyboard: "static/images/nav_help_keyboard_all.png"
  8123. },
  8124. middle: {
  8125. "top-info": o.HELP_DESKTOP_DOLLHOUSE_2A,
  8126. "big-image": "static/images/nav_help_mouse_position_right.png"
  8127. },
  8128. right: {
  8129. "top-info": o.HELP_DESKTOP_DOLLHOUSE_3A,
  8130. "big-image": "static/images/nav_help_mouse_zoom.png"
  8131. }
  8132. },
  8133. mobile: {
  8134. left: {
  8135. "top-info": o.HELP_MOBILE_DOLLHOUSE_1,
  8136. "big-image": "static/images/nav_help_gesture_drag.png"
  8137. },
  8138. middle: {
  8139. "top-info": o.HELP_MOBILE_DOLLHOUSE_2,
  8140. "big-image": "static/images/nav_help_gesture_position_two_finger.png"
  8141. },
  8142. right: {
  8143. "top-info": o.HELP_MOBILE_3,
  8144. "big-image": "static/images/nav_help_gesture_pinch.png"
  8145. }
  8146. }
  8147. },
  8148. this.assets[a.NAVIGATION][s.FLOORPLAN] = {
  8149. desktop: {
  8150. left: {
  8151. "top-info": o.HELP_DESKTOP_FLOORPLAN_1A,
  8152. "big-image": "static/images/nav_help_mouse_position_left.png"
  8153. },
  8154. middle: {
  8155. "top-info": o.HELP_DESKTOP_FLOORPLAN_2A,
  8156. "bottom-info": o.HELP_DESKTOP_FLOORPLAN_2B,
  8157. "big-image": "static/images/nav_help_mouse_drag_right.png",
  8158. keyboard: "static/images/nav_help_keyboard_left_right.png"
  8159. },
  8160. right: {
  8161. "top-info": o.HELP_DESKTOP_FLOORPLAN_3A,
  8162. "bottom-info": o.HELP_DESKTOP_FLOORPLAN_3B,
  8163. "big-image": "static/images/nav_help_mouse_zoom.png",
  8164. keyboard: "static/images/nav_help_keyboard_up_down.png"
  8165. }
  8166. },
  8167. mobile: {
  8168. left: {
  8169. "top-info": o.HELP_MOBILE_FLOORPLAN_1,
  8170. "big-image": "static/images/nav_help_gesture_position.png"
  8171. },
  8172. middle: {
  8173. "top-info": o.HELP_MOBILE_FLOORPLAN_2,
  8174. "big-image": "static/images/nav_help_gesture_drag_two_finger.png"
  8175. },
  8176. right: {
  8177. "top-info": o.HELP_MOBILE_3,
  8178. "big-image": "static/images/nav_help_gesture_pinch.png"
  8179. }
  8180. }
  8181. },
  8182. this.assets[a.NAVIGATION][s.OUTDOOR] = JSON.parse(JSON.stringify(this.assets[a.NAVIGATION][s.PANORAMA])),
  8183. this.assets[a.NAVIGATION][s.OUTDOOR].desktop.middle = {
  8184. "top-info": o.HELP_DESKTOP_360_2A,
  8185. "bottom-info": o.HELP_DESKTOP_360_2B,
  8186. "big-image": "static/images/nav_help_click_inside.png",
  8187. keyboard: "static/images/nav_help_inside_key.png"
  8188. },
  8189. this.assets[a.NAVIGATION][s.OUTDOOR].mobile.middle = {
  8190. "top-info": o.HELP_MOBILE_360_2,
  8191. "big-image": "static/images/nav_help_tap_inside.png"
  8192. },
  8193. this.assets[a.MORE_HELP] = {
  8194. desktop: {
  8195. "more-help-hlr": {
  8196. "top-info": o.HELP_MORE_HLR_A,
  8197. "big-image": "static/images/nav_help_expand.svg",
  8198. "bottom-info": o.HELP_DESKTOP_MORE_HLR_B
  8199. },
  8200. "more-help-dollhouse": {
  8201. "top-info": o.HELP_MORE_DOLLHOUSE_A,
  8202. "big-image": "static/images/nav_help_dollhouse.svg",
  8203. "bottom-info": o.HELP_DESKTOP_MORE_DOLLHOUSE_B
  8204. },
  8205. "more-help-floors": {
  8206. "top-info": o.HELP_MORE_FLOORS_A,
  8207. "big-image": "static/images/nav_help_floor picker.svg",
  8208. "bottom-info": o.HELP_DESKTOP_MORE_FLOORS_B
  8209. },
  8210. "more-help-tag": {
  8211. "top-info": o.HELP_MORE_TAG_A,
  8212. "big-image": "static/images/nav_help_tag.svg",
  8213. "bottom-info": o.HELP_DESKTOP_MORE_TAG_B
  8214. },
  8215. "more-help-zoom": {
  8216. "top-info": o.HELP_MORE_ZOOM_A,
  8217. "big-image": "static/images/nav_help_zoom.svg",
  8218. "bottom-info": o.HELP_DESKTOP_MORE_ZOOM_B
  8219. },
  8220. "more-help-tour": {
  8221. "top-info": o.HELP_MORE_TOUR_A,
  8222. "big-image": "static/images/nav_help_play.png",
  8223. "bottom-info": o.HELP_DESKTOP_MORE_TOUR_B
  8224. },
  8225. "more-help-inside": {
  8226. "top-info": o.HELP_MORE_INSIDE_A,
  8227. "big-image": "static/images/nav_help_inside.svg",
  8228. "bottom-info": o.HELP_DESKTOP_MORE_INSIDE_B
  8229. },
  8230. "more-help-vr": {
  8231. "top-info": o.HELP_MORE_VR_A,
  8232. "big-image": "static/images/nav_help_vr.svg",
  8233. "bottom-info": o.HELP_DESKTOP_MORE_VR_B
  8234. },
  8235. "more-help-360": {
  8236. "top-info": o.HELP_MORE_360_A,
  8237. "big-image": "static/images/nav_help_360.svg",
  8238. "bottom-info": o.HELP_DESKTOP_MORE_360_B
  8239. },
  8240. "more-help-fullscreen": {
  8241. "top-info": o.HELP_MORE_FULLSCREEN_A,
  8242. "big-image": "static/images/nav_help_fullscreen.svg",
  8243. "bottom-info": o.HELP_DESKTOP_MORE_FULLSCREEN_B
  8244. }
  8245. },
  8246. mobile: {
  8247. "more-help-hlr": {
  8248. "top-info": o.HELP_MORE_HLR_A,
  8249. "big-image": "static/images/nav_help_expand.svg",
  8250. "bottom-info": o.HELP_DESKTOP_MORE_HLR_B
  8251. },
  8252. "more-help-dollhouse": {
  8253. "top-info": o.HELP_MORE_DOLLHOUSE_A,
  8254. "big-image": "static/images/nav_help_dollhouse.svg",
  8255. "bottom-info": o.HELP_MOBILE_MORE_DOLLHOUSE_B
  8256. },
  8257. "more-help-floors": {
  8258. "top-info": o.HELP_MORE_FLOORS_A,
  8259. "big-image": "static/images/nav_help_floor picker.svg",
  8260. "bottom-info": o.HELP_DESKTOP_MORE_FLOORS_B
  8261. },
  8262. "more-help-tag": {
  8263. "top-info": o.HELP_MORE_TAG_A,
  8264. "big-image": "static/images/nav_help_tag.svg",
  8265. "bottom-info": o.HELP_MOBILE_MORE_TAG_B
  8266. },
  8267. "more-help-tour": {
  8268. "top-info": o.HELP_MORE_TOUR_A,
  8269. "big-image": "static/images/nav_help_play.png",
  8270. "bottom-info": o.HELP_DESKTOP_MORE_TOUR_B
  8271. },
  8272. "more-help-inside": {
  8273. "top-info": o.HELP_MORE_INSIDE_A,
  8274. "big-image": "static/images/nav_help_inside.svg",
  8275. "bottom-info": o.HELP_MOBILE_MORE_INSIDE_B
  8276. },
  8277. "more-help-vr": {
  8278. "top-info": o.HELP_MORE_VR_A,
  8279. "big-image": "static/images/webvr.svg",
  8280. "bottom-info": o.HELP_MOBILE_MORE_VR_B
  8281. },
  8282. "more-help-360": {
  8283. "top-info": o.HELP_MORE_360_A,
  8284. "big-image": "static/images/nav_help_360.svg",
  8285. "bottom-info": o.HELP_MOBILE_MORE_360_B
  8286. }
  8287. }
  8288. },
  8289. this.assets[a.TOUR_INTERACTION[s.PANORAMA]] = {
  8290. desktop: {
  8291. left: {
  8292. "top-info": o.ROTATE,
  8293. "big-image": "static/images/nav_help_mouse_drag_left.png",
  8294. keyboard: "static/images/nav_help_keyboard_left_right.png"
  8295. },
  8296. middle: {
  8297. "top-info": o.MOVE,
  8298. "big-image": "static/images/nav_help_mouse_click.png",
  8299. keyboard: "static/images/nav_help_keyboard_up_down.png"
  8300. },
  8301. right: {
  8302. "top-info": o.PLAY,
  8303. "big-image": "static/images/Desktop-help-play-button.svg",
  8304. keyboard: "static/images/Desktop-help-spacebar-2.svg"
  8305. }
  8306. },
  8307. mobile: {
  8308. left: {
  8309. "top-info": o.ROTATE,
  8310. "big-image": "static/images/nav_help_gesture_drag.png"
  8311. },
  8312. middle: {
  8313. "top-info": o.MOVE,
  8314. "big-image": "static/images/nav_help_gesture_tap.png"
  8315. },
  8316. right: {
  8317. "top-info": o.PLAY,
  8318. "big-image": "static/images/mobile-help-play-button.svg"
  8319. }
  8320. }
  8321. },
  8322. this.assets[a.TOUR_INTERACTION[s.OUTDOOR]] = JSON.parse(JSON.stringify(this.assets[a.TOUR_INTERACTION[s.PANORAMA]])),
  8323. this.assets[a.TOUR_INTERACTION[s.OUTDOOR]].desktop.middle = this.assets[a.LANDING[s.OUTDOOR]].desktop.middle,
  8324. this.assets[a.TOUR_INTERACTION[s.OUTDOOR]].mobile.middle = this.assets[a.LANDING[s.OUTDOOR]].mobile.middle,
  8325. this.assets[a.TOUR_INTERACTION[s.FLOORPLAN]] = JSON.parse(JSON.stringify(this.assets[a.TOUR_INTERACTION[s.OUTDOOR]])),
  8326. this.assets[a.TOUR_INTERACTION[s.FLOORPLAN]].desktop.left = this.assets[a.LANDING[s.FLOORPLAN]].desktop.left,
  8327. this.assets[a.TOUR_INTERACTION[s.FLOORPLAN]].mobile.left = this.assets[a.LANDING[s.FLOORPLAN]].mobile.left
  8328. }
  8329. },
  8330. fill: function(e, t, i) {
  8331. n.call(this, e, t, i, !0)
  8332. },
  8333. clear: function(e, t, i) {
  8334. n.call(this, e, t, i, !1)
  8335. }
  8336. }
  8337. }
  8338. , {
  8339. "../enum/HelpModalSize": 27,
  8340. "../enum/HelpModalType": 28,
  8341. "../enum/Viewmode": 51,
  8342. "../localization/localize": 108,
  8343. "../util/browser": 182
  8344. }],
  8345. 76: [function(e, t, i) {
  8346. "use strict";
  8347. t.exports = Object.freeze({
  8348. OPENED: "share.open",
  8349. CLOSED: "share.closed",
  8350. LINK_CLICKED: "share.linked"
  8351. })
  8352. }
  8353. , {}],
  8354. 77: [function(e, t, i) {
  8355. "use strict";
  8356. function n(e) {
  8357. function t(t, i) {
  8358. var n = window.screenY + ($("#player").height() - i) / 2
  8359. , r = window.screenX + ($("#player").width() - t) / 2
  8360. , o = "top=" + n + ",left=" + r + ",width=" + t + ",height=" + i;
  8361. I.emit(l.LINK_CLICKED, {
  8362. channel: e
  8363. }),
  8364. window.open(C[e], "shareWindow", o)
  8365. }
  8366. switch (e) {
  8367. case y.FACEBOOK:
  8368. t(580, 420);
  8369. break;
  8370. case y.TWITTER:
  8371. t(550, 440);
  8372. break;
  8373. case y.MAIL:
  8374. I.emit(l.LINK_CLICKED, {
  8375. channel: "email"
  8376. }),
  8377. window.open(C[e], "_blank");
  8378. break;
  8379. case y.LINKEDIN:
  8380. }
  8381. }
  8382. function r(e) {
  8383. I.emit(l.LINK_CLICKED, {
  8384. channel: "copylink"
  8385. });
  8386. var t = document.createRange();
  8387. t.selectNodeContents(v);
  8388. var i = window.getSelection();
  8389. i.removeAllRanges(),
  8390. i.addRange(t),
  8391. document.execCommand("copy"),
  8392. A.classList.remove("hidden"),
  8393. v.classList.add("highlighted")
  8394. }
  8395. function o(e) {
  8396. e && (e.stopPropagation(),
  8397. e.target === v) || (window.getSelection().removeAllRanges(),
  8398. v.classList.remove("highlighted"),
  8399. A.classList.add("hidden"))
  8400. }
  8401. var a = e("../../util/browser")
  8402. , s = e("../../localization/localize")
  8403. , l = e("./ShareEvents")
  8404. , c = e("../../util/common")
  8405. , h = e("events").EventEmitter
  8406. , u = document.getElementById("sharing")
  8407. , d = document.getElementById("share-modal")
  8408. , p = document.getElementById("share-close")
  8409. , f = document.getElementById("facebook-share")
  8410. , g = document.getElementById("twitter-share")
  8411. , m = document.getElementById("mail-share")
  8412. , v = document.getElementById("share-url-text")
  8413. , A = document.getElementById("copy-success")
  8414. , y = Object.freeze({
  8415. FACEBOOK: "facebook",
  8416. TWITTER: "twitter",
  8417. MAIL: "mail",
  8418. LINKEDIN: "linkedin"
  8419. })
  8420. , C = {};
  8421. C[y.FACEBOOK] = "http://www.facebook.com/sharer.php?u=" + encodeURIComponent(window.location.href + "&utm_source=1") + "&t=",
  8422. C[y.TWITTER] = "http://twitter.com/intent/tweet?text=",
  8423. C[y.MAIL] = "mailto:?subject=";
  8424. var I = {
  8425. init: function(e) {
  8426. var t = encodeURIComponent(s.SHARE_EXPLORE + e + " " + s.SHARE_AT + " ");
  8427. C[y.FACEBOOK] += t + encodeURIComponent(window.location.href + "&utm_source=1"),
  8428. C[y.TWITTER] += t + encodeURIComponent(window.location.href + "&utm_source=2 " + s.SHARE_WITH + " #port"),
  8429. C[y.MAIL] += encodeURIComponent(s.SHARE_EXPLORE + e + s.SHARE_3D) + "&body=" + t + encodeURIComponent(window.location.href + "&utm_source=3"),
  8430. u.addEventListener("click", this.toggle.bind(this)),
  8431. p.addEventListener("click", this.hide.bind(this)),
  8432. v.addEventListener("click", r),
  8433. d.addEventListener("click", o),
  8434. f.addEventListener("click", n.bind(this, y.FACEBOOK)),
  8435. g.addEventListener("click", n.bind(this, y.TWITTER)),
  8436. m.addEventListener("click", n.bind(this, y.MAIL)),
  8437. v.textContent = window.location.href + "&utm_source=4",
  8438. d.classList.add(a.isMobile() ? "mobile" : "desktop"),
  8439. u.classList.remove("hidden")
  8440. },
  8441. show: function() {
  8442. this.emit(l.OPENED),
  8443. d.classList.add("fadeIn")
  8444. },
  8445. hide: function() {
  8446. d.classList.contains("fadeIn") && (this.emit(l.CLOSED),
  8447. document.selection && document.selection.empty(),
  8448. window.getSelection().removeAllRanges(),
  8449. o(),
  8450. d.classList.remove("fadeIn"))
  8451. },
  8452. toggle: function() {
  8453. d.classList.contains("fadeIn") ? this.hide() : this.show()
  8454. }
  8455. };
  8456. c.extendObject(I, h.prototype),
  8457. t.exports = I
  8458. }
  8459. , {
  8460. "../../localization/localize": 108,
  8461. "../../util/browser": 182,
  8462. "../../util/common": 185,
  8463. "./ShareEvents": 76,
  8464. events: 202
  8465. }],
  8466. 78: [function(e, t, i) {
  8467. "use strict";
  8468. t.exports = Object.freeze({
  8469. OPENED: "terms.opened",
  8470. CLOSED: "terms.closed"
  8471. })
  8472. }
  8473. , {}],
  8474. 79: [function(e, t, i) {
  8475. "use strict";
  8476. var n = e("./TermsEvent")
  8477. , r = e("../../localization/localize")
  8478. , o = e("../../analytics")
  8479. , a = e("../../util/ajax")
  8480. , s = e("../../util/common")
  8481. , l = e("events").EventEmitter
  8482. , c = document.getElementById("terms-modal")
  8483. , h = {
  8484. init: function() {
  8485. $(".footer-terms").on("click", function(e) {
  8486. e.preventDefault(),
  8487. this.show()
  8488. }
  8489. .bind(this)),
  8490. $("#terms-modal .close").on("click", this.hide.bind(this))
  8491. },
  8492. show: function() {
  8493. this.emit(n.OPENED),
  8494. a.get("static/" + r.TERMS_TEXT_FILE).done(function(e) {
  8495. var t = $("#terms-text").html(e);
  8496. o.track("showcase_gui", {
  8497. gui_action: "click_terms_button",
  8498. interaction_source: "gui"
  8499. }),
  8500. t.find("a").attr("target", "_blank")
  8501. }).fail(function() {
  8502. $("#terms-text").html("<h1>" + r.TERMS_OF_USE + "</h1><p>" + r.TERMS_FAIL)
  8503. }),
  8504. c.classList.add("fadeIn")
  8505. },
  8506. hide: function(e) {
  8507. e && e.preventDefault(),
  8508. c.classList.contains("fadeIn") && this.emit(n.CLOSED),
  8509. c.classList.remove("fadeIn")
  8510. }
  8511. };
  8512. s.extendObject(h, l.prototype),
  8513. t.exports = h
  8514. }
  8515. , {
  8516. "../../analytics": 4,
  8517. "../../localization/localize": 108,
  8518. "../../util/ajax": 181,
  8519. "../../util/common": 185,
  8520. "./TermsEvent": 78,
  8521. events: 202
  8522. }],
  8523. 80: [function(e, t, i) {
  8524. "use strict";
  8525. t.exports = Object.freeze({
  8526. OPEN_INFO: "title.open.info",
  8527. CLOSE_INFO: "title.close.info",
  8528. SHOW_INFO: "title.show.info",
  8529. HIDE_INFO: "title.hide.info",
  8530. LINK_CLICKED: "title.link.click",
  8531. CONTACT_LINK_CLICKED: "title.contact.click",
  8532. ORIGIN_LINK_CLICKED: "title.origin.click"
  8533. })
  8534. }
  8535. , {}],
  8536. 81: [function(e, t, i) {
  8537. "use strict";
  8538. function n(e, t) {
  8539. o.tags.enabled && 0 !== Object.keys(e.tags).length && r(e, t)
  8540. }
  8541. function r(e, t) {
  8542. function i(i) {
  8543. e.shouldShowtags = "show" === this.value,
  8544. e.shouldShowtags ? t.showAlltags(o.tags.startup.fadeInDuration) : t.hideAlltags(o.tags.startup.fadeInDuration)
  8545. }
  8546. document.getElementById("tag-toggles").classList.remove("hidden"),
  8547. document.getElementById("radio-tag-show").checked = !0;
  8548. for (var n = document.getElementById("tag-inputs").querySelectorAll("input"), r = 0; r < n.length; r++)
  8549. n[r].addEventListener("change", i)
  8550. }
  8551. var o = e("../../settings");
  8552. t.exports.init = n
  8553. }
  8554. , {
  8555. "../../settings": 166
  8556. }],
  8557. 82: [function(e, t, i) {
  8558. (function(i) {
  8559. "use strict";
  8560. function n(e, t) {
  8561. return e && u.valueFromHash("title", 1) && 2 !== u.valueFromHash("mls", 0) ? (document.getElementsByClassName("titleText")[0].innerText = e, g_weixinObj.title = e,
  8562. e.length > g.minTooltipCharacters && I.parentElement.setAttribute("data-original-title", e),
  8563. t && 1 !== m.specialEdition && m.brand && !m.mls ? document.getElementById("cobrandTitle").innerText = t : (document.getElementsByClassName("co-brand")[0].classList.add("hidden"),
  8564. document.getElementById("gui-name").classList.add("noCoBrand"),
  8565. document.getElementById("cobrandTitle").classList.add("hidden")),
  8566. !0) : (document.getElementById("model-title").classList.add("hidden"),
  8567. !1)
  8568. }
  8569. function r(e) {
  8570. return e ? (L = !0,
  8571. void (_.innerHTML = e)) : void _.classList.add("hidden")
  8572. }
  8573. function o(e, t, i, n) {
  8574. if (!e && !t && !i || !m.brand || u.valueFromHash("mls", !1))
  8575. return void T.classList.add("hidden");
  8576. L = !0;
  8577. var r = []
  8578. , o = c(r, "<br>");
  8579. if (e && o('<span id="contactName">' + e + "</span>"),
  8580. t) {
  8581. var a = n || t
  8582. , s = u.isMobile() ? '<a id="phone" href="callto:' + t + '">' + a + "</a>" : "<span>" + a + "</span>";
  8583. o(s)
  8584. }
  8585. i && o('<a id="email" href="mailTo:' + i + '">' + i + "</a>"),
  8586. r[0] = "",
  8587. x.innerHTML = r.join("")
  8588. }
  8589. function a(e) {
  8590. if ("string" == typeof e)
  8591. try {
  8592. e = JSON.parse(e)
  8593. } catch (e) {
  8594. return y.warn("Unable to parse address data"),
  8595. void S.parentElement.classList.add("hidden")
  8596. }
  8597. if (!(e && (e.address_1 || e.address_2 || e.city || e.state || e.zip)))
  8598. return void S.parentElement.classList.add("hidden");
  8599. L = !0;
  8600. var t = []
  8601. , i = c(t, " ");
  8602. e.address_1 && i(e.address_1),
  8603. e.address_2 && i(e.address_2),
  8604. e.city && i(e.city, ", "),
  8605. e.state && i(e.state, ", "),
  8606. e.zip && i(e.zip, e.state ? " " : ", "),
  8607. t[0] = "",
  8608. S.innerText = t.join("")
  8609. }
  8610. function s(e) {
  8611. var t = document.createElement("a");
  8612. return t.id = "url",
  8613. t.target = "_blank",
  8614. t.href = e,
  8615. t.innerText = e,
  8616. t.addEventListener("click", N.emit.bind(N, v.ORIGIN_LINK_CLICKED)),
  8617. t
  8618. }
  8619. function l(e) {
  8620. return !(!e || u.inIframe() && document.referrer === e) && (R.classList.remove("hidden"),
  8621. P.innerHTML = f.WEBVR_LEARN_MORE + ": ",
  8622. P.appendChild(s(e)),
  8623. O.forEach(function(e) {
  8624. e.classList.add("share-link")
  8625. }),
  8626. !0)
  8627. }
  8628. function c(e, t) {
  8629. var i = e
  8630. , n = t;
  8631. return function(e, t) {
  8632. i.push(t || n, e)
  8633. }
  8634. }
  8635. function h() {
  8636. document.getElementById("title-toggle").addEventListener("click", N.toggleTitle.bind(N)),
  8637. L && I.addEventListener("click", N.toggleMeta.bind(N, !1));
  8638. var e = [].slice.call(_.querySelectorAll("a"));
  8639. e.forEach(function(e) {
  8640. e.addEventListener("click", N.emit.bind(N, v.LINK_CLICKED))
  8641. });
  8642. var t = [].slice.call(T.querySelectorAll("a"));
  8643. t.forEach(function(e) {
  8644. e.addEventListener("click", N.emit.bind(N, v.CONTACT_LINK_CLICKED, {
  8645. contact_type: e.getAttribute("id")
  8646. }))
  8647. })
  8648. }
  8649. var u = e("../../util/browser")
  8650. , d = e("../../util/common")
  8651. , p = e("../../util/logger")
  8652. , f = e("../../localization/localize")
  8653. , g = e("./titleBarSettings")
  8654. , m = e("../../settings")
  8655. , v = e("./TitleEvents")
  8656. , A = e("events").EventEmitter
  8657. , y = new p(i)
  8658. , C = document.querySelector(".pinTop.left")
  8659. , I = document.getElementsByClassName("title-container")[0]
  8660. , E = document.getElementById("title-toggle").querySelector("i")
  8661. , b = document.getElementById("meta-info-wrapper")
  8662. , w = document.getElementById("meta-info")
  8663. , _ = document.getElementById("meta-description")
  8664. , T = document.getElementsByClassName("contact-info")[0]
  8665. , x = document.getElementById("contact-data")
  8666. , S = document.getElementById("addressTxt")
  8667. , M = document.getElementById("tag-toggles")
  8668. , R = document.getElementById("share-origin")
  8669. , P = document.getElementById("share-link-wrapper")
  8670. , O = [w, b, I]
  8671. , L = !1
  8672. , D = !1
  8673. , N = {
  8674. populate: function(e) {
  8675. if (n(window.DATA.name, e.coBrand)) {
  8676. if (r(e.description),
  8677. o(e.contactName, e.phone, e.email, e.formatted_contact_phone),
  8678. a(e.address),
  8679. L) {
  8680. var t = document.createElement("br");
  8681. M.insertBefore(t, M.firstElementChild)
  8682. }
  8683. e.socialSharing && m.share.enabled && (D = l(e.url))
  8684. }
  8685. },
  8686. finishSetup: function(e) {
  8687. L = L || !!e,
  8688. h(),
  8689. L || (D ? I.classList.add("share-only") : I.classList.add("no-meta"))
  8690. },
  8691. toggleMeta: function(e, t) {
  8692. var title = document.getElementById("model-title");
  8693. t && t.preventDefault();
  8694. var i = w.classList.contains("expand");
  8695. e && !i || (i ? (O.forEach(function(e) {
  8696. e.classList.remove("expand")
  8697. }),
  8698. this.emit(v.CLOSE_INFO),title.classList.remove("expand")) : (O.forEach(function(e) {
  8699. e.classList.add("expand");
  8700. }),
  8701. title.classList.add("expand"),
  8702. this.emit(v.OPEN_INFO)))
  8703. },
  8704. setupToggling: function() {
  8705. b.style.height = w.offsetHeight + "px",
  8706. w.addEventListener("transitionend", function() {
  8707. b.style.height = w.offsetHeight + "px"
  8708. })
  8709. },
  8710. toggleTitle: function(e) {
  8711. e && e.preventDefault(),
  8712. C.classList.contains("closed") ? (C.classList.add("open"),
  8713. E.classList.remove("icon-dpad-right"),
  8714. E.classList.add("icon-dpad-left"),
  8715. this.emit(v.SHOW_INFO),
  8716. setTimeout(function() {
  8717. C.classList.remove("closed"),
  8718. C.classList.remove("open")
  8719. }, g.removeAnimationClasses)) : (C.classList.add("closed"),
  8720. E.classList.remove("icon-dpad-left"),
  8721. E.classList.add("icon-dpad-right"),
  8722. this.emit(v.HIDE_INFO))
  8723. }
  8724. };
  8725. d.extendObject(N, A.prototype),
  8726. t.exports = N
  8727. }
  8728. ).call(this, "/js/gui/title/titleBar.js")
  8729. }
  8730. , {
  8731. "../../localization/localize": 108,
  8732. "../../settings": 166,
  8733. "../../util/browser": 182,
  8734. "../../util/common": 185,
  8735. "../../util/logger": 189,
  8736. "./TitleEvents": 80,
  8737. "./titleBarSettings": 83,
  8738. events: 202
  8739. }],
  8740. 83: [function(e, t, i) {
  8741. "use strict";
  8742. t.exports = Object.freeze({
  8743. minTooltipCharacters: 19,
  8744. removeAnimationClasses: 500
  8745. })
  8746. }
  8747. , {}],
  8748. 84: [function(e, t, i) {
  8749. "use strict";
  8750. function n(e) {
  8751. C = e,
  8752. P.forEach(function(e) {
  8753. b.addEventListener(e, u.bind(this, !1), !0),
  8754. w.addEventListener(e, u.bind(this, !0), !0),
  8755. E.addEventListener(e, o, !0)
  8756. S.forEach(function(t) {//会触发导览停止
  8757. t.addEventListener(e, a, !0)
  8758. })
  8759. $("#drawer img").on(e, a)
  8760. })
  8761. document.addEventListener("keydown", u.bind(this, !1), !0)
  8762. C.on(v.TourStart, function() {
  8763. E.classList.add("playing")
  8764. })
  8765. }
  8766. function r() {
  8767. C.playTour(),
  8768. I && clearTimeout(I),
  8769. d(),
  8770. _.removeClass("fadeIn")
  8771. }
  8772. function o() {
  8773. E.classList.contains("playing") && (C.stopTour(),
  8774. _.addClass("fadeIn"),
  8775. setTimeout(function() {
  8776. _.removeClass("fadeIn")
  8777. }, p.tourInteraction.showPauseButton),
  8778. O || (clearTimeout(I),
  8779. I = setTimeout(h, p.tourInteraction.showModal)),
  8780. setTimeout(function() {
  8781. E.classList.remove("playing")
  8782. }, p.tourInteraction.allowNextClick))
  8783. }
  8784. function a() {
  8785. // 周恩光 在自动导览时拖动导览片段触发,会暂停自动导览
  8786. C.tourInProgress && (
  8787. // C.stopTour(),
  8788. C.endTourProgress(),
  8789. E.classList.remove("playing"))
  8790. }
  8791. function s() {
  8792. T.is(":visible") ? r() : o()
  8793. }
  8794. function l() {
  8795. x.hasClass("playing") && (clearTimeout(I),
  8796. C.atEndOfTour() ? c() : _.removeClass("fadeIn"))
  8797. }
  8798. function c() {
  8799. E.classList.remove("playing"),
  8800. h()
  8801. }
  8802. function h() {//去掉导览结束时的提示
  8803. /* if (!p.tourInteraction.disabled) {
  8804. M.removeClass("small landing " + g.FLOORPLAN + " " + g.OUTDOOR + " " + g.PANORAMA),
  8805. M.addClass("fadeIn tour " + m.deviceType);
  8806. var e = p.tourInteraction.smallModal ? y.SMALL : y.LARGE;
  8807. if (!p.tourInteraction.smallModal) {
  8808. var t;
  8809. 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,
  8810. m.fill(R, A.TOUR_INTERACTION[t]),
  8811. M.addClass(t)
  8812. }
  8813. M.addClass(e)
  8814. } */
  8815. }
  8816. function u(e, t) {
  8817. if(window.myKeyBlank) return
  8818. if (t) {
  8819. var i = "keydown" === t.type
  8820. , n = t.which === f.SPACE || C.tourIsPlaying;
  8821. i && n || e || (O = !0),
  8822. C.atEndOfTour() && d(),
  8823. !C.tourIsPlaying && C.tourInProgress && (_.removeClass("fadeIn"),
  8824. d(),
  8825. t.which !== f.SPACE && a()),
  8826. i && n && s()
  8827. }
  8828. }
  8829. function d() {
  8830. M.removeClass("fadeIn")
  8831. }
  8832. var p = (e("../util/browser"),
  8833. e("../settings"))
  8834. , f = e("../enum/Keys")
  8835. , g = e("../enum/Viewmode")
  8836. , m = (e("./helpManager"),
  8837. e("./populateModal"))
  8838. , v = e("../enum/DirectorEvents")
  8839. , A = e("../enum/HelpModalType")
  8840. , y = e("../enum/HelpModalSize")
  8841. , C = null
  8842. , I = null
  8843. , E = document.getElementById("pause-overlay")
  8844. , b = document.getElementById("player")
  8845. , w = document.getElementById("gui")
  8846. , _ = $("#pause-icon").eq(0)
  8847. , T = $("#play").eq(0)
  8848. , x = $("#playHead").eq(0)
  8849. , S = $(".rightViewContainer, #previous, #next, #gui-modes-inside, #gui-modes-outside, #gui-modes-dollhouse, #gui-modes-floorplan").toArray()
  8850. , M = $("#interaction-modal").eq(0)
  8851. , R = $("#interaction-modal .interaction").toArray()
  8852. , P = ["touchstart", "mousedown", "pointerdown"]
  8853. , O = !1;
  8854. t.exports.init = n,
  8855. t.exports.play = r,
  8856. t.exports.pause = o,
  8857. t.exports.pauseWithoutCTA = a,
  8858. t.exports.togglePlay = s,
  8859. t.exports.stopTour = l,
  8860. t.exports.dismissModal = d
  8861. }
  8862. , {
  8863. "../enum/DirectorEvents": 23,
  8864. "../enum/HelpModalSize": 27,
  8865. "../enum/HelpModalType": 28,
  8866. "../enum/Keys": 30,
  8867. "../enum/Viewmode": 51,
  8868. "../settings": 166,
  8869. "../util/browser": 182,
  8870. "./helpManager": 68,
  8871. "./populateModal": 75
  8872. }],
  8873. 85: [function(e, t, i) {
  8874. "use strict";
  8875. t.exports = Object.freeze({
  8876. OPENED: "vr.modal.opened",
  8877. LAUNCH: "vr.modal.launch",
  8878. CLOSED: "vr.modal.closed",
  8879. NEXT: "vr.modal.next",
  8880. PREV: "vr.modal.prev",
  8881. STORE: "vr.modal.store",
  8882. falseICECHOSEN: "vr.modal.device"
  8883. })
  8884. }
  8885. , {}],
  8886. 86: [function(e, t, i) {
  8887. "use strict";
  8888. function n(e, t, i) {
  8889. function n(e, t, n, r) {
  8890. function o() {
  8891. return p + "&m=" + t + "&display=" + e
  8892. }
  8893. function s() {
  8894. var e = "&utm_medium=" + (a.inIframe() ? "embed" : "direct")
  8895. , t = "&utm_source=" + u
  8896. , n = "&utm_showcase_session_id=" + i;
  8897. return e + t + n
  8898. }
  8899. function l() {
  8900. return d + "&sids=" + t + "&lsid=" + t + "&ln=" + encodeURIComponent(n) + "&ld=" + encodeURIComponent(r) + "&display=" + e
  8901. }
  8902. return a.valueFromHash("vrcoll", !1) ? l() + s() : o() + s()
  8903. }
  8904. function r(e, t, i, r) {
  8905. var o = "https://api.branch.io/v1/url"
  8906. , a = n(e, t, i, r)
  8907. , s = {
  8908. responseType: "json",
  8909. data: {
  8910. branch_key: h.appConfig.branch_key,
  8911. data: {
  8912. m: t,
  8913. full_url: a,
  8914. $desktop_url: m,
  8915. $og_app_id: "331853976762864119",
  8916. $og_title: i,
  8917. $og_description: r,
  8918. $og_image_url: location.origin + "/api/v1/player/models/" + t + "/thumb",
  8919. $canonical_url: window.location.href
  8920. }
  8921. }
  8922. };
  8923. c.post(o, s).done(function(t) {
  8924. f[e] = t.url
  8925. }).fail(function(t) {
  8926. f[e] = t
  8927. }
  8928. .bind(this, a))
  8929. }
  8930. function o(e, t, i) {
  8931. for (var r in s) {
  8932. var o = s[r]
  8933. , a = n(o, e, t, i);
  8934. f[o] = a
  8935. }
  8936. }
  8937. var u = a.inIframe() ? encodeURIComponent(document.referrer) : encodeURIComponent(window.location.href)
  8938. , d = g + "/vr/dlist/?ret=" + u
  8939. , p = g + "/vr/show/?ret=" + u
  8940. , m = "";
  8941. switch (e) {
  8942. case l.IOS:
  8943. r(s.CardboardIOS, t.sid, t.name, t.summary);
  8944. break;
  8945. default:
  8946. o(t.sid, t.name, t.summary)
  8947. }
  8948. }
  8949. function r(e) {
  8950. var t = f[e];
  8951. window.open(t, "_blank")
  8952. }
  8953. function o(e) {
  8954. var t = u[e];
  8955. window.open(t, "_blank")
  8956. }
  8957. var a = e("../../util/browser")
  8958. , s = e("../../enum/VRApps")
  8959. , l = e("../../enum/VRPlatforms")
  8960. , c = e("../../util/ajax")
  8961. , h = e("../../settings")
  8962. , u = {};
  8963. u[s.CardboardAndroid] = "https://play.google.com/store/apps/details?id=com.port.mpvrcardboard&redirect_uri=",
  8964. u[s.CardboardIOS] = "https://itunes.apple.com/us/app/port-vr/id1168808473&redirect_uri=",
  8965. u[s.GearVR] = "https://www.oculus.com/experiences/gear-vr/811670972252145/?redirect_uri=";
  8966. for (var d in s) {
  8967. var p = s[d];
  8968. u[p] += encodeURIComponent(document.referrer + "&display=" + p)
  8969. }
  8970. var f = {}
  8971. , g = function() {
  8972. var e = window.location.host;
  8973. return e.indexOf(".port.com") === -1 && e.indexOf("localhost") === -1 && (e = "my.port.com"),
  8974. "https://" + e
  8975. }();
  8976. t.exports.init = n,
  8977. t.exports.launch = r,
  8978. t.exports.launchStore = o
  8979. }
  8980. , {
  8981. "../../enum/VRApps": 46,
  8982. "../../enum/VRPlatforms": 49,
  8983. "../../settings": 166,
  8984. "../../util/ajax": 181,
  8985. "../../util/browser": 182
  8986. }],
  8987. 87: [function(e, t, i) {
  8988. "use strict";
  8989. function n(e) {
  8990. var t;
  8991. switch (e) {
  8992. case m.IOS:
  8993. return t = p.iosVersion(),
  8994. t.major > 9 || 9 === t.major && t.minor >= 1;
  8995. case m.Android:
  8996. return t = p.androidVersion(),
  8997. t.major > 4 || 4 === t.major && t.minor > 4 || 4 === t.major && 4 === t.minor && t.patch >= 4
  8998. }
  8999. return !1
  9000. }
  9001. function r(e, t) {
  9002. function i(e) {
  9003. K.emit(A.STORE, {
  9004. type: e
  9005. }),
  9006. f.launchStore(e)
  9007. }
  9008. function r(e) {
  9009. switch (e !== _.pageCount && (a(e),
  9010. N.text(e + 1 + " / " + _.pageCount)),
  9011. e) {
  9012. case _.Title:
  9013. O.css("display", "none"),
  9014. L.text(u[e]),
  9015. o(s);
  9016. break;
  9017. case _.Cardboard:
  9018. O.css("display", "block"),
  9019. L.text(u[e]),
  9020. M.filter(".cardboard").off(),
  9021. M.filter(".gearvr").off(),
  9022. c(e, s),
  9023. h(H, X, Z);
  9024. break;
  9025. case _.Gear:
  9026. L.text(u[e]),
  9027. c(e, s),
  9028. T.addClass("lastPage"),
  9029. h(G, X, Z);
  9030. break;
  9031. case _.pageCount:
  9032. T.removeClass("fadeIn"),
  9033. K.emit(A.CLOSED)
  9034. }
  9035. B.filter("[src='']").hide()
  9036. }
  9037. var s = function() {
  9038. return p.detectAndroid() ? p.detectAndroidMobile() && n(m.Android) ? (T.addClass("supported"),
  9039. w = ".show-supported",
  9040. m.Android) : (T.addClass("unsupported"),
  9041. w = ".show-unsupported",
  9042. m.UnsupportedAndroid) : p.detectIPhone() || p.detectIPod() ? (T.addClass("ios"),
  9043. w = ".show-ios",
  9044. _ = v.ios,
  9045. m.IOS) : (T.addClass("desktop"),
  9046. w = ".show-desktop",
  9047. m.Desktop)
  9048. }();
  9049. f.init(s, e, t),
  9050. s !== m.Desktop && T.addClass("mobile");
  9051. var l = function(e) {
  9052. K.emit(A.LAUNCH, {
  9053. vr_platform: s,
  9054. vr_app: e
  9055. }),
  9056. f.launch(e)
  9057. };
  9058. q.cardboardAndroid = l.bind(this, g.CardboardAndroid),
  9059. q.gear = l.bind(this, g.GearVR),
  9060. q.cardboardIOS = l.bind(this, g.CardboardIOS),
  9061. d(),
  9062. $(".show-supported, .show-unsupported, .show-ios, .show-desktop").hide(),
  9063. $(w).show();
  9064. var u = [C.VR_LEARN_MORE_CAPS, C.VR_NEXT_CAPS, C.VR_GOT_IT_CAPS]
  9065. , y = ["vr_modal_learn_more", "vr_modal_next", "vr_modal_done"];
  9066. s === m.IOS && (u.splice(1, 1),
  9067. y.splice(1, 1)),
  9068. $("#vr").on("click", function(e) {
  9069. e.preventDefault();
  9070. player.FlyToMode("panorama", ()=>{
  9071. if(!window.vrEnabled) { // 开启VR
  9072. window.vrEnabled = true;
  9073. this.classList.add('active');
  9074. $('#gui div').not('#vrOff').addClass('vrHide');
  9075. $('#vrOffImg').css({'display':'inline-block'});
  9076. }else{
  9077. }
  9078. })
  9079. });
  9080. $('#vrOff').on('click', function(){
  9081. window.vrEnabled = false;
  9082. $('#gui div').not('#vrOff').removeClass('vrHide');
  9083. $('#vrOffImg').css({'display':'none'});
  9084. $('#player canvas').css({width:'', 'height': ''}); // 清楚vr下给canvas设置的宽高, 避免横竖屏切换的时候出现宽高错误的现象
  9085. $('#vr').removeClass('active'); // 清除vr按钮的激活样式
  9086. })
  9087. var I = "https://my.port.com/vr/show/?m=" + e.sid;
  9088. s === m.IOS ? $(".cardboardLink").on("click", i.bind(this, g.CardboardIOS)) : $(".cardboardLink").on("click", i.bind(this, g.CardboardAndroid)),
  9089. $(".gearLink").on("click", i.bind(this, g.GearVR)),
  9090. $("span.modelLink").text(I),
  9091. O.on("click", function(e) {
  9092. K.emit(A.PREV),
  9093. b--,
  9094. r(b)
  9095. }),
  9096. L.on("click", function(e) {
  9097. L.text();
  9098. K.emit(A.NEXT, {
  9099. nextAction: y[b]
  9100. }),
  9101. b++,
  9102. r(b)
  9103. }),
  9104. T.find(".close").on("click", K.dismiss)
  9105. }
  9106. function o(e) {
  9107. switch (e) {
  9108. case m.Android:
  9109. M.filter(".cardboard").off().on("click", q.cardboardAndroid),
  9110. M.filter(".gearvr").off().on("click", q.gear),
  9111. s(H, G, "logo-button", "same-line");
  9112. break;
  9113. case m.UnsupportedAndroid:
  9114. s("", z, "", "");
  9115. break;
  9116. case m.IOS:
  9117. M.filter(".cardboard").off().on("click", q.cardboardIOS),
  9118. s(H, "", "logo-button", "");
  9119. break;
  9120. case m.Desktop:
  9121. M.filter(".cardboard").off().on("click", l.bind(this, null, F, U)),
  9122. M.filter(".gearvr").off().on("click", l.bind(this, G, V, null)),
  9123. s(H, G, "logo-button", "same-line"),
  9124. Q.cardboard()
  9125. }
  9126. }
  9127. function a(e) {
  9128. $(".p1, .p2, .p3").hide(),
  9129. x.insertAfter(S),
  9130. T.removeClass("front-page"),
  9131. T.removeClass("details-page"),
  9132. T.removeClass("lastPage"),
  9133. M.removeClass("logo-button"),
  9134. M.removeClass("same-line"),
  9135. S.removeClass("headsetOptions"),
  9136. R.attr("src", ""),
  9137. R.filter(".second").removeClass("gear"),
  9138. R.css("display", "inline-block"),
  9139. R.off(),
  9140. P.filter(".second").css("display", ""),
  9141. D.css("display", "none"),
  9142. $(".p" + (e + 1) + w).show(),
  9143. R.filter(".third").insertBefore(P.filter(".third"))
  9144. }
  9145. function s(e, t, i, n) {
  9146. T.addClass("front-page"),
  9147. R.filter(".first").attr("src", e),
  9148. R.filter(".second").attr("src", t),
  9149. M.filter(".first").addClass(i),
  9150. M.filter(".second").addClass(i),
  9151. M.addClass(n),
  9152. ".show-desktop" === w && S.insertAfter(x)
  9153. }
  9154. function l(e, t, i) {
  9155. S.addClass("headsetOptions"),
  9156. M.off(),
  9157. R.filter(".second").attr("src", t),
  9158. D.css("display", "block"),
  9159. P.filter(".second").css("display", "none"),
  9160. D.on("click", function() {
  9161. a(_.Title),
  9162. o(m.Desktop)
  9163. }),
  9164. e && (K.emit(A.falseICECHOSEN, {
  9165. name: g.GearVR
  9166. }),
  9167. R.filter(".first").attr("src", e),
  9168. R.filter(".second").addClass("gear"),
  9169. R.filter(".second").on("click", f.launchStore.bind(this, g.GearVR)),
  9170. Q.gearvr()),
  9171. i && (K.emit(A.falseICECHOSEN, {
  9172. name: g.Cardboard
  9173. }),
  9174. R.filter(".third").attr("src", i),
  9175. R.filter(".third").show(),
  9176. R.filter(".third").insertAfter(R.filter(".second")),
  9177. R.filter(".third").addClass("link"),
  9178. R.filter(".second").addClass("link"),
  9179. R.filter(".second").on("click", f.launchStore.bind(this, g.CardboardIOS)),
  9180. R.filter(".third").on("click", f.launchStore.bind(this, g.CardboardAndroid)),
  9181. Q.cardboard())
  9182. }
  9183. function c(e, t) {
  9184. switch (t) {
  9185. case m.IOS:
  9186. X = Y,
  9187. Z = j;
  9188. break;
  9189. case m.Desktop:
  9190. e === _.Cardboard ? (X = F,
  9191. Z = U,
  9192. R.filter(".second").on("click", f.launchStore.bind(this, g.CardboardIOS)),
  9193. R.filter(".third").on("click", f.launchStore.bind(this, g.CardboardAndroid))) : (X = V,
  9194. R.filter(".second").on("click", f.launchStore.bind(this, g.GearVR)),
  9195. Z = "");
  9196. break;
  9197. default:
  9198. e === _.Cardboard ? (X = z,
  9199. Z = j) : (X = k,
  9200. Z = W)
  9201. }
  9202. }
  9203. function h(e, t, i) {
  9204. T.find(".inner").addClass("details-page"),
  9205. T.addClass("details-page"),
  9206. R.filter(".first").attr("src", e),
  9207. R.filter(".second").attr("src", t),
  9208. R.filter(".third").attr("src", i)
  9209. }
  9210. function u() {
  9211. T.hasClass("fadeIn") && (T.removeClass("fadeIn"),
  9212. K.emit(A.CLOSED))
  9213. }
  9214. function d() {
  9215. var e = p.aspectRatio() > 1 && p.isMobile();
  9216. T.toggleClass("landscape", e).toggleClass("portrait", !e),
  9217. T.toggleClass("tiny", $("#player").height() <= y.narrowLandscapeHeight),
  9218. T.toggleClass("tinier", $("#player").height() <= y.reallyNarrowLandscapeHeight)
  9219. }
  9220. var p = e("../../util/browser")
  9221. , f = e("./vrLink")
  9222. , g = e("../../enum/VRApps")
  9223. , m = e("../../enum/VRPlatforms")
  9224. , v = e("../../enum/VRPages")
  9225. , A = e("./vrEvent")
  9226. , y = (e("../../settings"),
  9227. e("../../constants"))
  9228. , C = e("../../localization/localize")
  9229. , I = e("../../util/common")
  9230. , E = e("events").EventEmitter
  9231. , b = 0
  9232. , w = null
  9233. , _ = v.standard
  9234. , T = $(".vr-popup")
  9235. , x = T.find(".vr-popup-body")
  9236. , S = T.find(".vr-images")
  9237. , M = T.find(".img-container")
  9238. , R = T.find(".vr-sm-image")
  9239. , P = M.find(".vr-img-caption")
  9240. , O = $(".vr-buttons").find(".prev-button")
  9241. , L = $(".vr-buttons").find(".next-button")
  9242. , D = S.find(".front-close")
  9243. , N = $(".vr-page")
  9244. , B = T.find("img")
  9245. , F = "static/images/apple-store.png"
  9246. , V = "static/images/badge-oculus.png"
  9247. , U = "static/images/badge-cardboard.png"
  9248. , k = "static/images/logo-samsung.png"
  9249. , H = "static/images/headset-cardboard.png"
  9250. , G = "static/images/headset-gearvr.png"
  9251. , z = "static/images/ico-android-robot.png"
  9252. , W = "static/images/ico-gearvr.png"
  9253. , j = "static/images/ico-vr.png"
  9254. , Y = "static/images/apple-logo-white.svg"
  9255. , X = null
  9256. , Z = null
  9257. , q = {}
  9258. , K = {
  9259. init: r,
  9260. dismiss: u,
  9261. isDeviceSupported: n
  9262. };
  9263. I.extendObject(K, E.prototype),
  9264. $(window).resize(d);
  9265. var Q = function() {
  9266. var e = P.filter(".first").find(".cardboard")
  9267. , t = P.filter(".first").find(".gearvr");
  9268. return {
  9269. cardboard: function() {
  9270. t.addClass("hidden"),
  9271. e.removeClass("hidden")
  9272. },
  9273. gearvr: function() {
  9274. e.addClass("hidden"),
  9275. t.removeClass("hidden")
  9276. }
  9277. }
  9278. }();
  9279. t.exports = K
  9280. }
  9281. , {
  9282. "../../constants": 8,
  9283. "../../enum/VRApps": 46,
  9284. "../../enum/VRPages": 48,
  9285. "../../enum/VRPlatforms": 49,
  9286. "../../localization/localize": 108,
  9287. "../../settings": 166,
  9288. "../../util/browser": 182,
  9289. "../../util/common": 185,
  9290. "./vrEvent": 85,
  9291. "./vrLink": 86,
  9292. events: 202
  9293. }],
  9294. 88: [function(e, t, i) {
  9295. "use strict";
  9296. t.exports = Object.freeze({
  9297. OPENED: "webvr.modal.opened",
  9298. SHOW_TERMS: "webvr.footer.show.terms"
  9299. })
  9300. }
  9301. , {}],
  9302. 89: [function(e, t, i) {
  9303. (function(i) {
  9304. "use strict";
  9305. function n(e, t, i, n) {
  9306. function r(e) {
  9307. e.preventDefault(),
  9308. a(e.currentTarget.id)
  9309. }
  9310. function a(e) {
  9311. ne[e](),
  9312. Object.keys(ne).map(function(t, i) {
  9313. $("#" + t).toggleClass("tabs-underlined", t === e)
  9314. })
  9315. }
  9316. y = i,
  9317. v = t,
  9318. w.init(E.Android, e, n),
  9319. m();
  9320. var l = new RegExp("daydream","i")
  9321. , c = l.test(y.displayName);
  9322. c ? (a("tabdaydream"),
  9323. B.filter(".device-headset-side").attr("src", H),
  9324. D.find(".title").text(x.localizeText("WEBVR_FOR_DAYDREAM"))) : (a("tabcardboard"),
  9325. B.filter(".device-headset-side").attr("src", Y),
  9326. D.find(".title").text(x.localizeText("WEBVR_FOR_CARDBOARD"))),
  9327. $("#vr").on("click", function(e) {
  9328. e.preventDefault(),
  9329. g("click_webvr_button"),
  9330. L.is(":hidden") && (ie.emit(_.OPENED),
  9331. o())
  9332. }),
  9333. $(".webvr-popup .close").on("click", function(e) {
  9334. e.preventDefault(),
  9335. D.hasClass("hidden") ? (g("webvr_help_close"),
  9336. p()) : s()
  9337. }),
  9338. $("#tabcardboard").on("click", r),
  9339. $("#tabdaydream").on("click", r),
  9340. $("#tabnative").on("click", r),
  9341. $(".webvr-popup .open-with-app").on("click", function(e) {
  9342. e.preventDefault(),
  9343. g("webvr_learn_more"),
  9344. a("tabnative"),
  9345. p()
  9346. }),
  9347. $(".webvr-popup .help").on("click", function(e) {
  9348. e.preventDefault(),
  9349. g(D.hasClass("hidden") ? "webvr_help_close" : "webvr_help_show"),
  9350. p()
  9351. }),
  9352. $(".webvr-popup .terms").on("click", function(e) {
  9353. e.preventDefault(),
  9354. g("webvr_click_terms"),
  9355. s(),
  9356. ie.emit(_.SHOW_TERMS)
  9357. }),
  9358. F.on("click", function(e) {
  9359. e.preventDefault(),
  9360. g(ee),
  9361. window.open(J, "_blank")
  9362. }),
  9363. V.on("click", function(e) {
  9364. e.preventDefault(),
  9365. g("webvr_phone_link"),
  9366. window.open(te, "_blank")
  9367. }),
  9368. $(".webvr-popup .badge-cardboard").on("click", function(e) {
  9369. e.preventDefault(),
  9370. g("webvr_cardboard_link"),
  9371. w.launch(b.CardboardAndroid)
  9372. }),
  9373. $(".webvr-popup .badge-oculus").on("click", function(e) {
  9374. e.preventDefault(),
  9375. g("webvr_oculus_link"),
  9376. w.launch(b.GearVR)
  9377. })
  9378. }
  9379. function r() {
  9380. function e() {
  9381. y.isPresenting || (f(),
  9382. window.removeEventListener("vrdisplaypresentchange", e))
  9383. }
  9384. R.info("Headset mounted"),
  9385. v.suspend();
  9386. var t = document.createElement("canvas");
  9387. for (t.getContext("webgl"),
  9388. t.className = "webvr-canvas",
  9389. document.bgColor = "#000",
  9390. document.body.style.backgroundColor = "#000"; document.body.firstChild; )
  9391. document.body.removeChild(document.body.firstChild);
  9392. document.body.appendChild(t),
  9393. g("webvr_enter_app"),
  9394. y.requestPresent([{
  9395. source: t,
  9396. predistorted: !0
  9397. }]).catch(function(t) {
  9398. R.error("Failed to present: " + t),
  9399. g("webvr_exit_calibrate"),
  9400. e()
  9401. }),
  9402. A.then(function() {
  9403. window.dispatchEvent(new Event("vrapp-start"))
  9404. }),
  9405. window.addEventListener("vrdisplaypresentchange", e)
  9406. }
  9407. function o() {
  9408. O.fadeOut(I.guiAnimationSpeed),
  9409. L.fadeIn(I.guiAnimationSpeed),
  9410. a()
  9411. }
  9412. function a() {
  9413. if (!A) {
  9414. var e = C.valueFromHash("webvr") || I.appConfig.webvr_version
  9415. , t = "https://static.port.com/webvr/" + e + "/js/main.js";
  9416. A = new Promise(function(e, i) {
  9417. var n = document.createElement("script");
  9418. n.type = "text/javascript",
  9419. n.src = t,
  9420. n.onload = e,
  9421. document.head.appendChild(n)
  9422. }
  9423. )
  9424. }
  9425. D.find(".enter-button").on("click", r)
  9426. }
  9427. function s() {
  9428. g("webvr_modal_close"),
  9429. D.find(".enter-button").off("click", r),
  9430. L.fadeOut(I.guiAnimationSpeed, function() {
  9431. D.toggleClass("hidden", !1),
  9432. N.toggleClass("hidden", !0),
  9433. C.exitFullscreen()
  9434. }),
  9435. O.fadeIn(I.guiAnimationSpeed)
  9436. }
  9437. function l() {
  9438. k.toggleClass("hidden", !1),
  9439. U.toggleClass("hidden", !0)
  9440. }
  9441. function c() {
  9442. k.toggleClass("hidden", !0),
  9443. U.toggleClass("hidden", !1)
  9444. }
  9445. function h() {
  9446. B.filter(".device-headset").attr("src", G),
  9447. B.filter(".device-phone").attr("src", z),
  9448. J = Z,
  9449. ee = K,
  9450. F.text(x.localizeText("WEBVR_DAYDREAM_VIEW")),
  9451. V.text(x.localizeText("VR_NEED_DAYDREAM_PHONE")),
  9452. $(".webvr-popup .detail.daydream-label").toggleClass("hidden", !1),
  9453. c()
  9454. }
  9455. function u() {
  9456. B.filter(".badge-cardboard").attr("src", j),
  9457. B.filter(".badge-oculus").attr("src", X),
  9458. l()
  9459. }
  9460. function d() {
  9461. B.filter(".device-headset").attr("src", Y),
  9462. B.filter(".device-phone").attr("src", W),
  9463. J = q,
  9464. ee = Q,
  9465. F.text(x.localizeText("VR_GOOGLE_CARDBOARD")),
  9466. V.text(x.localizeText("VR_COMPATIBLE_ANDROID_LONG")),
  9467. $(".webvr-popup .detail.daydream-label").toggleClass("hidden", !0),
  9468. c()
  9469. }
  9470. function p() {
  9471. D.toggleClass("hidden"),
  9472. N.toggleClass("hidden")
  9473. }
  9474. function f() {
  9475. R.info("exiting webVR"),
  9476. g("webvr_exit_app"),
  9477. window.location.search.indexOf("&qs=1") === -1 ? window.location = window.location + "&qs=1" : window.location = window.location
  9478. }
  9479. function g(e) {
  9480. var t = C.isLandscape() ? "landscape" : "portrait";
  9481. T.trackAlways("showcase_gui", {
  9482. gui_action: e,
  9483. orientation: t
  9484. })
  9485. }
  9486. function m() {
  9487. var e = C.isLandscape();
  9488. L.toggleClass("landscape", e).toggleClass("portrait", !e)
  9489. }
  9490. var v, A, y, C = e("../../util/browser"), I = e("../../settings"), E = (e("./../gui"),
  9491. e("../../enum/VRPlatforms")), b = e("../../enum/VRApps"), w = e("./../vr/vrLink"), _ = e("./WebVrEvent"), T = e("../../analytics"), x = (e("../../constants"),
  9492. 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 = {
  9493. init: n
  9494. }, ne = {
  9495. tabcardboard: d,
  9496. tabdaydream: h,
  9497. tabnative: u
  9498. };
  9499. S.extendObject(ie, P.prototype),
  9500. $(window).resize(m),
  9501. t.exports = ie
  9502. }
  9503. ).call(this, "/js/gui/webvr/webVRgui.js")
  9504. }
  9505. , {
  9506. "../../analytics": 4,
  9507. "../../constants": 8,
  9508. "../../enum/VRApps": 46,
  9509. "../../enum/VRPlatforms": 49,
  9510. "../../localization/localize": 108,
  9511. "../../settings": 166,
  9512. "../../util/browser": 182,
  9513. "../../util/common": 185,
  9514. "../../util/logger": 189,
  9515. "./../gui": 65,
  9516. "./../vr/vrLink": 86,
  9517. "./WebVrEvent": 88,
  9518. events: 202
  9519. }],
  9520. 90: [function(e, t, i) {
  9521. "use strict";
  9522. function n(e, t, i, n, o) {
  9523. n || 0 === n ? this.floorId = n : this.floorId = -1,
  9524. this.roomId = o || "",
  9525. this.labelId = e,
  9526. this.position = (new r.Vector3).copy(t),
  9527. this.text = i
  9528. }
  9529. var r = e("three")
  9530. , o = e("../util/browser");
  9531. n.prototype.build = function() {
  9532. var e = window.document.createElement("div");
  9533. o.isMobile() ? e.setAttribute("class", "gui-floorplan-label gui-floorplan-label-mobile") : e.setAttribute("class", "gui-floorplan-label");
  9534. var t = window.document.createElement("div");
  9535. t.setAttribute("class", "gui-floorplan-label-text");
  9536. var i = window.document.createTextNode(this.text);
  9537. t.appendChild(i),
  9538. e.appendChild(t),
  9539. window.document.body.appendChild(e),
  9540. this.labelGui = e,
  9541. this.textBlock = t,
  9542. $(this.labelGui).hide();
  9543. var n = window.getComputedStyle(this.labelGui);
  9544. this.initialTransform = n.transform || n.webkitTransform
  9545. }
  9546. ,
  9547. t.exports = n
  9548. }
  9549. , {
  9550. "../util/browser": 182,
  9551. three: 217
  9552. }],
  9553. 91: [function(e, t, i) {
  9554. "use strict";
  9555. function n() {
  9556. this.player = null,
  9557. this.modelManager = null,
  9558. this.container = null
  9559. }
  9560. var r = e("three")
  9561. , o = (e("../util/common"),
  9562. e("../enum/PlayerEvents"))
  9563. , a = (e("../enum/DirectorEvents"),
  9564. e("../enum/ModelManagerEvents"))
  9565. , s = e("../settings")
  9566. , l = e("../enum/Viewmode")
  9567. , c = (e("../enum/WarpStyle"),
  9568. e("../util/transitions"),
  9569. e("../util/lerp"),
  9570. e("../util/browser"));
  9571. //场景初始化
  9572. n.prototype.init = function(e, t, i) {
  9573. this.player = e,
  9574. this.modelManager = t,
  9575. this.container = i,
  9576. this.updateModel(),
  9577. this.bindEvents()
  9578. }
  9579. ,
  9580. n.prototype.bindEvents = function() {
  9581. this.modelManager.on(a.ActiveModelChanged, this.updateModel.bind(this)),
  9582. this.player.on(o.ViewChanged, this.handlePlayerViewChanged.bind(this)),
  9583. this.player.on(o.ModeChanged, this.handlePlayerViewChanged.bind(this)),
  9584. this.player.on(o.StartInside, this.handleStartInside.bind(this)),
  9585. this.player.on(o.StartOutside, this.handleStartOutside.bind(this))
  9586. }
  9587. ,
  9588. n.prototype.updateModel = function() {
  9589. this.model = this.modelManager.getActiveModel()
  9590. }
  9591. ,
  9592. n.prototype.handlePlayerViewChanged = function() {
  9593. this.updateLabelVisibility(),
  9594. this.updateLabelDisplay()
  9595. }
  9596. ,
  9597. n.prototype.getLabelsForFloor = function(e, t) {
  9598. return t = t || [],
  9599. t.length = 0,
  9600. this.model.labels.forEach(function(i) {
  9601. this.labelVisibleForFloor(i, e) && t.push(i)
  9602. }
  9603. .bind(this)),
  9604. t
  9605. }
  9606. ,
  9607. n.prototype.getLabelsForCurrentFloor = function(e) {
  9608. return this.getLabelsForFloor(this.model.currentFloor.floorIndex, e)
  9609. }
  9610. ,
  9611. n.prototype.labelVisibleForFloor = function(e, t) {
  9612. var i = c.isMobile() && this.player.getLabelScaleFactor() < s.labels.zoomHideThreshhold.mobile || !c.isMobile() && this.player.getLabelScaleFactor() < s.labels.zoomHideThreshhold.desktop;
  9613. if (!this.model.showingLabels || !e.labelGui || !i)
  9614. return !1;
  9615. var n = e.floorId === this.model.floors.size() - 1;
  9616. return this.model.allFloorsVisible ? n : e.floorId === t
  9617. }
  9618. ,
  9619. n.prototype.updateLabelVisibility = function(e) {
  9620. this.model.labels.forEach(function(e) {
  9621. 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)
  9622. }
  9623. .bind(this))
  9624. }
  9625. ,
  9626. n.prototype.showAllLabels = function(e, t) {
  9627. this.model.labels.forEach(function(i) {
  9628. this.showLabel(i, e, t)
  9629. }
  9630. .bind(this))
  9631. }
  9632. ,
  9633. n.prototype.hideAllLabels = function(e, t) {
  9634. this.model.labels.forEach(function(i) {
  9635. this.hideLabel(i, e, t)
  9636. }
  9637. .bind(this))
  9638. }
  9639. ,
  9640. n.prototype.showLabel = function(e, t, i) {
  9641. this.model.showingLabels && (e.visible || (e.visible = !0,
  9642. e.labelGui.style.display = "block",
  9643. e.labelGui.style.opacity = 0,
  9644. $(e.labelGui).delay(t).fadeTo(i, 1)))
  9645. }
  9646. ,
  9647. n.prototype.hideLabel = function(e, t, i) {
  9648. e.visible && (e.visible = !1,
  9649. c.isMobile() ? $(e.labelGui).hide() : $(e.labelGui).delay(t).fadeOut(i))
  9650. }
  9651. ,
  9652. n.prototype.supportedMode = function() {
  9653. return this.player.mode === l.FLOORPLAN
  9654. }
  9655. ,
  9656. n.prototype.updateLabelDisplay = function() {
  9657. var e = (new r.Vector3,
  9658. new r.Vector3,
  9659. []);
  9660. return function() {
  9661. var t = this.player.getLabelScaleFactor()
  9662. , i = .6
  9663. , n = 1.2
  9664. , r = (1 - t) * n + i
  9665. , o = c.isMobile() ? s.labels.zoomTruncateThreshhold.mobile : s.labels.zoomTruncateThreshhold.desktop;
  9666. this.getLabelsForCurrentFloor(e);
  9667. for (var a = 0; a < e.length; a++) {
  9668. var l = e[a];
  9669. this.supportedMode() && l.labelGui && (this.updateProjectedGuiElement(l.labelGui, l.textBlock, l.position, r, r),
  9670. 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)
  9671. }
  9672. }
  9673. }(),
  9674. n.prototype.updateProjectedGuiElement = function() {
  9675. var e = new r.Vector3;
  9676. new r.Vector3;
  9677. return function(t, i, n, r, o) {
  9678. i.style.fontSize = 100 * o + "%";
  9679. var a = $("#player").width()
  9680. , s = $("#player").height()
  9681. , l = .5 * a
  9682. , c = .5 * s;
  9683. e.copy(n),
  9684. e.project(this.player.camera);
  9685. var h = e.x * l + l
  9686. , u = -(e.y * c) + c;
  9687. h -= t.offsetWidth / 2,
  9688. u -= t.offsetHeight / 2,
  9689. t.style.left = h + "px",
  9690. t.style.top = u + "px"
  9691. }
  9692. }(),
  9693. n.prototype.handleStartInside = function(e) {
  9694. this.updateLabelVisibility()
  9695. }
  9696. ,
  9697. n.prototype.handleStartOutside = function() {
  9698. this.updateLabelVisibility()
  9699. }
  9700. ,
  9701. t.exports = n
  9702. }
  9703. , {
  9704. "../enum/DirectorEvents": 23,
  9705. "../enum/ModelManagerEvents": 33,
  9706. "../enum/PlayerEvents": 40,
  9707. "../enum/Viewmode": 51,
  9708. "../enum/WarpStyle": 52,
  9709. "../settings": 166,
  9710. "../util/browser": 182,
  9711. "../util/common": 185,
  9712. "../util/lerp": 188,
  9713. "../util/transitions": 195,
  9714. three: 217
  9715. }],
  9716. 92: [function(e, t, i) {
  9717. "use strict";
  9718. Array.prototype.findIndex || (Array.prototype.findIndex = function(e) {
  9719. if (null == this)
  9720. throw new TypeError("Array.prototype.findIndex called on null or undefined");
  9721. if ("function" != typeof e)
  9722. throw new TypeError("predicate must be a function");
  9723. for (var t, i = Object(this), n = i.length >>> 0, r = arguments[1], o = 0; o < n; o++)
  9724. if (t = i[o],
  9725. e.call(r, t, o, i))
  9726. return o;
  9727. return -1
  9728. }
  9729. ),
  9730. Array.prototype.find || Object.defineProperty(Array.prototype, "find", {
  9731. value: function(e) {
  9732. if (null == this)
  9733. throw new TypeError('"this" is null or not defined');
  9734. var t = Object(this)
  9735. , i = t.length >>> 0;
  9736. if ("function" != typeof e)
  9737. throw new TypeError("predicate must be a function");
  9738. for (var n = arguments[1], r = 0; r < i; ) {
  9739. var o = t[r];
  9740. if (e.call(n, o, r, t))
  9741. return o;
  9742. r++
  9743. }
  9744. }
  9745. })
  9746. }
  9747. , {}],
  9748. 93: [function(e, t, i) {
  9749. "use strict";
  9750. var n = n || {};
  9751. t.exports = n,
  9752. n.gui = n.gui || {},
  9753. n.utils = n.utils || {},
  9754. n.controllers = n.controllers || {},
  9755. n.dom = n.dom || {},
  9756. n.color = n.color || {},
  9757. n.utils.css = function() {
  9758. return {
  9759. load: function(e, t) {
  9760. t = t || document;
  9761. var i = t.createElement("link");
  9762. i.type = "text/css",
  9763. i.rel = "stylesheet",
  9764. i.href = e,
  9765. t.getElementsByTagName("head")[0].appendChild(i)
  9766. },
  9767. inject: function(e, t) {
  9768. t = t || document;
  9769. var i = document.createElement("style");
  9770. i.type = "text/css",
  9771. i.innerHTML = e,
  9772. t.getElementsByTagName("head")[0].appendChild(i)
  9773. }
  9774. }
  9775. }(),
  9776. n.utils.common = function() {
  9777. var e = Array.prototype.forEach
  9778. , t = Array.prototype.slice;
  9779. return {
  9780. BREAK: {},
  9781. extend: function(e) {
  9782. return this.each(t.call(arguments, 1), function(t) {
  9783. for (var i in t)
  9784. this.isUndefined(t[i]) || (e[i] = t[i])
  9785. }, this),
  9786. e
  9787. },
  9788. defaults: function(e) {
  9789. return this.each(t.call(arguments, 1), function(t) {
  9790. for (var i in t)
  9791. this.isUndefined(e[i]) && (e[i] = t[i])
  9792. }, this),
  9793. e
  9794. },
  9795. compose: function() {
  9796. var e = t.call(arguments);
  9797. return function() {
  9798. for (var i = t.call(arguments), n = e.length - 1; n >= 0; n--)
  9799. i = [e[n].apply(this, i)];
  9800. return i[0]
  9801. }
  9802. },
  9803. each: function(t, i, n) {
  9804. if (t)
  9805. if (e && t.forEach && t.forEach === e)
  9806. t.forEach(i, n);
  9807. else if (t.length === t.length + 0) {
  9808. for (var r = 0, o = t.length; r < o; r++)
  9809. if (r in t && i.call(n, t[r], r) === this.BREAK)
  9810. return
  9811. } else
  9812. for (var r in t)
  9813. if (i.call(n, t[r], r) === this.BREAK)
  9814. return
  9815. },
  9816. defer: function(e) {
  9817. setTimeout(e, 0)
  9818. },
  9819. toArray: function(e) {
  9820. return e.toArray ? e.toArray() : t.call(e)
  9821. },
  9822. isUndefined: function(e) {
  9823. return void 0 === e
  9824. },
  9825. isNull: function(e) {
  9826. return null === e
  9827. },
  9828. isNaN: function(e) {
  9829. return e !== e
  9830. },
  9831. isArray: Array.isArray || function(e) {
  9832. return e.constructor === Array
  9833. }
  9834. ,
  9835. isObject: function(e) {
  9836. return e === Object(e)
  9837. },
  9838. isNumber: function(e) {
  9839. return e === e + 0
  9840. },
  9841. isString: function(e) {
  9842. return e === e + ""
  9843. },
  9844. isBoolean: function(e) {
  9845. return e === !1 || e === !0
  9846. },
  9847. isFunction: function(e) {
  9848. return "[object Function]" === Object.prototype.toString.call(e)
  9849. }
  9850. }
  9851. }(),
  9852. n.controllers.Controller = function(e) {
  9853. var t = function(e, t) {
  9854. this.initialValue = e[t],
  9855. this.domElement = document.createElement("div"),
  9856. this.object = e,
  9857. this.property = t,
  9858. this.__onChange = void 0,
  9859. this.__onFinishChange = void 0
  9860. };
  9861. return e.extend(t.prototype, {
  9862. onChange: function(e) {
  9863. return this.__onChange = e,
  9864. this
  9865. },
  9866. onFinishChange: function(e) {
  9867. return this.__onFinishChange = e,
  9868. this
  9869. },
  9870. setValue: function(e) {
  9871. return this.object[this.property] = e,
  9872. this.__onChange && this.__onChange.call(this, e),
  9873. this.updateDisplay(),
  9874. this
  9875. },
  9876. getValue: function() {
  9877. return this.object[this.property]
  9878. },
  9879. updateDisplay: function() {
  9880. return this
  9881. },
  9882. isModified: function() {
  9883. return this.initialValue !== this.getValue()
  9884. }
  9885. }),
  9886. t
  9887. }(n.utils.common),
  9888. n.dom.dom = function(e) {
  9889. function t(t) {
  9890. if ("0" === t || e.isUndefined(t))
  9891. return 0;
  9892. var i = t.match(r);
  9893. return e.isNull(i) ? 0 : parseFloat(i[1])
  9894. }
  9895. var i = {
  9896. HTMLEvents: ["change"],
  9897. MouseEvents: ["click", "mousemove", "mousedown", "mouseup", "mouseover"],
  9898. KeyboardEvents: ["keydown"]
  9899. }
  9900. , n = {};
  9901. e.each(i, function(t, i) {
  9902. e.each(t, function(e) {
  9903. n[e] = i
  9904. })
  9905. });
  9906. var r = /(\d+(\.\d+)?)px/
  9907. , o = {
  9908. makeSelectable: function(e, t) {
  9909. void 0 !== e && void 0 !== e.style && (e.onselectstart = t ? function() {
  9910. return !1
  9911. }
  9912. : function() {}
  9913. ,
  9914. e.style.MozUserSelect = t ? "auto" : "none",
  9915. e.style.KhtmlUserSelect = t ? "auto" : "none",
  9916. e.unselectable = t ? "on" : "off")
  9917. },
  9918. makeFullscreen: function(t, i, n) {
  9919. e.isUndefined(i) && (i = !0),
  9920. e.isUndefined(n) && (n = !0),
  9921. t.style.position = "absolute",
  9922. i && (t.style.left = 0,
  9923. t.style.right = 0),
  9924. n && (t.style.top = 0,
  9925. t.style.bottom = 0)
  9926. },
  9927. fakeEvent: function(t, i, r, o) {
  9928. r = r || {};
  9929. var a = n[i];
  9930. if (!a)
  9931. throw new Error("Event type " + i + " not supported.");
  9932. var s = document.createEvent(a);
  9933. switch (a) {
  9934. case "MouseEvents":
  9935. var l = r.x || r.clientX || 0
  9936. , c = r.y || r.clientY || 0;
  9937. s.initMouseEvent(i, r.bubbles || !1, r.cancelable || !0, window, r.clickCount || 1, 0, 0, l, c, !1, !1, !1, !1, 0, null);
  9938. break;
  9939. case "KeyboardEvents":
  9940. var h = s.initKeyboardEvent || s.initKeyEvent;
  9941. e.defaults(r, {
  9942. cancelable: !0,
  9943. ctrlKey: !1,
  9944. altKey: !1,
  9945. shiftKey: !1,
  9946. metaKey: !1,
  9947. keyCode: void 0,
  9948. charCode: void 0
  9949. }),
  9950. h(i, r.bubbles || !1, r.cancelable, window, r.ctrlKey, r.altKey, r.shiftKey, r.metaKey, r.keyCode, r.charCode);
  9951. break;
  9952. default:
  9953. s.initEvent(i, r.bubbles || !1, r.cancelable || !0)
  9954. }
  9955. e.defaults(s, o),
  9956. t.dispatchEvent(s)
  9957. },
  9958. bind: function(e, t, i, n) {
  9959. return n = n || !1,
  9960. e.addEventListener ? e.addEventListener(t, i, n) : e.attachEvent && e.attachEvent("on" + t, i),
  9961. o
  9962. },
  9963. unbind: function(e, t, i, n) {
  9964. return n = n || !1,
  9965. e.removeEventListener ? e.removeEventListener(t, i, n) : e.detachEvent && e.detachEvent("on" + t, i),
  9966. o
  9967. },
  9968. addClass: function(e, t) {
  9969. if (void 0 === e.className)
  9970. e.className = t;
  9971. else if (e.className !== t) {
  9972. var i = e.className.split(/ +/);
  9973. i.indexOf(t) == -1 && (i.push(t),
  9974. e.className = i.join(" ").replace(/^\s+/, "").replace(/\s+$/, ""))
  9975. }
  9976. return o
  9977. },
  9978. removeClass: function(e, t) {
  9979. if (t)
  9980. if (void 0 === e.className)
  9981. ;
  9982. else if (e.className === t)
  9983. e.removeAttribute("class");
  9984. else {
  9985. var i = e.className.split(/ +/)
  9986. , n = i.indexOf(t);
  9987. n != -1 && (i.splice(n, 1),
  9988. e.className = i.join(" "))
  9989. }
  9990. else
  9991. e.className = void 0;
  9992. return o
  9993. },
  9994. hasClass: function(e, t) {
  9995. return new RegExp("(?:^|\\s+)" + t + "(?:\\s+|$)").test(e.className) || !1
  9996. },
  9997. getWidth: function(e) {
  9998. var i = getComputedStyle(e);
  9999. return t(i["border-left-width"]) + t(i["border-right-width"]) + t(i["padding-left"]) + t(i["padding-right"]) + t(i.width)
  10000. },
  10001. getHeight: function(e) {
  10002. var i = getComputedStyle(e);
  10003. return t(i["border-top-width"]) + t(i["border-bottom-width"]) + t(i["padding-top"]) + t(i["padding-bottom"]) + t(i.height)
  10004. },
  10005. getOffset: function(e) {
  10006. var t = {
  10007. left: 0,
  10008. top: 0
  10009. };
  10010. if (e.offsetParent)
  10011. do
  10012. t.left += e.offsetLeft,
  10013. t.top += e.offsetTop;
  10014. while (e = e.offsetParent);return t
  10015. },
  10016. isActive: function(e) {
  10017. return e === document.activeElement && (e.type || e.href)
  10018. }
  10019. };
  10020. return o
  10021. }(n.utils.common),
  10022. n.controllers.OptionController = function(e, t, i) {
  10023. var n = function(e, r, o) {
  10024. n.superclass.call(this, e, r);
  10025. var a = this;
  10026. if (this.__select = document.createElement("select"),
  10027. i.isArray(o)) {
  10028. var s = {};
  10029. i.each(o, function(e) {
  10030. s[e] = e
  10031. }),
  10032. o = s
  10033. }
  10034. i.each(o, function(e, t) {
  10035. var i = document.createElement("option");
  10036. i.innerHTML = t,
  10037. i.setAttribute("value", e),
  10038. a.__select.appendChild(i)
  10039. }),
  10040. this.updateDisplay(),
  10041. t.bind(this.__select, "change", function() {
  10042. var e = this.options[this.selectedIndex].value;
  10043. a.setValue(e)
  10044. }),
  10045. this.domElement.appendChild(this.__select)
  10046. };
  10047. return n.superclass = e,
  10048. i.extend(n.prototype, e.prototype, {
  10049. setValue: function(e) {
  10050. var t = n.superclass.prototype.setValue.call(this, e);
  10051. return this.__onFinishChange && this.__onFinishChange.call(this, this.getValue()),
  10052. t
  10053. },
  10054. updateDisplay: function() {
  10055. return this.__select.value = this.getValue(),
  10056. n.superclass.prototype.updateDisplay.call(this)
  10057. }
  10058. }),
  10059. n
  10060. }(n.controllers.Controller, n.dom.dom, n.utils.common),
  10061. n.controllers.NumberController = function(e, t) {
  10062. function i(e) {
  10063. return e = e.toString(),
  10064. e.indexOf(".") > -1 ? e.length - e.indexOf(".") - 1 : 0
  10065. }
  10066. var n = function(e, r, o) {
  10067. n.superclass.call(this, e, r),
  10068. o = o || {},
  10069. this.__min = o.min,
  10070. this.__max = o.max,
  10071. this.__step = o.step,
  10072. 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,
  10073. this.__precision = i(this.__impliedStep)
  10074. };
  10075. return n.superclass = e,
  10076. t.extend(n.prototype, e.prototype, {
  10077. setValue: function(e) {
  10078. return void 0 !== this.__min && e < this.__min ? e = this.__min : void 0 !== this.__max && e > this.__max && (e = this.__max),
  10079. void 0 !== this.__step && e % this.__step != 0 && (e = Math.round(e / this.__step) * this.__step),
  10080. n.superclass.prototype.setValue.call(this, e)
  10081. },
  10082. min: function(e) {
  10083. return this.__min = e,
  10084. this
  10085. },
  10086. max: function(e) {
  10087. return this.__max = e,
  10088. this
  10089. },
  10090. step: function(e) {
  10091. return this.__step = e,
  10092. this.__impliedStep = e,
  10093. this.__precision = i(e),
  10094. this
  10095. }
  10096. }),
  10097. n
  10098. }(n.controllers.Controller, n.utils.common),
  10099. n.controllers.NumberControllerBox = function(e, t, i) {
  10100. function n(e, t) {
  10101. var i = Math.pow(10, t);
  10102. return Math.round(e * i) / i
  10103. }
  10104. var r = function(e, n, o) {
  10105. function a() {
  10106. var e = parseFloat(d.__input.value);
  10107. i.isNaN(e) || d.setValue(e)
  10108. }
  10109. function s() {
  10110. a(),
  10111. d.__onFinishChange && d.__onFinishChange.call(d, d.getValue())
  10112. }
  10113. function l(e) {
  10114. t.bind(window, "mousemove", c),
  10115. t.bind(window, "mouseup", h),
  10116. u = e.clientY
  10117. }
  10118. function c(e) {
  10119. var t = u - e.clientY;
  10120. d.setValue(d.getValue() + t * d.__impliedStep),
  10121. u = e.clientY
  10122. }
  10123. function h() {
  10124. t.unbind(window, "mousemove", c),
  10125. t.unbind(window, "mouseup", h)
  10126. }
  10127. this.__truncationSuspended = !1,
  10128. r.superclass.call(this, e, n, o);
  10129. var u, d = this;
  10130. this.__input = document.createElement("input"),
  10131. this.__input.setAttribute("type", "text"),
  10132. t.bind(this.__input, "change", a),
  10133. t.bind(this.__input, "blur", s),
  10134. t.bind(this.__input, "mousedown", l),
  10135. t.bind(this.__input, "keydown", function(e) {
  10136. 13 === e.keyCode && (d.__truncationSuspended = !0,
  10137. this.blur(),
  10138. d.__truncationSuspended = !1)
  10139. }),
  10140. this.updateDisplay(),
  10141. this.domElement.appendChild(this.__input)
  10142. };
  10143. return r.superclass = e,
  10144. i.extend(r.prototype, e.prototype, {
  10145. updateDisplay: function() {
  10146. return this.__input.value = this.__truncationSuspended ? this.getValue() : n(this.getValue(), this.__precision),
  10147. r.superclass.prototype.updateDisplay.call(this)
  10148. }
  10149. }),
  10150. r
  10151. }(n.controllers.NumberController, n.dom.dom, n.utils.common),
  10152. n.controllers.NumberControllerSlider = function(e, t, i, n, r) {
  10153. function o(e, t, i, n, r) {
  10154. return n + (r - n) * ((e - t) / (i - t))
  10155. }
  10156. var a = function(e, i, n, r, s) {
  10157. function l(e) {
  10158. t.bind(window, "mousemove", c),
  10159. t.bind(window, "mouseup", h),
  10160. c(e)
  10161. }
  10162. function c(e) {
  10163. e.preventDefault();
  10164. var i = t.getOffset(u.__background)
  10165. , n = t.getWidth(u.__background);
  10166. return u.setValue(o(e.clientX, i.left, i.left + n, u.__min, u.__max)),
  10167. !1
  10168. }
  10169. function h() {
  10170. t.unbind(window, "mousemove", c),
  10171. t.unbind(window, "mouseup", h),
  10172. u.__onFinishChange && u.__onFinishChange.call(u, u.getValue())
  10173. }
  10174. a.superclass.call(this, e, i, {
  10175. min: n,
  10176. max: r,
  10177. step: s
  10178. });
  10179. var u = this;
  10180. this.__background = document.createElement("div"),
  10181. this.__foreground = document.createElement("div"),
  10182. t.bind(this.__background, "mousedown", l),
  10183. t.addClass(this.__background, "slider"),
  10184. t.addClass(this.__foreground, "slider-fg"),
  10185. this.updateDisplay(),
  10186. this.__background.appendChild(this.__foreground),
  10187. this.domElement.appendChild(this.__background)
  10188. };
  10189. return a.superclass = e,
  10190. a.useDefaultStyles = function() {
  10191. i.inject(r)
  10192. }
  10193. ,
  10194. n.extend(a.prototype, e.prototype, {
  10195. updateDisplay: function() {
  10196. var e = (this.getValue() - this.__min) / (this.__max - this.__min);
  10197. return this.__foreground.style.width = 100 * e + "%",
  10198. a.superclass.prototype.updateDisplay.call(this)
  10199. }
  10200. }),
  10201. a
  10202. }(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}"),
  10203. n.controllers.FunctionController = function(e, t, i) {
  10204. var n = function(e, i, r) {
  10205. n.superclass.call(this, e, i);
  10206. var o = this;
  10207. this.__button = document.createElement("div"),
  10208. this.__button.innerHTML = void 0 === r ? "Fire" : r,
  10209. t.bind(this.__button, "click", function(e) {
  10210. return e.preventDefault(),
  10211. o.fire(),
  10212. !1
  10213. }),
  10214. t.addClass(this.__button, "button"),
  10215. this.domElement.appendChild(this.__button)
  10216. };
  10217. return n.superclass = e,
  10218. i.extend(n.prototype, e.prototype, {
  10219. fire: function() {
  10220. this.__onChange && this.__onChange.call(this),
  10221. this.__onFinishChange && this.__onFinishChange.call(this, this.getValue()),
  10222. this.getValue().call(this.object)
  10223. }
  10224. }),
  10225. n
  10226. }(n.controllers.Controller, n.dom.dom, n.utils.common),
  10227. n.controllers.BooleanController = function(e, t, i) {
  10228. var n = function(e, i) {
  10229. function r() {
  10230. o.setValue(!o.__prev)
  10231. }
  10232. n.superclass.call(this, e, i);
  10233. var o = this;
  10234. this.__prev = this.getValue(),
  10235. this.__checkbox = document.createElement("input"),
  10236. this.__checkbox.setAttribute("type", "checkbox"),
  10237. t.bind(this.__checkbox, "change", r, !1),
  10238. this.domElement.appendChild(this.__checkbox),
  10239. this.updateDisplay()
  10240. };
  10241. return n.superclass = e,
  10242. i.extend(n.prototype, e.prototype, {
  10243. setValue: function(e) {
  10244. var t = n.superclass.prototype.setValue.call(this, e);
  10245. return this.__onFinishChange && this.__onFinishChange.call(this, this.getValue()),
  10246. this.__prev = this.getValue(),
  10247. t
  10248. },
  10249. updateDisplay: function() {
  10250. return this.getValue() === !0 ? (this.__checkbox.setAttribute("checked", "checked"),
  10251. this.__checkbox.checked = !0) : this.__checkbox.checked = !1,
  10252. n.superclass.prototype.updateDisplay.call(this)
  10253. }
  10254. }),
  10255. n
  10256. }(n.controllers.Controller, n.dom.dom, n.utils.common),
  10257. n.color.toString = function(e) {
  10258. return function(t) {
  10259. if (1 == t.a || e.isUndefined(t.a)) {
  10260. for (var i = t.hex.toString(16); i.length < 6; )
  10261. i = "0" + i;
  10262. return "#" + i
  10263. }
  10264. return "rgba(" + Math.round(t.r) + "," + Math.round(t.g) + "," + Math.round(t.b) + "," + t.a + ")"
  10265. }
  10266. }(n.utils.common),
  10267. n.color.interpret = function(e, t) {
  10268. var i, n, r = function() {
  10269. n = !1;
  10270. var e = arguments.length > 1 ? t.toArray(arguments) : arguments[0];
  10271. return t.each(o, function(r) {
  10272. if (r.litmus(e))
  10273. return t.each(r.conversions, function(r, o) {
  10274. if (i = r.read(e),
  10275. n === !1 && i !== !1)
  10276. return n = i,
  10277. i.conversionName = o,
  10278. i.conversion = r,
  10279. t.BREAK
  10280. }),
  10281. t.BREAK
  10282. }),
  10283. n
  10284. }, o = [{
  10285. litmus: t.isString,
  10286. conversions: {
  10287. THREE_CHAR_HEX: {
  10288. read: function(e) {
  10289. var t = e.match(/^#([A-F0-9])([A-F0-9])([A-F0-9])$/i);
  10290. return null !== t && {
  10291. space: "HEX",
  10292. hex: parseInt("0x" + t[1].toString() + t[1].toString() + t[2].toString() + t[2].toString() + t[3].toString() + t[3].toString())
  10293. }
  10294. },
  10295. write: e
  10296. },
  10297. SIX_CHAR_HEX: {
  10298. read: function(e) {
  10299. var t = e.match(/^#([A-F0-9]{6})$/i);
  10300. return null !== t && {
  10301. space: "HEX",
  10302. hex: parseInt("0x" + t[1].toString())
  10303. }
  10304. },
  10305. write: e
  10306. },
  10307. CSS_RGB: {
  10308. read: function(e) {
  10309. var t = e.match(/^rgb\(\s*(.+)\s*,\s*(.+)\s*,\s*(.+)\s*\)/);
  10310. return null !== t && {
  10311. space: "RGB",
  10312. r: parseFloat(t[1]),
  10313. g: parseFloat(t[2]),
  10314. b: parseFloat(t[3])
  10315. }
  10316. },
  10317. write: e
  10318. },
  10319. CSS_RGBA: {
  10320. read: function(e) {
  10321. var t = e.match(/^rgba\(\s*(.+)\s*,\s*(.+)\s*,\s*(.+)\s*\,\s*(.+)\s*\)/);
  10322. return null !== t && {
  10323. space: "RGB",
  10324. r: parseFloat(t[1]),
  10325. g: parseFloat(t[2]),
  10326. b: parseFloat(t[3]),
  10327. a: parseFloat(t[4])
  10328. }
  10329. },
  10330. write: e
  10331. }
  10332. }
  10333. }, {
  10334. litmus: t.isNumber,
  10335. conversions: {
  10336. HEX: {
  10337. read: function(e) {
  10338. return {
  10339. space: "HEX",
  10340. hex: e,
  10341. conversionName: "HEX"
  10342. }
  10343. },
  10344. write: function(e) {
  10345. return e.hex
  10346. }
  10347. }
  10348. }
  10349. }, {
  10350. litmus: t.isArray,
  10351. conversions: {
  10352. RGB_ARRAY: {
  10353. read: function(e) {
  10354. return 3 == e.length && {
  10355. space: "RGB",
  10356. r: e[0],
  10357. g: e[1],
  10358. b: e[2]
  10359. }
  10360. },
  10361. write: function(e) {
  10362. return [e.r, e.g, e.b]
  10363. }
  10364. },
  10365. RGBA_ARRAY: {
  10366. read: function(e) {
  10367. return 4 == e.length && {
  10368. space: "RGB",
  10369. r: e[0],
  10370. g: e[1],
  10371. b: e[2],
  10372. a: e[3]
  10373. }
  10374. },
  10375. write: function(e) {
  10376. return [e.r, e.g, e.b, e.a]
  10377. }
  10378. }
  10379. }
  10380. }, {
  10381. litmus: t.isObject,
  10382. conversions: {
  10383. RGBA_OBJ: {
  10384. read: function(e) {
  10385. return !!(t.isNumber(e.r) && t.isNumber(e.g) && t.isNumber(e.b) && t.isNumber(e.a)) && {
  10386. space: "RGB",
  10387. r: e.r,
  10388. g: e.g,
  10389. b: e.b,
  10390. a: e.a
  10391. }
  10392. },
  10393. write: function(e) {
  10394. return {
  10395. r: e.r,
  10396. g: e.g,
  10397. b: e.b,
  10398. a: e.a
  10399. }
  10400. }
  10401. },
  10402. RGB_OBJ: {
  10403. read: function(e) {
  10404. return !!(t.isNumber(e.r) && t.isNumber(e.g) && t.isNumber(e.b)) && {
  10405. space: "RGB",
  10406. r: e.r,
  10407. g: e.g,
  10408. b: e.b
  10409. }
  10410. },
  10411. write: function(e) {
  10412. return {
  10413. r: e.r,
  10414. g: e.g,
  10415. b: e.b
  10416. }
  10417. }
  10418. },
  10419. HSVA_OBJ: {
  10420. read: function(e) {
  10421. return !!(t.isNumber(e.h) && t.isNumber(e.s) && t.isNumber(e.v) && t.isNumber(e.a)) && {
  10422. space: "HSV",
  10423. h: e.h,
  10424. s: e.s,
  10425. v: e.v,
  10426. a: e.a
  10427. }
  10428. },
  10429. write: function(e) {
  10430. return {
  10431. h: e.h,
  10432. s: e.s,
  10433. v: e.v,
  10434. a: e.a
  10435. }
  10436. }
  10437. },
  10438. HSV_OBJ: {
  10439. read: function(e) {
  10440. return !!(t.isNumber(e.h) && t.isNumber(e.s) && t.isNumber(e.v)) && {
  10441. space: "HSV",
  10442. h: e.h,
  10443. s: e.s,
  10444. v: e.v
  10445. }
  10446. },
  10447. write: function(e) {
  10448. return {
  10449. h: e.h,
  10450. s: e.s,
  10451. v: e.v
  10452. }
  10453. }
  10454. }
  10455. }
  10456. }];
  10457. return r
  10458. }(n.color.toString, n.utils.common),
  10459. n.GUI = n.gui.GUI = function(e, t, i, n, r, o, a, s, l, c, h, u, d, p, f) {
  10460. function g(e, t, i, o) {
  10461. if (void 0 === t[i])
  10462. throw new Error("Object " + t + ' has no property "' + i + '"');
  10463. var a;
  10464. if (o.color)
  10465. a = new h(t,i);
  10466. else {
  10467. var s = [t, i].concat(o.factoryArgs);
  10468. a = n.apply(e, s)
  10469. }
  10470. o.before instanceof r && (o.before = o.before.__li),
  10471. A(e, a),
  10472. p.addClass(a.domElement, "c");
  10473. var l = document.createElement("span");
  10474. p.addClass(l, "property-name"),
  10475. l.innerHTML = a.property;
  10476. var c = document.createElement("div");
  10477. c.appendChild(l),
  10478. c.appendChild(a.domElement);
  10479. var u = m(e, c, o.before);
  10480. return p.addClass(u, V.CLASS_CONTROLLER_ROW),
  10481. p.addClass(u, typeof a.getValue()),
  10482. v(e, u, a),
  10483. e.__controllers.push(a),
  10484. a
  10485. }
  10486. function m(e, t, i) {
  10487. var n = document.createElement("li");
  10488. return t && n.appendChild(t),
  10489. i ? e.__ul.insertBefore(n, params.before) : e.__ul.appendChild(n),
  10490. e.onResize(),
  10491. n
  10492. }
  10493. function v(e, t, i) {
  10494. if (i.__li = t,
  10495. i.__gui = e,
  10496. f.extend(i, {
  10497. options: function(t) {
  10498. return arguments.length > 1 ? (i.remove(),
  10499. g(e, i.object, i.property, {
  10500. before: i.__li.nextElementSibling,
  10501. factoryArgs: [f.toArray(arguments)]
  10502. })) : f.isArray(t) || f.isObject(t) ? (i.remove(),
  10503. g(e, i.object, i.property, {
  10504. before: i.__li.nextElementSibling,
  10505. factoryArgs: [t]
  10506. })) : void 0
  10507. },
  10508. name: function(e) {
  10509. return i.__li.firstElementChild.firstElementChild.innerHTML = e,
  10510. i
  10511. },
  10512. listen: function() {
  10513. return i.__gui.listen(i),
  10514. i
  10515. },
  10516. remove: function() {
  10517. return i.__gui.remove(i),
  10518. i
  10519. }
  10520. }),
  10521. i instanceof l) {
  10522. var n = new s(i.object,i.property,{
  10523. min: i.__min,
  10524. max: i.__max,
  10525. step: i.__step
  10526. });
  10527. f.each(["updateDisplay", "onChange", "onFinishChange"], function(e) {
  10528. var t = i[e]
  10529. , r = n[e];
  10530. i[e] = n[e] = function() {
  10531. var e = Array.prototype.slice.call(arguments);
  10532. return t.apply(i, e),
  10533. r.apply(n, e)
  10534. }
  10535. }),
  10536. p.addClass(t, "has-slider"),
  10537. i.domElement.insertBefore(n.domElement, i.domElement.firstElementChild)
  10538. } else if (i instanceof s) {
  10539. var r = function(t) {
  10540. return f.isNumber(i.__min) && f.isNumber(i.__max) ? (i.remove(),
  10541. g(e, i.object, i.property, {
  10542. before: i.__li.nextElementSibling,
  10543. factoryArgs: [i.__min, i.__max, i.__step]
  10544. })) : t
  10545. };
  10546. i.min = f.compose(r, i.min),
  10547. i.max = f.compose(r, i.max)
  10548. } else
  10549. i instanceof o ? (p.bind(t, "click", function() {
  10550. p.fakeEvent(i.__checkbox, "click")
  10551. }),
  10552. p.bind(i.__checkbox, "click", function(e) {
  10553. e.stopPropagation()
  10554. })) : i instanceof a ? (p.bind(t, "click", function() {
  10555. p.fakeEvent(i.__button, "click")
  10556. }),
  10557. p.bind(t, "mouseover", function() {
  10558. p.addClass(i.__button, "hover")
  10559. }),
  10560. p.bind(t, "mouseout", function() {
  10561. p.removeClass(i.__button, "hover")
  10562. })) : i instanceof h && (p.addClass(t, "color"),
  10563. i.updateDisplay = f.compose(function(e) {
  10564. return t.style.borderLeftColor = i.__color.toString(),
  10565. e
  10566. }, i.updateDisplay),
  10567. i.updateDisplay());
  10568. i.setValue = f.compose(function(t) {
  10569. return e.getRoot().__preset_select && i.isModified() && T(e.getRoot(), !0),
  10570. t
  10571. }, i.setValue)
  10572. }
  10573. function A(e, t) {
  10574. var i = e.getRoot()
  10575. , n = i.__rememberedObjects.indexOf(t.object);
  10576. if (n != -1) {
  10577. var r = i.__rememberedObjectIndecesToControllers[n];
  10578. if (void 0 === r && (r = {},
  10579. i.__rememberedObjectIndecesToControllers[n] = r),
  10580. r[t.property] = t,
  10581. i.load && i.load.remembered) {
  10582. var o, a = i.load.remembered;
  10583. if (a[e.preset])
  10584. o = a[e.preset];
  10585. else {
  10586. if (!a[L])
  10587. return;
  10588. o = a[L]
  10589. }
  10590. if (o[n] && void 0 !== o[n][t.property]) {
  10591. var s = o[n][t.property];
  10592. t.initialValue = s,
  10593. t.setValue(s)
  10594. }
  10595. }
  10596. }
  10597. }
  10598. function y(e, t) {
  10599. return document.location.href + "." + t
  10600. }
  10601. function C(e) {
  10602. var t = e.__save_row = document.createElement("li");
  10603. p.addClass(e.domElement, "has-save"),
  10604. e.__ul.insertBefore(t, e.__ul.firstChild),
  10605. p.addClass(t, "save-row");
  10606. var i = document.createElement("span");
  10607. i.innerHTML = "&nbsp;",
  10608. p.addClass(i, "button gears");
  10609. var n = document.createElement("span");
  10610. n.innerHTML = "Save",
  10611. p.addClass(n, "button"),
  10612. p.addClass(n, "save");
  10613. var r = document.createElement("span");
  10614. r.innerHTML = "New",
  10615. p.addClass(r, "button"),
  10616. p.addClass(r, "save-as");
  10617. var o = document.createElement("span");
  10618. o.innerHTML = "Revert",
  10619. p.addClass(o, "button"),
  10620. p.addClass(o, "revert");
  10621. var a = e.__preset_select = document.createElement("select");
  10622. if (e.load && e.load.remembered ? f.each(e.load.remembered, function(t, i) {
  10623. w(e, i, i == e.preset)
  10624. }) : w(e, L, !1),
  10625. p.bind(a, "change", function() {
  10626. for (var t = 0; t < e.__preset_select.length; t++)
  10627. e.__preset_select[t].innerHTML = e.__preset_select[t].value;
  10628. e.preset = this.value
  10629. }),
  10630. t.appendChild(a),
  10631. t.appendChild(i),
  10632. t.appendChild(n),
  10633. t.appendChild(r),
  10634. t.appendChild(o),
  10635. D) {
  10636. var s = document.getElementById("dg-save-locally")
  10637. , l = document.getElementById("dg-local-explain");
  10638. s.style.display = "block";
  10639. var c = document.getElementById("dg-local-storage");
  10640. "true" === localStorage.getItem(y(e, "isLocal")) && c.setAttribute("checked", "checked");
  10641. var h = function() {
  10642. l.style.display = e.useLocalStorage ? "block" : "none"
  10643. };
  10644. h(),
  10645. p.bind(c, "change", function() {
  10646. e.useLocalStorage = !e.useLocalStorage,
  10647. h()
  10648. })
  10649. }
  10650. var u = document.getElementById("dg-new-constructor");
  10651. p.bind(u, "keydown", function(e) {
  10652. !e.metaKey || 67 !== e.which && 67 != e.keyCode || S.hide()
  10653. }),
  10654. p.bind(i, "click", function() {
  10655. u.innerHTML = JSON.stringify(e.getSaveObject(), void 0, 2),
  10656. S.show(),
  10657. u.focus(),
  10658. u.select()
  10659. }),
  10660. p.bind(n, "click", function() {
  10661. e.save()
  10662. }),
  10663. p.bind(r, "click", function() {
  10664. var t = prompt("Enter a new preset name.");
  10665. t && e.saveAs(t)
  10666. }),
  10667. p.bind(o, "click", function() {
  10668. e.revert()
  10669. })
  10670. }
  10671. function I(e) {
  10672. function t(t) {
  10673. return t.preventDefault(),
  10674. r = t.clientX,
  10675. p.addClass(e.__closeButton, V.CLASS_DRAG),
  10676. p.bind(window, "mousemove", i),
  10677. p.bind(window, "mouseup", n),
  10678. !1
  10679. }
  10680. function i(t) {
  10681. return t.preventDefault(),
  10682. e.width += r - t.clientX,
  10683. e.onResize(),
  10684. r = t.clientX,
  10685. !1
  10686. }
  10687. function n() {
  10688. p.removeClass(e.__closeButton, V.CLASS_DRAG),
  10689. p.unbind(window, "mousemove", i),
  10690. p.unbind(window, "mouseup", n)
  10691. }
  10692. e.__resize_handle = document.createElement("div"),
  10693. f.extend(e.__resize_handle.style, {
  10694. width: "6px",
  10695. marginLeft: "-3px",
  10696. height: "200px",
  10697. cursor: "ew-resize",
  10698. position: "absolute"
  10699. });
  10700. var r;
  10701. p.bind(e.__resize_handle, "mousedown", t),
  10702. p.bind(e.__closeButton, "mousedown", t),
  10703. e.domElement.insertBefore(e.__resize_handle, e.domElement.firstElementChild)
  10704. }
  10705. function E(e, t) {
  10706. e.domElement.style.width = t + "px",
  10707. e.__save_row && e.autoPlace && (e.__save_row.style.width = t + "px"),
  10708. e.__closeButton && (e.__closeButton.style.width = t + "px")
  10709. }
  10710. function b(e, t) {
  10711. var i = {};
  10712. return f.each(e.__rememberedObjects, function(n, r) {
  10713. var o = {}
  10714. , a = e.__rememberedObjectIndecesToControllers[r];
  10715. f.each(a, function(e, i) {
  10716. o[i] = t ? e.initialValue : e.getValue()
  10717. }),
  10718. i[r] = o
  10719. }),
  10720. i
  10721. }
  10722. function w(e, t, i) {
  10723. var n = document.createElement("option");
  10724. n.innerHTML = t,
  10725. n.value = t,
  10726. e.__preset_select.appendChild(n),
  10727. i && (e.__preset_select.selectedIndex = e.__preset_select.length - 1)
  10728. }
  10729. function _(e) {
  10730. for (var t = 0; t < e.__preset_select.length; t++)
  10731. e.__preset_select[t].value == e.preset && (e.__preset_select.selectedIndex = t)
  10732. }
  10733. function T(e, t) {
  10734. var i = e.__preset_select[e.__preset_select.selectedIndex];
  10735. t ? i.innerHTML = i.value + "*" : i.innerHTML = i.value
  10736. }
  10737. function x(e) {
  10738. 0 != e.length && u(function() {
  10739. x(e)
  10740. }),
  10741. f.each(e, function(e) {
  10742. e.updateDisplay()
  10743. })
  10744. }
  10745. e.inject(i);
  10746. var S, M, R = "dg", P = 72, O = 20, L = "Default", D = function() {
  10747. try {
  10748. return "localStorage"in window && null !== window.localStorage
  10749. } catch (e) {
  10750. return !1
  10751. }
  10752. }(), N = !0, B = !1, F = [], V = function(e) {
  10753. function t() {
  10754. var e = i.getRoot();
  10755. e.width += 1,
  10756. f.defer(function() {
  10757. e.width -= 1
  10758. })
  10759. }
  10760. var i = this;
  10761. this.domElement = document.createElement("div"),
  10762. this.__ul = document.createElement("ul"),
  10763. this.domElement.appendChild(this.__ul),
  10764. p.addClass(this.domElement, R),
  10765. this.__folders = {},
  10766. this.__controllers = [],
  10767. this.__rememberedObjects = [],
  10768. this.__rememberedObjectIndecesToControllers = [],
  10769. this.__listening = [],
  10770. e = e || {},
  10771. e = f.defaults(e, {
  10772. autoPlace: !0,
  10773. width: V.DEFAULT_WIDTH
  10774. }),
  10775. e = f.defaults(e, {
  10776. resizable: e.autoPlace,
  10777. hideable: e.autoPlace
  10778. }),
  10779. f.isUndefined(e.load) ? e.load = {
  10780. preset: L
  10781. } : e.preset && (e.load.preset = e.preset),
  10782. f.isUndefined(e.parent) && e.hideable && F.push(this),
  10783. e.resizable = f.isUndefined(e.parent) && e.resizable,
  10784. e.autoPlace && f.isUndefined(e.scrollable) && (e.scrollable = !0);
  10785. var n, r = D && "true" === localStorage.getItem(y(this, "isLocal"));
  10786. if (Object.defineProperties(this, {
  10787. parent: {
  10788. get: function() {
  10789. return e.parent
  10790. }
  10791. },
  10792. scrollable: {
  10793. get: function() {
  10794. return e.scrollable
  10795. }
  10796. },
  10797. autoPlace: {
  10798. get: function() {
  10799. return e.autoPlace
  10800. }
  10801. },
  10802. preset: {
  10803. get: function() {
  10804. return i.parent ? i.getRoot().preset : e.load.preset
  10805. },
  10806. set: function(t) {
  10807. i.parent ? i.getRoot().preset = t : e.load.preset = t,
  10808. _(this),
  10809. i.revert()
  10810. }
  10811. },
  10812. width: {
  10813. get: function() {
  10814. return e.width
  10815. },
  10816. set: function(t) {
  10817. e.width = t,
  10818. E(i, t)
  10819. }
  10820. },
  10821. name: {
  10822. get: function() {
  10823. return e.name
  10824. },
  10825. set: function(t) {
  10826. e.name = t,
  10827. a && (a.innerHTML = e.name)
  10828. }
  10829. },
  10830. closed: {
  10831. get: function() {
  10832. return e.closed
  10833. },
  10834. set: function(t) {
  10835. e.closed = t,
  10836. e.closed ? p.addClass(i.__ul, V.CLASS_CLOSED) : p.removeClass(i.__ul, V.CLASS_CLOSED),
  10837. this.onResize(),
  10838. i.__closeButton && (i.__closeButton.innerHTML = t ? V.TEXT_OPEN : V.TEXT_CLOSED)
  10839. }
  10840. },
  10841. load: {
  10842. get: function() {
  10843. return e.load
  10844. }
  10845. },
  10846. useLocalStorage: {
  10847. get: function() {
  10848. return r
  10849. },
  10850. set: function(e) {
  10851. D && (r = e,
  10852. e ? p.bind(window, "unload", n) : p.unbind(window, "unload", n),
  10853. localStorage.setItem(y(i, "isLocal"), e))
  10854. }
  10855. }
  10856. }),
  10857. f.isUndefined(e.parent)) {
  10858. if (e.closed = !1,
  10859. p.addClass(this.domElement, V.CLASS_MAIN),
  10860. p.makeSelectable(this.domElement, !1),
  10861. D && r) {
  10862. i.useLocalStorage = !0;
  10863. var o = localStorage.getItem(y(this, "gui"));
  10864. o && (e.load = JSON.parse(o))
  10865. }
  10866. this.__closeButton = document.createElement("div"),
  10867. this.__closeButton.innerHTML = V.TEXT_CLOSED,
  10868. p.addClass(this.__closeButton, V.CLASS_CLOSE_BUTTON),
  10869. this.domElement.appendChild(this.__closeButton),
  10870. p.bind(this.__closeButton, "click", function() {
  10871. i.closed = !i.closed
  10872. })
  10873. } else {
  10874. void 0 === e.closed && (e.closed = !0);
  10875. var a = document.createTextNode(e.name);
  10876. p.addClass(a, "controller-name");
  10877. var s = m(i, a)
  10878. , l = function(e) {
  10879. return e.preventDefault(),
  10880. i.closed = !i.closed,
  10881. !1
  10882. };
  10883. p.addClass(this.__ul, V.CLASS_CLOSED),
  10884. p.addClass(s, "title"),
  10885. p.bind(s, "click", l),
  10886. e.closed || (this.closed = !1)
  10887. }
  10888. e.autoPlace && (f.isUndefined(e.parent) && (N && (M = document.createElement("div"),
  10889. p.addClass(M, R),
  10890. p.addClass(M, V.CLASS_AUTO_PLACE_CONTAINER),
  10891. document.body.appendChild(M),
  10892. N = !1),
  10893. M.appendChild(this.domElement),
  10894. p.addClass(this.domElement, V.CLASS_AUTO_PLACE)),
  10895. this.parent || E(i, e.width)),
  10896. p.bind(window, "resize", function() {
  10897. i.onResize()
  10898. }),
  10899. p.bind(this.__ul, "webkitTransitionEnd", function() {
  10900. i.onResize()
  10901. }),
  10902. p.bind(this.__ul, "transitionend", function() {
  10903. i.onResize()
  10904. }),
  10905. p.bind(this.__ul, "oTransitionEnd", function() {
  10906. i.onResize()
  10907. }),
  10908. this.onResize(),
  10909. e.resizable && I(this),
  10910. n = function() {
  10911. D && "true" === localStorage.getItem(y(i, "isLocal")) && localStorage.setItem(y(i, "gui"), JSON.stringify(i.getSaveObject()))
  10912. }
  10913. ,
  10914. this.saveToLocalStorageIfPossible = n;
  10915. i.getRoot();
  10916. e.parent || t()
  10917. };
  10918. return V.toggleHide = function() {
  10919. B = !B,
  10920. f.each(F, function(e) {
  10921. e.domElement.style.zIndex = B ? -999 : 999,
  10922. e.domElement.style.opacity = B ? 0 : 1
  10923. })
  10924. }
  10925. ,
  10926. V.CLASS_AUTO_PLACE = "a",
  10927. V.CLASS_AUTO_PLACE_CONTAINER = "ac",
  10928. V.CLASS_MAIN = "main",
  10929. V.CLASS_CONTROLLER_ROW = "cr",
  10930. V.CLASS_TOO_TALL = "taller-than-window",
  10931. V.CLASS_CLOSED = "closed",
  10932. V.CLASS_CLOSE_BUTTON = "close-button",
  10933. V.CLASS_DRAG = "drag",
  10934. V.DEFAULT_WIDTH = 245,
  10935. V.TEXT_CLOSED = "Close Controls",
  10936. V.TEXT_OPEN = "Open Controls",
  10937. p.bind(window, "keydown", function(e) {
  10938. "text" === document.activeElement.type || e.which !== P && e.keyCode != P || V.toggleHide()
  10939. }, !1),
  10940. f.extend(V.prototype, {
  10941. add: function(e, t) {
  10942. return g(this, e, t, {
  10943. factoryArgs: Array.prototype.slice.call(arguments, 2)
  10944. })
  10945. },
  10946. addColor: function(e, t) {
  10947. return g(this, e, t, {
  10948. color: !0
  10949. })
  10950. },
  10951. remove: function(e) {
  10952. this.__ul.removeChild(e.__li),
  10953. this.__controllers.slice(this.__controllers.indexOf(e), 1);
  10954. var t = this;
  10955. f.defer(function() {
  10956. t.onResize()
  10957. })
  10958. },
  10959. destroy: function() {
  10960. this.autoPlace && M.removeChild(this.domElement)
  10961. },
  10962. addFolder: function(e) {
  10963. if (void 0 !== this.__folders[e])
  10964. throw new Error('You already have a folder in this GUI by the name "' + e + '"');
  10965. var t = {
  10966. name: e,
  10967. parent: this
  10968. };
  10969. t.autoPlace = this.autoPlace,
  10970. this.load && this.load.folders && this.load.folders[e] && (t.closed = this.load.folders[e].closed,
  10971. t.load = this.load.folders[e]);
  10972. var i = new V(t);
  10973. this.__folders[e] = i;
  10974. var n = m(this, i.domElement);
  10975. return p.addClass(n, "folder"),
  10976. i
  10977. },
  10978. open: function() {
  10979. this.closed = !1
  10980. },
  10981. close: function() {
  10982. this.closed = !0
  10983. },
  10984. onResize: function() {
  10985. var e = this.getRoot();
  10986. if (e.scrollable) {
  10987. var t = p.getOffset(e.__ul).top
  10988. , i = 0;
  10989. f.each(e.__ul.childNodes, function(t) {
  10990. e.autoPlace && t === e.__save_row || (i += p.getHeight(t))
  10991. }),
  10992. $("#player").height() - t - O < i ? (p.addClass(e.domElement, V.CLASS_TOO_TALL),
  10993. e.__ul.style.height = $("#player").height() - t - O + "px") : (p.removeClass(e.domElement, V.CLASS_TOO_TALL),
  10994. e.__ul.style.height = "auto")
  10995. }
  10996. e.__resize_handle && f.defer(function() {
  10997. e.__resize_handle.style.height = e.__ul.offsetHeight + "px"
  10998. }),
  10999. e.__closeButton && (e.__closeButton.style.width = e.width + "px")
  11000. },
  11001. remember: function() {
  11002. if (f.isUndefined(S) && (S = new d,
  11003. S.domElement.innerHTML = t),
  11004. this.parent)
  11005. throw new Error("You can only call remember on a top level GUI.");
  11006. var e = this;
  11007. f.each(Array.prototype.slice.call(arguments), function(t) {
  11008. 0 == e.__rememberedObjects.length && C(e),
  11009. e.__rememberedObjects.indexOf(t) == -1 && e.__rememberedObjects.push(t)
  11010. }),
  11011. this.autoPlace && E(this, this.width)
  11012. },
  11013. getRoot: function() {
  11014. for (var e = this; e.parent; )
  11015. e = e.parent;
  11016. return e
  11017. },
  11018. getSaveObject: function() {
  11019. var e = this.load;
  11020. return e.closed = this.closed,
  11021. this.__rememberedObjects.length > 0 && (e.preset = this.preset,
  11022. e.remembered || (e.remembered = {}),
  11023. e.remembered[this.preset] = b(this)),
  11024. e.folders = {},
  11025. f.each(this.__folders, function(t, i) {
  11026. e.folders[i] = t.getSaveObject()
  11027. }),
  11028. e
  11029. },
  11030. save: function() {
  11031. this.load.remembered || (this.load.remembered = {}),
  11032. this.load.remembered[this.preset] = b(this),
  11033. T(this, !1),
  11034. this.saveToLocalStorageIfPossible()
  11035. },
  11036. saveAs: function(e) {
  11037. this.load.remembered || (this.load.remembered = {},
  11038. this.load.remembered[L] = b(this, !0)),
  11039. this.load.remembered[e] = b(this),
  11040. this.preset = e,
  11041. w(this, e, !0),
  11042. this.saveToLocalStorageIfPossible()
  11043. },
  11044. revert: function(e) {
  11045. f.each(this.__controllers, function(t) {
  11046. this.getRoot().load.remembered ? A(e || this.getRoot(), t) : t.setValue(t.initialValue)
  11047. }, this),
  11048. f.each(this.__folders, function(e) {
  11049. e.revert(e)
  11050. }),
  11051. e || T(this.getRoot(), !1)
  11052. },
  11053. listen: function(e) {
  11054. var t = 0 == this.__listening.length;
  11055. this.__listening.push(e),
  11056. t && x(this.__listening)
  11057. }
  11058. }),
  11059. V
  11060. }(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) {
  11061. return function(s, l) {
  11062. var c = s[l];
  11063. 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,{
  11064. min: arguments[2],
  11065. max: arguments[3]
  11066. }) : a.isString(c) ? new n(s,l) : a.isFunction(c) ? new r(s,l,"") : a.isBoolean(c) ? new o(s,l) : void 0
  11067. }
  11068. }(n.controllers.OptionController, n.controllers.NumberControllerBox, n.controllers.NumberControllerSlider, n.controllers.StringController = function(e, t, i) {
  11069. var n = function(e, i) {
  11070. function r() {
  11071. a.setValue(a.__input.value)
  11072. }
  11073. function o() {
  11074. a.__onFinishChange && a.__onFinishChange.call(a, a.getValue())
  11075. }
  11076. n.superclass.call(this, e, i);
  11077. var a = this;
  11078. this.__input = document.createElement("input"),
  11079. this.__input.setAttribute("type", "text"),
  11080. t.bind(this.__input, "keyup", r),
  11081. t.bind(this.__input, "change", r),
  11082. t.bind(this.__input, "blur", o),
  11083. t.bind(this.__input, "keydown", function(e) {
  11084. 13 === e.keyCode && this.blur()
  11085. }),
  11086. this.updateDisplay(),
  11087. this.domElement.appendChild(this.__input)
  11088. };
  11089. return n.superclass = e,
  11090. i.extend(n.prototype, e.prototype, {
  11091. updateDisplay: function() {
  11092. return t.isActive(this.__input) || (this.__input.value = this.getValue()),
  11093. n.superclass.prototype.updateDisplay.call(this)
  11094. }
  11095. }),
  11096. n
  11097. }(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) {
  11098. function o(e, t, i, n) {
  11099. e.style.background = "",
  11100. r.each(l, function(r) {
  11101. e.style.cssText += "background: " + r + "linear-gradient(" + t + ", " + i + " 0%, " + n + " 100%); "
  11102. })
  11103. }
  11104. function a(e) {
  11105. e.style.background = "",
  11106. e.style.cssText += "background: -moz-linear-gradient(top, #ff0000 0%, #ff00ff 17%, #0000ff 34%, #00ffff 50%, #00ff00 67%, #ffff00 84%, #ff0000 100%);",
  11107. e.style.cssText += "background: -webkit-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);",
  11108. e.style.cssText += "background: -o-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);",
  11109. e.style.cssText += "background: -ms-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);",
  11110. e.style.cssText += "background: linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);"
  11111. }
  11112. var s = function(e, l) {
  11113. function c(e) {
  11114. p(e),
  11115. t.bind(window, "mousemove", p),
  11116. t.bind(window, "mouseup", h)
  11117. }
  11118. function h() {
  11119. t.unbind(window, "mousemove", p),
  11120. t.unbind(window, "mouseup", h)
  11121. }
  11122. function u() {
  11123. var e = n(this.value);
  11124. e !== !1 ? (g.__color.__state = e,
  11125. g.setValue(g.__color.toOriginal())) : this.value = g.__color.toString()
  11126. }
  11127. function d() {
  11128. t.unbind(window, "mousemove", f),
  11129. t.unbind(window, "mouseup", d)
  11130. }
  11131. function p(e) {
  11132. e.preventDefault();
  11133. var i = t.getWidth(g.__saturation_field)
  11134. , n = t.getOffset(g.__saturation_field)
  11135. , r = (e.clientX - n.left + document.body.scrollLeft) / i
  11136. , o = 1 - (e.clientY - n.top + document.body.scrollTop) / i;
  11137. return o > 1 ? o = 1 : o < 0 && (o = 0),
  11138. r > 1 ? r = 1 : r < 0 && (r = 0),
  11139. g.__color.v = o,
  11140. g.__color.s = r,
  11141. g.setValue(g.__color.toOriginal()),
  11142. !1
  11143. }
  11144. function f(e) {
  11145. e.preventDefault();
  11146. var i = t.getHeight(g.__hue_field)
  11147. , n = t.getOffset(g.__hue_field)
  11148. , r = 1 - (e.clientY - n.top + document.body.scrollTop) / i;
  11149. return r > 1 ? r = 1 : r < 0 && (r = 0),
  11150. g.__color.h = 360 * r,
  11151. g.setValue(g.__color.toOriginal()),
  11152. !1
  11153. }
  11154. s.superclass.call(this, e, l),
  11155. this.__color = new i(this.getValue()),
  11156. this.__temp = new i(0);
  11157. var g = this;
  11158. this.domElement = document.createElement("div"),
  11159. t.makeSelectable(this.domElement, !1),
  11160. this.__selector = document.createElement("div"),
  11161. this.__selector.className = "selector",
  11162. this.__saturation_field = document.createElement("div"),
  11163. this.__saturation_field.className = "saturation-field",
  11164. this.__field_knob = document.createElement("div"),
  11165. this.__field_knob.className = "field-knob",
  11166. this.__field_knob_border = "2px solid ",
  11167. this.__hue_knob = document.createElement("div"),
  11168. this.__hue_knob.className = "hue-knob",
  11169. this.__hue_field = document.createElement("div"),
  11170. this.__hue_field.className = "hue-field",
  11171. this.__input = document.createElement("input"),
  11172. this.__input.type = "text",
  11173. this.__input_textShadow = "0 1px 1px ",
  11174. t.bind(this.__input, "keydown", function(e) {
  11175. 13 === e.keyCode && u.call(this)
  11176. }),
  11177. t.bind(this.__input, "blur", u),
  11178. t.bind(this.__selector, "mousedown", function(e) {
  11179. t.addClass(this, "drag").bind(window, "mouseup", function(e) {
  11180. t.removeClass(g.__selector, "drag")
  11181. })
  11182. });
  11183. var m = document.createElement("div");
  11184. r.extend(this.__selector.style, {
  11185. width: "122px",
  11186. height: "102px",
  11187. padding: "3px",
  11188. backgroundColor: "#222",
  11189. boxShadow: "0px 1px 3px rgba(0,0,0,0.3)"
  11190. }),
  11191. r.extend(this.__field_knob.style, {
  11192. position: "absolute",
  11193. width: "12px",
  11194. height: "12px",
  11195. border: this.__field_knob_border + (this.__color.v < .5 ? "#fff" : "#000"),
  11196. boxShadow: "0px 1px 3px rgba(0,0,0,0.5)",
  11197. borderRadius: "12px",
  11198. zIndex: 1
  11199. }),
  11200. r.extend(this.__hue_knob.style, {
  11201. position: "absolute",
  11202. width: "15px",
  11203. height: "2px",
  11204. borderRight: "4px solid #fff",
  11205. zIndex: 1
  11206. }),
  11207. r.extend(this.__saturation_field.style, {
  11208. width: "100px",
  11209. height: "100px",
  11210. border: "1px solid #555",
  11211. marginRight: "3px",
  11212. display: "inline-block",
  11213. cursor: "pointer"
  11214. }),
  11215. r.extend(m.style, {
  11216. width: "100%",
  11217. height: "100%",
  11218. background: "none"
  11219. }),
  11220. o(m, "top", "rgba(0,0,0,0)", "#000"),
  11221. r.extend(this.__hue_field.style, {
  11222. width: "15px",
  11223. height: "100px",
  11224. display: "inline-block",
  11225. border: "1px solid #555",
  11226. cursor: "ns-resize"
  11227. }),
  11228. a(this.__hue_field),
  11229. r.extend(this.__input.style, {
  11230. outline: "none",
  11231. textAlign: "center",
  11232. color: "#fff",
  11233. border: 0,
  11234. fontWeight: "bold",
  11235. textShadow: this.__input_textShadow + "rgba(0,0,0,0.7)"
  11236. }),
  11237. t.bind(this.__saturation_field, "mousedown", c),
  11238. t.bind(this.__field_knob, "mousedown", c),
  11239. t.bind(this.__hue_field, "mousedown", function(e) {
  11240. f(e),
  11241. t.bind(window, "mousemove", f),
  11242. t.bind(window, "mouseup", d)
  11243. }),
  11244. this.__saturation_field.appendChild(m),
  11245. this.__selector.appendChild(this.__field_knob),
  11246. this.__selector.appendChild(this.__saturation_field),
  11247. this.__selector.appendChild(this.__hue_field),
  11248. this.__hue_field.appendChild(this.__hue_knob),
  11249. this.domElement.appendChild(this.__input),
  11250. this.domElement.appendChild(this.__selector),
  11251. this.updateDisplay()
  11252. };
  11253. s.superclass = e,
  11254. r.extend(s.prototype, e.prototype, {
  11255. updateDisplay: function() {
  11256. var e = n(this.getValue());
  11257. if (e !== !1) {
  11258. var t = !1;
  11259. r.each(i.COMPONENTS, function(i) {
  11260. if (!r.isUndefined(e[i]) && !r.isUndefined(this.__color.__state[i]) && e[i] !== this.__color.__state[i])
  11261. return t = !0,
  11262. {}
  11263. }, this),
  11264. t && r.extend(this.__color.__state, e)
  11265. }
  11266. r.extend(this.__temp.__state, this.__color.__state),
  11267. this.__temp.a = 1;
  11268. var a = this.__color.v < .5 || this.__color.s > .5 ? 255 : 0
  11269. , s = 255 - a;
  11270. r.extend(this.__field_knob.style, {
  11271. marginLeft: 100 * this.__color.s - 7 + "px",
  11272. marginTop: 100 * (1 - this.__color.v) - 7 + "px",
  11273. backgroundColor: this.__temp.toString(),
  11274. border: this.__field_knob_border + "rgb(" + a + "," + a + "," + a + ")"
  11275. }),
  11276. this.__hue_knob.style.marginTop = 100 * (1 - this.__color.h / 360) + "px",
  11277. this.__temp.s = 1,
  11278. this.__temp.v = 1,
  11279. o(this.__saturation_field, "left", "#fff", this.__temp.toString()),
  11280. r.extend(this.__input.style, {
  11281. backgroundColor: this.__input.value = this.__color.toString(),
  11282. color: "rgb(" + a + "," + a + "," + a + ")",
  11283. textShadow: this.__input_textShadow + "rgba(" + s + "," + s + "," + s + ",.7)"
  11284. })
  11285. }
  11286. });
  11287. var l = ["-moz-", "-o-", "-webkit-", "-ms-", ""];
  11288. return s
  11289. }(n.controllers.Controller, n.dom.dom, n.color.Color = function(e, t, i, n) {
  11290. function r(e, t, i) {
  11291. Object.defineProperty(e, t, {
  11292. get: function() {
  11293. return "RGB" === this.__state.space ? this.__state[t] : (a(this, t, i),
  11294. this.__state[t])
  11295. },
  11296. set: function(e) {
  11297. "RGB" !== this.__state.space && (a(this, t, i),
  11298. this.__state.space = "RGB"),
  11299. this.__state[t] = e
  11300. }
  11301. })
  11302. }
  11303. function o(e, t) {
  11304. Object.defineProperty(e, t, {
  11305. get: function() {
  11306. return "HSV" === this.__state.space ? this.__state[t] : (s(this),
  11307. this.__state[t])
  11308. },
  11309. set: function(e) {
  11310. "HSV" !== this.__state.space && (s(this),
  11311. this.__state.space = "HSV"),
  11312. this.__state[t] = e
  11313. }
  11314. })
  11315. }
  11316. function a(e, i, r) {
  11317. if ("HEX" === e.__state.space)
  11318. e.__state[i] = t.component_from_hex(e.__state.hex, r);
  11319. else {
  11320. if ("HSV" !== e.__state.space)
  11321. throw "Corrupted color state";
  11322. n.extend(e.__state, t.hsv_to_rgb(e.__state.h, e.__state.s, e.__state.v))
  11323. }
  11324. }
  11325. function s(e) {
  11326. var i = t.rgb_to_hsv(e.r, e.g, e.b);
  11327. n.extend(e.__state, {
  11328. s: i.s,
  11329. v: i.v
  11330. }),
  11331. n.isNaN(i.h) ? n.isUndefined(e.__state.h) && (e.__state.h = 0) : e.__state.h = i.h
  11332. }
  11333. var l = function() {
  11334. if (this.__state = e.apply(this, arguments),
  11335. this.__state === !1)
  11336. throw "Failed to interpret color arguments";
  11337. this.__state.a = this.__state.a || 1
  11338. };
  11339. return l.COMPONENTS = ["r", "g", "b", "h", "s", "v", "hex", "a"],
  11340. n.extend(l.prototype, {
  11341. toString: function() {
  11342. return i(this)
  11343. },
  11344. toOriginal: function() {
  11345. return this.__state.conversion.write(this)
  11346. }
  11347. }),
  11348. r(l.prototype, "r", 2),
  11349. r(l.prototype, "g", 1),
  11350. r(l.prototype, "b", 0),
  11351. o(l.prototype, "h"),
  11352. o(l.prototype, "s"),
  11353. o(l.prototype, "v"),
  11354. Object.defineProperty(l.prototype, "a", {
  11355. get: function() {
  11356. return this.__state.a
  11357. },
  11358. set: function(e) {
  11359. this.__state.a = e
  11360. }
  11361. }),
  11362. Object.defineProperty(l.prototype, "hex", {
  11363. get: function() {
  11364. return "HEX" !== !this.__state.space && (this.__state.hex = t.rgb_to_hex(this.r, this.g, this.b)),
  11365. this.__state.hex
  11366. },
  11367. set: function(e) {
  11368. this.__state.space = "HEX",
  11369. this.__state.hex = e
  11370. }
  11371. }),
  11372. l
  11373. }(n.color.interpret, n.color.math = function() {
  11374. var e;
  11375. return {
  11376. hsv_to_rgb: function(e, t, i) {
  11377. var n = Math.floor(e / 60) % 6
  11378. , r = e / 60 - Math.floor(e / 60)
  11379. , o = i * (1 - t)
  11380. , a = i * (1 - r * t)
  11381. , s = i * (1 - (1 - r) * t)
  11382. , l = [[i, s, o], [a, i, o], [o, i, s], [o, a, i], [s, o, i], [i, o, a]][n];
  11383. return {
  11384. r: 255 * l[0],
  11385. g: 255 * l[1],
  11386. b: 255 * l[2]
  11387. }
  11388. },
  11389. rgb_to_hsv: function(e, t, i) {
  11390. var n, r, o = Math.min(e, t, i), a = Math.max(e, t, i), s = a - o;
  11391. return 0 == a ? {
  11392. h: NaN,
  11393. s: 0,
  11394. v: 0
  11395. } : (r = s / a,
  11396. n = e == a ? (t - i) / s : t == a ? 2 + (i - e) / s : 4 + (e - t) / s,
  11397. n /= 6,
  11398. n < 0 && (n += 1),
  11399. {
  11400. h: 360 * n,
  11401. s: r,
  11402. v: a / 255
  11403. })
  11404. },
  11405. rgb_to_hex: function(e, t, i) {
  11406. var n = this.hex_with_component(0, 2, e);
  11407. return n = this.hex_with_component(n, 1, t),
  11408. n = this.hex_with_component(n, 0, i)
  11409. },
  11410. component_from_hex: function(e, t) {
  11411. return e >> 8 * t & 255
  11412. },
  11413. hex_with_component: function(t, i, n) {
  11414. return n << (e = 8 * i) | t & ~(255 << e)
  11415. }
  11416. }
  11417. }(), n.color.toString, n.utils.common), n.color.interpret, n.utils.common), n.utils.requestAnimationFrame = function() {
  11418. return window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame || window.oRequestAnimationFrame || window.msRequestAnimationFrame || function(e, t) {
  11419. window.setTimeout(e, 1e3 / 60)
  11420. }
  11421. }(), n.dom.CenteredDiv = function(e, t) {
  11422. var i = function() {
  11423. this.backgroundElement = document.createElement("div"),
  11424. t.extend(this.backgroundElement.style, {
  11425. backgroundColor: "rgba(0,0,0,0.8)",
  11426. top: 0,
  11427. left: 0,
  11428. display: "none",
  11429. zIndex: "1000",
  11430. opacity: 0,
  11431. WebkitTransition: "opacity 0.2s linear"
  11432. }),
  11433. e.makeFullscreen(this.backgroundElement),
  11434. this.backgroundElement.style.position = "fixed",
  11435. this.domElement = document.createElement("div"),
  11436. t.extend(this.domElement.style, {
  11437. position: "fixed",
  11438. display: "none",
  11439. zIndex: "1001",
  11440. opacity: 0,
  11441. WebkitTransition: "-webkit-transform 0.2s ease-out, opacity 0.2s linear"
  11442. }),
  11443. document.body.appendChild(this.backgroundElement),
  11444. document.body.appendChild(this.domElement);
  11445. var i = this;
  11446. e.bind(this.backgroundElement, "click", function() {
  11447. i.hide()
  11448. })
  11449. };
  11450. return i.prototype.show = function() {
  11451. var e = this;
  11452. this.backgroundElement.style.display = "block",
  11453. this.domElement.style.display = "block",
  11454. this.domElement.style.opacity = 0,
  11455. this.domElement.style.webkitTransform = "scale(1.1)",
  11456. this.layout(),
  11457. t.defer(function() {
  11458. e.backgroundElement.style.opacity = 1,
  11459. e.domElement.style.opacity = 1,
  11460. e.domElement.style.webkitTransform = "scale(1)"
  11461. })
  11462. }
  11463. ,
  11464. i.prototype.hide = function() {
  11465. var t = this
  11466. , i = function() {
  11467. t.domElement.style.display = "none",
  11468. t.backgroundElement.style.display = "none",
  11469. e.unbind(t.domElement, "webkitTransitionEnd", i),
  11470. e.unbind(t.domElement, "transitionend", i),
  11471. e.unbind(t.domElement, "oTransitionEnd", i)
  11472. };
  11473. e.bind(this.domElement, "webkitTransitionEnd", i),
  11474. e.bind(this.domElement, "transitionend", i),
  11475. e.bind(this.domElement, "oTransitionEnd", i),
  11476. this.backgroundElement.style.opacity = 0,
  11477. this.domElement.style.opacity = 0,
  11478. this.domElement.style.webkitTransform = "scale(1.1)"
  11479. }
  11480. ,
  11481. i.prototype.layout = function() {
  11482. this.domElement.style.left = $("#player").width() / 2 - e.getWidth(this.domElement) / 2 + "px",
  11483. this.domElement.style.top = $("#player").height() / 2 - e.getHeight(this.domElement) / 2 + "px"
  11484. }
  11485. ,
  11486. i
  11487. }(n.dom.dom, n.utils.common), n.dom.dom, n.utils.common)
  11488. }
  11489. , {}],
  11490. 94: [function(e, t, i) {
  11491. (function(e) {
  11492. "use strict";
  11493. function i(t) {
  11494. function i(e) {
  11495. 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++) {
  11496. var n = _((t[i] * e + 50) / 100);
  11497. n < 1 ? n = 1 : n > 255 && (n = 255),
  11498. T[G[i]] = n
  11499. }
  11500. 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++) {
  11501. var a = _((r[o] * e + 50) / 100);
  11502. a < 1 ? a = 1 : a > 255 && (a = 255),
  11503. x[G[o]] = a
  11504. }
  11505. for (var s = [1, 1.387039845, 1.306562965, 1.175875602, 1, .785694958, .5411961, .275899379], l = 0, c = 0; c < 8; c++)
  11506. for (var h = 0; h < 8; h++)
  11507. S[l] = 1 / (T[G[l]] * s[c] * s[h] * 8),
  11508. M[l] = 1 / (x[G[l]] * s[c] * s[h] * 8),
  11509. l++
  11510. }
  11511. function n(e, t) {
  11512. for (var i = 0, n = 0, r = new Array, o = 1; o <= 16; o++) {
  11513. for (var a = 1; a <= e[o]; a++)
  11514. r[t[n]] = [],
  11515. r[t[n]][0] = i,
  11516. r[t[n]][1] = o,
  11517. n++,
  11518. i++;
  11519. i *= 2
  11520. }
  11521. return r
  11522. }
  11523. function r() {
  11524. C = n(z, W),
  11525. I = n(X, Z),
  11526. E = n(j, Y),
  11527. b = n(q, K)
  11528. }
  11529. function o() {
  11530. for (var e = 1, t = 2, i = 1; i <= 15; i++) {
  11531. for (var n = e; n < t; n++)
  11532. P[32767 + n] = i,
  11533. R[32767 + n] = [],
  11534. R[32767 + n][1] = i,
  11535. R[32767 + n][0] = n;
  11536. for (var r = -(t - 1); r <= -e; r++)
  11537. P[32767 + r] = i,
  11538. R[32767 + r] = [],
  11539. R[32767 + r][1] = i,
  11540. R[32767 + r][0] = t - 1 + r;
  11541. e <<= 1,
  11542. t <<= 1
  11543. }
  11544. }
  11545. function a() {
  11546. for (var e = 0; e < 256; e++)
  11547. H[e] = 19595 * e,
  11548. H[e + 256 >> 0] = 38470 * e,
  11549. H[e + 512 >> 0] = 7471 * e + 32768,
  11550. H[e + 768 >> 0] = -11059 * e,
  11551. H[e + 1024 >> 0] = -21709 * e,
  11552. H[e + 1280 >> 0] = 32768 * e + 8421375,
  11553. H[e + 1536 >> 0] = -27439 * e,
  11554. H[e + 1792 >> 0] = -5329 * e
  11555. }
  11556. function s(e) {
  11557. for (var t = e[0], i = e[1] - 1; i >= 0; )
  11558. t & 1 << i && (N |= 1 << B),
  11559. i--,
  11560. B--,
  11561. B < 0 && (255 == N ? (l(255),
  11562. l(0)) : l(N),
  11563. B = 7,
  11564. N = 0)
  11565. }
  11566. function l(e) {
  11567. D.push(e)
  11568. }
  11569. function c(e) {
  11570. l(e >> 8 & 255),
  11571. l(255 & e)
  11572. }
  11573. function h(e, t) {
  11574. var i, n, r, o, a, s, l, c, h, u = 0, d = 8, p = 64;
  11575. for (h = 0; h < d; ++h) {
  11576. i = e[u],
  11577. n = e[u + 1],
  11578. r = e[u + 2],
  11579. o = e[u + 3],
  11580. a = e[u + 4],
  11581. s = e[u + 5],
  11582. l = e[u + 6],
  11583. c = e[u + 7];
  11584. var f = i + c
  11585. , g = i - c
  11586. , m = n + l
  11587. , v = n - l
  11588. , A = r + s
  11589. , y = r - s
  11590. , C = o + a
  11591. , I = o - a
  11592. , E = f + C
  11593. , b = f - C
  11594. , w = m + A
  11595. , _ = m - A;
  11596. e[u] = E + w,
  11597. e[u + 4] = E - w;
  11598. var T = .707106781 * (_ + b);
  11599. e[u + 2] = b + T,
  11600. e[u + 6] = b - T,
  11601. E = I + y,
  11602. w = y + v,
  11603. _ = v + g;
  11604. var x = .382683433 * (E - _)
  11605. , S = .5411961 * E + x
  11606. , M = 1.306562965 * _ + x
  11607. , R = .707106781 * w
  11608. , P = g + R
  11609. , L = g - R;
  11610. e[u + 5] = L + S,
  11611. e[u + 3] = L - S,
  11612. e[u + 1] = P + M,
  11613. e[u + 7] = P - M,
  11614. u += 8
  11615. }
  11616. for (u = 0,
  11617. h = 0; h < d; ++h) {
  11618. i = e[u],
  11619. n = e[u + 8],
  11620. r = e[u + 16],
  11621. o = e[u + 24],
  11622. a = e[u + 32],
  11623. s = e[u + 40],
  11624. l = e[u + 48],
  11625. c = e[u + 56];
  11626. var D = i + c
  11627. , N = i - c
  11628. , B = n + l
  11629. , F = n - l
  11630. , V = r + s
  11631. , U = r - s
  11632. , k = o + a
  11633. , H = o - a
  11634. , G = D + k
  11635. , z = D - k
  11636. , W = B + V
  11637. , j = B - V;
  11638. e[u] = G + W,
  11639. e[u + 32] = G - W;
  11640. var Y = .707106781 * (j + z);
  11641. e[u + 16] = z + Y,
  11642. e[u + 48] = z - Y,
  11643. G = H + U,
  11644. W = U + F,
  11645. j = F + N;
  11646. var X = .382683433 * (G - j)
  11647. , Z = .5411961 * G + X
  11648. , q = 1.306562965 * j + X
  11649. , K = .707106781 * W
  11650. , Q = N + K
  11651. , J = N - K;
  11652. e[u + 40] = J + Z,
  11653. e[u + 24] = J - Z,
  11654. e[u + 8] = Q + q,
  11655. e[u + 56] = Q - q,
  11656. u++
  11657. }
  11658. var $;
  11659. for (h = 0; h < p; ++h)
  11660. $ = e[h] * t[h],
  11661. O[h] = $ > 0 ? $ + .5 | 0 : $ - .5 | 0;
  11662. return O
  11663. }
  11664. function u() {
  11665. c(65504),
  11666. c(16),
  11667. l(74),
  11668. l(70),
  11669. l(73),
  11670. l(70),
  11671. l(0),
  11672. l(1),
  11673. l(1),
  11674. l(0),
  11675. c(1),
  11676. c(1),
  11677. l(0),
  11678. l(0)
  11679. }
  11680. function d(e, t) {
  11681. c(65472),
  11682. c(17),
  11683. l(8),
  11684. c(t),
  11685. c(e),
  11686. l(3),
  11687. l(1),
  11688. l(17),
  11689. l(0),
  11690. l(2),
  11691. l(17),
  11692. l(1),
  11693. l(3),
  11694. l(17),
  11695. l(1)
  11696. }
  11697. function p() {
  11698. c(65499),
  11699. c(132),
  11700. l(0);
  11701. for (var e = 0; e < 64; e++)
  11702. l(T[e]);
  11703. l(1);
  11704. for (var t = 0; t < 64; t++)
  11705. l(x[t])
  11706. }
  11707. function f() {
  11708. c(65476),
  11709. c(418),
  11710. l(0);
  11711. for (var e = 0; e < 16; e++)
  11712. l(z[e + 1]);
  11713. for (var t = 0; t <= 11; t++)
  11714. l(W[t]);
  11715. l(16);
  11716. for (var i = 0; i < 16; i++)
  11717. l(j[i + 1]);
  11718. for (var n = 0; n <= 161; n++)
  11719. l(Y[n]);
  11720. l(1);
  11721. for (var r = 0; r < 16; r++)
  11722. l(X[r + 1]);
  11723. for (var o = 0; o <= 11; o++)
  11724. l(Z[o]);
  11725. l(17);
  11726. for (var a = 0; a < 16; a++)
  11727. l(q[a + 1]);
  11728. for (var s = 0; s <= 161; s++)
  11729. l(K[s])
  11730. }
  11731. function g() {
  11732. c(65498),
  11733. c(12),
  11734. l(3),
  11735. l(1),
  11736. l(0),
  11737. l(2),
  11738. l(17),
  11739. l(3),
  11740. l(17),
  11741. l(0),
  11742. l(63),
  11743. l(0)
  11744. }
  11745. function m(e, t, i, n, r) {
  11746. for (var o, a = r[0], l = r[240], c = 16, u = 63, d = 64, p = h(e, t), f = 0; f < d; ++f)
  11747. L[G[f]] = p[f];
  11748. var g = L[0] - i;
  11749. i = L[0],
  11750. 0 == g ? s(n[0]) : (o = 32767 + g,
  11751. s(n[P[o]]),
  11752. s(R[o]));
  11753. for (var m = 63; m > 0 && 0 == L[m]; m--)
  11754. ;
  11755. if (0 == m)
  11756. return s(a),
  11757. i;
  11758. for (var v, A = 1; A <= m; ) {
  11759. for (var y = A; 0 == L[A] && A <= m; ++A)
  11760. ;
  11761. var C = A - y;
  11762. if (C >= c) {
  11763. v = C >> 4;
  11764. for (var I = 1; I <= v; ++I)
  11765. s(l);
  11766. C &= 15
  11767. }
  11768. o = 32767 + L[A],
  11769. s(r[(C << 4) + P[o]]),
  11770. s(R[o]),
  11771. A++
  11772. }
  11773. return m != u && s(a),
  11774. i
  11775. }
  11776. function v() {
  11777. for (var e = String.fromCharCode, t = 0; t < 256; t++)
  11778. k[t] = e(t)
  11779. }
  11780. function A(e) {
  11781. if (e <= 0 && (e = 1),
  11782. e > 100 && (e = 100),
  11783. w != e) {
  11784. var t = 0;
  11785. t = e < 50 ? Math.floor(5e3 / e) : Math.floor(200 - 2 * e),
  11786. i(t),
  11787. w = e
  11788. }
  11789. }
  11790. function y() {
  11791. var e = (new Date).getTime();
  11792. t || (t = 50),
  11793. v(),
  11794. r(),
  11795. o(),
  11796. a(),
  11797. A(t);
  11798. (new Date).getTime() - e
  11799. }
  11800. var C, I, E, b, w, _ = (Math.round,
  11801. 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];
  11802. this.encode = function(t, i) {
  11803. var n = ((new Date).getTime(),
  11804. i.quality);
  11805. n && A(n),
  11806. D = new Array,
  11807. N = 0,
  11808. B = 7,
  11809. c(65496),
  11810. u(),
  11811. p(),
  11812. d(t.width, t.height),
  11813. f(),
  11814. g();
  11815. var r = 0
  11816. , o = 0
  11817. , a = 0;
  11818. N = 0,
  11819. B = 7,
  11820. this.encode.displayName = "_encode_";
  11821. 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; ) {
  11822. for (l = 0; l < G; ) {
  11823. for (w = G * z + l,
  11824. _ = w,
  11825. T = -1,
  11826. x = 0,
  11827. R = 0; R < 64; R++)
  11828. x = (k ? 63 - R : R) >> 3,
  11829. T = 4 * (7 & R),
  11830. _ = w + x * G + T,
  11831. z + x >= L && (_ -= G * (z + 1 + x - L)),
  11832. l + T >= G && (_ -= l + T - G + 4),
  11833. h = P[_++],
  11834. v = P[_++],
  11835. y = P[_++],
  11836. F[R] = (H[h] + H[v + 256 >> 0] + H[y + 512 >> 0] >> 16) - 128,
  11837. V[R] = (H[h + 768 >> 0] + H[v + 1024 >> 0] + H[y + 1280 >> 0] >> 16) - 128,
  11838. U[R] = (H[h + 1280 >> 0] + H[v + 1536 >> 0] + H[y + 1792 >> 0] >> 16) - 128;
  11839. r = m(F, S, r, C, E),
  11840. o = m(V, M, o, I, b),
  11841. a = m(U, M, a, I, b),
  11842. l += 32
  11843. }
  11844. z += W
  11845. }
  11846. if (B >= 0) {
  11847. var j = [];
  11848. j[1] = B + 1,
  11849. j[0] = (1 << B + 1) - 1,
  11850. s(j)
  11851. }
  11852. return c(65497),
  11853. new e(D)
  11854. }
  11855. ,
  11856. y()
  11857. }
  11858. function n(e, t) {
  11859. t = t || {},
  11860. t.quality = t.quality || 50;
  11861. var n = t.quality
  11862. , r = new i(n)
  11863. , o = r.encode(e, t);
  11864. return {
  11865. data: o,
  11866. width: e.width,
  11867. height: e.height
  11868. }
  11869. }
  11870. t.exports.encode = n
  11871. }
  11872. ).call(this, e("buffer").Buffer)
  11873. }
  11874. , {
  11875. buffer: 198
  11876. }],
  11877. 95: [function(e, t, i) {
  11878. "use strict";
  11879. !function() {
  11880. if ("performance"in window == !1 && (window.performance = {}),
  11881. Date.now = Date.now || function() {
  11882. return (new Date).getTime()
  11883. }
  11884. ,
  11885. "now"in window.performance == !1) {
  11886. var e = Date.now();
  11887. performance.timing && performance.timing.navigationStart && (e = performance.timing.navigationStart),
  11888. window.performance.now = function() {
  11889. return Date.now() - e
  11890. }
  11891. }
  11892. }()
  11893. }
  11894. , {}],
  11895. 96: [function(e, t, i) {
  11896. "use strict";
  11897. var n = e("three");
  11898. n.EffectComposer = function(e, t) {
  11899. if (this.renderer = e,
  11900. void 0 === t) {
  11901. var i = {
  11902. minFilter: n.LinearFilter,
  11903. magFilter: n.LinearFilter,
  11904. format: n.RGBAFormat,
  11905. stencilBuffer: !1
  11906. }
  11907. , r = e.getSize();
  11908. t = new n.WebGLRenderTarget(r.width,r.height,i)
  11909. }
  11910. this.renderTarget1 = t,
  11911. this.renderTarget2 = t.clone(),
  11912. this.writeBuffer = this.renderTarget1,
  11913. this.readBuffer = this.renderTarget2,
  11914. this.passes = [],
  11915. void 0 === n.CopyShader && console.error("THREE.EffectComposer relies on THREE.CopyShader"),
  11916. this.copyPass = new n.ShaderPass(n.CopyShader)
  11917. }
  11918. ,
  11919. n.EffectComposer.prototype = {
  11920. swapBuffers: function() {
  11921. var e = this.readBuffer;
  11922. this.readBuffer = this.writeBuffer,
  11923. this.writeBuffer = e
  11924. },
  11925. addPass: function(e) {
  11926. this.passes.push(e)
  11927. },
  11928. insertPass: function(e, t) {
  11929. this.passes.splice(t, 0, e)
  11930. },
  11931. render: function(e) {
  11932. this.writeBuffer = this.renderTarget1,
  11933. this.readBuffer = this.renderTarget2;
  11934. var t, i, r = !1, o = this.passes.length;
  11935. for (i = 0; i < o; i++)
  11936. if (t = this.passes[i],
  11937. t.enabled) {
  11938. if (t.render(this.renderer, this.writeBuffer, this.readBuffer, e, r),
  11939. t.needsSwap) {
  11940. if (r) {
  11941. var a = this.renderer.context;
  11942. a.stencilFunc(a.NOTEQUAL, 1, 4294967295),
  11943. this.copyPass.render(this.renderer, this.writeBuffer, this.readBuffer, e),
  11944. a.stencilFunc(a.EQUAL, 1, 4294967295)
  11945. }
  11946. this.swapBuffers()
  11947. }
  11948. t instanceof n.MaskPass ? r = !0 : t instanceof n.ClearMaskPass && (r = !1)
  11949. }
  11950. },
  11951. reset: function(e) {
  11952. if (void 0 === e) {
  11953. var t = this.renderer.getSize();
  11954. e = this.renderTarget1.clone(),
  11955. e.setSize(t.width, t.height)
  11956. }
  11957. this.renderTarget1.dispose(),
  11958. this.renderTarget2.dispose(),
  11959. this.renderTarget1 = e,
  11960. this.renderTarget2 = e.clone(),
  11961. this.writeBuffer = this.renderTarget1,
  11962. this.readBuffer = this.renderTarget2
  11963. },
  11964. setSize: function(e, t) {
  11965. this.renderTarget1.setSize(e, t),
  11966. this.renderTarget2.setSize(e, t)
  11967. this.passes.forEach(a=>{//add
  11968. a.setSize && a.setSize(e, t)
  11969. })
  11970. }
  11971. }
  11972. }
  11973. , {
  11974. three: 217
  11975. }],
  11976. 97: [function(e, t, i) {
  11977. "use strict";
  11978. var n = e("three");
  11979. n.MaskPass = function(e, t) {
  11980. this.scene = e,
  11981. this.camera = t,
  11982. this.enabled = !0,
  11983. this.clear = !0,
  11984. this.needsSwap = !1,
  11985. this.inverse = !1
  11986. }
  11987. ,
  11988. n.MaskPass.prototype = {
  11989. render: function(e, t, i, n) {
  11990. var r = e.context;
  11991. r.colorMask(!1, !1, !1, !1),
  11992. r.depthMask(!1);
  11993. var o, a;
  11994. this.inverse ? (o = 0,
  11995. a = 1) : (o = 1,
  11996. a = 0),
  11997. r.enable(r.STENCIL_TEST),
  11998. r.stencilOp(r.REPLACE, r.REPLACE, r.REPLACE),
  11999. r.stencilFunc(r.ALWAYS, o, 4294967295),
  12000. r.clearStencil(a),
  12001. e.render(this.scene, this.camera, i, this.clear),
  12002. e.render(this.scene, this.camera, t, this.clear),
  12003. r.colorMask(!0, !0, !0, !0),
  12004. r.depthMask(!0),
  12005. r.stencilFunc(r.EQUAL, 1, 4294967295),
  12006. r.stencilOp(r.KEEP, r.KEEP, r.KEEP)
  12007. }
  12008. },
  12009. n.ClearMaskPass = function() {
  12010. this.enabled = !0
  12011. }
  12012. ,
  12013. n.ClearMaskPass.prototype = {
  12014. render: function(e, t, i, n) {
  12015. var r = e.context;
  12016. r.disable(r.STENCIL_TEST)
  12017. }
  12018. }
  12019. }
  12020. , {
  12021. three: 217
  12022. }],
  12023. 98: [function(e, t, i) {
  12024. "use strict";
  12025. var n = e("three");
  12026. n.RenderPass = function(e, t, i, r, o) {
  12027. this.scene = e,
  12028. this.camera = t,
  12029. this.overrideMaterial = i,
  12030. this.clearColor = r,
  12031. this.clearAlpha = void 0 !== o ? o : 1,
  12032. this.oldClearColor = new n.Color,
  12033. this.oldClearAlpha = 1,
  12034. this.enabled = !0,
  12035. this.clear = !0,
  12036. this.needsSwap = !1
  12037. }
  12038. ,
  12039. n.RenderPass.prototype = {
  12040. render: function(e, t, i, n) {
  12041. this.scene.overrideMaterial = this.overrideMaterial,
  12042. this.clearColor && (this.oldClearColor.copy(e.getClearColor()),
  12043. this.oldClearAlpha = e.getClearAlpha(),
  12044. e.setClearColor(this.clearColor, this.clearAlpha)),
  12045. e.render(this.scene, this.camera, i, this.clear),
  12046. this.clearColor && e.setClearColor(this.oldClearColor, this.oldClearAlpha),
  12047. this.scene.overrideMaterial = null
  12048. }
  12049. }
  12050. }
  12051. , {
  12052. three: 217
  12053. }],
  12054. 99: [function(e, t, i) {
  12055. "use strict";
  12056. var n = e("three");
  12057. n.ShaderPass = function(e, t) {
  12058. this.textureID = void 0 !== t ? t : "tDiffuse",
  12059. e instanceof n.ShaderMaterial ? (this.uniforms = e.uniforms,
  12060. this.material = e) : e && (this.uniforms = n.UniformsUtils.clone(e.uniforms),
  12061. this.material = new n.ShaderMaterial({
  12062. defines: e.defines || {},
  12063. uniforms: this.uniforms,
  12064. vertexShader: e.vertexShader,
  12065. fragmentShader: e.fragmentShader
  12066. })),
  12067. this.renderToScreen = !1,
  12068. this.enabled = !0,
  12069. this.needsSwap = !0,
  12070. this.clear = !1,
  12071. this.camera = new n.OrthographicCamera(-1,1,1,-1,0,1),
  12072. this.scene = new n.Scene,
  12073. this.quad = new n.Mesh(new n.PlaneBufferGeometry(2,2),null),
  12074. this.scene.add(this.quad)
  12075. }
  12076. ,
  12077. n.ShaderPass.prototype = {
  12078. render: function(e, t, i, n) {
  12079. this.uniforms[this.textureID] && (this.uniforms[this.textureID].value = i),
  12080. this.quad.material = this.material,
  12081. this.renderToScreen ? e.render(this.scene, this.camera) : e.render(this.scene, this.camera, t, this.clear)
  12082. }
  12083. }
  12084. }
  12085. , {
  12086. three: 217
  12087. }],
  12088. 100: [function(e, t, i) {
  12089. "use strict";
  12090. var n = e("three");
  12091. n.CopyShader = {
  12092. uniforms: {
  12093. tDiffuse: {
  12094. type: "t",
  12095. value: null
  12096. },
  12097. opacity: {
  12098. type: "f",
  12099. value: 1
  12100. }
  12101. },
  12102. vertexShader: ["varying vec2 vUv;", "void main() {", "vUv = uv;", "gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );", "}"].join("\n"),
  12103. fragmentShader: ["uniform float opacity;", "uniform sampler2D tDiffuse;", "varying vec2 vUv;", "void main() {", "vec4 texel = texture2D( tDiffuse, vUv );", "gl_FragColor = opacity * texel;", "}"].join("\n")
  12104. }
  12105. }
  12106. , {
  12107. three: 217
  12108. }],
  12109. 101: [function(e, t, i) {
  12110. "use strict";
  12111. var n = e("three");
  12112. n.HorizontalBlurShader = {
  12113. uniforms: {
  12114. tDiffuse: {
  12115. type: "t",
  12116. value: null
  12117. },
  12118. h: {
  12119. type: "f",
  12120. value: 1 / 512
  12121. }
  12122. },
  12123. vertexShader: ["varying vec2 vUv;", "void main() {", "vUv = uv;", "gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );", "}"].join("\n"),
  12124. 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")
  12125. }
  12126. }
  12127. , {
  12128. three: 217
  12129. }],
  12130. 102: [function(e, t, i) {
  12131. "use strict";
  12132. var n = e("three");
  12133. n.VerticalBlurShader = {
  12134. uniforms: {
  12135. tDiffuse: {
  12136. type: "t",
  12137. value: null
  12138. },
  12139. v: {
  12140. type: "f",
  12141. value: 1 / 512
  12142. }
  12143. },
  12144. vertexShader: ["varying vec2 vUv;", "void main() {", "vUv = uv;", "gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );", "}"].join("\n"),
  12145. 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")
  12146. }
  12147. }
  12148. , {
  12149. three: 217
  12150. }],
  12151. 103: [function(e, t, i) {
  12152. "use strict";
  12153. var n = e("three");
  12154. !function() {
  12155. if ("performance"in window == 0 && (window.performance = {}),
  12156. "now"in window.performance == 0) {
  12157. var e = Date.now();
  12158. performance.timing && performance.timing.navigationStart && (e = performance.timing.navigationStart),
  12159. window.performance.now = function() {
  12160. return Date.now() - e
  12161. }
  12162. }
  12163. }(),
  12164. n.WebGLRenderer.prototype.paramThreeToGL = function(e) {
  12165. var t, i = this.extensions, r = this.context;
  12166. if (e === n.RepeatWrapping)
  12167. return r.REPEAT;
  12168. if (e === n.ClampToEdgeWrapping)
  12169. return r.CLAMP_TO_EDGE;
  12170. if (e === n.MirroredRepeatWrapping)
  12171. return r.MIRRORED_REPEAT;
  12172. if (e === n.NearestFilter)
  12173. return r.NEAREST;
  12174. if (e === n.NearestMipMapNearestFilter)
  12175. return r.NEAREST_MIPMAP_NEAREST;
  12176. if (e === n.NearestMipMapLinearFilter)
  12177. return r.NEAREST_MIPMAP_LINEAR;
  12178. if (e === n.LinearFilter)
  12179. return r.LINEAR;
  12180. if (e === n.LinearMipMapNearestFilter)
  12181. return r.LINEAR_MIPMAP_NEAREST;
  12182. if (e === n.LinearMipMapLinearFilter)
  12183. return r.LINEAR_MIPMAP_LINEAR;
  12184. if (e === n.UnsignedByteType)
  12185. return r.UNSIGNED_BYTE;
  12186. if (e === n.UnsignedShort4444Type)
  12187. return r.UNSIGNED_SHORT_4_4_4_4;
  12188. if (e === n.UnsignedShort5551Type)
  12189. return r.UNSIGNED_SHORT_5_5_5_1;
  12190. if (e === n.UnsignedShort565Type)
  12191. return r.UNSIGNED_SHORT_5_6_5;
  12192. if (e === n.ByteType)
  12193. return r.BYTE;
  12194. if (e === n.ShortType)
  12195. return r.SHORT;
  12196. if (e === n.UnsignedShortType)
  12197. return r.UNSIGNED_SHORT;
  12198. if (e === n.IntType)
  12199. return r.INT;
  12200. if (e === n.UnsignedIntType)
  12201. return r.UNSIGNED_INT;
  12202. if (e === n.FloatType)
  12203. return r.FLOAT;
  12204. if (t = i.get("OES_texture_half_float"),
  12205. null !== t && e === n.HalfFloatType)
  12206. return t.HALF_FLOAT_OES;
  12207. if (e === n.AlphaFormat)
  12208. return r.ALPHA;
  12209. if (e === n.RGBFormat)
  12210. return r.RGB;
  12211. if (e === n.RGBAFormat)
  12212. return r.RGBA;
  12213. if (e === n.LuminanceFormat)
  12214. return r.LUMINANCE;
  12215. if (e === n.LuminanceAlphaFormat)
  12216. return r.LUMINANCE_ALPHA;
  12217. if (e === n.AddEquation)
  12218. return r.FUNC_ADD;
  12219. if (e === n.SubtractEquation)
  12220. return r.FUNC_SUBTRACT;
  12221. if (e === n.ReverseSubtractEquation)
  12222. return r.FUNC_REVERSE_SUBTRACT;
  12223. if (e === n.ZeroFactor)
  12224. return r.ZERO;
  12225. if (e === n.OneFactor)
  12226. return r.ONE;
  12227. if (e === n.SrcColorFactor)
  12228. return r.SRC_COLOR;
  12229. if (e === n.OneMinusSrcColorFactor)
  12230. return r.ONE_MINUS_SRC_COLOR;
  12231. if (e === n.SrcAlphaFactor)
  12232. return r.SRC_ALPHA;
  12233. if (e === n.OneMinusSrcAlphaFactor)
  12234. return r.ONE_MINUS_SRC_ALPHA;
  12235. if (e === n.DstAlphaFactor)
  12236. return r.DST_ALPHA;
  12237. if (e === n.OneMinusDstAlphaFactor)
  12238. return r.ONE_MINUS_DST_ALPHA;
  12239. if (e === n.DstColorFactor)
  12240. return r.DST_COLOR;
  12241. if (e === n.OneMinusDstColorFactor)
  12242. return r.ONE_MINUS_DST_COLOR;
  12243. if (e === n.SrcAlphaSaturateFactor)
  12244. return r.SRC_ALPHA_SATURATE;
  12245. if (t = i.get("WEBGL_compressed_texture_s3tc"),
  12246. null !== t) {
  12247. if (e === n.RGB_S3TC_DXT1_Format)
  12248. return t.COMPRESSED_RGB_S3TC_DXT1_EXT;
  12249. if (e === n.RGBA_S3TC_DXT1_Format)
  12250. return t.COMPRESSED_RGBA_S3TC_DXT1_EXT;
  12251. if (e === n.RGBA_S3TC_DXT3_Format)
  12252. return t.COMPRESSED_RGBA_S3TC_DXT3_EXT;
  12253. if (e === n.RGBA_S3TC_DXT5_Format)
  12254. return t.COMPRESSED_RGBA_S3TC_DXT5_EXT
  12255. }
  12256. if (t = i.get("WEBGL_compressed_texture_pvrtc"),
  12257. null !== t) {
  12258. if (e === n.RGB_PVRTC_4BPPV1_Format)
  12259. return t.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;
  12260. if (e === n.RGB_PVRTC_2BPPV1_Format)
  12261. return t.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;
  12262. if (e === n.RGBA_PVRTC_4BPPV1_Format)
  12263. return t.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;
  12264. if (e === n.RGBA_PVRTC_2BPPV1_Format)
  12265. return t.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG
  12266. }
  12267. if (t = i.get("WEBGL_compressed_texture_etc1"),
  12268. null !== t && e === n.RGB_ETC1_Format)
  12269. return t.COMPRESSED_RGB_ETC1_WEBGL;
  12270. if (t = i.get("EXT_blend_minmax"),
  12271. null !== t) {
  12272. if (e === n.MinEquation)
  12273. return t.MIN_EXT;
  12274. if (e === n.MaxEquation)
  12275. return t.MAX_EXT
  12276. }
  12277. return 0
  12278. }
  12279. ,
  12280. n.WebGLState = function(e, t, i) {
  12281. var r = this
  12282. , o = new n.Vector4
  12283. , a = e.getParameter(e.MAX_VERTEX_ATTRIBS)
  12284. , s = new Uint8Array(a)
  12285. , l = new Uint8Array(a)
  12286. , c = new Uint8Array(a)
  12287. , h = {}
  12288. , u = null
  12289. , d = null
  12290. , p = null
  12291. , f = null
  12292. , g = null
  12293. , m = null
  12294. , v = null
  12295. , A = null
  12296. , y = !1
  12297. , C = null
  12298. , I = null
  12299. , E = null
  12300. , b = null
  12301. , w = null
  12302. , _ = null
  12303. , T = null
  12304. , x = null
  12305. , S = null
  12306. , M = null
  12307. , R = null
  12308. , P = null
  12309. , O = null
  12310. , L = null
  12311. , D = null
  12312. , N = e.getParameter(e.MAX_TEXTURE_IMAGE_UNITS)
  12313. , B = void 0
  12314. , F = {}
  12315. , V = new n.Vector4
  12316. , U = null
  12317. , k = null
  12318. , H = new n.Vector4
  12319. , G = new n.Vector4;
  12320. this.init = function() {
  12321. this.clearColor(0, 0, 0, 1),
  12322. this.clearDepth(1),
  12323. this.clearStencil(0),
  12324. this.enable(e.DEPTH_TEST),
  12325. e.depthFunc(e.LEQUAL),
  12326. e.frontFace(e.CCW),
  12327. e.cullFace(e.BACK),
  12328. this.enable(e.CULL_FACE),
  12329. this.enable(e.BLEND),
  12330. e.blendEquation(e.FUNC_ADD),
  12331. e.blendFunc(e.SRC_ALPHA, e.ONE_MINUS_SRC_ALPHA)
  12332. }
  12333. ,
  12334. this.initAttributes = function() {
  12335. for (var e = 0, t = s.length; e < t; e++)
  12336. s[e] = 0
  12337. }
  12338. ,
  12339. this.enableAttribute = function(i) {
  12340. if (s[i] = 1,
  12341. 0 === l[i] && (e.enableVertexAttribArray(i),
  12342. l[i] = 1),
  12343. 0 !== c[i]) {
  12344. var n = t.get("ANGLE_instanced_arrays");
  12345. n.vertexAttribDivisorANGLE(i, 0),
  12346. c[i] = 0
  12347. }
  12348. }
  12349. ,
  12350. this.enableAttributeAndDivisor = function(t, i, n) {
  12351. s[t] = 1,
  12352. 0 === l[t] && (e.enableVertexAttribArray(t),
  12353. l[t] = 1),
  12354. c[t] !== i && (n.vertexAttribDivisorANGLE(t, i),
  12355. c[t] = i)
  12356. }
  12357. ,
  12358. this.disableUnusedAttributes = function() {
  12359. for (var t = 0, i = l.length; t < i; t++)
  12360. l[t] !== s[t] && (e.disableVertexAttribArray(t),
  12361. l[t] = 0)
  12362. }
  12363. ,
  12364. this.enable = function(t) {
  12365. h[t] !== !0 && (e.enable(t),
  12366. h[t] = !0)
  12367. }
  12368. ,
  12369. this.disable = function(t) {
  12370. h[t] !== !1 && (e.disable(t),
  12371. h[t] = !1)
  12372. }
  12373. ,
  12374. this.getCompressedTextureFormats = function() {
  12375. if (null === u && (u = [],
  12376. t.get("WEBGL_compressed_texture_pvrtc") || t.get("WEBGL_compressed_texture_s3tc") || t.get("WEBGL_compressed_texture_etc1")))
  12377. for (var i = e.getParameter(e.COMPRESSED_TEXTURE_FORMATS), n = 0; n < i.length; n++)
  12378. u.push(i[n]);
  12379. return u
  12380. }
  12381. ,
  12382. this.setBlending = function(t, r, o, a, s, l, c, h) {
  12383. t === n.NoBlending ? this.disable(e.BLEND) : this.enable(e.BLEND),
  12384. t === d && h === y || (t === n.AdditiveBlending ? h ? (e.blendEquationSeparate(e.FUNC_ADD, e.FUNC_ADD),
  12385. e.blendFuncSeparate(e.ONE, e.ONE, e.ONE, e.ONE)) : (e.blendEquation(e.FUNC_ADD),
  12386. e.blendFunc(e.SRC_ALPHA, e.ONE)) : t === n.SubtractiveBlending ? h ? (e.blendEquationSeparate(e.FUNC_ADD, e.FUNC_ADD),
  12387. e.blendFuncSeparate(e.ZERO, e.ZERO, e.ONE_MINUS_SRC_COLOR, e.ONE_MINUS_SRC_ALPHA)) : (e.blendEquation(e.FUNC_ADD),
  12388. e.blendFunc(e.ZERO, e.ONE_MINUS_SRC_COLOR)) : t === n.MultiplyBlending ? h ? (e.blendEquationSeparate(e.FUNC_ADD, e.FUNC_ADD),
  12389. e.blendFuncSeparate(e.ZERO, e.ZERO, e.SRC_COLOR, e.SRC_ALPHA)) : (e.blendEquation(e.FUNC_ADD),
  12390. e.blendFunc(e.ZERO, e.SRC_COLOR)) : h ? (e.blendEquationSeparate(e.FUNC_ADD, e.FUNC_ADD),
  12391. e.blendFuncSeparate(e.ONE, e.ONE_MINUS_SRC_ALPHA, e.ONE, e.ONE_MINUS_SRC_ALPHA)) : (e.blendEquationSeparate(e.FUNC_ADD, e.FUNC_ADD),
  12392. e.blendFuncSeparate(e.SRC_ALPHA, e.ONE_MINUS_SRC_ALPHA, e.ONE, e.ONE_MINUS_SRC_ALPHA)),
  12393. d = t,
  12394. y = h),
  12395. t === n.CustomBlending ? (s = s || r,
  12396. l = l || o,
  12397. c = c || a,
  12398. r === p && s === m || (e.blendEquationSeparate(i(r), i(s)),
  12399. p = r,
  12400. m = s),
  12401. o === f && a === g && l === v && c === A || (e.blendFuncSeparate(i(o), i(a), i(l), i(c)),
  12402. f = o,
  12403. g = a,
  12404. v = l,
  12405. A = c)) : (p = null,
  12406. f = null,
  12407. g = null,
  12408. m = null,
  12409. v = null,
  12410. A = null)
  12411. }
  12412. ,
  12413. this.setDepthFunc = function(t) {
  12414. if (C !== t) {
  12415. if (t)
  12416. switch (t) {
  12417. case n.NeverDepth:
  12418. e.depthFunc(e.NEVER);
  12419. break;
  12420. case n.AlwaysDepth:
  12421. e.depthFunc(e.ALWAYS);
  12422. break;
  12423. case n.LessDepth:
  12424. e.depthFunc(e.LESS);
  12425. break;
  12426. case n.LessEqualDepth:
  12427. e.depthFunc(e.LEQUAL);
  12428. break;
  12429. case n.EqualDepth:
  12430. e.depthFunc(e.EQUAL);
  12431. break;
  12432. case n.GreaterEqualDepth:
  12433. e.depthFunc(e.GEQUAL);
  12434. break;
  12435. case n.GreaterDepth:
  12436. e.depthFunc(e.GREATER);
  12437. break;
  12438. case n.NotEqualDepth:
  12439. e.depthFunc(e.NOTEQUAL);
  12440. break;
  12441. default:
  12442. e.depthFunc(e.LEQUAL)
  12443. }
  12444. else
  12445. e.depthFunc(e.LEQUAL);
  12446. C = t
  12447. }
  12448. }
  12449. ,
  12450. this.setDepthTest = function(t) {
  12451. t ? this.enable(e.DEPTH_TEST) : this.disable(e.DEPTH_TEST)
  12452. }
  12453. ,
  12454. this.setDepthWrite = function(t) {
  12455. I !== t && (e.depthMask(t),
  12456. I = t)
  12457. }
  12458. ,
  12459. this.setColorWrite = function(t) {
  12460. E !== t && (e.colorMask(t, t, t, t),
  12461. E = t)
  12462. }
  12463. ,
  12464. this.setStencilFunc = function(t, i, n) {
  12465. w === t && _ === i && T === n || (e.stencilFunc(t, i, n),
  12466. w = t,
  12467. _ = i,
  12468. T = n)
  12469. }
  12470. ,
  12471. this.setStencilOp = function(t, i, n) {
  12472. x === t && S === i && M === n || (e.stencilOp(t, i, n),
  12473. x = t,
  12474. S = i,
  12475. M = n)
  12476. }
  12477. ,
  12478. this.setStencilTest = function(t) {
  12479. t ? this.enable(e.STENCIL_TEST) : this.disable(e.STENCIL_TEST)
  12480. }
  12481. ,
  12482. this.setStencilWrite = function(t) {
  12483. b !== t && (e.stencilMask(t),
  12484. b = t)
  12485. }
  12486. ,
  12487. this.setFlipSided = function(t) {
  12488. R !== t && (t ? e.frontFace(e.CW) : e.frontFace(e.CCW),
  12489. R = t)
  12490. }
  12491. ,
  12492. this.setLineWidth = function(t) {
  12493. t !== P && (e.lineWidth(t),
  12494. P = t)
  12495. }
  12496. ,
  12497. this.setPolygonOffset = function(t, i, n) {
  12498. t ? this.enable(e.POLYGON_OFFSET_FILL) : this.disable(e.POLYGON_OFFSET_FILL),
  12499. !t || O === i && L === n || (e.polygonOffset(i, n),
  12500. O = i,
  12501. L = n)
  12502. }
  12503. ,
  12504. this.getScissorTest = function() {
  12505. return D
  12506. }
  12507. ,
  12508. this.setScissorTest = function(t) {
  12509. D = t,
  12510. t ? this.enable(e.SCISSOR_TEST) : this.disable(e.SCISSOR_TEST)
  12511. }
  12512. ,
  12513. this.activeTexture = function(t) {
  12514. void 0 === t && (t = e.TEXTURE0 + N - 1),
  12515. B !== t && (e.activeTexture(t),
  12516. B = t)
  12517. }
  12518. ,
  12519. this.bindTexture = function(t, i) {
  12520. void 0 === B && r.activeTexture();
  12521. var n = F[B];
  12522. void 0 === n && (n = {
  12523. type: void 0,
  12524. texture: void 0
  12525. },
  12526. F[B] = n),
  12527. n.type === t && n.texture === i || (e.bindTexture(t, i),
  12528. n.type = t,
  12529. n.texture = i)
  12530. }
  12531. ,
  12532. this.compressedTexImage2D = function() {
  12533. try {
  12534. e.compressedTexImage2D.apply(e, arguments)
  12535. } catch (e) {
  12536. console.error(e)
  12537. }
  12538. }
  12539. ,
  12540. this.texImage2D = function() {
  12541. try {
  12542. e.texImage2D.apply(e, arguments)
  12543. } catch (e) {
  12544. console.error(e)
  12545. }
  12546. }
  12547. ,
  12548. this.clearColor = function(t, i, n, r) {
  12549. o.set(t, i, n, r),
  12550. V.equals(o) === !1 && (e.clearColor(t, i, n, r),
  12551. V.copy(o))
  12552. }
  12553. ,
  12554. this.clearDepth = function(t) {
  12555. U !== t && (e.clearDepth(t),
  12556. U = t)
  12557. }
  12558. ,
  12559. this.clearStencil = function(t) {
  12560. k !== t && (e.clearStencil(t),
  12561. k = t)
  12562. }
  12563. ,
  12564. this.scissor = function(t) {
  12565. H.equals(t) === !1 && (e.scissor(t.x, t.y, t.z, t.w),
  12566. H.copy(t))
  12567. }
  12568. ,
  12569. this.viewport = function(t) {
  12570. G.equals(t) === !1 && (e.viewport(t.x, t.y, t.z, t.w),
  12571. G.copy(t))
  12572. }
  12573. ,
  12574. this.reset = function() {
  12575. for (var t = 0; t < l.length; t++)
  12576. 1 === l[t] && (e.disableVertexAttribArray(t),
  12577. l[t] = 0);
  12578. h = {},
  12579. u = null,
  12580. B = void 0,
  12581. F = {},
  12582. d = null,
  12583. E = null,
  12584. I = null,
  12585. b = null,
  12586. R = null
  12587. }
  12588. }
  12589. }
  12590. , {
  12591. three: 217
  12592. }],
  12593. 104: [function(e, t, i) {
  12594. (function(i, n) {
  12595. "use strict";
  12596. function r(e) {
  12597. this.urls = e;
  12598. var t = i("bWVzc2FnZSBiaW5hcnlfbWVzaCB7CglyZXBlYXRlZCBjaHVua19zaW1wbGUgY2h1bmsgPSAxOwoJcmVwZWF0ZWQgY2h1bmtfcXVhbnRpemVkIHF1YW50aXplZF9jaHVuayA9IDI7Cn0KCi8vIERlZmluaXRpb24gb2YgdmVydGljZXM6IDNEIGNvb3JkaW5hdGVzLCBhbmQgMkQgdGV4dHVyZSBjb29yZGluYXRlcy4KbWVzc2FnZSB2ZXJ0aWNlc19zaW1wbGUgewoJcmVwZWF0ZWQgZmxvYXQgeHl6ID0gMSBbcGFja2VkPXRydWVdOyAgLy8geF8wLHlfMCx6XzAsIHhfMSx5XzEsel8xLCAuLi4KCXJlcGVhdGVkIGZsb2F0IHV2ID0gMiBbcGFja2VkPXRydWVdOyAgLy8gdV8wLHZfMCwgdV8xLHZfMSwgLi4uCn0KCi8vIEluZGV4ZXMgb2YgdmVydGljZXMgb2YgZmFjZXMKbWVzc2FnZSBmYWNlc19zaW1wbGUgewoJcmVwZWF0ZWQgdWludDMyIGZhY2VzID0gMSBbcGFja2VkPXRydWVdOyAvLyBpMDAsaTAxLGkwMiwgaTEwLGkxMSxpMTIsIC4uLgp9CgovLyBBIHNpbXBseSBlbmNvZGVkIGNodW5rLgovLyBUT0RPOiBhZGQgY2h1bmsgcHJvcGVyaXRlcyAoc3VjaCBhcyAicmVmbGVjdGl2ZSIpCm1lc3NhZ2UgY2h1bmtfc2ltcGxlIHsKCW9wdGlvbmFsIHZlcnRpY2VzX3NpbXBsZSB2ZXJ0aWNlcyA9IDE7CglvcHRpb25hbCBmYWNlc19zaW1wbGUgZmFjZXMgPSAyOwoJb3B0aW9uYWwgc3RyaW5nIGNodW5rX25hbWUgPSAzOwoJb3B0aW9uYWwgc3RyaW5nIG1hdGVyaWFsX25hbWUgPSA0Owp9CgovLyBRdWFudGl6ZWQgdmVyc2lvbnMgZm9sbG93OgptZXNzYWdlIHZlcnRpY2VzX3F1YW50aXplZCB7CglvcHRpb25hbCBmbG9hdCBxdWFudGl6YXRpb24gPSAxOwoJcmVwZWF0ZWQgZmxvYXQgdHJhbnNsYXRpb24gPSAyOwoJcmVwZWF0ZWQgc2ludDMyIHggPSAzIFtwYWNrZWQ9dHJ1ZV07CglyZXBlYXRlZCBzaW50MzIgeSA9IDQgW3BhY2tlZD10cnVlXTsKCXJlcGVhdGVkIHNpbnQzMiB6ID0gNSBbcGFja2VkPXRydWVdOwp9CgptZXNzYWdlIHV2X3F1YW50aXplZCB7CglvcHRpb25hbCBzdHJpbmcgbmFtZSA9IDE7CglvcHRpb25hbCBmbG9hdCBxdWFudGl6YXRpb24gPSAyOwoJcmVwZWF0ZWQgc2ludDMyIHUgPSAzIFtwYWNrZWQ9dHJ1ZV07CglyZXBlYXRlZCBzaW50MzIgdiA9IDQgW3BhY2tlZD10cnVlXTsKfQoKLy8gSW5kZXhlcyBvZiB2ZXJ0aWNlcyBvZiBmYWNlcwptZXNzYWdlIGZhY2VzX2NvbXByZXNzZWQgewoJcmVwZWF0ZWQgc2ludDMyIGZhY2VzID0gMSBbcGFja2VkPXRydWVdOyAvLyBpMDAsaTAxLGkwMiwgaTEwLGkxMSxpMTIsIC4uLgp9CgptZXNzYWdlIGNodW5rX3F1YW50aXplZCB7CglvcHRpb25hbCBzdHJpbmcgY2h1bmtfbmFtZSA9IDE7CglvcHRpb25hbCBzdHJpbmcgbWF0ZXJpYWxfbmFtZSA9IDI7CglvcHRpb25hbCB2ZXJ0aWNlc19xdWFudGl6ZWQgdmVydGljZXMgPSAzOwoJcmVwZWF0ZWQgdXZfcXVhbnRpemVkIHV2cyA9IDQ7CglvcHRpb25hbCBmYWNlc19zaW1wbGUgZmFjZXMgPSA1Owp9Cg==", "base64");
  12599. this.builder = a.loadProto(t),
  12600. this.decoder = this.builder.build("binary_mesh")
  12601. }
  12602. var o = e("three")
  12603. , a = e("protobufjs")
  12604. , s = e("../util/logger")
  12605. , l = (e("../util/common"),
  12606. e("../util/ajax"))
  12607. , c = e("../objects/Chunk")
  12608. , h = new s(n);
  12609. r.prototype = {
  12610. constructor: r,
  12611. load: function(e, t, i, n) {
  12612. return h.time("download"),
  12613. l.get(e, {
  12614. responseType: "arraybuffer"
  12615. }).done(function(r) {
  12616. h.timeEnd("download"),
  12617. this.parse(r, e, t, i, n)
  12618. }
  12619. .bind(this)).fail(n)
  12620. },
  12621. parse: function(e, t, i, n, r) {
  12622. var o = this.readProtobuf(e);
  12623. if (!o)
  12624. return r();
  12625. try {
  12626. h.time("convert to webgl"),
  12627. this.convertProtobufToSceneObject(o, t, i, n, r),
  12628. h.timeEnd("convert to webgl")
  12629. } catch (e) {
  12630. return h.error("failed parsing .dam"),
  12631. h.error(e.message),
  12632. r()
  12633. }
  12634. },
  12635. readProtobuf: function(e) {
  12636. var t;
  12637. try {
  12638. h.time("parse proto"),
  12639. t = this.decoder.decode(e),
  12640. h.timeEnd("parse proto")
  12641. } catch (e) {
  12642. return h.error("failed parsing proto for .dam"),
  12643. h.error(e.message),
  12644. null
  12645. }
  12646. return t
  12647. },
  12648. convertProtobufToSceneObject: function(e, t, i, n, r) {
  12649. function a(e) {
  12650. var i = new o.BufferGeometry;
  12651. return i.addAttribute("position", new o.BufferAttribute(new Float32Array(e.vertices.xyz,0,3),3)),
  12652. e.vertices.uv.length > 0 && i.addAttribute("uv", new o.BufferAttribute(new Float32Array(e.vertices.uv,0,2),2)),
  12653. i.setIndex(new o.BufferAttribute(new Uint32Array(e.faces.faces,0,1),1)),
  12654. i.applyMatrix(s),
  12655. i.computeBoundingBox(),
  12656. new c({
  12657. geometry: i,
  12658. textureName: e.material_name,
  12659. name: e.chunk_name,
  12660. meshUrl: t
  12661. })
  12662. }
  12663. if (0 === e.chunk.length)
  12664. return h.warn("No chunks in damfile..."),
  12665. i([]);
  12666. var s = new o.Matrix4;
  12667. s.set(1, 0, 0, 0, 0, 0, 1, 0, 0, -1, 0, 0, 0, 0, 0, 1);
  12668. var l = e.chunk.map(a);
  12669. return l ? i(l) : (h.error(".dam protobuf came out with no chunks..."),
  12670. r())
  12671. }
  12672. },
  12673. t.exports = r
  12674. }
  12675. ).call(this, e("buffer").Buffer, "/js/loaders/DamLoader.js")
  12676. }
  12677. , {
  12678. "../objects/Chunk": 144,
  12679. "../util/ajax": 181,
  12680. "../util/common": 185,
  12681. "../util/logger": 189,
  12682. buffer: 198,
  12683. protobufjs: 214,
  12684. three: 217
  12685. }],
  12686. 105: [function(e, t, i) {
  12687. (function(i) {
  12688. "use strict";
  12689. var n = (e("three"),
  12690. e("../settings"),
  12691. e("../util/browser"),
  12692. e("./DamLoader"))
  12693. , r = e("../util/logger")
  12694. , o = (e("../ab"),
  12695. new r(i));
  12696. t.exports = {
  12697. getLoaders: function() {
  12698. return [["_50k", ".dam", n], ["", ".dam", n]]
  12699. },
  12700. load: function(e, t, i, n, r, a) {
  12701. var s = this.getLoaders();
  12702. a = a || 0;
  12703. var l = s[a];
  12704. if (!l)
  12705. return void (r && r("No suitable model file found..."));
  12706. var c = l[0]
  12707. , h = l[1]
  12708. , u = new l[2](t)
  12709. , d = t.get(e + c + h);
  12710. d ? (o.debug("Trying " + c + h),
  12711. u.load(d, i, n, function() {
  12712. this.load(e, t, i, n, r, ++a)
  12713. }
  12714. .bind(this))) : (o.debug("Skipping " + h + ", not available"),
  12715. this.load(e, t, i, n, r, ++a))
  12716. }
  12717. }
  12718. }
  12719. ).call(this, "/js/loaders/ModelLoader.js")
  12720. }
  12721. , {
  12722. "../ab": 3,
  12723. "../settings": 166,
  12724. "../util/browser": 182,
  12725. "../util/logger": 189,
  12726. "./DamLoader": 104,
  12727. three: 217
  12728. }],
  12729. 106: [function(e, t, i) {
  12730. (function(i) {
  12731. "use strict";
  12732. var n = e("../util/common")
  12733. , r = e("../util/texture")
  12734. , o = e("../util/browser")
  12735. , a = e("../util/logger")
  12736. , s = e("../settings")
  12737. , l = new a(i);
  12738. t.exports = {
  12739. load: function(e, t) {
  12740. function i(e, i) {
  12741. e || (t.push(i),
  12742. p++,
  12743. d.notify(p, a),
  12744. p === a && d.resolve())
  12745. }
  12746. if (!e.chunks[0] || !e.chunks[0].meshUrl)
  12747. return $.when();
  12748. var a = n.countUnique(e.chunks.map(function(e) {
  12749. return e.textureName
  12750. }))
  12751. , c = e.chunks[0].meshUrl.indexOf("_50k") !== -1 ? "_50k" : ""
  12752. , h = "_50k" === c ? "high" : "low";
  12753. s.minimalMemoryMode && "high" === h && (o.detectSamsungS6() ? (l.warn("Galaxy S6 cannot handle large textures, turning down quality."),
  12754. h = "low") : a > s.maxMobileTextures && (l.warn("Model probably too large for mobile, turning down quality."),
  12755. h = "low"));
  12756. var u = e.data.job.uuid + c + "_texture_jpg_" + h + "/"
  12757. , d = $.Deferred()
  12758. , p = 0;
  12759. return e.chunks.forEach(function(t) {
  12760. if (!t.material.map && t.textureName) {
  12761. var n = e.urls.get(u + t.textureName);
  12762. t.setTextureMap(r.load(n, i.bind(this, r.isLoaded(n))))
  12763. }
  12764. }),
  12765. d.promise()
  12766. }
  12767. }
  12768. }
  12769. ).call(this, "/js/loaders/ModelTextureLoader.js")
  12770. }
  12771. , {
  12772. "../settings": 166,
  12773. "../util/browser": 182,
  12774. "../util/common": 185,
  12775. "../util/logger": 189,
  12776. "../util/texture": 194
  12777. }],
  12778. 107: [function(e, t, i) {
  12779. (function(i, n) {
  12780. "use strict";
  12781. function r(e) {
  12782. this.model = e,
  12783. this.modelDataPath = this.model.urls.get("vision.modeldata")+"?m="+new Date().getTime(),
  12784. this.sweepLocationsPath = this.model.urls.get("sweep_locations.csv");
  12785. var t = i("Ly8gUHJvdG9jb2wgQnVmZmVyIGZvciBwdWNrIHZpc2liaWxpdHkgYW5kIHJlbGF0ZWQgZGF0YQovLwovLyBUbyBkdW1wIG91dCBhIGJpbnJheSBtYW5pZmVzdCBpbiB0ZXh0IGZvcm1hdCwgeW91IGNhbiB1c2UgcHJvdG9jIGRpcmVjdGx5OgovLyAgIHByb3RvYyAtLXByb3RvX3BhdGggfi9kZXYvbXBfdmlzaW9uLyAgLS1kZWNvZGU9ZW9zLnN0b3JhZ2UuVmlzaW9uTW9kZWxkYXRhIH4vZGV2L21wX3Zpc2lvbi9lb3Mvc3RvcmFnZS92aXNpb25fbW9kZWxkYXRhLnByb3RvIDwgdmlzaW9uLm1vZGVsZGF0YQoKLy8gcGFja2FnZSBlb3Muc3RvcmFnZTsKCi8vIGltcG9ydCAiZW9zL2luZnJhL2NvbW1vbi5wcm90byI7Ci8vIFRoZSBmb2xsb3dpbmcgd2VyZSBtYW51YWxseSBleHRyYWN0ZWQgaGVyZSwgSlMgZG9lcyBub3QgbGlrZSBwcm90b2J1ZiBpbXBvcnRzCgptZXNzYWdlIEFmZmluZTNmIHsKCW9wdGlvbmFsIFF1YXRlcm5pb25mIHJvdGF0aW9uID0gMTsKCW9wdGlvbmFsIFZlY3RvcjNmIHRyYW5zbGF0aW9uID0gMjsKfQoKbWVzc2FnZSBRdWF0ZXJuaW9uZiB7CglvcHRpb25hbCBmbG9hdCB3ID0gMTsKCW9wdGlvbmFsIGZsb2F0IHggPSAyOwoJb3B0aW9uYWwgZmxvYXQgeSA9IDM7CglvcHRpb25hbCBmbG9hdCB6ID0gNDsKfQoKbWVzc2FnZSBWZWN0b3IzZiB7CglvcHRpb25hbCBmbG9hdCB4ID0gMTsKCW9wdGlvbmFsIGZsb2F0IHkgPSAyOwoJb3B0aW9uYWwgZmxvYXQgeiA9IDM7Cn0KCi8vCi8vIE9uZSBzd2VlcCAvIHBhbm8KLy8KbWVzc2FnZSBTd2VlcExvY2F0aW9uIHsKCW9wdGlvbmFsIGJ5dGVzIHV1aWQgPSAxOyAgLyogdXVpZCAqLwoJb3B0aW9uYWwgQWZmaW5lM2YgcG9zZSA9IDI7ICAvKiBjYW1lcmEgcG9zZSAoeCwgeSx6KSBpbiBtZXRlciBhbmQgYSBxdWF0ZXJuaW9uKi8KCW9wdGlvbmFsIFZlY3RvcjNmIHB1Y2sgPSAzOyAgLyogcHVjayBsb2NhdGlvbiAtIHggYW55IGlzIGdlbmVyYWxseSB0aGUgc2FtZSBhcyBwb3NlLCB6IGlzIHRoZSBoZWlnaHQgb2YgdGhlIGNsb3Nlc3QgZmxvb3IgdW5kZXIgdGhlIGNhbWVyYSAqLwoJb3B0aW9uYWwgaW50MzIgZ3JvdXAgPSA0OyAgLyogZmxvb3IgaW5kZXggKi8KCW9wdGlvbmFsIGludDMyIHN1Ymdyb3VwID0gNTsgIC8qIHJvb20gaW5kZXggKi8KCXJlcGVhdGVkIGludDMyIHZpc2libGVzID0gNjsgIC8qIGxpc3Qgb2YgaW5kaWNlcyB0byBhbGwgcHVja3MgdmlzaWJsZSBmcm9tIHRoaXMgcHVjayAqLwoJcmVwZWF0ZWQgZmxvYXQgc2NvcmVzID0gNzsgLyogdXNlZCBhcyBwYXJ0IG9mIHNjb3JpbmcgZnVuY3Rpb24gZm9yIGRldGVybWluaW5nIHdoaWNoIHB1Y2sgdG8gZ28gdG8gbmV4dCAqLwogIG9wdGlvbmFsIHN0cmluZyBzd2VlcF9uYW1lID0gODsKCiAgLy8gV2l0aCBvdXRkb29yIHBhbm9zLCB3ZSBoYXZlIGEgY291cGxlIG9mIGRpZmZlcmVudCBzaXR1YXRpb25zIGZvciBhbGlnbm1lbnQuIFRoZSBjb21tb24KICAvLyBjYXNlIGlzIHRoYXQgdGhlIHBhbm8gYWxpZ25lZCBub3JtYWxseS4gSXQgY291bGQgYWxzbyBoYXZlIGJlZW4gcGxhY2VkIG1hbnVhbGx5IGluCiAgLy8gQ2FwdHVyZUFwcCBvciBXb3Jrc2hvcCwgb3IgbGVmdCB1bmFsaWduZWQgZm9yIGhpZ2hsaWdodC1yZWVsIHZpZXdpbmcuCiAgZW51bSBBbGlnbm1lbnRUeXBlCiAgewogICAgICBVTktOT1dOID0gMDsKICAgICAgQUxJR05FRCA9IDE7CiAgICAgIFVOQUxJR05FRCA9IDI7CiAgICAgIE1BTlVBTExZX1BMQUNFRCA9IDM7CiAgfQogIG9wdGlvbmFsIEFsaWdubWVudFR5cGUgYWxpZ25tZW50X3R5cGUgPSA5IFtkZWZhdWx0ID0gQUxJR05FRF07Cn0KCm1lc3NhZ2UgU3ViZ3JvdXBJbmZvIHsKCW9wdGlvbmFsIGludDMyIHN1Ymdyb3VwID0gMTsKCW9wdGlvbmFsIGZsb2F0IGFyZWEgPSAyOyAvKiBmbG9vciBhcmVhIGluIG1eMiAoc3F1YXJlIG1ldGVyYWdlKSAqLwp9CgovKiBBbGwgcHVja3MgaW4gYSBtb2RlbC4gUHVja3MgYXJlIHN0b3JlZCBpbiBzY2FubmluZyBvcmRlci4gKi8KbWVzc2FnZSBWaXNpb25Nb2RlbGRhdGEgewoJcmVwZWF0ZWQgU3dlZXBMb2NhdGlvbiBzd2VlcExvY2F0aW9ucyA9IDE7CglyZXBlYXRlZCBTdWJncm91cEluZm8gc3ViZ3JvdXBJbmZvcyA9IDI7Cn0K", "base64")
  12786. , n = o.loadProto(t);
  12787. this.decoder = n.build("VisionModeldata")
  12788. }
  12789. var o = e("protobufjs")
  12790. , a = e("../util/ajax")
  12791. , s = (e("../util/common"),
  12792. e("../util/math"))
  12793. , l = e("../util/logger")
  12794. , c = new l(n);
  12795. r.prototype.load = function() {
  12796. return this.modelDataPath ? (c.info("Using vision.modeldata"),
  12797. this.loadVisionModelData()) : this.sweepLocationsPath ? (c.warn("Using sweep_locations.csv"),
  12798. this.loadSweepLocationsCSV()) : (c.warn("No sweep file found"),
  12799. $.when([]))
  12800. }
  12801. ,
  12802. r.prototype.loadVisionModelData = function() {
  12803. return a.get(this.modelDataPath, {
  12804. responseType: "arraybuffer"
  12805. }).then(function(e) {
  12806. var t;
  12807. try {
  12808. t = this.decoder.decode(e)
  12809. } catch (e) {
  12810. return c.warn("Could not decode vision.modeldata, trying sweep_locations.csv"),
  12811. this.loadSweepLocationsCSV()
  12812. }
  12813. var i = t.sweepLocations.map(function(e) {
  12814. return {
  12815. uuid: e.uuid.toUTF8().replace(/-/g, ""),
  12816. position: {
  12817. x: e.pose.translation.x,
  12818. y: e.pose.translation.y,
  12819. z: e.pose.translation.z
  12820. },
  12821. quaternion: {
  12822. x: e.pose.rotation.x,
  12823. y: e.pose.rotation.y,
  12824. z: e.pose.rotation.z,
  12825. w: e.pose.rotation.w
  12826. },
  12827. puck: {
  12828. x: e.puck.x,
  12829. y: e.puck.y,
  12830. z: e.puck.z
  12831. },
  12832. floor: window.sceneFrom == 'kankan' ? e.subgroup : e.group,
  12833. neighbours: e.visibles,
  12834. alignmentType: e.alignment_type
  12835. }
  12836. }).map(function(e) {
  12837. return e.position = s.convertVisionVector(e.position),
  12838. e.quaternion = s.convertVisionQuaternion(e.quaternion),
  12839. e.puck = s.convertVisionVector(e.puck),
  12840. e
  12841. });
  12842. return i.forEach(function(e) {
  12843. e.neighbours = e.neighbours.map(function(e) {
  12844. return i[e].uuid
  12845. })
  12846. }),
  12847. i
  12848. }
  12849. .bind(this), function() {
  12850. return c.warn("Could not load vision.modeldata, trying sweep_locations.csv"),
  12851. this.loadSweepLocationsCSV()
  12852. }
  12853. .bind(this))
  12854. }
  12855. ,
  12856. r.prototype.loadSweepLocationsCSV = function() {
  12857. return a.get(this.sweepLocationsPath).then(function(e) {
  12858. var t = e.split("\n").map(function(e) {
  12859. return e.split(", ")
  12860. }).filter(function(e) {
  12861. return e.length > 1
  12862. }).map(function(e) {
  12863. return {
  12864. uuid: e[0],
  12865. position: {
  12866. x: parseFloat(e[1]),
  12867. y: parseFloat(e[2]),
  12868. z: parseFloat(e[3])
  12869. },
  12870. quaternion: {
  12871. x: parseFloat(e[4]),
  12872. y: parseFloat(e[5]),
  12873. z: parseFloat(e[6]),
  12874. w: parseFloat(e[7])
  12875. }
  12876. }
  12877. }).map(function(e) {
  12878. return e.position = s.convertVisionVector(e.position),
  12879. e.quaternion = s.convertVisionQuaternion(e.quaternion),
  12880. e
  12881. });
  12882. return t
  12883. }).fail(function() {
  12884. c.warn("Could not load sweep_locations.csv, no sweeps loaded.")
  12885. })
  12886. }
  12887. ,
  12888. t.exports = r
  12889. }
  12890. ).call(this, e("buffer").Buffer, "/js/loaders/SweepDataLoader.js")
  12891. }
  12892. , {
  12893. "../util/ajax": 181,
  12894. "../util/common": 185,
  12895. "../util/logger": 189,
  12896. "../util/math": 190,
  12897. buffer: 198,
  12898. protobufjs: 214
  12899. }],
  12900. 108: [function(e, t, i) {
  12901. (function(i) {
  12902. "use strict";
  12903. function n() {
  12904. this.locale = null
  12905. }
  12906. var r = e("../settings")
  12907. , o = e("../util/common")
  12908. , a = e("../util/logger")
  12909. , s = e("../enum/Locale")
  12910. , l = new a(i);
  12911. n.prototype.init = function() {
  12912. var t;
  12913. switch (r.languageTag) {
  12914. case null:
  12915. case "en":
  12916. case s.EN_US:
  12917. this.locale = s.EN_US,
  12918. t = e("./strings-en-US");
  12919. break;
  12920. case "es":
  12921. case s.ES_MX:
  12922. this.locale = s.ES_MX,
  12923. t = e("./strings-es-MX");
  12924. break;
  12925. case "fr":
  12926. case s.FR_FR:
  12927. this.locale = s.FR_FR,
  12928. t = e("./strings-fr-FR");
  12929. break;
  12930. case "de":
  12931. case s.DE_DE:
  12932. this.locale = s.DE_DE,
  12933. t = e("./strings-de-DE");
  12934. break;
  12935. case "ru":
  12936. case s.RU_RU:
  12937. this.locale = s.RU_RU,
  12938. t = e("./strings-ru-RU");
  12939. break;
  12940. case "cn":
  12941. case s.CN_CN:
  12942. this.locale = s.CN_CN,
  12943. t = e("./strings-cn-CN");
  12944. break;
  12945. case "jp":
  12946. case s.JP_JP:
  12947. this.locale = s.JP_JP,
  12948. t = e("./strings-jp-JP");
  12949. break;
  12950. default:
  12951. l.info("Unsupported language tag, defaulting to 'en-US'"),
  12952. this.locale = s.EN_US,
  12953. t = e("./strings-en-US")
  12954. }
  12955. l.info("Using locale '" + this.locale + "'"),
  12956. o.extendObject(this, t)
  12957. }
  12958. ,
  12959. n.prototype.localizeGUI = function() {
  12960. var e = document.querySelector("#gui-parent");
  12961. this.localizeTree(e),
  12962. this.localizeLoadingText()
  12963. }
  12964. ,
  12965. n.prototype.localizeLoadingText = function() {
  12966. // var e = document.querySelector("#loader-cont")
  12967. // , t = e.getAttribute("title");
  12968. // e.removeAttribute("title"),
  12969. // e.setAttribute("data-status", t),
  12970. // e.classList.add(this.locale),
  12971. document.querySelector("#help-dialog").classList.add(this.locale),
  12972. document.querySelector("#interaction-modal").classList.add(this.locale),
  12973. document.querySelector("#gui").classList.add(this.locale);
  12974. }
  12975. ,
  12976. n.prototype.localizeTree = function(e) {
  12977. var t, i, n = /{\[{ ?(\w+) ?}\]}/;
  12978. if (e.nodeType === Node.TEXT_NODE)
  12979. t = e.data.match(n),
  12980. t && (i = t[1],
  12981. e.data = this.localizeText(i) || i);
  12982. else if (e.nodeType === Node.ELEMENT_NODE) {
  12983. var r = e.getAttribute("title");
  12984. r && (t = r.match(n),
  12985. t && (i = t[1],
  12986. e.setAttribute("title", this.localizeText(i) || i)))
  12987. }
  12988. for (e = e.firstChild; e; )
  12989. this.localizeTree(e),
  12990. e = e.nextSibling
  12991. }
  12992. ,
  12993. n.prototype.localizeText = function(t) {
  12994. var i = this[t];
  12995. return i || this.locale === s.EN_US || (l.warn("Localization key '" + t + "' not available for locale '" + this.locale + "', defaulting to English."),
  12996. i = e("./strings-en-US")[t]),
  12997. i || l.warn("Localization key '" + t + "' not available for locale 'en-US'"),
  12998. i
  12999. }
  13000. ,
  13001. t.exports = new n
  13002. }
  13003. ).call(this, "/js/localization/localize.js")
  13004. }
  13005. , {
  13006. "../enum/Locale": 31,
  13007. "../settings": 166,
  13008. "../util/common": 185,
  13009. "../util/logger": 189,
  13010. "./strings-cn-CN": 109,
  13011. "./strings-de-DE": 110,
  13012. "./strings-en-US": 111,
  13013. "./strings-es-MX": 112,
  13014. "./strings-fr-FR": 113,
  13015. "./strings-jp-JP": 114,
  13016. "./strings-ru-RU": 115
  13017. }],
  13018. 109: [function(e, t, i) {
  13019. "use strict";
  13020. t.exports = {
  13021. PAGE_TITLE: "",
  13022. LOADING: "正在加载",
  13023. PRESENTED_BY_CAPS: "呈现者:",
  13024. POWERED_BY: "技术支持:",
  13025. POWERED_BY_CAPS: "技术支持:",
  13026. DESKTOP_SHORT_CTA: "点击一次以探索这个 3D 空间。",
  13027. MOBILE_SHORT_CTA: "点击一次以探索这个 3D 空间。",
  13028. PRESENTED_BY: "呈现者:",
  13029. MORE: "更多 ",
  13030. LESS: "更少 ",
  13031. TAG_CONTENT: "tag™ 内容",
  13032. SHOW: "显示",
  13033. HIDE: "隐藏",
  13034. DOLLHOUSE: "场景屋",
  13035. FLOOR_PLAN: "楼层平面图",
  13036. OPEN_HIGHLIGHTS: "打开精彩片段",
  13037. CLOSE_HIGHLIGHTS: "关闭",
  13038. PREVIOUS: "上一个",
  13039. PLAY: "播放",
  13040. PAUSE: "暂停",
  13041. NEXT: "下一个",
  13042. EXPLORE_3D_SPACE: "探索 3D 空间",
  13043. VIEW_DOLLHOUSE: "观看场景屋",
  13044. SOCIAL_SHARING: "分享这个空间",
  13045. VIEW_IN_VR: "以 VR 观看",
  13046. VIEW_FULLSCREEN: "全屏观看",
  13047. EXIT_FULLSCREEN: " 退出全屏",
  13048. ZOOM_IN: "放大",
  13049. ZOOM_OUT: "缩小",
  13050. FLOOR_NAME: "楼层",
  13051. FLOOR_ALL: "ALL",
  13052. FLOOR_Lang: ["Floor",""],
  13053. TERMS: "条款",
  13054. PORT_TERMS: "port 条款",
  13055. TERMS_OF_USE: "使用条款",
  13056. CLOSE_TERMS: "关闭",
  13057. TERMS_TEXT_FILE: "terms-cn-CN.html",
  13058. TERMS_FAIL: "无法获取条款。请确保您有互联网连接以查看使用条款。",
  13059. WEBVR_FOR_DAYDREAM: "用于 Daydream 视图",
  13060. WEBVR_ENTER_WEBVR: "进入 VR",
  13061. WEBVR_DIFFERENT_HEADSET: "有其他耳机吗?",
  13062. WEBVR_LEARN_MORE: "了解更多",
  13063. WEBVR_VIEW_SPACE: "在 VR 中观看空间",
  13064. WEBVR_DAYDREAM_VIEW: "Daydream 视图",
  13065. WEBVR_DAYDREAM_PHONE: "支持 Daydream 的手机",
  13066. WEBVR_FOR_CARDBOARD: "用于 Google Cardboard",
  13067. WEBVR_VIEW_CARDBOARD: "或在 Google Cardboard 上观看",
  13068. VR_VIEW_SPACE: "在虚拟现实中观看空间",
  13069. VR_LEARN_MORE_CAPS: "了解更多",
  13070. VR_PREVIOUS_CAPS: "上一个’,",
  13071. VR_NEXT_CAPS: "下一个",
  13072. VR_GOT_IT_CAPS: "明白了",
  13073. VR_SHOW_SUPPORTED: "点击以使用 VR 观看空间",
  13074. VR_SHOW_UNSUPPORTED: "很遗憾,您的设备不符合在 VR 中观看空间的最低要求。",
  13075. VR_SHOW_IOS_1: "点击以使用 VR 观看空间",
  13076. VR_SHOW_IOS_2: "需要有 port VR 应用程序和兼容的 iPhone 才能观看",
  13077. VR_WHAT_YOU_NEED: "关于...您需要什么",
  13078. VR_NEED_CARDBOARD: "您使用 Google Cardboard 时需要什么",
  13079. VR_NEED_SAMSUNG: "您使用 Samsung Gear VR 时需要什么",
  13080. VR_NEED_DAYDREAM: "需要事先与 DAYDREAM VIEW 配对",
  13081. VR_NEED_DAYDREAM_PHONE: "支持 Daydream 的手机",
  13082. VR_GOOGLE_CARDBOARD: "Google Cardboard",
  13083. VR_GOOGLE_DAYDREAM: "Google Daydream",
  13084. VR_APP: "port VR 应用程序",
  13085. VR_SAMSUNG_GEAR_VR: "Samsung Gear VR",
  13086. VR_COMPATIBLE_IPHONES_1: "iPhones",
  13087. VR_COMPATIBLE_IPHONES_2: "iPhone 5s 和更高版本,运行 iOS 9.1 和更高版本",
  13088. VR_COMPATIBLE_IPHONES_3: "兼容的 iPhone",
  13089. VR_COMPATIBLE_ANDROID: "兼容的 Android 设备",
  13090. VR_COMPATIBLE_ANDROID_LONG: "4.5-5.5 英寸、运行 Android OS 4.4.4 和更高版本的兼容型 Android 设备显示屏",
  13091. VR_ANDROID_DETAIL: "4.5 至 5.5 英寸、运行 Android OS 4.4.4 和更高版本的显示屏",
  13092. VR_ANDROID_DVICES: "Android 设备",
  13093. VR_COMPATIBLE_SAMSUNG: "兼容的 Samsung 设备",
  13094. VR_SAMSUNG_DETAIL: "Galaxy S6 和更高版本",
  13095. VR_APP_FOR_CARDBOARD: "用于 Google Cardboard 的 port VR 应用程序",
  13096. VR_APP_FOR_SAMSUNG: "用于 Gear VR 的 port VR 应用程序",
  13097. VR_APP_FOR_ANDROID: "用于 Android 手机的 port VR 应用程序",
  13098. VR_APP_OPEN: "请使用 port VR 应用程序打开",
  13099. VR_DOWNLOAD_HERE: "在此下载",
  13100. VR_REQUIRE_HEADSET: "需要一副 VR 耳机并安装用于 Android 的 port VR 应用程序",
  13101. VR_REDIRECT_TO_STORE: "如果未安装应用程序,您将跳转到应用程序商店。",
  13102. VR_IMPROPER_EMBED: "port 空间未正确嵌入,无法在您的 Web 浏览器支持 VR。",
  13103. VR_OPEN_ANDROID_LINK: "在您的手机上打开链接",
  13104. VR_ANDROID_OPTIONS: "可用的 VR 耳机选项",
  13105. SHARE_TO: "分享到",
  13106. SHARE_LINK: "直接链接",
  13107. SHARE_EXPLORE: "探索",
  13108. SHARE_AT: "在",
  13109. SHARE_WITH: "使用",
  13110. SHARE_3D: "以 3D",
  13111. SHARE_COPIED: "已复制!",
  13112. ERROR_BROWSER_SOLUTION: "安装更新的浏览器以探索 3D。",
  13113. ERROR_BROWSER_EXPLANATION: "WebGL 需要现代的浏览器。",
  13114. ERROR_GENERIC_PROBLEM: "糟糕,出现问题。",
  13115. ERROR_GENERIC_SOLUTION: "重新启动您的浏览器。",
  13116. ERROR_GENERIC_ACTIONS_1: "如果问题仍然存在,",
  13117. ERROR_GENERIC_ACTIONS_2: "请安装支持的浏览器",
  13118. ERROR_GENERIC_ACTIONS_3: " 或",
  13119. ERROR_GENERIC_ACTIONS_4: "查看我们的故障排除指南",
  13120. ERROR_WEBGL_UNSUPPORTED_PROBLEM: "浏览器不受支持。",
  13121. ERROR_WEBGL_IOS_PROBLEM: "iOS 版本不受支持。",
  13122. ERROR_WEBGL_IOS_SOLUTION: "升级到 iOS 8 或更高版本以在 3D 中探索。",
  13123. ERROR_WEBGL_IOS_ACTIONS_1: "点击 ",
  13124. ERROR_WEBGL_IOS_ACTIONS_2: "设置 > 通用 > 软件更新",
  13125. ERROR_WEBGL_SAFARI_PROBLEM: "启用 WebGL 以在 3D 中探索。",
  13126. ERROR_WEBGL_SAFARI_ACTIONS_1: "单击",
  13127. ERROR_WEBGL_SAFARI_ACTIONS_2: "菜单栏中的首选项 > 高级 > 显示开发菜单",
  13128. ERROR_WEBGL_SAFARI_ACTIONS_3: "然后单击",
  13129. ERROR_WEBGL_SAFARI_ACTIONS_4: "开发 > 启用 WebGL",
  13130. ERROR_MISSING_URLS_PROBLEM: "糟糕,没有此模型的全景。",
  13131. ERROR_MISSING_URLS_EXPLANATION: "这是较早的模型。网站所有者可能正在开发一种新模型。",
  13132. ERROR_LOADING_FAILED_PROBLEM: "糟糕,模式不可用。",
  13133. ERROR_LOADING_FAILED_ACTIONS_1: "如果问题仍然存在,",
  13134. ERROR_LOADING_FAILED_ACTIONS_2: "查看我们的故障排除指南",
  13135. ERROR_MAINTENANCE_PROBLEM: "正在进行维护",
  13136. ERROR_MAINTENANCE_SOLUTION: "请过几分钟再来。",
  13137. LINK_TO_LOCATION: "地点链接",
  13138. MENU_COPY: "复制",
  13139. LINK_ALERT_COPY: "请使用 CTRL/CMD + C 复制。",
  13140. ROTATE: "旋转",
  13141. MOVE: "移动",
  13142. INSIDE: "内部",
  13143. ZOOM: "缩放",
  13144. HELP: "小帮手",
  13145. HELP_NAVIGATION_TAB: "导航",
  13146. HELP_MORE_HELP_TAB: "更多帮助",
  13147. HELP_DESKTOP_PANORAMA_1A: "单击并拖动以环顾空间。",
  13148. HELP_DESKTOP_PANORAMA_2A: "单击整个空间内的圆环以四处移动。",
  13149. HELP_DESKTOP_PANORAMA_3A: "使用鼠标滚轮来放大和缩小。",
  13150. HELP_DESKTOP_PANORAMA_1B: "或者,使用箭头键向左向右转。",
  13151. HELP_DESKTOP_PANORAMA_2B: "或者,使用箭头键向前移动和向后移动。",
  13152. HELP_DESKTOP_PANORAMA_3B: "或者,使用加号和减号键来放大和缩小。",
  13153. HELP_DESKTOP_360_2A: "单击内部视图图标以进入空间。",
  13154. HELP_DESKTOP_360_2B: "或者,按 1 号键进入内部视图。 ",
  13155. HELP_DESKTOP_DOLLHOUSE_1A: "左键单击并向左、向右、向上和向下拖动以旋转场景屋。",
  13156. HELP_DESKTOP_DOLLHOUSE_2A: "右键单击并向左、向右、向上和向下拖动以改变场景屋在屏幕上的位置。",
  13157. HELP_DESKTOP_DOLLHOUSE_3A: "使用鼠标滚轮来放大和缩小。",
  13158. HELP_DESKTOP_DOLLHOUSE_1B: "或者,使用箭头键来旋转场景屋。",
  13159. HELP_DESKTOP_FLOORPLAN_1A: "左键单击并向左、向右、向上和向下拖动以改变楼层平面图在屏幕上的位置。",
  13160. HELP_DESKTOP_FLOORPLAN_2A: "右键单击并向左或向右拖动以旋转楼层平面图。",
  13161. HELP_DESKTOP_FLOORPLAN_3A: "使用鼠标滚轮来放大和缩小。",
  13162. HELP_DESKTOP_FLOORPLAN_2B: "或者,使用箭头键以向左或向右旋转。",
  13163. HELP_DESKTOP_FLOORPLAN_3B: "或者,使用箭头键来放大和缩小。",
  13164. HELP_MOBILE_PANORAMA_1: "触摸并拖动以环顾空间。",
  13165. HELP_MOBILE_PANORAMA_2: "点击整个空间内的圆环以四处移动。",
  13166. HELP_MOBILE_3: "使用捏合手势来放大和缩小。",
  13167. HELP_MOBILE_360_2: "点击内部视图图标以进入空间。",
  13168. HELP_MOBILE_DOLLHOUSE_1: "触摸并向上、向下、向左和向右拖动以旋转场景屋。",
  13169. HELP_MOBILE_DOLLHOUSE_2: "用两指触摸并拖动以定位场景屋。",
  13170. HELP_MOBILE_FLOORPLAN_1: "触摸并拖动以定位楼层平面图。",
  13171. HELP_MOBILE_FLOORPLAN_2: "用两指触摸并拖动以旋转楼层平面图。",
  13172. HELP_MORE_HLR_A: "精彩片段集锦",
  13173. HELP_DESKTOP_MORE_HLR_B: "打开以使用缩略图图像在空间中流览。",
  13174. HELP_MORE_DOLLHOUSE_A: "场景屋",
  13175. HELP_DESKTOP_MORE_DOLLHOUSE_B: "单击以查看和旋转 3D 内整个空间的俯视图。",
  13176. HELP_MOBILE_MORE_DOLLHOUSE_B: "点击以查看和旋转 3D 内整个空间的俯视图。",
  13177. HELP_MORE_FLOORS_A: "楼层选择器",
  13178. HELP_DESKTOP_MORE_FLOORS_B: "在空间中的楼层之间切换。",
  13179. HELP_MORE_TAG_A: "tag™ 贴文",
  13180. HELP_DESKTOP_MORE_TAG_B: "单击或悬停鼠标以查看空间中的功能信息。",
  13181. HELP_MOBILE_MORE_TAG_B: "点击以查看空间中的功能信息。",
  13182. HELP_MORE_ZOOM_A: "缩放控件",
  13183. HELP_DESKTOP_MORE_ZOOM_B: "使用这些控件来放大和缩小或使用滚轮。",
  13184. HELP_MORE_TOUR_A: "导览控件",
  13185. HELP_DESKTOP_MORE_TOUR_B: "通过导览播放、暂停以及向前和向后流览。",
  13186. HELP_MORE_INSIDE_A: "内部视图",
  13187. HELP_DESKTOP_MORE_INSIDE_B: "单击以探索空间内部。",
  13188. HELP_MOBILE_MORE_INSIDE_B: "点击以探索空间内部。",
  13189. HELP_MORE_VR_A: "VR 模式",
  13190. HELP_DESKTOP_MORE_VR_B: "单击以在虚拟现实中启动空间。",
  13191. HELP_MOBILE_MORE_VR_B: "点击以在虚拟现实中启动空间。",
  13192. HELP_MORE_360_A: "360° 视图",
  13193. HELP_DESKTOP_MORE_360_B: "单击精彩片段集锦中的 360 视图中以观看室外场景。",
  13194. HELP_MOBILE_MORE_360_B: "点击精彩片段集锦中的 360 视图中以观看室外场景。",
  13195. HELP_MORE_FULLSCREEN_A: "全屏",
  13196. HELP_DESKTOP_MORE_FULLSCREEN_B: "将 3D Showcase 扩展到全屏。",
  13197. CLOSE: "关闭"
  13198. }
  13199. }
  13200. , {}],
  13201. 110: [function(e, t, i) {
  13202. "use strict";
  13203. t.exports = {
  13204. PAGE_TITLE: "",
  13205. LOADING: "Lädt",
  13206. PRESENTED_BY_CAPS: "PRÄSENTIERT VON",
  13207. POWERED_BY: "Angetrieben von",
  13208. POWERED_BY_CAPS: "ANGETRIEBEN VON",
  13209. DESKTOP_SHORT_CTA: "Sehen sie sich in diesem 3D Raum um.",
  13210. MOBILE_SHORT_CTA: "Sehen sie sich in diesem 3D Raum um.",
  13211. PRESENTED_BY: "Präsentiert von ",
  13212. MORE: "Mehr ",
  13213. LESS: "Weniger ",
  13214. TAG_CONTENT: "tag™ Inhalt",
  13215. SHOW: "Anzeigen",
  13216. HIDE: "Verbergen",
  13217. DOLLHOUSE: "Puppenhaus",
  13218. FLOOR_PLAN: "Grundriss",
  13219. OPEN_HIGHLIGHTS: "Highlights anzeigen",
  13220. CLOSE_HIGHLIGHTS: "Schließen",
  13221. PREVIOUS: "Vorheriges",
  13222. PLAY: "Abspielen",
  13223. PAUSE: "Pausieren",
  13224. NEXT: "Nächstes",
  13225. EXPLORE_3D_SPACE: "Innenraum betreten",
  13226. VIEW_DOLLHOUSE: "Puppenhaus ansehen",
  13227. SOCIAL_SHARING: "Teilen Sie diesen Raum",
  13228. VIEW_IN_VR: "In VR ansehen",
  13229. VIEW_FULLSCREEN: "Ansicht im Vollbildmodus",
  13230. EXIT_FULLSCREEN: "Beenden des Vollbildmodus",
  13231. ZOOM_IN: "Vergrößern",
  13232. ZOOM_OUT: "Verkleinern",
  13233. FLOOR_NAME: "Etage ",
  13234. FLOOR_ALL: "Alle",
  13235. TERMS: "Bedingungen",
  13236. PORT_TERMS: "port Bedingungen",
  13237. TERMS_OF_USE: "Nutzungsbedingungen",
  13238. TERMS_TEXT_FILE: "terms-de-DE.html",
  13239. CLOSE_TERMS: "Schließen",
  13240. TERMS_FAIL: "Konnte die Nutzungsbedingungen nicht abrufen. Bitte stellen Sie sicher, dass Sie zum Internet verbunden sind.",
  13241. HELP: "Hilfe",
  13242. HELP_NAVIGATION_TAB: "Navigation",
  13243. HELP_MORE_HELP_TAB: "Hilfe-Details",
  13244. CLOSE: "Schließen",
  13245. HELP_DESKTOP_PANORAMA_1A: "Klicken und ziehen Sie um sich im Raum umzusehen.",
  13246. HELP_DESKTOP_PANORAMA_2A: "Klicken Sie auf die Ringe im Raum um sich zu bewegen.",
  13247. HELP_DESKTOP_PANORAMA_3A: "Verwenden Sie das Scrollrad zum Vergrößern und Verkleinern.",
  13248. HELP_DESKTOP_PANORAMA_1B: "Oder verwenden Sie die Pfeiltasten um sich nach links und rechts zu bewegen.",
  13249. HELP_DESKTOP_PANORAMA_2B: "Oder verwenden Sie die Pfeiltasten um sich vorwärts und rückwärts zubewegen.",
  13250. HELP_DESKTOP_PANORAMA_3B: "Oder verwenden Sie die Plus- und Minus-Tasten zum Vergrößern und Verkleinern.",
  13251. HELP_DESKTOP_360_2A: "Klicken Sie die Innenansicht ikone, um diesen Raum zu starten .",
  13252. HELP_DESKTOP_360_2B: "Oder, drücken Sie die 1-Taste um die Innenraumansicht zu starten.",
  13253. HELP_DESKTOP_DOLLHOUSE_1A: "Klicken Sie mit der linken Maustaste und ziehen Sie nach links, rechts, oben und unten um das Puppenhaus zu drehen.",
  13254. 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.",
  13255. HELP_DESKTOP_DOLLHOUSE_3A: "Verwenden Sie das Scrollrad zum Vergrößern und Verkleinern.",
  13256. HELP_DESKTOP_DOLLHOUSE_1B: "Oder verwenden Sie die Pfeiltasten um das Puppenhaus zu drehen.",
  13257. 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.",
  13258. HELP_DESKTOP_FLOORPLAN_2A: "Klicken Sie mit der rechten Maustaste und ziehen Sie nach links oder rechts um den Grundriss zu drehen.",
  13259. HELP_DESKTOP_FLOORPLAN_3A: "Verwenden Sie das Scrollrad zum Vergrößern und Verkleinern.",
  13260. HELP_DESKTOP_FLOORPLAN_2B: "Oder verwenden Sie die Pfeiltasten um das Modell nach links oder rechts zu drehen.",
  13261. HELP_DESKTOP_FLOORPLAN_3B: "Oder verwenden Sie die Pfeiltasten zum Vergrößern und Verkleinern.",
  13262. HELP_MOBILE_PANORAMA_1: "Berühren und ziehen an dem Raum um sich umzusehen.",
  13263. HELP_MOBILE_PANORAMA_2: "Klicken Sie auf die Ringe im Raum, um sich zu bewegen.",
  13264. HELP_MOBILE_3: "Benutzen Sie die Zoom-Gäste zum Vergrößern und Verkleinern.",
  13265. HELP_MOBILE_360_2: "Tippen Sie die Innenansicht ikone, um diesen Raum zu starten.",
  13266. HELP_MOBILE_DOLLHOUSE_1: "Berühren und nach oben, unten, links und rechts ziehen um das Puppenhaus zu drehen.",
  13267. HELP_MOBILE_DOLLHOUSE_2: "Berühren und mit zwei Fingern ziehen um das Puppenhaus zu positionieren.",
  13268. HELP_MOBILE_FLOORPLAN_1: "Berühren und ziehen, um den Grundriss zu positionieren.",
  13269. HELP_MOBILE_FLOORPLAN_2: "Berühren und ziehen mit zwei Fingern, um den Grundriss zu drehen.",
  13270. HELP_MORE_HLR_A: "Liste das Highlight",
  13271. HELP_DESKTOP_MORE_HLR_B: "Öffnen um durch den Raum mit Vorschau-Bildern zu navigieren.",
  13272. HELP_MORE_DOLLHOUSE_A: "Puppenhaus Ansicht",
  13273. HELP_DESKTOP_MORE_DOLLHOUSE_B: "Klicken Sie um die von oben nach unten Sicht des gesamten Raumes in 3D anzuzeigen und zu drehen.",
  13274. HELP_MOBILE_MORE_DOLLHOUSE_B: "Tippen Sie um die von oben nach unten Sicht des gesamten Raumes in 3D anzuzeigen und zu drehen.",
  13275. HELP_MORE_FLOORS_A: "Etage auswählen",
  13276. HELP_DESKTOP_MORE_FLOORS_B: "Zwischen den Etagen im Raum wechseln.",
  13277. HELP_MORE_TAG_A: "tag™ Posts",
  13278. HELP_DESKTOP_MORE_TAG_B: "Klicken Sie auf oder bewegen Sie Ihren Mauszeiger über die Informationen über die Funktionen im Raum.",
  13279. HELP_MOBILE_MORE_TAG_B: "Tippen Sie für Informationen über die Funktionen im Raum.",
  13280. HELP_MORE_ZOOM_A: "Zoom Steuerung",
  13281. HELP_DESKTOP_MORE_ZOOM_B: "Verwenden Sie diese Steuerung oder das Scrollrad zum Vergrößern und Verkleinern.",
  13282. HELP_MORE_TOUR_A: "Tour Steuerung",
  13283. HELP_DESKTOP_MORE_TOUR_B: "Abspielen, pausieren und vorwärts und rückwärts durch eine geführte Tour navigieren.",
  13284. HELP_MORE_INSIDE_A: "Innenansicht",
  13285. HELP_DESKTOP_MORE_INSIDE_B: "Klicken Sie hier um sich im Raum umzusehen.",
  13286. HELP_MOBILE_MORE_INSIDE_B: "Sehen Sie sich in diesen 3D Raum um.",
  13287. HELP_MORE_VR_A: "VR Modus",
  13288. HELP_DESKTOP_MORE_VR_B: "Klicken Sie hier, um den Raum in der virtuellen Realität zu starten.",
  13289. HELP_MOBILE_MORE_VR_B: "Tippen Sie um den Raum in der virtuellen Realität zu starten.",
  13290. HELP_MORE_360_A: "360° Views Ansicht ",
  13291. HELP_DESKTOP_MORE_360_B: "Klicken Sie die 360° Views Ansicht in das Highlight um Aussen-Szenen zu sehen.",
  13292. HELP_MOBILE_MORE_360_B: "Tippen Sie die 360° Views Ansicht in das Highlight um Aussen-Szenen zu sehen.",
  13293. HELP_MORE_FULLSCREEN_A: "Vollbild",
  13294. HELP_DESKTOP_MORE_FULLSCREEN_B: "Erweitern Sie 3D Showcase im Vollbildmodus.",
  13295. WEBVR_FOR_CARDBOARD: "Für Google Cardboard",
  13296. WEBVR_FOR_DAYDREAM: "Für Daydream View",
  13297. WEBVR_ENTER_WEBVR: "Starten Sie VR",
  13298. WEBVR_DIFFERENT_HEADSET: "Haben Sie anderes Headset?",
  13299. WEBVR_LEARN_MORE: "Mehr Infos",
  13300. WEBVR_VIEW_SPACE: "Ansicht des Raumes in VR",
  13301. WEBVR_DAYDREAM_VIEW: "Daydream View",
  13302. WEBVR_DAYDREAM_PHONE: "Daydream-fähiges Handy",
  13303. WEBVR_VIEW_CARDBOARD: "Oder mit Google Cardboard ansehen",
  13304. VR_WHAT_YOU_NEED: "Was Sie dafür brauchen...",
  13305. VR_NEED_DAYDREAM_PHONE: "Daydream-fähiges Handy",
  13306. VR_GOOGLE_DAYDREAM: "Google Daydream",
  13307. VR_APP: "port VR App",
  13308. VR_APP_OPEN: "Oder öffnen Sie die port VR App",
  13309. 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",
  13310. VR_SAMSUNG_DETAIL: "Galaxy S6 und neuer",
  13311. VR_APP_FOR_ANDROID: "port VR app für Android",
  13312. VR_NEED_DAYDREAM: "ERFORDERT VOR DER 'PAIRING' MIT DAYDREAM VIEW",
  13313. VR_VIEW_SPACE: "Ansicht des Raumes in VR",
  13314. VR_LEARN_MORE_CAPS: "MEHR INFOS",
  13315. VR_PREVIOUS_CAPS: "ZURÜCK",
  13316. VR_NEXT_CAPS: "WEITER",
  13317. VR_GOT_IT_CAPS: "VERSTANDEN",
  13318. VR_SHOW_SUPPORTED: "Tippen Sie um den Raum in VR zu sehen",
  13319. VR_SHOW_UNSUPPORTED: "Schade, aber Ihr Gerät erfüllt nicht die Mindestanforderungen um den Raum in VR zu sehen.",
  13320. VR_SHOW_IOS_1: "Tippen Sie um den Raum in VR zu sehen",
  13321. VR_SHOW_IOS_2: "port VR App sowie kompatibles iPhone sind von nöten um diesen Raum zu sehen",
  13322. VR_NEED_CARDBOARD: "Was Sie dafür brauchen ist Google Cardboard",
  13323. VR_NEED_SAMSUNG: "Was Sie dafür brauchen ist Samsung Gear VR",
  13324. VR_GOOGLE_CARDBOARD: "Google Cardboard",
  13325. VR_SAMSUNG_GEAR_VR: "Samsung Gear VR",
  13326. VR_COMPATIBLE_IPHONES_1: "iPhones",
  13327. VR_COMPATIBLE_IPHONES_2: "iPhone 5s oder neuer, mit iOS 9.1 und später",
  13328. VR_COMPATIBLE_IPHONES_3: "Kompatibles iPhones",
  13329. VR_COMPATIBLE_ANDROID: "Kompatibles Android Gerät",
  13330. VR_ANDROID_DETAIL: "Bildschirmdiagonale von 11,5 bis 14 cm (4,5 - 5,5 Zoll) und Android 4.4.4 und neuer",
  13331. VR_ANDROID_DVICES: "Android Geräte",
  13332. VR_COMPATIBLE_SAMSUNG: "Kompatible Samsung Geräte",
  13333. VR_APP_FOR_CARDBOARD: "port VR App für Google Cardboard",
  13334. VR_APP_FOR_SAMSUNG: "port VR App für Gear VR",
  13335. VR_DOWNLOAD_HERE: "Hier runterladen",
  13336. VR_REQUIRE_HEADSET: "Benötigt das ein VR-Headset und port VR App für Android installiert wird",
  13337. VR_REDIRECT_TO_STORE: "Wenn App nicht installiert ist, werden Sie zum App Store umgeleitet.",
  13338. VR_IMPROPER_EMBED: "Der port Raum ist nicht richtig eingebettet um VR in Ihrem Webbrowser zu unterstützen.",
  13339. VR_OPEN_ANDROID_LINK: "Öffnen Sie den Link auf Ihrem Handy",
  13340. VR_ANDROID_OPTIONS: "VR Headset Optionen",
  13341. SHARE_TO: "Teilen auf",
  13342. SHARE_LINK: "Direkter Link",
  13343. SHARE_EXPLORE: "Umsehen",
  13344. SHARE_AT: "auf",
  13345. SHARE_WITH: "mit",
  13346. SHARE_3D: "in 3D",
  13347. SHARE_COPIED: "Kopiert!",
  13348. ERROR_BROWSER_SOLUTION: "Installieren Sie einen neueren Browser um sich in 3D umzusehen.",
  13349. ERROR_BROWSER_EXPLANATION: "WebGL benötigt einen modernen Browser.",
  13350. ERROR_GENERIC_PROBLEM: "Huch, etwas ist schief gelaufen.",
  13351. ERROR_GENERIC_SOLUTION: "Starten Sie Ihren Browser neu.",
  13352. ERROR_GENERIC_ACTIONS_1: "Wenn das Problem weiterhin besteht, ",
  13353. ERROR_GENERIC_ACTIONS_2: "Installieren Sie einen unterstützten Browser",
  13354. ERROR_GENERIC_ACTIONS_3: " oder ",
  13355. ERROR_GENERIC_ACTIONS_4: "Sehen Sie unseren Leitfaden zur Fehlerbehebung",
  13356. ERROR_WEBGL_UNSUPPORTED_PROBLEM: "Browser wird nicht unterstützt.",
  13357. ERROR_WEBGL_IOS_PROBLEM: "iOS-Version wird nicht unterstützt.",
  13358. ERROR_WEBGL_IOS_SOLUTION: "Aktualisieren Sie auf iOS 8 oder neuer um sich in 3D umzusehen.",
  13359. ERROR_WEBGL_IOS_ACTIONS_1: "Tippen ",
  13360. ERROR_WEBGL_IOS_ACTIONS_2: "Einstellungen > Allgemein > Softwareaktualisierung",
  13361. ERROR_WEBGL_SAFARI_PROBLEM: "Aktivieren Sie WebVR um sich in 3D umzusehen.",
  13362. ERROR_WEBGL_SAFARI_ACTIONS_1: "Klicken ",
  13363. ERROR_WEBGL_SAFARI_ACTIONS_2: "Präferenzen > Fortgeschrittene > Entwickler-Menü anzeigen",
  13364. ERROR_WEBGL_SAFARI_ACTIONS_3: "Klicken Sie dann ",
  13365. ERROR_WEBGL_SAFARI_ACTIONS_4: "Entwickler > WebGL Aktivieren",
  13366. ERROR_MISSING_URLS_PROBLEM: "Huch, es gibt keine Panoramen für dieses Modell .",
  13367. ERROR_MISSING_URLS_EXPLANATION: "Dies ist ein älteres Modell. Der Website-Besitzer hat eventuell ein neues Modell in Arbeit.",
  13368. ERROR_LOADING_FAILED_PROBLEM: "Huch, das Modell ist nicht verfügbar.",
  13369. ERROR_LOADING_FAILED_ACTIONS_1: "Wenn das Problem weiterhin besteht, ",
  13370. ERROR_LOADING_FAILED_ACTIONS_2: "sehen Sie unseren Leitfaden zur Fehlerbehebung",
  13371. ERROR_MAINTENANCE_PROBLEM: "Wartung im Gange.",
  13372. ERROR_MAINTENANCE_SOLUTION: "Bitte versuchen Sie es in ein paar Minuten nochmal.",
  13373. LINK_TO_LOCATION: "Link zu",
  13374. MENU_COPY: "Kopieren",
  13375. LINK_ALERT_COPY: "Bitte benutzen Sie CTRL/CMD + C zum kopieren.",
  13376. ROTATE: "Drehen",
  13377. INSIDE: "Drinnen",
  13378. MOVE: "Bewegen",
  13379. ZOOM: "Vergrößern"
  13380. }
  13381. }
  13382. , {}],
  13383. 111: [function(e, t, i) {
  13384. "use strict";
  13385. t.exports = {
  13386. PAGE_TITLE: "",
  13387. LOADING: "Loading",
  13388. PRESENTED_BY_CAPS: "PRESENTED BY",
  13389. POWERED_BY: "powered by ",
  13390. POWERED_BY_CAPS: "POWERED BY",
  13391. DESKTOP_SHORT_CTA: "Click to explore this 3D space.",
  13392. MOBILE_SHORT_CTA: "Tap to explore this 3D space.",
  13393. PRESENTED_BY: "Presented by ",
  13394. MORE: "More ",
  13395. LESS: "Less ",
  13396. TAG_CONTENT: "tag™ Content",
  13397. SHOW: "Show",
  13398. HIDE: "Hide",
  13399. DOLLHOUSE: "Dollhouse",
  13400. FLOOR_PLAN: "Floor plan",
  13401. OPEN_HIGHLIGHTS: "Open Highlights",
  13402. CLOSE_HIGHLIGHTS: "Close",
  13403. PREVIOUS: "Previous",
  13404. PLAY: "Play",
  13405. PAUSE: "Pause",
  13406. NEXT: "Next",
  13407. EXPLORE_3D_SPACE: "Explore 3D Space",
  13408. VIEW_DOLLHOUSE: "View dollhouse",
  13409. SOCIAL_SHARING: "Share this Space",
  13410. VIEW_IN_VR: "View in VR",
  13411. VIEW_FULLSCREEN: "全屏",
  13412. EXIT_FULLSCREEN: "退出全屏",
  13413. ZOOM_IN: "Zoom in",
  13414. ZOOM_OUT: "Zoom out",
  13415. FLOOR_NAME: "Floor ",
  13416. FLOOR_ALL: "全部",
  13417. TERMS: "Terms",
  13418. PORT_TERMS: "port terms",
  13419. TERMS_OF_USE: "Terms of Use",
  13420. TERMS_TEXT_FILE: "terms-en-US.html",
  13421. CLOSE_TERMS: "Close",
  13422. TERMS_FAIL: "Could not fetch terms. Please make sure you have an internet connection to view the terms of use.",
  13423. HELP: "Help",
  13424. HELP_NAVIGATION_TAB: "Navigation",
  13425. HELP_MORE_HELP_TAB: "More Help",
  13426. CLOSE: "Close",
  13427. HELP_DESKTOP_PANORAMA_1A: "Click and Drag to look around the Space.",
  13428. HELP_DESKTOP_PANORAMA_2A: "Click on the rings throughout the space to move around.",
  13429. HELP_DESKTOP_PANORAMA_3A: "Use the scroll wheel to zoom in and out.",
  13430. HELP_DESKTOP_PANORAMA_1B: "Or, use the arrow keys to turn left and right.",
  13431. HELP_DESKTOP_PANORAMA_2B: "Or, use the arrow keys to move forward and back.",
  13432. HELP_DESKTOP_PANORAMA_3B: "Or, use the plus and minus keys to zoom in and out.",
  13433. HELP_DESKTOP_360_2A: "Click the Inside View icon to enter the Space.",
  13434. HELP_DESKTOP_360_2B: "Or, press the number 1 key to enter Inside View.",
  13435. HELP_DESKTOP_DOLLHOUSE_1A: "Left click and drag left, right, up, and down to rotate the Dollhouse.",
  13436. HELP_DESKTOP_DOLLHOUSE_2A: "Right click and drag left, right, up, and down to change the Dollhouse position on screen.",
  13437. HELP_DESKTOP_DOLLHOUSE_3A: "Use the scroll wheel to zoom in and out.",
  13438. HELP_DESKTOP_DOLLHOUSE_1B: "Or, use the arrow keys to rotate the Dollhouse.",
  13439. HELP_DESKTOP_FLOORPLAN_1A: "Left click and drag left, right, up, and down to change the Floorplan position on screen.",
  13440. HELP_DESKTOP_FLOORPLAN_2A: "Right click and drag left or right to rotate the Floorplan.",
  13441. HELP_DESKTOP_FLOORPLAN_3A: "Use the scroll wheel to zoom in and out.",
  13442. HELP_DESKTOP_FLOORPLAN_2B: "Or, use the arrow keys to rotate left or right.",
  13443. HELP_DESKTOP_FLOORPLAN_3B: "Or, use the arrow keys to zoom in and out.",
  13444. HELP_MOBILE_PANORAMA_1: "Touch and Drag to look around the Space.",
  13445. HELP_MOBILE_PANORAMA_2: "Tap on the rings throughout the Space to move around.",
  13446. HELP_MOBILE_3: "Use a pinch gesture to zoom in and out.",
  13447. HELP_MOBILE_360_2: "Tap the Inside View icon to enter the Space.",
  13448. HELP_MOBILE_DOLLHOUSE_1: "Touch and drag up, down, left, and right to rotate the Dollhouse.",
  13449. HELP_MOBILE_DOLLHOUSE_2: "Touch and drag with two fingers to position the Dollhouse.",
  13450. HELP_MOBILE_FLOORPLAN_1: "Touch and drag to position the Floorplan.",
  13451. HELP_MOBILE_FLOORPLAN_2: "Touch and drag with two fingers to rotate the Floorplan.",
  13452. HELP_MORE_HLR_A: "Highlight Reel",
  13453. HELP_DESKTOP_MORE_HLR_B: "Open to navigate through the Space using thumbnail images.",
  13454. HELP_MORE_DOLLHOUSE_A: "Dollhouse View",
  13455. HELP_DESKTOP_MORE_DOLLHOUSE_B: "Click to view and rotate a top-down view of the entire Space in 3D.",
  13456. HELP_MOBILE_MORE_DOLLHOUSE_B: "Tap to view and rotate a top-down view of the entire Space in 3D.",
  13457. HELP_MORE_FLOORS_A: "Floor Selector",
  13458. HELP_DESKTOP_MORE_FLOORS_B: "Switch between floors in the Space.",
  13459. HELP_MORE_TAG_A: "tag™ Posts",
  13460. HELP_DESKTOP_MORE_TAG_B: "Click or hover over for information about features in the Space.",
  13461. HELP_MOBILE_MORE_TAG_B: "Tap for information about features in the Space.",
  13462. HELP_MORE_ZOOM_A: "Zoom Controls",
  13463. HELP_DESKTOP_MORE_ZOOM_B: "Use these controls to zoom in and out or use the scroll wheel.",
  13464. HELP_MORE_TOUR_A: "Tour Controls",
  13465. HELP_DESKTOP_MORE_TOUR_B: "Play, pause, and navigate forward and backward through a Guided Tour.",
  13466. HELP_MORE_INSIDE_A: "Inside View",
  13467. HELP_DESKTOP_MORE_INSIDE_B: "Click to explore inside the Space.",
  13468. HELP_MOBILE_MORE_INSIDE_B: "Tap to explore inside the Space.",
  13469. HELP_MORE_VR_A: "VR Mode",
  13470. HELP_DESKTOP_MORE_VR_B: "Click to launch the Space in virtual reality.",
  13471. HELP_MOBILE_MORE_VR_B: "Tap to launch the Space in virtual reality.",
  13472. HELP_MORE_360_A: "360° Views",
  13473. HELP_DESKTOP_MORE_360_B: "Click 360 Views in the Highlight Reel to view outdoor scenes.",
  13474. HELP_MOBILE_MORE_360_B: "Tap 360 Views in the Highlight Reel to view outdoor scenes.",
  13475. HELP_MORE_FULLSCREEN_A: "Full screen",
  13476. HELP_DESKTOP_MORE_FULLSCREEN_B: "Expand 3D Showcase to full screen.",
  13477. WEBVR_FOR_CARDBOARD: "For Google Cardboard",
  13478. WEBVR_VIEW_CARDBOARD: "Or View on Google Cardboard",
  13479. WEBVR_FOR_DAYDREAM: "For Daydream View",
  13480. WEBVR_ENTER_WEBVR: "ENTER VR",
  13481. WEBVR_DIFFERENT_HEADSET: "Have a different headset?",
  13482. WEBVR_LEARN_MORE: "Learn more",
  13483. WEBVR_VIEW_SPACE: "View Space in VR",
  13484. WEBVR_DAYDREAM_VIEW: "Daydream View",
  13485. WEBVR_DAYDREAM_PHONE: "Daydream-ready phone",
  13486. VR_VIEW_SPACE: "View Space in Virtual Reality",
  13487. VR_LEARN_MORE_CAPS: "LEARN MORE",
  13488. VR_PREVIOUS_CAPS: "PREVIOUS",
  13489. VR_NEXT_CAPS: "NEXT",
  13490. VR_GOT_IT_CAPS: "GOT IT",
  13491. VR_SHOW_SUPPORTED: "Tap to view the Space in VR with",
  13492. VR_SHOW_UNSUPPORTED: "Sorry, but your device doesn't meet the minimum requirements to view a space in VR.",
  13493. VR_SHOW_IOS_1: "Tap to view the space in VR",
  13494. VR_SHOW_IOS_2: "Requires port VR app and compatible iPhone to view",
  13495. VR_WHAT_YOU_NEED: "What You'll Need For...",
  13496. VR_NEED_CARDBOARD: "What you'll need with Google Cardboard",
  13497. VR_NEED_SAMSUNG: "What you'll need with Samsung Gear VR",
  13498. VR_NEED_DAYDREAM: "NEEDS PRIOR PAIRING WITH DAYDREAM VIEW",
  13499. VR_NEED_DAYDREAM_PHONE: "Daydream-ready phone",
  13500. VR_GOOGLE_CARDBOARD: "Google Cardboard",
  13501. VR_GOOGLE_DAYDREAM: "Google Daydream",
  13502. VR_APP: "port VR App",
  13503. VR_SAMSUNG_GEAR_VR: "Samsung Gear VR",
  13504. VR_COMPATIBLE_IPHONES_1: "iPhones",
  13505. VR_COMPATIBLE_IPHONES_2: "iPhone 5s and newer, running iOS 9.1 and higher",
  13506. VR_COMPATIBLE_IPHONES_3: "Compatible iPhones",
  13507. VR_COMPATIBLE_ANDROID: "Compatible Android Devices",
  13508. VR_COMPATIBLE_ANDROID_LONG: 'Compatible Android Devices Displays from 4.5"-5.5" running Android OS 4.4.4 and higher',
  13509. VR_ANDROID_DETAIL: 'Displays from 4.5"-5.5" running Android OS 4.4.4 and higher',
  13510. VR_ANDROID_DVICES: "Android Devices",
  13511. VR_COMPATIBLE_SAMSUNG: "Compatible Samsung Devices",
  13512. VR_SAMSUNG_DETAIL: "Galaxy S6 and Above",
  13513. VR_APP_FOR_CARDBOARD: "port VR app for Google Cardboard",
  13514. VR_APP_FOR_SAMSUNG: "port VR app for Gear VR",
  13515. VR_APP_FOR_ANDROID: "port VR app for Android Phones",
  13516. VR_APP_OPEN: "Open with the port VR app instead",
  13517. VR_DOWNLOAD_HERE: "Download here",
  13518. VR_REQUIRE_HEADSET: "Requires a VR headset and port VR app for Android to be installed",
  13519. VR_REDIRECT_TO_STORE: "If app is not installed, you will be redirected to the app store.",
  13520. VR_IMPROPER_EMBED: "The port Space is not embedded properly to support VR in your web browser.",
  13521. VR_OPEN_ANDROID_LINK: "Open the Link on Your Mobile Phone",
  13522. VR_ANDROID_OPTIONS: "Available VR Headset Options",
  13523. SHARE_TO: "Share to",
  13524. SHARE_LINK: "Direct Link",
  13525. SHARE_EXPLORE: "Explore ",
  13526. SHARE_AT: "at",
  13527. SHARE_WITH: "with",
  13528. SHARE_3D: " in 3D",
  13529. SHARE_COPIED: "Copied!",
  13530. ERROR_BROWSER_SOLUTION: "Install a new browser to explore in 3D.",
  13531. ERROR_BROWSER_EXPLANATION: "WebGL requires a modern browser.",
  13532. ERROR_GENERIC_PROBLEM: "Oops, something went wrong.",
  13533. ERROR_GENERIC_SOLUTION: "Restart your browser.",
  13534. ERROR_GENERIC_ACTIONS_1: "If the problem persists, ",
  13535. ERROR_GENERIC_ACTIONS_2: "install a supported browser",
  13536. ERROR_GENERIC_ACTIONS_3: " or ",
  13537. ERROR_GENERIC_ACTIONS_4: "see our troubleshooting guide",
  13538. ERROR_WEBGL_UNSUPPORTED_PROBLEM: "Browser not supported.",
  13539. ERROR_WEBGL_IOS_PROBLEM: "iOS version not supported.",
  13540. ERROR_WEBGL_IOS_SOLUTION: "Upgrade to iOS 8 or higher to explore in 3D.",
  13541. ERROR_WEBGL_IOS_ACTIONS_1: "Tap ",
  13542. ERROR_WEBGL_IOS_ACTIONS_2: "Settings > General > Software Update",
  13543. ERROR_WEBGL_SAFARI_PROBLEM: "Enable WebGL to explore in 3D.",
  13544. ERROR_WEBGL_SAFARI_ACTIONS_1: "Click ",
  13545. ERROR_WEBGL_SAFARI_ACTIONS_2: "Preferences > Advanced > Show Develop menu",
  13546. ERROR_WEBGL_SAFARI_ACTIONS_3: "Then click ",
  13547. ERROR_WEBGL_SAFARI_ACTIONS_4: "Develop > Enable WebGL",
  13548. ERROR_MISSING_URLS_PROBLEM: "Oops, there are no panoramas for this model.",
  13549. ERROR_MISSING_URLS_EXPLANATION: "This is an older model. The website owner may have a new model on the way.",
  13550. ERROR_LOADING_FAILED_PROBLEM: "模型不可用.",
  13551. ERROR_LOADING_FAILED_ACTIONS_1: "If the problem persists, ",
  13552. ERROR_LOADING_FAILED_ACTIONS_2: "see our troubleshooting guide",
  13553. ERROR_MAINTENANCE_PROBLEM: "Maintenance in progress.",
  13554. ERROR_MAINTENANCE_SOLUTION: "Please come back in a few minutes.",
  13555. LINK_TO_LOCATION: "Link to location",
  13556. MENU_COPY: "Copy",
  13557. LINK_ALERT_COPY: "Please use CTRL/CMD + C to copy.",
  13558. ROTATE: "Rotate",
  13559. INSIDE: "Inside",
  13560. MOVE: "Move",
  13561. ZOOM: "Zoom"
  13562. }
  13563. }
  13564. , {}],
  13565. 112: [function(e, t, i) {
  13566. "use strict";
  13567. t.exports = {
  13568. PAGE_TITLE: "",
  13569. LOADING: "Cargando",
  13570. PRESENTED_BY_CAPS: "PRESENTADO POR",
  13571. POWERED_BY: "potenciando por ",
  13572. POWERED_BY_CAPS: "POTENCIADO POR ",
  13573. DESKTOP_SHORT_CTA: "Haga clic para explorar este Espacio 3D.",
  13574. MOBILE_SHORT_CTA: "Pulse para explorar este Espacio 3D.",
  13575. PRESENTED_BY: "Presentado por ",
  13576. MORE: "Más ",
  13577. LESS: "Menos ",
  13578. TAG_CONTENT: "Contenido de tag™",
  13579. SHOW: "Mostrar",
  13580. HIDE: "Ocultar",
  13581. DOLLHOUSE: "Dollhouse",
  13582. FLOOR_PLAN: "Planos",
  13583. OPEN_HIGHLIGHTS: "Aspectos Destacados",
  13584. CLOSE_HIGHLIGHTS: "Cerrar",
  13585. PREVIOUS: "Anterior",
  13586. PLAY: "Play",
  13587. PAUSE: "Pausa",
  13588. NEXT: "Siguiente",
  13589. EXPLORE_3D_SPACE: "Explorar el Espacio 3D",
  13590. VIEW_DOLLHOUSE: "Ver dollhouse",
  13591. SOCIAL_SHARING: "Compartir este espacio",
  13592. VIEW_IN_VR: "Ver en realidad virtual",
  13593. VIEW_FULLSCREEN: "Ver en pantalla completa",
  13594. EXIT_FULLSCREEN: "Salir de pantalla completa",
  13595. ZOOM_IN: "Acercar",
  13596. ZOOM_OUT: "Alejar",
  13597. FLOOR_NAME: "Piso ",
  13598. FLOOR_ALL: "Todas",
  13599. TERMS: "Condiciones",
  13600. PORT_TERMS: "port términos de uso",
  13601. TERMS_OF_USE: "Términos de uso",
  13602. TERMS_TEXT_FILE: "terms-es-MX.html",
  13603. CLOSE_TERMS: "Cerrar",
  13604. 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.",
  13605. HELP: "Ayuda",
  13606. HELP_NAVIGATION_TAB: "Navegación",
  13607. HELP_MORE_HELP_TAB: "Más Ayuda",
  13608. CLOSE: "Cerrar",
  13609. HELP_DESKTOP_PANORAMA_1A: "Haga clic y arrastre para mirar alrededor del espacio.",
  13610. HELP_DESKTOP_PANORAMA_2A: "Haga clic en los aros a lo largo del espacio para moverse.",
  13611. HELP_DESKTOP_PANORAMA_3A: "Use la rueda de desplazamiento para acercar o alejar.",
  13612. HELP_DESKTOP_PANORAMA_1B: "O use las teclas de flecha para girar a la izquierda y a la derecha.",
  13613. HELP_DESKTOP_PANORAMA_2B: "O use las teclas de dirección para adelantar o retroceder.",
  13614. HELP_DESKTOP_PANORAMA_3B: "O use la tecla más para acercar y la tecla menos para alejar.",
  13615. HELP_DESKTOP_360_2A: "Haga clic en el icono Vista Interior para ingresar al Espacio.",
  13616. HELP_DESKTOP_360_2B: "O bien, presione la tecla numero 1 para entrar en la Vista Interior.",
  13617. HELP_DESKTOP_DOLLHOUSE_1A: "Haga clic izquierdo y arrastre hacia la izquierda, derecha, arriba o abajo para girar la Dollhouse.",
  13618. HELP_DESKTOP_DOLLHOUSE_2A: "Haga clic derecho y arrastre hacia la izquierda, derecha, arriba o abajo para cambiar la posición della dollhouse.",
  13619. HELP_DESKTOP_DOLLHOUSE_3A: "Use la rueda de desplazamiento para acercar o alejar.",
  13620. HELP_DESKTOP_DOLLHOUSE_1B: "O use las teclas de dirección para girar la Dollhouse.",
  13621. 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.",
  13622. HELP_DESKTOP_FLOORPLAN_2A: "Haga clic derecho y arrastre hacia la izquierda o derecha para girar la planta.",
  13623. HELP_DESKTOP_FLOORPLAN_3A: "Use la rueda de desplazamiento para acercar o alejar.",
  13624. HELP_DESKTOP_FLOORPLAN_2B: "O use las teclas para girar hacia la izquierda o derecha.",
  13625. HELP_DESKTOP_FLOORPLAN_3B: "O use las teclas de dirección para acercar o alejar.",
  13626. HELP_MOBILE_PANORAMA_1: "Toque y arrastre para mirar alrededor del espacio.",
  13627. HELP_MOBILE_PANORAMA_2: "Toque en los aros a lo largo del espacio para moverse.",
  13628. HELP_MOBILE_3: "Use el gesto de pellizcar para acercar o alejar.",
  13629. HELP_MOBILE_360_2: "Toque el ícono Vista Interior para entrar en el Espacio.",
  13630. HELP_MOBILE_DOLLHOUSE_1: "Toque y arrastre con dos dedos para cambiar la posición della dollhouse.",
  13631. HELP_MOBILE_DOLLHOUSE_2: "Toque y arrastre con dos dedos para cambiar la posición de la vista aérea.",
  13632. HELP_MOBILE_FLOORPLAN_1: "Toque y arrastre para cambiar la posición de la planta.",
  13633. HELP_MOBILE_FLOORPLAN_2: "Toque y arrastre con dos dedos para girar la planta.",
  13634. HELP_MORE_HLR_A: "Galería destacada",
  13635. HELP_DESKTOP_MORE_HLR_B: "Abra para navegar a través del espacio utilizando imágenes en miniatura.",
  13636. HELP_MORE_DOLLHOUSE_A: "Vista aérea por pisos",
  13637. HELP_DESKTOP_MORE_DOLLHOUSE_B: "Haga clic para ver y girar la Dollhouse del espacio completo en 3D.",
  13638. HELP_MOBILE_MORE_DOLLHOUSE_B: "Toque para ver y girar la vista Dollhouse del espacio completo en 3D.",
  13639. HELP_MORE_FLOORS_A: "Seleccionador de plantas",
  13640. HELP_DESKTOP_MORE_FLOORS_B: "Cambie de una planta a otra en el espacio.",
  13641. HELP_MORE_TAG_A: "tag™ Posts",
  13642. HELP_DESKTOP_MORE_TAG_B: "Haga clic o coloque el cursor para obtener más información acerca de las características del espacio.",
  13643. HELP_MOBILE_MORE_TAG_B: "Toque para obtener más información acerca de las características del espacio.",
  13644. HELP_MORE_ZOOM_A: "Controles de zoom",
  13645. HELP_DESKTOP_MORE_ZOOM_B: "Use estos controles o la rueda de desplazamiento para acercar o alejar.",
  13646. HELP_MORE_TOUR_A: "Controles de recorrido",
  13647. HELP_DESKTOP_MORE_TOUR_B: "Reproduzca, pause, adelante o retroceda a través de un recorrido guiado.",
  13648. HELP_MORE_INSIDE_A: "Vista interior",
  13649. HELP_DESKTOP_MORE_INSIDE_B: "Haga clic para explorar el interior del espacio.",
  13650. HELP_MOBILE_MORE_INSIDE_B: "Toque para explorar el interior del espacio.",
  13651. HELP_MORE_VR_A: "Modo de realidad virtual",
  13652. HELP_DESKTOP_MORE_VR_B: "Toque para ver el espacio en realidad virtual.",
  13653. HELP_MOBILE_MORE_VR_B: "Toque para ver el espacio en realidad virtual.",
  13654. HELP_MORE_360_A: "360° Views",
  13655. HELP_DESKTOP_MORE_360_B: "Una vez que se encuentre en galería destacada, haga clic en vistas de 360º para ver el exterior.",
  13656. HELP_MOBILE_MORE_360_B: "Una vez que se encuentre en galería destacada, toque en vistas de 360º para ver el exterior.",
  13657. HELP_MORE_FULLSCREEN_A: "Pantalla completa",
  13658. HELP_DESKTOP_MORE_FULLSCREEN_B: "Expanda el escenario 3D para verlo en pantalla completa.",
  13659. WEBVR_FOR_CARDBOARD: "Para Google Cardboard",
  13660. WEBVR_FOR_DAYDREAM: "Para Daydream View",
  13661. WEBVR_ENTER_WEBVR: "ENTRAR VR",
  13662. WEBVR_DIFFERENT_HEADSET: "¿Tiene un auricular diferente?",
  13663. WEBVR_LEARN_MORE: "Más información",
  13664. WEBVR_VIEW_SPACE: "Ver Espacio en VR",
  13665. WEBVR_DAYDREAM_VIEW: "Daydream View",
  13666. WEBVR_DAYDREAM_PHONE: "Daydream Teléfono listos",
  13667. WEBVR_VIEW_CARDBOARD: "O Ver en Google Cardboard",
  13668. VR_NEED_DAYDREAM: "Necesidades antes de acoplarse con Daydream View",
  13669. VR_NEED_DAYDREAM_PHONE: "Teléfono listo para Daydream",
  13670. VR_GOOGLE_DAYDREAM: "Daydream de Google",
  13671. VR_APP: "port VR App",
  13672. VR_COMPATIBLE_ANDROID_LONG: 'Compatible con los Dispositivos Android con Pantallas de 4.5"-5.5" operando Android OS 4.4.4 y posteriores',
  13673. VR_APP_FOR_ANDROID: "Aplicación port VR para Teléfonos Android",
  13674. VR_APP_OPEN: "Abrir con la aplicación port VR en su lugar",
  13675. VR_VIEW_SPACE: "Ver Espacio en realidad virtual",
  13676. VR_LEARN_MORE_CAPS: "SABER MÁS",
  13677. VR_PREVIOUS_CAPS: "ANTERIOR",
  13678. VR_NEXT_CAPS: "SIGUIENTE",
  13679. VR_GOT_IT_CAPS: "COMPRENDIDO",
  13680. VR_SHOW_SUPPORTED: "Pulse para ver el Espacio en realidad virtual con",
  13681. VR_SHOW_UNSUPPORTED: "Lo sentimos, pero su dispositivo no cumple los requisitos mínimos para ver un Espacio en realidad virtual.",
  13682. VR_SHOW_IOS_1: "Pulse para ver el Espacio en realidad virtual",
  13683. VR_SHOW_IOS_2: "Necesita la aplicación port VR y un iPhone compatible para ver",
  13684. VR_WHAT_YOU_NEED: "Lo que necesitaras...",
  13685. VR_NEED_CARDBOARD: "Lo que necesitaras con Google Cardboard",
  13686. VR_NEED_SAMSUNG: "Lo que necesitaras con el Samsung Gear VR",
  13687. VR_GOOGLE_CARDBOARD: "Google Cardboard",
  13688. VR_SAMSUNG_GEAR_VR: "Samsung Gear VR",
  13689. VR_COMPATIBLE_IPHONES_1: "iPhones",
  13690. VR_COMPATIBLE_IPHONES_2: "Compatible con iPhone 6S o superior y con iOS 9.1 en adelante",
  13691. VR_COMPATIBLE_IPHONES_3: "iPhones compatibles",
  13692. VR_COMPATIBLE_ANDROID: "Dispositivos Android compatibles",
  13693. VR_ANDROID_DETAIL: "Pantallas de 11.43 cm a 13.97 cm con OS de Android 4.4.4 en adelante",
  13694. VR_ANDROID_DVICES: "Dispositivos Android",
  13695. VR_COMPATIBLE_SAMSUNG: "Dispositivos compatibles del Samsung",
  13696. VR_SAMSUNG_DETAIL: "Galaxy S5 en adelante",
  13697. VR_APP_FOR_CARDBOARD: "Aplicación port VR para Google Cardboard",
  13698. VR_APP_FOR_SAMSUNG: "Aplicación port VR para Gear VR",
  13699. VR_DOWNLOAD_HERE: "Descargar aquí",
  13700. VR_REQUIRE_HEADSET: "Necesita un casco de realidad virtual y que se instale la aplicación port VR para Android",
  13701. VR_REDIRECT_TO_STORE: "Si la aplicación no está instalada, se le redirigirá a la tienda de aplicaciones.",
  13702. VR_IMPROPER_EMBED: "El espacio de port no está incorporado correctamente para apoyar VR en su navegador web.",
  13703. VR_OPEN_ANDROID_LINK: "Abre el enlace en tu teléfono móvil",
  13704. VR_ANDROID_OPTIONS: "Opciones de auriculares en RV disponibles",
  13705. SHARE_TO: "Compartir en",
  13706. SHARE_LINK: "Enlace directo",
  13707. SHARE_EXPLORE: "Explorar ",
  13708. SHARE_AT: "en",
  13709. SHARE_WITH: "con",
  13710. SHARE_3D: " en 3D",
  13711. SHARE_COPIED: "¡Copiado!",
  13712. ERROR_BROWSER_SOLUTION: "Instale un nuevo navegador para explorar en 3D.",
  13713. ERROR_BROWSER_EXPLANATION: "WebGL requiere un navegador moderno.",
  13714. ERROR_GENERIC_PROBLEM: "Vaya, algo ha ido mal.",
  13715. ERROR_GENERIC_SOLUTION: "Reinicie su navegador.",
  13716. ERROR_GENERIC_ACTIONS_1: "Si el problema persiste, ",
  13717. ERROR_GENERIC_ACTIONS_2: "instale un navegador compatible",
  13718. ERROR_GENERIC_ACTIONS_3: " o ",
  13719. ERROR_GENERIC_ACTIONS_4: "consulte nuestra guía de solución de problemas",
  13720. ERROR_WEBGL_UNSUPPORTED_PROBLEM: "Navegador no compatible.",
  13721. ERROR_WEBGL_IOS_PROBLEM: "Versión de iOS no compatible.",
  13722. ERROR_WEBGL_IOS_SOLUTION: "Actualice a iOS 8 o superior para explorar en 3D.",
  13723. ERROR_WEBGL_IOS_ACTIONS_1: "Pulse ",
  13724. ERROR_WEBGL_IOS_ACTIONS_2: "Ajustes > General > Actualización de software",
  13725. ERROR_WEBGL_SAFARI_PROBLEM: "Habilite WebGL para explorar en 3D.",
  13726. ERROR_WEBGL_SAFARI_ACTIONS_1: "Haga clic en ",
  13727. ERROR_WEBGL_SAFARI_ACTIONS_2: "Preferencias > Avanzado > Mostrar el menú Desarrollar",
  13728. ERROR_WEBGL_SAFARI_ACTIONS_3: "Después, haga clic en ",
  13729. ERROR_WEBGL_SAFARI_ACTIONS_4: "Desarrollar > Habilitar WebGL",
  13730. ERROR_MISSING_URLS_PROBLEM: "Vaya, no hay panoramas para este modelo.",
  13731. ERROR_MISSING_URLS_EXPLANATION: "Este es un modelo antiguo. El propietario del sitio web puede tener un nuevo modelo en mente.",
  13732. ERROR_LOADING_FAILED_PROBLEM: "Vaya, modelo no disponible.",
  13733. ERROR_LOADING_FAILED_ACTIONS_1: "Si el problema persiste, ",
  13734. ERROR_LOADING_FAILED_ACTIONS_2: "consulte nuestra guía de solución de problemas",
  13735. ERROR_MAINTENANCE_PROBLEM: "Mantenimiento en progreso.",
  13736. ERROR_MAINTENANCE_SOLUTION: "Regrese en unos minutos.",
  13737. LINK_TO_LOCATION: "Enlace a la ubicación",
  13738. MENU_COPY: "Copiar",
  13739. LINK_ALERT_COPY: "Utilice CTRL/CMD + C para copiar.",
  13740. ROTATE: "Girar",
  13741. INSIDE: "Interior",
  13742. MOVE: "Moverse",
  13743. ZOOM: "Acercar o alejar"
  13744. }
  13745. }
  13746. , {}],
  13747. 113: [function(e, t, i) {
  13748. "use strict";
  13749. t.exports = {
  13750. PAGE_TITLE: "",
  13751. LOADING: "Chargement",
  13752. PRESENTED_BY_CAPS: "PRÉSENTÉ PAR",
  13753. POWERED_BY: "alimenté par ",
  13754. POWERED_BY_CAPS: "ALIMENTÉ PAR",
  13755. DESKTOP_SHORT_CTA: "Cliquez pour explorer l'Espace 3D.",
  13756. MOBILE_SHORT_CTA: "Cliquez pour explorer l'Espace 3D.",
  13757. PRESENTED_BY: "Présenté par ",
  13758. MORE: "Plus ",
  13759. LESS: "Moins ",
  13760. TAG_CONTENT: "Contenu tag™",
  13761. SHOW: "Montrer",
  13762. HIDE: "Cacher",
  13763. DOLLHOUSE: "Dollhouse",
  13764. FLOOR_PLAN: "Plan de sol",
  13765. OPEN_HIGHLIGHTS: "Ouvrir les faits saillants",
  13766. CLOSE_HIGHLIGHTS: "Fermer",
  13767. PREVIOUS: "Précédent",
  13768. PLAY: "Lecture",
  13769. PAUSE: "Pause",
  13770. NEXT: "Suivant",
  13771. EXPLORE_3D_SPACE: "Explorer l'Espace en 3D",
  13772. VIEW_DOLLHOUSE: "Voir dollhouse",
  13773. SOCIAL_SHARING: "Partager cet espace",
  13774. VIEW_IN_VR: "Voir en VR",
  13775. VIEW_FULLSCREEN: "Plein écran",
  13776. EXIT_FULLSCREEN: "Fermer plein écran",
  13777. ZOOM_IN: "Zoom avant",
  13778. ZOOM_OUT: "Zoom arrière",
  13779. FLOOR_NAME: "Étage ",
  13780. FLOOR_ALL: "Tous",
  13781. TERMS: "Mentions légales",
  13782. PORT_TERMS: "port mentions légales",
  13783. TERMS_OF_USE: "Conditions d'utilisation",
  13784. TERMS_TEXT_FILE: "terms-fr-FR.html",
  13785. CLOSE_TERMS: "Fermer",
  13786. TERMS_FAIL: "Impossible d'accéder aux mentions légales. Vérifiez que vous avez une connexion Internet pour afficher les conditions d'utilisation.",
  13787. HELP: "Aide",
  13788. HELP_NAVIGATION_TAB: "Navigation",
  13789. HELP_MORE_HELP_TAB: "Aide",
  13790. CLOSE: "Fermer",
  13791. HELP_DESKTOP_PANORAMA_1A: "Cliquez et faites glisser pour regarder autour de l’espace.",
  13792. HELP_DESKTOP_PANORAMA_2A: "Cliquez sur les anneaux pour vous déplacer.",
  13793. HELP_DESKTOP_PANORAMA_3A: "Utilisez la molette de votre souris pour zoomer.",
  13794. HELP_DESKTOP_PANORAMA_1B: "Ou utilisez les touches pour tourner.",
  13795. HELP_DESKTOP_PANORAMA_2B: "Ou utilisez les touches pour avancer et reculer.",
  13796. HELP_DESKTOP_PANORAMA_3B: "Ou utilisez les touches plus et moins pour zoomer.",
  13797. HELP_DESKTOP_360_2A: "Cliquez sur l’icône Vue Intérieure pour entrer dans l’Espace.",
  13798. HELP_DESKTOP_360_2B: "Ou, appuyez sur la touche numéro 1 pour entrer dans la Vue Intérieure.",
  13799. HELP_DESKTOP_DOLLHOUSE_1A: "Faites un clic gauche et bougez votre souris pour faire pivoter la vue Dollhouse.",
  13800. HELP_DESKTOP_DOLLHOUSE_2A: "Faites un clic droit et bougez votre souris pour changer la position de la vue Dollhouse.",
  13801. HELP_DESKTOP_DOLLHOUSE_3A: "Utilisez la molette de votre souris pour zoomer.",
  13802. HELP_DESKTOP_DOLLHOUSE_1B: "Ou utilisez les touches pour faire pivoter la vue Dollhouse.",
  13803. HELP_DESKTOP_FLOORPLAN_1A: "Faites un clic droit pour changer la position du plan sur l’écran.",
  13804. HELP_DESKTOP_FLOORPLAN_2A: "Faites un clic droit et faites glisser à gauche ou à droite pour faire pivoter le plan.",
  13805. HELP_DESKTOP_FLOORPLAN_3A: "Utilisez la molette de votre souris pour zoomer.",
  13806. HELP_DESKTOP_FLOORPLAN_2B: "Ou utilisez les touches pour faire pivoter à gauche ou à droite.",
  13807. HELP_DESKTOP_FLOORPLAN_3B: "Ou utilisez les touches pour effectuer un zoom avant ou arrière.",
  13808. HELP_MOBILE_PANORAMA_1: "Touchez et faites glisser pour regarder autour de l’espace.",
  13809. HELP_MOBILE_PANORAMA_2: "Tapez sur les anneaux dans tout l’espace pour vous déplacer.",
  13810. HELP_MOBILE_3: "Utilisez un geste de pincement pour zoomer avant/arrière.",
  13811. HELP_MOBILE_360_2: "Tapez sur l’icône Vue Intérieure pour entrer dans l’Espace.",
  13812. HELP_MOBILE_DOLLHOUSE_1: "Touchez et faites glisser vers le haut/bas/gauche/droite pour faire pivoter la vue Dollhouse.",
  13813. HELP_MOBILE_DOLLHOUSE_2: "Touchez et faites glisser avec deux doigts pour positionner vue en coupe.",
  13814. HELP_MOBILE_FLOORPLAN_1: "Touchez et faites glisser pour positionner le plan.",
  13815. HELP_MOBILE_FLOORPLAN_2: "Touchez et faites glisser avec deux doigts pour faire pivoter le plan.",
  13816. HELP_MORE_HLR_A: "Carrousel",
  13817. HELP_DESKTOP_MORE_HLR_B: "Ouvrez pour naviguer dans l’espace en utilisant les vignettes.",
  13818. HELP_MORE_DOLLHOUSE_A: "Vue en coupe",
  13819. HELP_DESKTOP_MORE_DOLLHOUSE_B: "Cliquez pour afficher et faire pivoter l’espace entier en 3D.",
  13820. HELP_MOBILE_MORE_DOLLHOUSE_B: "Tapez pour afficher et faire pivoter l’espace entier en 3D.",
  13821. HELP_MORE_FLOORS_A: "Sélecteur d’étage",
  13822. HELP_DESKTOP_MORE_FLOORS_B: "Basculer entre les étages dans l’espace.",
  13823. HELP_MORE_TAG_A: "tag™ Posts",
  13824. HELP_DESKTOP_MORE_TAG_B: "Cliquez ou survolez pour obtenir des informations sur l’espace.",
  13825. HELP_MOBILE_MORE_TAG_B: "Tapez pour obtenir des informations sur l’espace.",
  13826. HELP_MORE_ZOOM_A: "Commandes de zoom",
  13827. HELP_DESKTOP_MORE_ZOOM_B: "Utilisez votre clavier ou la molette de votre souris pour zoomer.",
  13828. HELP_MORE_TOUR_A: "Commandes de la visite",
  13829. HELP_DESKTOP_MORE_TOUR_B: "Mettez en marche ou en pause, avancez et reculez lors d'une visite guidée.",
  13830. HELP_MORE_INSIDE_A: "Vue intérieure",
  13831. HELP_DESKTOP_MORE_INSIDE_B: "Cliquez pour explorer l’intérieur de l’espace.",
  13832. HELP_MOBILE_MORE_INSIDE_B: "Tapez pour explorer l’intérieur de l’espace.",
  13833. HELP_MORE_VR_A: "Mode RV",
  13834. HELP_DESKTOP_MORE_VR_B: "Cliquez pour lancer l’espace en réalité virtuelle.",
  13835. HELP_MOBILE_MORE_VR_B: "Tapez pour lancer l’espace en réalité virtuelle.",
  13836. HELP_MORE_360_A: "Vues 360°",
  13837. HELP_DESKTOP_MORE_360_B: "Cliquez sur vues 360°, dans le carrousel pour voir les scènes extérieures.",
  13838. HELP_MOBILE_MORE_360_B: "Tapez sur vues 360°, dans le carrousel pour voir les scènes extérieures.",
  13839. HELP_MORE_FULLSCREEN_A: "Plein écran",
  13840. HELP_DESKTOP_MORE_FULLSCREEN_B: "Voir 3D Showcase en plein écran.",
  13841. WEBVR_FOR_CARDBOARD: "Pour Google Cardboard",
  13842. WEBVR_FOR_DAYDREAM: "Pour Daydream View",
  13843. WEBVR_ENTER_WEBVR: "ENTRER VR",
  13844. WEBVR_DIFFERENT_HEADSET: "Avez-vous un casque différent?",
  13845. WEBVR_LEARN_MORE: "En savoir plus",
  13846. WEBVR_VIEW_SPACE: "Voir Espace en VR",
  13847. WEBVR_DAYDREAM_VIEW: "Daydream View",
  13848. WEBVR_DAYDREAM_PHONE: "Téléphone compatibles Daydream",
  13849. WEBVR_VIEW_CARDBOARD: "Ou Afficher sur Google Cardboard",
  13850. VR_VIEW_SPACE: "Voir l'Espace en Réalité Virtuelle",
  13851. VR_LEARN_MORE_CAPS: "EN SAVOIR PLUS",
  13852. VR_PREVIOUS_CAPS: "PRÉCÉDENT",
  13853. VR_NEXT_CAPS: "SUIVANT",
  13854. VR_GOT_IT_CAPS: "BIEN COMPRIS",
  13855. VR_SHOW_SUPPORTED: "Taper pour voir l'Espace en VR avec",
  13856. VR_SHOW_UNSUPPORTED: "Désolé mais votre appareil ne répond pas aux critères minimaux pour voir cet Espace en mode VR.",
  13857. VR_SHOW_IOS_1: "Taper pour voir l’Espace en Realité Virtuelle",
  13858. VR_SHOW_IOS_2: "Nécessite l’application port VR et un iPhone compatible pour voir",
  13859. VR_WHAT_YOU_NEED: "Ce dont vous aurez besoin pour...",
  13860. VR_NEED_CARDBOARD: "Ce dont vous aurez besoin avec Google Cardboard",
  13861. VR_NEED_SAMSUNG: "Ce dont vous aurez besoin avec Samsung Gear VR",
  13862. VR_NEED_DAYDREAM: "BESOINS AVANT APPARIEMENT AVEC DAYDREAM VIEW",
  13863. VR_NEED_DAYDREAM_PHONE: "Téléphone compatible avec Daydream",
  13864. VR_GOOGLE_CARDBOARD: "Google Cardboard",
  13865. VR_GOOGLE_DAYDREAM: "Google Daydream",
  13866. VR_APP: "port VR App",
  13867. VR_SAMSUNG_GEAR_VR: "Samsung Gear VR",
  13868. VR_COMPATIBLE_IPHONES_1: "iPhones",
  13869. VR_COMPATIBLE_IPHONES_2: "iPhone 5s et plus récent, avec iOS 9.1 et plus récent",
  13870. VR_COMPATIBLE_IPHONES_3: "iPhones compatibles",
  13871. VR_COMPATIBLE_ANDROID: "Appareils Android compatibles",
  13872. 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",
  13873. VR_ANDROID_DETAIL: 'Écrans 4.5" à 5.5" avec Android 4.4.4 ou plus récent',
  13874. VR_ANDROID_DVICES: "Appareils Android",
  13875. VR_COMPATIBLE_SAMSUNG: "Appareils Samsung Compatibles",
  13876. VR_SAMSUNG_DETAIL: "Galaxy S6 et plus récents",
  13877. VR_APP_FOR_CARDBOARD: "Application port VR pour Google Cardboard",
  13878. VR_APP_FOR_SAMSUNG: "Application port VR pour Gear VR",
  13879. VR_APP_FOR_ANDROID: "Application port VR pour téléphones Android",
  13880. VR_APP_OPEN: "Ouvrir plutôt avec l’application port VR",
  13881. VR_DOWNLOAD_HERE: "Télécharger ici",
  13882. VR_REQUIRE_HEADSET: "Nécessite un casque VR et l'application port VR pour Android afin d'être installé",
  13883. VR_REDIRECT_TO_STORE: "Si l'application n'est pas installée, vous serez rediriger vers l'App store.",
  13884. VR_IMPROPER_EMBED: "L'Espace port n'est pas correctement intégré pour supporter VR dans votre navigateur Web.",
  13885. VR_OPEN_ANDROID_LINK: "Ouvrez ce lien avec votre appareil mobile",
  13886. VR_ANDROID_OPTIONS: "Options disponibles pour casque VR sous",
  13887. SHARE_TO: "Partager sur",
  13888. SHARE_LINK: "Lien direct",
  13889. SHARE_EXPLORE: "Explorer ",
  13890. SHARE_AT: "à",
  13891. SHARE_WITH: "avec",
  13892. SHARE_3D: " en 3D",
  13893. SHARE_COPIED: "Copié!",
  13894. ERROR_BROWSER_SOLUTION: "Installer un nouveau navigateur pour explorer en 3D.",
  13895. ERROR_BROWSER_EXPLANATION: "WebGL a besoin d'un navigateur récent.",
  13896. ERROR_GENERIC_PROBLEM: "Il y eu un problème.",
  13897. ERROR_GENERIC_SOLUTION: "Redémarrer votre navigateur.",
  13898. ERROR_GENERIC_ACTIONS_1: "Si le problème persiste, ",
  13899. ERROR_GENERIC_ACTIONS_2: "installez un navigateur plus récent",
  13900. ERROR_GENERIC_ACTIONS_3: " ou ",
  13901. ERROR_GENERIC_ACTIONS_4: "voir notre guide de dépannage",
  13902. ERROR_WEBGL_UNSUPPORTED_PROBLEM: "Navigateur non-supporté.",
  13903. ERROR_WEBGL_IOS_PROBLEM: "Version iOS non-supportée.",
  13904. ERROR_WEBGL_IOS_SOLUTION: "Mettre à jour avec iOS8 au minimum pour voir l'Espace en 3D.",
  13905. ERROR_WEBGL_IOS_ACTIONS_1: "Tapez ",
  13906. ERROR_WEBGL_IOS_ACTIONS_2: "Paramètres > Général > Mise à jour Software",
  13907. ERROR_WEBGL_SAFARI_PROBLEM: "Activez WegGL pour explorer en 3D.",
  13908. ERROR_WEBGL_SAFARI_ACTIONS_1: "Cliquez ",
  13909. ERROR_WEBGL_SAFARI_ACTIONS_2: "Préferences > Avancés > Voir menu développeur",
  13910. ERROR_WEBGL_SAFARI_ACTIONS_3: "Puis cliquez ",
  13911. ERROR_WEBGL_SAFARI_ACTIONS_4: "Développe > Activé WebGL",
  13912. ERROR_MISSING_URLS_PROBLEM: "Il n'y a pas de panoromas pour ce modèle.",
  13913. ERROR_MISSING_URLS_EXPLANATION: "Ceci est un ancien modèle. Le propriétaire du site a peut-être un nouveau modèle en cours.",
  13914. ERROR_LOADING_FAILED_PROBLEM: "Ce modèle n'est pas disponible.",
  13915. ERROR_LOADING_FAILED_ACTIONS_1: "Si le problème persiste, ",
  13916. ERROR_LOADING_FAILED_ACTIONS_2: "voir notre guide de dépannage",
  13917. ERROR_MAINTENANCE_PROBLEM: "Maintenance en cours.",
  13918. ERROR_MAINTENANCE_SOLUTION: "Revenez dans quelques instants.",
  13919. LINK_TO_LOCATION: "Lien vers l'emplacement",
  13920. MENU_COPY: "Copie",
  13921. LINK_ALERT_COPY: "Utiliser CTRL+CMD C pour copier.",
  13922. ROTATE: "Faire pivoter",
  13923. INSIDE: "Intérieure",
  13924. MOVE: "Se déplacer",
  13925. ZOOM: "Zoom"
  13926. }
  13927. }
  13928. , {}],
  13929. 114: [function(e, t, i) {
  13930. "use strict";
  13931. t.exports = {
  13932. PAGE_TITLE: "",
  13933. LOADING: "読み込み中",
  13934. PRESENTED_BY_CAPS: "PRESENTED BY",
  13935. POWERED_BY: "powered by",
  13936. POWERED_BY_CAPS: "POWERED BY",
  13937. DESKTOP_SHORT_CTA: "クリックしてこの3D Spaceを探索",
  13938. MOBILE_SHORT_CTA: "タップしてこの3D Spaceを探索",
  13939. PRESENTED_BY: "Presented by ",
  13940. MORE: "全て表示 ",
  13941. LESS: "閉じる ",
  13942. TAG_CONTENT: "tag™コンテンツ ",
  13943. SHOW: "表示",
  13944. HIDE: "非表示",
  13945. DOLLHOUSE: "ドールハウス",
  13946. FLOOR_PLAN: "フロアプラン",
  13947. OPEN_HIGHLIGHTS: "ハイライトを開く",
  13948. CLOSE_HIGHLIGHTS: "閉じる",
  13949. PREVIOUS: "前へ",
  13950. PLAY: "再生",
  13951. PAUSE: "一時停止",
  13952. NEXT: "次へ",
  13953. EXPLORE_3D_SPACE: "3DSpaceの探索",
  13954. VIEW_DOLLHOUSE: "ドールハウスの表示",
  13955. SOCIAL_SHARING: "このSpaceを共有する",
  13956. VIEW_IN_VR: "VRで表示",
  13957. VIEW_FULLSCREEN: "フルスクリーン表示",
  13958. EXIT_FULLSCREEN: "フルスクリーン表示を終了",
  13959. ZOOM_IN: "ズームイン",
  13960. ZOOM_OUT: "ズームアウト",
  13961. FLOOR_NAME: "フロア ",
  13962. FLOOR_ALL: "すべて",
  13963. TERMS: "規約",
  13964. PORT_TERMS: "port規約",
  13965. TERMS_OF_USE: "利用規約",
  13966. CLOSE_TERMS: "閉じる",
  13967. TERMS_TEXT_FILE: "terms-jp-JP.html",
  13968. TERMS_FAIL: "規約を取得できませんでした。利用規約を表示するためにインターネットに接続されていることを確認してください。",
  13969. WEBVR_FOR_DAYDREAM: "Daydream View用",
  13970. WEBVR_ENTER_WEBVR: "VRに入る",
  13971. WEBVR_DIFFERENT_HEADSET: "別のヘッドセットをお持ちですか?",
  13972. WEBVR_LEARN_MORE: "もっと詳しく",
  13973. WEBVR_VIEW_SPACE: "VRでSpaceを表示",
  13974. WEBVR_DAYDREAM_VIEW: "Daydream View",
  13975. WEBVR_DAYDREAM_PHONE: "Daydream対応スマホ",
  13976. WEBVR_FOR_CARDBOARD: "Google Cardboard用",
  13977. WEBVR_VIEW_CARDBOARD: "またはGoogle Cardboardで表示",
  13978. VR_VIEW_SPACE: "バーチャルリアリティでSpaceを表示",
  13979. VR_LEARN_MORE_CAPS: "もっと詳しく",
  13980. VR_PREVIOUS_CAPS: "前へ",
  13981. VR_NEXT_CAPS: "次へ",
  13982. VR_GOT_IT_CAPS: "了解",
  13983. VR_SHOW_SUPPORTED: "タップして次を使用してVRでSpaceを表示: ",
  13984. VR_SHOW_UNSUPPORTED: "お使いのデバイスはVRでSpaceを表示する最低要件を満たしていません",
  13985. VR_SHOW_IOS_1: "タップしてVRでSpaceを表示",
  13986. VR_SHOW_IOS_2: "表示するにはport VRアプリと互換性のあるiPhoneが必要です",
  13987. VR_WHAT_YOU_NEED: "必要なもの",
  13988. VR_NEED_CARDBOARD: "Google Cardboardに必要なもの",
  13989. VR_NEED_SAMSUNG: "Samsung Gear VRに必要なもの",
  13990. VR_NEED_DAYDREAM: "事前にDaydream Viewとのペアリングが必要です",
  13991. VR_NEED_DAYDREAM_PHONE: "Daydream対応スマホ",
  13992. VR_GOOGLE_CARDBOARD: "Google Cardboard",
  13993. VR_GOOGLE_DAYDREAM: "Google Daydream",
  13994. VR_APP: "port VRアプリ",
  13995. VR_SAMSUNG_GEAR_VR: "Samsung Gear VR",
  13996. VR_COMPATIBLE_IPHONES_1: "iPhone",
  13997. VR_COMPATIBLE_IPHONES_2: "iOS 9.1以降で動作するiPhone 5s以降のモデル",
  13998. VR_COMPATIBLE_IPHONES_3: "互換性のあるiPhone",
  13999. VR_COMPATIBLE_ANDROID: "互換性のあるAndroidデバイス",
  14000. VR_COMPATIBLE_ANDROID_LONG: "Android OS 4.4.4以降で動作する互換性のあるAndroidデバイスの4.5~5.5インチディスプレイ",
  14001. VR_ANDROID_DETAIL: "Android OS 4.4.4以降で動作する4.5~5.5インチディスプレイ",
  14002. VR_ANDROID_DVICES: "Androidデバイス",
  14003. VR_COMPATIBLE_SAMSUNG: "互換性のあるSamsungデバイス",
  14004. VR_SAMSUNG_DETAIL: "Galaxy S5以降のモデル",
  14005. VR_APP_FOR_CARDBOARD: "Google Cardboard用のport VRアプリ",
  14006. VR_APP_FOR_SAMSUNG: "Gear VR 用のport VRアプリ",
  14007. VR_APP_FOR_ANDROID: "Androidフォン用のport VRアプリ",
  14008. VR_APP_OPEN: "port VRアプリで開く",
  14009. VR_DOWNLOAD_HERE: "ここからダウンロード",
  14010. VR_REQUIRE_HEADSET: "Android 用のVRヘッドセットとport VRアプリ をインストールする必要があります",
  14011. VR_REDIRECT_TO_STORE: "アプリがインストールされていない場合、App Storeにリダイレクトされます",
  14012. VR_IMPROPER_EMBED: "お使いのウェブブラウザでVRがサポートされるようport Spaceが適切に埋め込まれていません。",
  14013. VR_OPEN_ANDROID_LINK: "お使いの携帯電話でリンクを開いてください",
  14014. VR_ANDROID_OPTIONS: "利用可能なVRヘッドセットオプション",
  14015. SHARE_TO: "共有先",
  14016. SHARE_LINK: "ダイレクトリンク",
  14017. SHARE_EXPLORE: "探索",
  14018. SHARE_AT: "場所",
  14019. SHARE_WITH: "使用アプリ",
  14020. SHARE_3D: "3Dで",
  14021. SHARE_COPIED: "コピーされました!",
  14022. ERROR_BROWSER_SOLUTION: "3D探索するには、新しいバージョンのブラウザをインストールしてください",
  14023. ERROR_BROWSER_EXPLANATION: "WebGLにはモダンブラウザが必要です。",
  14024. ERROR_GENERIC_PROBLEM: "問題が発生しました。",
  14025. ERROR_GENERIC_SOLUTION: "ブラウザを再起動してください。",
  14026. ERROR_GENERIC_ACTIONS_1: "問題が解決しない場合は、",
  14027. ERROR_GENERIC_ACTIONS_2: "サポートされているブラウザをインストールしてください",
  14028. ERROR_GENERIC_ACTIONS_3: "または",
  14029. ERROR_GENERIC_ACTIONS_4: "トラブルシューティングガイドを参照してください",
  14030. ERROR_WEBGL_UNSUPPORTED_PROBLEM: "ブラウザがサポートされていません。",
  14031. ERROR_WEBGL_IOS_PROBLEM: "サポートされていないiOSバージョンです。",
  14032. ERROR_WEBGL_IOS_SOLUTION: "3D探索するには、iOS 8以降にアップグレードしてください。",
  14033. ERROR_WEBGL_IOS_ACTIONS_1: "以下の順にタップします:",
  14034. ERROR_WEBGL_IOS_ACTIONS_2: "設定 > 全般 > ソフトウェアの更新",
  14035. ERROR_WEBGL_SAFARI_PROBLEM: "WebGLを有効にして3Dで探索します。",
  14036. ERROR_WEBGL_SAFARI_ACTIONS_1: "以下の順にクリックします:",
  14037. ERROR_WEBGL_SAFARI_ACTIONS_2: "環境設定 > 詳細 > メニューバーに開発メニューを表示",
  14038. ERROR_WEBGL_SAFARI_ACTIONS_3: "その後、以下の順にクリックします:",
  14039. ERROR_WEBGL_SAFARI_ACTIONS_4: "開発 > WebGLを有効にする",
  14040. ERROR_MISSING_URLS_PROBLEM: "このモデルではパノラマを使用できません。",
  14041. ERROR_MISSING_URLS_EXPLANATION: "これは古いモデルです。ウェブサイト所有者が新しいモデルを開発中かもしれません。",
  14042. ERROR_LOADING_FAILED_PROBLEM: "モデルは利用できません。",
  14043. ERROR_LOADING_FAILED_ACTIONS_1: "問題が解決しない場合は、",
  14044. ERROR_LOADING_FAILED_ACTIONS_2: "トラブルシューティングガイドを参照してください",
  14045. ERROR_MAINTENANCE_PROBLEM: "メンテナンスは進行中です。",
  14046. ERROR_MAINTENANCE_SOLUTION: "しばらくしてからやり直し てください。",
  14047. LINK_TO_LOCATION: "ロケーションへのリンク",
  14048. MENU_COPY: "コピー",
  14049. LINK_ALERT_COPY: "コピーするにはCTRL/CMD + Cを使用してください。",
  14050. ROTATE: "回転",
  14051. MOVE: "移動",
  14052. INSIDE: "内側",
  14053. ZOOM: "ズーム",
  14054. HELP: "ヘルプ",
  14055. HELP_NAVIGATION_TAB: "ナビゲーション",
  14056. HELP_MORE_HELP_TAB: "その他のヘルプ",
  14057. HELP_DESKTOP_PANORAMA_1A: "Spaceを見回すには、クリックしてドラッグします。",
  14058. HELP_DESKTOP_PANORAMA_2A: "移動するには、Space全体にあるリングをクリックします。",
  14059. HELP_DESKTOP_PANORAMA_3A: "スクロールホイールを使用してズームイン、ズームアウトします。",
  14060. HELP_DESKTOP_PANORAMA_1B: "または、矢印キーを使用して左右に向きを変えます。",
  14061. HELP_DESKTOP_PANORAMA_2B: "または、矢印キーを使用して前後に向きを変えます。",
  14062. HELP_DESKTOP_PANORAMA_3B: "あるいは、プラス(+)キーまたはマイナス(-)キーを使用して、ズームイン、ズームアウトします。",
  14063. HELP_DESKTOP_360_2A: "内側ビューアイコンをクリックしてSpaceに入ります。",
  14064. HELP_DESKTOP_360_2B: "または、数字キー1を押して内側ビューに入ります。",
  14065. HELP_DESKTOP_DOLLHOUSE_1A: "左クリックと左右、上下のドラッグでドールハウスを回転します。",
  14066. HELP_DESKTOP_DOLLHOUSE_2A: "右クリックと左右、上下のドラッグでドールハウスの画面上の位置を変更します。",
  14067. HELP_DESKTOP_DOLLHOUSE_3A: "スクロールホイールを使用してズームイン、ズームアウトします。",
  14068. HELP_DESKTOP_DOLLHOUSE_1B: "または、矢印キーを使用してドールハウスを回転します。",
  14069. HELP_DESKTOP_FLOORPLAN_1A: "左ボタンを押しながら、上下左右にドラッグしてフロアプランの画面上の位置を変更します。",
  14070. HELP_DESKTOP_FLOORPLAN_2A: "右ボタンを押しながら左右にドラッグして、フロアプランを回転します。",
  14071. HELP_DESKTOP_FLOORPLAN_3A: "スクロールホイールを使用してズームイン、ズームアウトします。",
  14072. HELP_DESKTOP_FLOORPLAN_2B: "または、矢印キーを使用して左右に回転します。",
  14073. HELP_DESKTOP_FLOORPLAN_3B: "または、矢印キーを使用して、ズームイン、ズームアウトします。",
  14074. HELP_MOBILE_PANORAMA_1: "Spaceを見回すには、タッチしてドラッグします。",
  14075. HELP_MOBILE_PANORAMA_2: "移動するには、Space全体にあるリングをタップします。",
  14076. HELP_MOBILE_3: "ピンチジェスチャーを使用してズームイン、ズームアウトします。",
  14077. HELP_MOBILE_360_2: "内側ビューアイコンをタップしてSpaceに入ります。",
  14078. HELP_MOBILE_DOLLHOUSE_1: "タッチして上下左右にドラッグしてドールハウスを回転します。",
  14079. HELP_MOBILE_DOLLHOUSE_2: "タッチして、2本指でドラッグしてドールハウスを配置します。",
  14080. HELP_MOBILE_FLOORPLAN_1: "タッチ&ドラッグしてフロアプランを配置します。",
  14081. HELP_MOBILE_FLOORPLAN_2: "タッチして、2本指でドラッグしてフロアプランを回転します。",
  14082. HELP_MORE_HLR_A: "ハイライト",
  14083. HELP_DESKTOP_MORE_HLR_B: "サムネイル画像を使用してSpaceを移動するために開きます。",
  14084. HELP_MORE_DOLLHOUSE_A: "ドールハウス",
  14085. HELP_DESKTOP_MORE_DOLLHOUSE_B: "クリックして3DでSpace全体のトップダウンビューを表示して回転します。",
  14086. HELP_MOBILE_MORE_DOLLHOUSE_B: "タップして3DでSpace全体のトップダウンビューを表示して回転します。",
  14087. HELP_MORE_FLOORS_A: "フロアセレクター",
  14088. HELP_DESKTOP_MORE_FLOORS_B: "Space内のフロアを切り替えます。",
  14089. HELP_MORE_TAG_A: "tag™ Posts",
  14090. HELP_DESKTOP_MORE_TAG_B: "クリックするか、カーソルを置くとSpace内の機能についての説明が表示されます。",
  14091. HELP_MOBILE_MORE_TAG_B: "タップするとSpace内の機能についての説明が表示されます。",
  14092. HELP_MORE_ZOOM_A: "ズームコントロール",
  14093. HELP_DESKTOP_MORE_ZOOM_B: "これらのコントロールまたはスクロールホイールを使用して、ズームイン、ズームアウトします。",
  14094. HELP_MORE_TOUR_A: "ツアーコントロール",
  14095. HELP_DESKTOP_MORE_TOUR_B: "ガイド付きツアー中に再生、一時停止、前方・後方に移動します。",
  14096. HELP_MORE_INSIDE_A: "内側ビュー",
  14097. HELP_DESKTOP_MORE_INSIDE_B: "クリックしてSpace内を探索します。",
  14098. HELP_MOBILE_MORE_INSIDE_B: "タップしてSpace内を探索します。",
  14099. HELP_MORE_VR_A: "VRモード",
  14100. HELP_DESKTOP_MORE_VR_B: "クリックしてバーチャルリアリティでSpaceを起動します。",
  14101. HELP_MOBILE_MORE_VR_B: "タップしてバーチャルリアリティでSpaceを起動します。",
  14102. HELP_MORE_360_A: "360° Views",
  14103. HELP_DESKTOP_MORE_360_B: "Highlight Reelの360° Viewsをクリックして屋外シーンを表示します。",
  14104. HELP_MOBILE_MORE_360_B: "Highlight Reelの360° Viewsをタップして屋外シーンを表示します。",
  14105. HELP_MORE_FULLSCREEN_A: "フルスクリーン",
  14106. HELP_DESKTOP_MORE_FULLSCREEN_B: "3D Showcaseをフルスクリーン表示にします。",
  14107. CLOSE: "閉じる"
  14108. }
  14109. }
  14110. , {}],
  14111. 115: [function(e, t, i) {
  14112. "use strict";
  14113. t.exports = {
  14114. PAGE_TITLE: "",
  14115. LOADING: "Загрузка",
  14116. PRESENTED_BY_CAPS: "ПРЕДСТАВЛЕНО",
  14117. POWERED_BY: "разработано на платформе ",
  14118. POWERED_BY_CAPS: "РАЗРАБОТАНО НА ПЛАТФОРМЕ",
  14119. DESKTOP_SHORT_CTA: "Нажмите для просмотра.",
  14120. MOBILE_SHORT_CTA: "Нажмите для просмотра.",
  14121. PRESENTED_BY: "Представлено ",
  14122. MORE: "Больше ",
  14123. LESS: "Меньше ",
  14124. TAG_CONTENT: "tag™ Контент",
  14125. SHOW: "Показать",
  14126. HIDE: "Скрыть",
  14127. DOLLHOUSE: "Dollhouse",
  14128. FLOOR_PLAN: "Планировка",
  14129. OPEN_HIGHLIGHTS: "Открыть Фотоколлаж",
  14130. CLOSE_HIGHLIGHTS: "Закрыть",
  14131. PREVIOUS: "Предыдущий",
  14132. PLAY: "Воспроизвести",
  14133. PAUSE: "Пауза",
  14134. NEXT: "Следующий",
  14135. EXPLORE_3D_SPACE: "Просмотреть 3D модель",
  14136. VIEW_DOLLHOUSE: "Посмотреть Dollhouse",
  14137. SOCIAL_SHARING: "Поделиться этой моделью",
  14138. VIEW_IN_VR: "Посмотреть в VR",
  14139. VIEW_FULLSCREEN: "Полный экран",
  14140. EXIT_FULLSCREEN: "Выйти из полноэкранного режима",
  14141. ZOOM_IN: "Увеличить",
  14142. ZOOM_OUT: "Уменьшить",
  14143. FLOOR_NAME: "Этаж ",
  14144. FLOOR_ALL: "Все",
  14145. TERMS: "Условия",
  14146. PORT_TERMS: "Правила пользования",
  14147. TERMS_OF_USE: "Условия использования",
  14148. TERMS_TEXT_FILE: "terms-ru-RU.html",
  14149. CLOSE_TERMS: "Закрыть",
  14150. TERMS_FAIL: "Не удалось загрузить условия использования. Для просмотра условий использования, пожалуйста, убедитесь, что у Вас есть подключение к Интернету.",
  14151. HELP: "Помощь",
  14152. HELP_NAVIGATION_TAB: "Навигация",
  14153. HELP_MORE_HELP_TAB: "Доп. Помощь",
  14154. CLOSE: "Закрыть",
  14155. HELP_DESKTOP_PANORAMA_1A: "Нажмите и перетащите, чтобы осмотреть пространство вокруг.",
  14156. HELP_DESKTOP_PANORAMA_2A: "Для передвижения по модели нажимайте на круги .",
  14157. HELP_DESKTOP_PANORAMA_3A: "Используйте колесо прокрутки для увеличения и уменьшения.",
  14158. HELP_DESKTOP_PANORAMA_1B: "Или используйте клавиши со стрелками для поворота влево и вправо.",
  14159. HELP_DESKTOP_PANORAMA_2B: "Или используйте стрелки для перемещения вперед и назад.",
  14160. HELP_DESKTOP_PANORAMA_3B: "Или используйте клавиши ‘плюс’ и ‘минус’ для увеличения и уменьшения изображения.",
  14161. HELP_DESKTOP_360_2A: "Нажмите на значок ‘Вид Изнутри’, чтобы увидеть внутреннюю панораму.",
  14162. HELP_DESKTOP_360_2B: "или нажмите 1 на клавиатуре, чтобы увидеть внутреннюю панораму.",
  14163. HELP_DESKTOP_DOLLHOUSE_1A: "Нажмите левую кнопку мыши и перетащите влево, вправо, вверх и вниз, чтобы повернуть Dollhouse.",
  14164. HELP_DESKTOP_DOLLHOUSE_2A: "Нажмите правую кнопку мыши и перетащите влево, вправо, вверх и вниз, чтобы изменить позицию Dollhouse на экране.",
  14165. HELP_DESKTOP_DOLLHOUSE_3A: "Используйте колесо прокрутки чтобы увеличить и уменьшить.",
  14166. HELP_DESKTOP_DOLLHOUSE_1B: "Или используйте клавиши со стрелками, чтобы повернуть Dollhouse.",
  14167. HELP_DESKTOP_FLOORPLAN_1A: "Нажмите левую кнопку мыши и перетащите влево, вправо, вверх и вниз, чтобы изменить положение Планировки на экране.",
  14168. HELP_DESKTOP_FLOORPLAN_2A: "Нажмите правую кнопку мыши и перетащите влево или вправо, чтобы повернуть Планировку.",
  14169. HELP_DESKTOP_FLOORPLAN_3A: "Используйте колесо прокрутки чтобы увеличить и уменьшить.",
  14170. HELP_DESKTOP_FLOORPLAN_2B: "Или используйте клавиши со стрелками для поворота влево или вправо.",
  14171. HELP_DESKTOP_FLOORPLAN_3B: "Или используйте стрелки для увеличения и уменьшения.",
  14172. HELP_MOBILE_PANORAMA_1: "Нажмите и перетащите, чтобы осмотреть модель.",
  14173. HELP_MOBILE_PANORAMA_2: "Для передвижения по модели нажимайте на круги.",
  14174. HELP_MOBILE_3: "Используйте движение двумя пальцами в разные стороны, чтобы увеличить и уменьшить.",
  14175. HELP_MOBILE_360_2: "Нажмите на значок ‘Вид Изнутри’, чтобы увидеть внутреннюю панораму.",
  14176. HELP_MOBILE_DOLLHOUSE_1: "Нажмите и перетащите вверх, вниз, влево и вправо, чтобы повернуть Dollhouse.",
  14177. HELP_MOBILE_DOLLHOUSE_2: "Нажмите и перетащите, чтобы расположить Dollhouse.",
  14178. HELP_MOBILE_FLOORPLAN_1: "Нажмите и перетащите, чтобы расположить план здания.",
  14179. HELP_MOBILE_FLOORPLAN_2: "Коснитесь и перетащите двумя пальцами, чтобы повернуть план здания.",
  14180. HELP_MORE_HLR_A: "Фотоколлаж",
  14181. HELP_DESKTOP_MORE_HLR_B: "Откройте для перемещения по модели, используя иконки изображений.",
  14182. HELP_MORE_DOLLHOUSE_A: "Dollhouse",
  14183. HELP_DESKTOP_MORE_DOLLHOUSE_B: "Нажмите и поверните сверху вниз чтобы просмотреть всю 3D модель.",
  14184. HELP_MOBILE_MORE_DOLLHOUSE_B: "Нажмите и поверните сверху вниз чтобы просмотреть всю 3D модель.",
  14185. HELP_MORE_FLOORS_A: "Выбор Этажа",
  14186. HELP_DESKTOP_MORE_FLOORS_B: "Переключение между этажами.",
  14187. HELP_MORE_TAG_A: "tag™ Posts",
  14188. HELP_DESKTOP_MORE_TAG_B: "Нажмите или наведите курсор мыши для получения информации о функциях в Пространстве.",
  14189. HELP_MOBILE_MORE_TAG_B: "Нажмите для получения информации о функциях.",
  14190. HELP_MORE_ZOOM_A: "Масштаб",
  14191. HELP_DESKTOP_MORE_ZOOM_B: "Используйте эти кнопки для увеличения и уменьшения изображения или используйте колесо прокрутки.",
  14192. HELP_MORE_TOUR_A: "Управление Туром",
  14193. HELP_DESKTOP_MORE_TOUR_B: "Используйте кнопки Воспроизвести, Пауза, Вперед и Назад для управления фотоколлажем.",
  14194. HELP_MORE_INSIDE_A: "Вид Изнутри",
  14195. HELP_DESKTOP_MORE_INSIDE_B: "Нажмите, чтобы просмотреть модель изнутри.",
  14196. HELP_MOBILE_MORE_INSIDE_B: "Нажмите, чтобы просмотреть модель изнутри.",
  14197. HELP_MORE_VR_A: "Режим VR",
  14198. HELP_DESKTOP_MORE_VR_B: "Нажмите, чтобы запустить модель в виртуальной реальности.",
  14199. HELP_MOBILE_MORE_VR_B: "Нажмите, чтобы запустить модель в виртуальной реальности.",
  14200. HELP_MORE_360_A: "360° Views",
  14201. HELP_DESKTOP_MORE_360_B: "Нажмите на “360 Views” в фотоколлаже, чтобы просмотреть внешний пейзаж.",
  14202. HELP_MOBILE_MORE_360_B: "Нажмите на “360 Views” в фотоколлаже, чтобы просмотреть внешний пейзаж.",
  14203. HELP_MORE_FULLSCREEN_A: "Полный экран",
  14204. HELP_DESKTOP_MORE_FULLSCREEN_B: "Развернуть 3D Showcase во весь экран.",
  14205. WEBVR_FOR_CARDBOARD: "Для Google Cardboard",
  14206. WEBVR_FOR_DAYDREAM: "Для просмотра в Daydream",
  14207. WEBVR_ENTER_WEBVR: "ВОЙТИ В VR ",
  14208. WEBVR_DIFFERENT_HEADSET: "Есть другой VR-шлем?",
  14209. WEBVR_LEARN_MORE: "Узнать больше",
  14210. WEBVR_VIEW_SPACE: "Запустить модель в VR",
  14211. WEBVR_DAYDREAM_VIEW: "Посмотреть в Daydream",
  14212. WEBVR_DAYDREAM_PHONE: "Daydream-готовый телефон",
  14213. WEBVR_VIEW_CARDBOARD: "Или просмотреть в Google Cardboard",
  14214. VR_WHAT_YOU_NEED: "Что Вам потребуется...",
  14215. VR_NEED_DAYDREAM_PHONE: "Daydream-готовый телефон",
  14216. VR_GOOGLE_DAYDREAM: "Google Daydream",
  14217. VR_APP: "port VR App",
  14218. VR_APP_OPEN: "Или открыть через приложение port VR",
  14219. VR_COMPATIBLE_ANDROID_LONG: 'Совместимые Android устройства с диагональю экрана 4.5"-5.5" дюймов и Android версией 4.4.4, и выше',
  14220. VR_SAMSUNG_DETAIL: "Galaxy S6 и выше",
  14221. VR_APP_FOR_ANDROID: "Приложение port VR для Android",
  14222. VR_NEED_DAYDREAM: "Необходимо для соединением с Daydream",
  14223. VR_VIEW_SPACE: "Запустить модель в VR",
  14224. VR_LEARN_MORE_CAPS: "УЗНАТЬ БОЛЬШЕ",
  14225. VR_PREVIOUS_CAPS: "ПРЕДЫДУЩИЙ",
  14226. VR_NEXT_CAPS: "СЛЕДУЮЩИЙ",
  14227. VR_GOT_IT_CAPS: "ЯСНО",
  14228. VR_SHOW_SUPPORTED: "Нажмите, чтобы просмотреть модель в VR с помощью",
  14229. VR_SHOW_UNSUPPORTED: "Извините, но Ваше устройство не соответствует минимальным требованиям для просмотра модели в VR.",
  14230. VR_SHOW_IOS_1: "Нажмите, чтобы просмотреть модель в VR",
  14231. VR_SHOW_IOS_2: "Для просмотра требуется приложение port VR и совместимый iPhone",
  14232. VR_NEED_CARDBOARD: "Что Вам потребуется для Google Cardboard",
  14233. VR_NEED_SAMSUNG: "Что Вам потребуется для Samsung Gear VR",
  14234. VR_GOOGLE_CARDBOARD: "Google Cardboard",
  14235. VR_SAMSUNG_GEAR_VR: "Samsung Gear VR",
  14236. VR_COMPATIBLE_IPHONES_1: "iPhones",
  14237. VR_COMPATIBLE_IPHONES_2: "iPhone 5s или новее с iOS 9.1 и выше",
  14238. VR_COMPATIBLE_IPHONES_3: "Совместимые модели iPhone",
  14239. VR_COMPATIBLE_ANDROID: "Совместимые Android устройства",
  14240. VR_ANDROID_DETAIL: 'Экран от 4.5" до 5.5" и Android 4.4.4, и выше',
  14241. VR_ANDROID_DVICES: "Android устройства",
  14242. VR_COMPATIBLE_SAMSUNG: "Совместимые Samsung устройства",
  14243. VR_APP_FOR_CARDBOARD: "Приложение port VR для Google Cardboard",
  14244. VR_APP_FOR_SAMSUNG: "Приложение port VR для Gear VR",
  14245. VR_DOWNLOAD_HERE: "Скачать здесь",
  14246. VR_REQUIRE_HEADSET: "Требуется VR-шлем и установленное приложение port VR для Android",
  14247. VR_REDIRECT_TO_STORE: "Если приложение не установлено, Вы будете перенаправлены на страницу магазина приложений.",
  14248. VR_IMPROPER_EMBED: "port модель не встроена должным образом для поддержки VR в вашем веб-браузере.",
  14249. VR_OPEN_ANDROID_LINK: "Откройте ссылку на Вашем мобильном телефоне",
  14250. VR_ANDROID_OPTIONS: "Доступные опции VR-шлемов",
  14251. SHARE_TO: "Поделиться",
  14252. SHARE_LINK: "Прямая ссылка",
  14253. SHARE_EXPLORE: "просмотреть",
  14254. SHARE_AT: "на",
  14255. SHARE_WITH: "с",
  14256. SHARE_3D: "в 3D",
  14257. SHARE_COPIED: "Скопировано!",
  14258. ERROR_BROWSER_SOLUTION: "установите новый браузер, чтобы просмотреть 3D пространство.",
  14259. ERROR_BROWSER_EXPLANATION: "WebGL требует современный браузер.",
  14260. ERROR_GENERIC_PROBLEM: "Ой, что-то пошло не так.",
  14261. ERROR_GENERIC_SOLUTION: "Перезапустите браузер.",
  14262. ERROR_GENERIC_ACTIONS_1: "Если проблема не устранена, ",
  14263. ERROR_GENERIC_ACTIONS_2: "установите поддерживаемый браузер",
  14264. ERROR_GENERIC_ACTIONS_3: " или ",
  14265. ERROR_GENERIC_ACTIONS_4: "смотрите наше руководство по устранению неполадок",
  14266. ERROR_WEBGL_UNSUPPORTED_PROBLEM: "Браузер не поддерживается.",
  14267. ERROR_WEBGL_IOS_PROBLEM: "iOS-версия не поддерживается.",
  14268. ERROR_WEBGL_IOS_SOLUTION: "Обновите до iOS 8 или выше, чтобы просмотреть пространство в 3D.",
  14269. ERROR_WEBGL_IOS_ACTIONS_1: "Нажмите ",
  14270. ERROR_WEBGL_IOS_ACTIONS_2: "Настройки > Общие > Обновление ПО",
  14271. ERROR_WEBGL_SAFARI_PROBLEM: "Включите WebGL для 3D-просмотра.",
  14272. ERROR_WEBGL_SAFARI_ACTIONS_1: "Нажмите ",
  14273. ERROR_WEBGL_SAFARI_ACTIONS_2: "Настойки > Дополнения > Показывать меню “Разработка” в строке меню",
  14274. ERROR_WEBGL_SAFARI_ACTIONS_3: "Затем нажмите ",
  14275. ERROR_WEBGL_SAFARI_ACTIONS_4: "Разработка > Разрешить WebGL",
  14276. ERROR_MISSING_URLS_PROBLEM: "Ой, для этой модели нет панорамы.",
  14277. ERROR_MISSING_URLS_EXPLANATION: "Эта модель устарела. У владельца веб-сайта может быть новая модель.",
  14278. ERROR_LOADING_FAILED_PROBLEM: "Ой, модель недоступна.",
  14279. ERROR_LOADING_FAILED_ACTIONS_1: "Если проблема не устранена, ",
  14280. ERROR_LOADING_FAILED_ACTIONS_2: "посмотрите наше руководство по устранению неполадок",
  14281. ERROR_MAINTENANCE_PROBLEM: "Выполняется техническое обслуживание.",
  14282. ERROR_MAINTENANCE_SOLUTION: "Пожалуйста, попробуйте снова через несколько минут.",
  14283. LINK_TO_LOCATION: "Ссылка на местоположение",
  14284. MENU_COPY: "Копировать",
  14285. LINK_ALERT_COPY: "Для того, чтобы скопировать, пожалуйста, используйте CTRL/CMD + C.",
  14286. ROTATE: "Вращать",
  14287. MOVE: "Передвигаться",
  14288. INSIDE: "Вид изнутри",
  14289. ZOOM: "Масштаб"
  14290. }
  14291. }
  14292. , {}],
  14293. 116: [function(e, t, i) {//main.js
  14294. (function(t) {
  14295. "use strict";
  14296. var modelProgressBase = 0.4;
  14297. var progressUpdate = function(e){ // 0 <= e <= 1
  14298. console.log('e1:'+e)
  14299. e = Math.round(modelProgressBase * e * 100);
  14300. console.log('e2:'+e)
  14301. var t = $('.progressbar');
  14302. t.find('.bar').css('width',e+'%');
  14303. t.find('.label').css('left', t.width() * e / 100 - 15 + 'px' ); //上面跟着的字的百分比
  14304. t.find('.perc').text(e +'%'); //具体数字的百分比
  14305. }
  14306. $('#gui-loading').fadeIn(200);
  14307. progressUpdate(0.1)
  14308. var fileName = g_version ? 'modeldata.js' : 'someData.json' ;
  14309. $.ajax(g_Prefix + "data/"+window.number+"/"+fileName+"?"+randomTime().getTime(),{dataType: "json"}).done( function(e){ //改
  14310. var data = matcher(e);
  14311. data.files.templates[0] = g_Prefix + e.files.templates[0].replace("{{number}}",window.number);
  14312. data.user = {
  14313. "is_authenticated": false,
  14314. "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"]
  14315. }
  14316. try{//处理一下导览数据
  14317. data.model.images = data.model.images.filter(e=>{
  14318. if(!e.locations && !e.thumbnail_signed_src)return; //旧的曾有导览数据是错误的,将它删除
  14319. if(e.locations && e.locations.length == 0)return;
  14320. return e
  14321. })
  14322. }catch(e){console.log(e) }
  14323. window.DATA = data;
  14324. data.model.summary = data.summary
  14325. data.model.name = data.name
  14326. for(let i in data){
  14327. data[i] == "false" && (data[i] = false)
  14328. }
  14329. progressUpdate(0.7);
  14330. StartLoad(); //xzw someData.js是我整合的 原本在html里 但这样每个场景的html都不一样了
  14331. if(data.weixinDesc){
  14332. g_weixinObj.desc = data.weixinDesc;
  14333. }
  14334. if(data.shareImgUrl){
  14335. g_weixinObj.imgUrl = data.shareImgUrl
  14336. }
  14337. window.wx && manage.weixinShare();
  14338. //初始画面
  14339. data.camera_start && data.camera_start.thumbImg && E(manage.dealURL(data.camera_start.thumbImg))
  14340. function E(e) {
  14341. $("<img/>").attr("src", e).on("load", function() {
  14342. $("#gui-thumb").css("backgroundImage", "url(" + e + ")").fadeIn(500),
  14343. $(this).remove()
  14344. })
  14345. }
  14346. //背景
  14347. settings.transparentBg = settings.transparentBg || data.transparentBg || false,
  14348. settings.bgImg = settings.bgImg || data.bgImg || null
  14349. if(settings.bgImg){
  14350. $("#player").css({'background-image': "url("+settings.bgImg+")",
  14351. "background-position": "center center"
  14352. })
  14353. }
  14354. {//初始化导览时间
  14355. if(DATA.tourBlackSpeed == void 0)DATA.tourBlackSpeed = 100
  14356. window._settings.warp.teleportTime = settings.teleportTime / DATA.tourBlackSpeed * 100;
  14357. if(DATA.tourWalkSpeed == void 0)DATA.tourWalkSpeed = 100
  14358. if(DATA.tourRotTime == '' || DATA.tourRotTime == void 0){
  14359. DATA.tourRotTime = settings.tourRotTime; //默认停留2秒
  14360. }
  14361. }
  14362. {//其他
  14363. _settings.floorPlanAngle = DATA.floorPlanAngle || 0
  14364. }
  14365. }).fail(e=>{
  14366. alert("缺少someData文件,请检查场景码是否正确。")
  14367. })
  14368. function StartLoad(){//当加载完data后
  14369. function i() {
  14370. var e = window.number//Y.getModelIDFromQueryString();
  14371. if (!e)
  14372. return b(null, "loading-failed");
  14373. var t = Y.parseSidUrl(e)
  14374. , i = l()
  14375. , a = c()
  14376. , s = o()
  14377. , u = V.quickstart.enabled
  14378. , g = null
  14379. , m = null
  14380. , v = null
  14381. , w = null
  14382. , T = null
  14383. , x = null
  14384. , S = null
  14385. , M = null
  14386. , R = null
  14387. , P = null
  14388. , O = null
  14389. , L = null
  14390. , N = new ue;
  14391. r(s);
  14392. h({ //MP开头写法
  14393. urlBase: t.urlBase
  14394. }).then(function() {
  14395. return re.init(),
  14396. d(t, e) //getModel and load
  14397. }).then(function(e) {
  14398. progressUpdate(0.9)
  14399. return P = e,
  14400. p(P, V.appConfig.segment_key, V.appConfig.keen_write_key, V.appConfig.keen_project_id, {
  14401. startSource: i,
  14402. autoplay: V.autoplay,
  14403. quickstart: u
  14404. }),
  14405. P.urls.init()
  14406. }).then(function() {
  14407. return P.loadPanos()
  14408. }).then(function() {
  14409. m = X.getStartCameraOptions(P, P.panos),
  14410. S = A(P),
  14411. O = y(u, m.mode),
  14412. v = O.controls,
  14413. w = O.player,
  14414. T = O.director,
  14415. x = O.tagManager,
  14416. M = O.tileDownloader,
  14417. R = O.qualityManager,
  14418. L = O.panoRenderer,
  14419. C(P, S, O, s),
  14420. w.director = T,//xzw add
  14421. P.supportsTiles && M.start(),
  14422. !u || m.mode === D.PANORAMA && m.pano || (de.warn("Tried to quickstart, but failed as we are not starting in inside mode."),
  14423. u = !1);
  14424. var e = null;
  14425. if (u) {
  14426. de.warn("Quickstart engaged. Hold on to your knickers.");
  14427. var t = v.controls[D.PANORAMA];
  14428. g = new ie(R,S.scene,S.camera,t,s),
  14429. _(S, s, P),
  14430. e = g.load(m).then(function() {
  14431. S.addComponent(g),
  14432. S.once(le.AfterRender, function() {
  14433. de.warn("First render after quickstart load finished.")
  14434. })
  14435. })
  14436. }
  14437. window.flyToFirst = function(){//xzw add
  14438. var pano = w.model.panos.get("8d778e19657f433fb9cf8947d823bb70");
  14439. var q = new _x.Quaternion(0.7099827027821568,-0.07708150183830938,0.6958985789714591,0.07555241737970636);
  14440. var lookAtPoint = new _x.Vector3(0,0,-1).applyQuaternion(q).add(pano.position);
  14441. w.flyToPano({pano:pano, lookAtPoint:lookAtPoint})
  14442. };
  14443. return $.when(e, U.startLoading(P, w, T, V.autoplay, u, N))
  14444. }).then(function() {
  14445. return f(P, U.onProgress, i, !u, a)
  14446. }).then(function() {
  14447. if (m.quickstart = u,
  14448. I(P, S, O, s),
  14449. S.started || _(S, s, P),
  14450. H.modelLoaded(P, w, v, V.autoplay),
  14451. E(w, P, m, V.autoplay).done(function() {
  14452. T.autoTour()
  14453. }),
  14454. !P.supportsTiles) {
  14455. var e = new Z(P,w);
  14456. e.start()
  14457. }
  14458. u && (S.removeComponent(g),
  14459. g.destroy(),
  14460. m.pano.enter()),
  14461. U.init(P, T, w, v, S, m, H.getSessionId()),
  14462. U.endLoading(P, T, x),
  14463. S.once(le.AfterRender, function() {
  14464. N.setAppReadyTime();
  14465. var e = N.calcFullLoadingTime();
  14466. de.warn("Total load time: " + e / 1e3),
  14467. H.loadComplete(e),
  14468. $('.jumpvideo').fadeIn()
  14469. de.warn("First render after model load finished.")
  14470. }),
  14471. S.on(le.MemoryUsageUpdated, n)
  14472. }).fail(b.bind(this, e))
  14473. }
  14474. function n(e) {
  14475. ce.update(e)
  14476. }
  14477. function r(e) {
  14478. de.info("Version", "2.25.6-0-gd87e5b1"),
  14479. q.defaultMaxListeners = 1e3,
  14480. a(e),
  14481. s()
  14482. }
  14483. function o() {
  14484. return document.getElementById("player")
  14485. }
  14486. function a(e) {
  14487. e.addEventListener("dragenter", T, !1),
  14488. e.addEventListener("dragover", T, !1)
  14489. }
  14490. function s() {
  14491. F.valueFromHash("title", !0) || $(document).ready(function() {
  14492. var e = $(".model-title");
  14493. e.hide()
  14494. })
  14495. }
  14496. function l() {
  14497. return F.valueFromHash("play", !1) ? "autoplay" : F.inIframe() ? "click" : "fullpage"
  14498. }
  14499. function c() {
  14500. return {
  14501. panoElementsToLoad: 6,
  14502. modelElementsToLoad: 0,
  14503. totalElementsLoaded: 0,
  14504. totalElementsToLoad: 0,
  14505. totalPercentageLoaded: 0,
  14506. progressCallback: null
  14507. }
  14508. }
  14509. function h(e) {
  14510. return K.loadFeatureFlags(e).done(function(e) {
  14511. K.updateDependentSettings(e, V)
  14512. })
  14513. }
  14514. // function u(e) {
  14515. // return Q.get(e.urlBase + "/api/v1/config/showcase", {
  14516. // responseType: "json",
  14517. // prefetchFrom: "config"
  14518. // }).then(function(e) {
  14519. // return e ? void j.extendObject(V.appConfig, e) : {}
  14520. // }, function(e) {
  14521. // return de.warn("Failed loading runtime config, using defaults."),
  14522. // $.when({})
  14523. // })
  14524. // }
  14525. function d(e, t) {
  14526. var i = B.getModel({
  14527. url: t,
  14528. floors: F.valueFromHash("f", !0),
  14529. autoload: !1
  14530. })
  14531. ;
  14532. return $.when(i, n).then(null, function(e) {
  14533. return this
  14534. })
  14535. }
  14536. function p(e, t, i, n, r) {
  14537. de.info("Model data loaded"),
  14538. de.debug("UUID: " + e.data.job.uuid),
  14539. J.init(K.getFlags()),
  14540. i && H.initKeen({
  14541. token: i,
  14542. appId: n
  14543. }),
  14544. H.initSegment({
  14545. model: e.sid,
  14546. version: "2.25.6-0-gd87e5b1",
  14547. startSource: r.startSource,
  14548. token: t,
  14549. autoplay: r.autoplay,
  14550. quickstart: r.quickstart
  14551. })
  14552. }
  14553. function f(e, t, i, n, r) {
  14554. return r.progressCallback = t,
  14555. H.sessionStart(),
  14556. e.load(n).progress(g.bind(this, r))
  14557. }
  14558. function g(e, t) {
  14559. e.modelElementsToLoad = t[1],
  14560. v(e),
  14561. m(e)
  14562. }
  14563. function m(e) {
  14564. e.totalElementsLoaded++,
  14565. e.totalPercentageLoaded = e.totalElementsLoaded / e.totalElementsToLoad,
  14566. //----许钟文-----------------模型进度条向后调整
  14567. isNaN(e.totalPercentageLoaded) && (e.totalPercentageLoaded = 0);
  14568. e.totalPercentageLoaded = modelProgressBase + (1-modelProgressBase)*e.totalPercentageLoaded;
  14569. //console.log('pro:'+e.totalPercentageLoaded)
  14570. //---------------------------
  14571. e.progressCallback && e.progressCallback(100 * e.totalPercentageLoaded)
  14572. }
  14573. function v(e) {
  14574. e.totalElementsToLoad = e.modelElementsToLoad + e.panoElementsToLoad
  14575. }
  14576. function A(e) {
  14577. var t = new x.PerspectiveCamera;
  14578. t.layers.enable(he.PANOMARKERS),
  14579. t.layers.enable(he.RETICULE),
  14580. t.layers.enable(he.TAG);
  14581. var i = new x.Scene
  14582. , n = new x.AmbientLight(16777215);
  14583. i.add(n),
  14584. i.plane = new x.Mesh(new x.PlaneBufferGeometry(1e5,1e5),new x.RawShaderMaterial({
  14585. side: x.DoubleSide
  14586. })),
  14587. i.plane.position.y = 0,
  14588. i.plane.rotateX(-Math.PI / 2),
  14589. i.plane.material.visible = !1,
  14590. i.add(i.plane),
  14591. i.updateMatrixWorld(),
  14592. V.showScreenshotLocations && e.data.images.forEach(function(e) {
  14593. if (e.metadata && e.metadata.camera_position) {
  14594. var t = e.metadata.camera_position
  14595. , n = new x.Mesh(new x.BoxGeometry(.3,.3,.3));
  14596. n.position = t.clone(),
  14597. i.add(n);
  14598. var r = e.metadata.camera_quaternion
  14599. , o = new x.Vector3(0,0,-1).applyQuaternion(r);
  14600. i.add(new x.ArrowHelper(o,t.clone(),1,16711680))
  14601. }
  14602. }),
  14603. V.showAxis && (i.add(new x.ArrowHelper(new x.Vector3(0,1,0),new x.Vector3(0,0,0),1,255)),
  14604. i.add(new x.ArrowHelper(new x.Vector3(0,0,1),new x.Vector3(0,0,0),1,16711680)),
  14605. i.add(new x.ArrowHelper(new x.Vector3(1,0,0),new x.Vector3(0,0,0),1,65280)));
  14606. //背景
  14607. if(!settings.transparentBg && !settings.bgImg){
  14608. i.skybox = new W
  14609. i.add(i.skybox)
  14610. }
  14611. var r = new te(i,t,z);
  14612. return r
  14613. }
  14614. function y(e, t) {
  14615. var i = e ? 1 : 1e3
  14616. , n = J.tilegen || J.imgopt ? 6 : 2;
  14617. n = F.valueFromHash("tileconc", n);
  14618. var r = new ne
  14619. , o = new ae({
  14620. concurrentDownloads: n
  14621. })
  14622. , a = new se
  14623. , s = new P
  14624. , l = new M
  14625. , c = new S(t)
  14626. , h = new R
  14627. , u = new O(i)
  14628. , d = new L
  14629. , p = new oe;
  14630. return {
  14631. qualityManager: r,
  14632. panoRenderer: a,
  14633. tileDownloader: o,
  14634. player: c,
  14635. director: l,
  14636. modelManager: s,
  14637. tagManager: p,
  14638. displayController: u,
  14639. labelDisplayController: d,
  14640. controls: h
  14641. }
  14642. }
  14643. function C(e, t, i, n) {
  14644. var r = i.controls
  14645. , o = i.qualityManager
  14646. , a = i.panoRenderer
  14647. , s = i.tileDownloader
  14648. , l = i.modelManager;
  14649. r.init(n, l),
  14650. ee.init(i.director, r, i.player, l, t),
  14651. o.init(l),
  14652. s.init(o),
  14653. a.init(t, s, o),
  14654. l.init(s, a, o),
  14655. l.addModel(e),
  14656. t.addComponent(G)
  14657. }
  14658. function I(e, t, i, n) {
  14659. var r = i.qualityManager
  14660. , o = i.panoRenderer
  14661. , a = i.tileDownloader
  14662. , s = i.modelManager
  14663. , l = i.player
  14664. , c = i.director
  14665. , h = i.tagManager
  14666. , u = i.displayController
  14667. , d = i.labelDisplayController
  14668. , p = i.controls;
  14669. t.scene.add(e),
  14670. t.qualityManager = r;
  14671. var f = {
  14672. camera: t.camera,
  14673. director: c,
  14674. modelManager: s,
  14675. tileDownloader: a,
  14676. panoRenderer: o,
  14677. qualityManager: r,
  14678. tagManager: h,
  14679. container: n,
  14680. controls: p
  14681. };
  14682. l.init(f),
  14683. l.setScene(t.scene),
  14684. h.init(s, l),
  14685. c.init(l, s),
  14686. u.init(c, l, s, h, n),
  14687. d.init(l, s, n),
  14688. z.bindEvents(l),
  14689. t.addComponent(h),
  14690. t.addComponent(l),
  14691. t.addComponent(o),
  14692. l.sceneRenderer = t; //xzw add 方便resize
  14693. }
  14694. function E(e, t, i, n) {
  14695. return de.info("Starting player in " + i.mode),
  14696. H.report(t.sid, "started-playing", n, i.quickstart),
  14697. e.start(i)
  14698. }
  14699. function b(e, t) {
  14700. de.error(t),
  14701. k.error(t),
  14702. H.report(e, "error-" + t)
  14703. }
  14704. function w(e) {
  14705. var t = F.details();
  14706. t && "Safari" === t.name && t.version > 500 && t.version < 600 ? (k.error("webgl-safari"),
  14707. H.report(e, "error-webgl-safari")) : (k.error("webgl-generic"),
  14708. H.report(e, "error-webgl-generic"))
  14709. }
  14710. function _(e, t, i) {
  14711. try {
  14712. e.start(t)
  14713. } catch (e) {
  14714. throw de.warn(e.message),
  14715. w(i.sid),
  14716. e
  14717. }
  14718. }
  14719. function T(e) {
  14720. e.stopPropagation(),
  14721. e.preventDefault()
  14722. }
  14723. //czj 判断someData 有没有hoticon字段 修改热点的样式
  14724. if (window.DATA.hoticon){
  14725. g_HotImage = {
  14726. point: ('static/'+ window.DATA.hoticon.default )|| "https://super.4dage.com/static/images/4dagePoint2.png",
  14727. point2: ('static/'+ window.DATA.hoticon.higt) || "https://super.4dage.com/static/images/4dagePoint.png"
  14728. } ;
  14729. }
  14730. //czj 判断someData 有没有backgroundMusic 添加音乐
  14731. if (window.DATA.backgroundMusic) {
  14732. if(window.isLocal){
  14733. SoundManager.setSrc('bgm', manage.dealURL(window.DATA.backgroundMusic))
  14734. }else{
  14735. SoundManager.setSrc('bgm', window.DATA.backgroundMusic )
  14736. }
  14737. $("#volume").show();
  14738. }else if (g_version === "one"){
  14739. SoundManager.setSrc('bgm', manage.dealURL( g_Prefix+"/audio/"+"audio"+window.number + "/background.mp3"))
  14740. $("#volume").show();
  14741. }else {
  14742. $("#volume").hide();
  14743. }
  14744. //隐藏公司logo
  14745. if(window.DATA.loadlogo){
  14746. showLogo();
  14747. }
  14748. e("./lib/three75-shim"),
  14749. e("./lib/array-polyfill"),
  14750. e("./lib/performance-polyfill"),
  14751. e("./lib/shaders/CopyShader.js"),
  14752. e("./lib/shaders/HorizontalBlurShader.js"),
  14753. e("./lib/shaders/VerticalBlurShader.js"),
  14754. e("./lib/postprocessing/EffectComposer.js"),
  14755. e("./lib/postprocessing/RenderPass.js"),
  14756. e("./lib/postprocessing/MaskPass.js"),
  14757. e("./lib/postprocessing/ShaderPass.js"),
  14758. window.Promise || (window.Promise = e("promise-polyfill"));
  14759. var x = e("three")
  14760. , _x = e("three")
  14761. , S = (e("./util/sentry"),
  14762. e("./player"))
  14763. , M = e("./director")
  14764. , R = e("./controls/CameraControls")
  14765. , P = e("./model/ModelManager")
  14766. , O = e("./DisplayController")
  14767. , L = e("./label/LabelDisplayController")
  14768. , D = e("./enum/Viewmode")
  14769. , N = e("./util/logger")
  14770. , B = e("./showcase")
  14771. , F = e("./util/browser")
  14772. , V = e("./settings")
  14773. , U = e("./gui/gui")
  14774. , k = e("./gui/error")
  14775. , H = e("./analytics")
  14776. , G = e("./util/transitions")
  14777. , z = e("./effects")
  14778. , W = e("./objects/Skybox")
  14779. , j = e("./util/common")
  14780. , Y = (e("./util/PanoramaCollection"),
  14781. e("./util/math"),
  14782. e("./util/showcase"))
  14783. , X = e("./util/camera")
  14784. , Z = (e("./objects/Panorama"),
  14785. e("./cameras/PanoramaCamera"),
  14786. e("./preloaders"))
  14787. , q = e("events").EventEmitter
  14788. , K = e("./featureflags")
  14789. , Q = (e("./util/lerp"),
  14790. e("./util/ajax"))
  14791. , J = e("./ab")
  14792. , ee = e("./sdk/automation.js")
  14793. , te = e("./scene/SceneRenderer")
  14794. , ie = e("./scene/QuickstartManager")
  14795. , ne = e("./tile/QualityManager.js")
  14796. , re = e("./localization/localize")
  14797. , oe = e("./tag/tagManager")
  14798. , ae = e("./tile/TileDownloader")
  14799. , se = e("./tile/PanoRenderer")
  14800. , le = (e("./enum/PanoSizeClass"),
  14801. e("./enum/PanoramaEvents"),
  14802. e("./enum/SceneRendererEvents"))
  14803. , ce = e("./gui/memoryUsage")
  14804. , he = e("./enum/RenderLayers")
  14805. , ue = e("./TimingData")
  14806. , de = new N(t);
  14807. N.level = V.logLevel,
  14808. N.consoleEnabled = V.console,
  14809. i()
  14810. }
  14811. }
  14812. ).call(this, "/js/main.js")
  14813. }
  14814. , {
  14815. "./DisplayController": 1,
  14816. "./TimingData": 2,
  14817. "./ab": 3,
  14818. "./analytics": 4,
  14819. "./cameras/PanoramaCamera": 7,
  14820. "./controls/CameraControls": 9,
  14821. "./director": 15,
  14822. "./effects": 16,
  14823. "./enum/PanoSizeClass": 36,
  14824. "./enum/PanoramaEvents": 37,
  14825. "./enum/RenderLayers": 41,
  14826. "./enum/SceneRendererEvents": 43,
  14827. "./enum/Viewmode": 51,
  14828. "./featureflags": 59,
  14829. "./gui/error": 64,
  14830. "./gui/gui": 65,
  14831. "./gui/memoryUsage": 73,
  14832. "./label/LabelDisplayController": 91,
  14833. "./lib/array-polyfill": 92,
  14834. "./lib/performance-polyfill": 95,
  14835. "./lib/postprocessing/EffectComposer.js": 96,
  14836. "./lib/postprocessing/MaskPass.js": 97,
  14837. "./lib/postprocessing/RenderPass.js": 98,
  14838. "./lib/postprocessing/ShaderPass.js": 99,
  14839. "./lib/shaders/CopyShader.js": 100,
  14840. "./lib/shaders/HorizontalBlurShader.js": 101,
  14841. "./lib/shaders/VerticalBlurShader.js": 102,
  14842. "./lib/three75-shim": 103,
  14843. "./localization/localize": 108,
  14844. "./tag/tagManager": 124,
  14845. "./model/ModelManager": 140,
  14846. "./objects/Panorama": 148,
  14847. "./objects/Skybox": 152,
  14848. "./player": 155,
  14849. "./preloaders": 156,
  14850. "./scene/QuickstartManager": 157,
  14851. "./scene/SceneRenderer": 158,
  14852. "./sdk/automation.js": 164,
  14853. "./settings": 166,
  14854. "./showcase": 168,
  14855. "./tile/PanoRenderer": 169,
  14856. "./tile/QualityManager.js": 170,
  14857. "./tile/TileDownloader": 171,
  14858. "./util/PanoramaCollection": 178,
  14859. "./util/ajax": 181,
  14860. "./util/browser": 182,
  14861. "./util/camera": 183,
  14862. "./util/common": 185,
  14863. "./util/lerp": 188,
  14864. "./util/logger": 189,
  14865. "./util/math": 190,
  14866. "./util/sentry": 192,
  14867. "./util/showcase": 193,
  14868. "./util/transitions": 195,
  14869. events: 202,
  14870. "promise-polyfill": 213,
  14871. three: 217
  14872. }],
  14873. 117: [function(e, t, i) {
  14874. "use strict";
  14875. function n(e) {
  14876. e = e || {}
  14877. r.RawShaderMaterial.call(this, a.extendObject({
  14878. fragmentShader: o.cube.fragmentShader,
  14879. vertexShader: o.cube.vertexShader,
  14880. uniforms: r.UniformsUtils.clone(o.cube.uniforms),
  14881. name: "CubemapMaterial",
  14882. }, e))
  14883. }
  14884. var r = e("three")
  14885. , o = e("../shaders")
  14886. , a = e("../util/common");
  14887. n.prototype = Object.create(r.RawShaderMaterial.prototype),
  14888. n.prototype.constructor = n,
  14889. t.exports = n
  14890. }
  14891. , {
  14892. "../shaders": 167,
  14893. "../util/common": 185,
  14894. three: 217
  14895. }],
  14896. 118: [function(e, t, i) {
  14897. "use strict";
  14898. function n(e) {
  14899. e = e || {}
  14900. r.RawShaderMaterial.call(this, a.extendObject({
  14901. fragmentShader: o.model.fragmentShader,
  14902. vertexShader: o.model.vertexShader,
  14903. uniforms: r.UniformsUtils.clone(o.model.uniforms),
  14904. name: "ModelTextureMaterial",
  14905. }, e))
  14906. }
  14907. var r = e("three")
  14908. , o = e("../shaders")
  14909. , a = e("../util/common");
  14910. n.prototype = Object.create(r.RawShaderMaterial.prototype),
  14911. n.prototype.constructor = n,
  14912. n.prototype.setProjectedPanos = function(e, t, i) {
  14913. i && (this.uniforms.progress.value = 0),
  14914. e.ensureSkyboxReadyForRender(),
  14915. this.uniforms.pano0Map.value = e.getSkyboxTexture(),
  14916. this.uniforms.pano0Position.value.copy(e.position),
  14917. this.uniforms.pano0Matrix.value.copy(e.skyboxMesh.matrixWorld),
  14918. t.ensureSkyboxReadyForRender(),
  14919. this.uniforms.pano1Map.value = t.getSkyboxTexture(),
  14920. this.uniforms.pano1Position.value.copy(t.position),
  14921. this.uniforms.pano1Matrix.value.copy(t.skyboxMesh.matrixWorld)
  14922. }
  14923. /* n.prototype.setEyeDir = function(dir, pos) {//加
  14924. this.uniforms.eyeDir.value.copy(dir)
  14925. this.uniforms.eyePos.value.copy(pos)
  14926. }
  14927. n.prototype.setBendCameraQua = function(matrix) {//加
  14928. this.uniforms.cameraDeltaMatrix.value.copy(matrix)
  14929. } */
  14930. ,
  14931. t.exports = n
  14932. }
  14933. , {
  14934. "../shaders": 167,
  14935. "../util/common": 185,
  14936. three: 217
  14937. }],
  14938. 119: [function(e, t, i) {
  14939. (function(i) {
  14940. "use strict";
  14941. function n(e, t, i, n) {
  14942. this.div = null,
  14943. this.body = null,
  14944. this.label = e,
  14945. this.description = t,
  14946. this.parsedDescription = [],
  14947. this.media = i || {
  14948. type: null
  14949. },
  14950. this.loadingSpinner = null,
  14951. this.parser = new r({
  14952. supportLinks: !u.valueFromHash("mls"),
  14953. keepLinkLabels: !0
  14954. }),
  14955. this.state = I.CLOSED,
  14956. this.orientation = "",
  14957. this.initialTransform = "",
  14958. this.hovering = !1,
  14959. this.openTransition = null,
  14960. this.closeTransition = null,
  14961. this.openPromise = null,
  14962. this.closePromise = null,
  14963. this.animationTransition = null,
  14964. this.animationScale = 0
  14965. }
  14966. var r = e("../Parser/DescriptionParser")
  14967. , o = e("../Media/Link")
  14968. , a = e("../Media/Image")
  14969. , s = e("../Media/EmbedlyPlayer")
  14970. , l = e("../Media/EmbedlyEmbed")
  14971. , c = e("../../util/transitions")
  14972. , h = e("../../util/lerp")
  14973. , u = e("../../util/browser")
  14974. , d = e("./BillboardEvent")
  14975. , p = e("../Media/MediaEvent")
  14976. , f = e("../Parser/DescriptionChunkType")
  14977. , g = e("events").EventEmitter
  14978. , m = e("./billboardSettings")
  14979. , v = e("./overlaySettings")
  14980. , A = e("../../util/logger")
  14981. , y = new A(i)
  14982. , C = document.getElementById("tag-billboards");
  14983. C.addEventListener("touchend", function(e) {
  14984. C.style.pointerEvents = "none"
  14985. }),
  14986. C.addEventListener("touchcancel", function(e) {
  14987. C.style.pointerEvents = "none"
  14988. });
  14989. var I = {
  14990. CLOSED: "closed",
  14991. OPENING: "opening",
  14992. OPEN: "open",
  14993. CLOSING: "closing",
  14994. ACTIVE: "active"
  14995. };
  14996. n.prototype = Object.create(g.prototype),
  14997. n.prototype.build = function(e) {
  14998. this.parsedDescription = this.parser.parse(this.description);
  14999. var t = document.createElement("div");
  15000. t.className = "tag-container has-hotzone",
  15001. this.div = t,
  15002. this.body = document.createElement("div"),
  15003. this.body.className = "tag-body";
  15004. var i = document.createElement("div");
  15005. i.classList.add("tag-content");
  15006. var n = document.createElement("div");
  15007. n.classList.add("tag-text-content");
  15008. var r = document.createElement("div");
  15009. r.className = "tag-label",
  15010. r.textContent = this.label,
  15011. n.appendChild(r);
  15012. var o = document.createElement("div");
  15013. o.className = "tag-desc",
  15014. n.appendChild(o),
  15015. i.appendChild(n),
  15016. this.body.appendChild(i),
  15017. this.appendDescriptionElements(this.parsedDescription, o),
  15018. this.appendMedia(),
  15019. t.appendChild(this.body),
  15020. C.appendChild(t),
  15021. this.bindEvents(t, this.body)
  15022. }
  15023. ,
  15024. n.prototype.bindEvents = function(e, t) {
  15025. var i = function(e) {
  15026. return function(t) {
  15027. if (!this.div.classList.contains("overlay")) {
  15028. var i, n = document.getElementById("player");
  15029. try {
  15030. i = new MouseEvent(e,t)
  15031. } catch (n) {
  15032. i = document.createEvent("MouseEvents"),
  15033. 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)
  15034. }
  15035. n.dispatchEvent(i)
  15036. }
  15037. }
  15038. };
  15039. t.addEventListener("mousedown", function(e) {
  15040. e.stopPropagation()
  15041. }),
  15042. t.addEventListener("mouseup", function(e) {
  15043. e.stopPropagation()
  15044. }),
  15045. e.addEventListener("touchstart", function(e) {
  15046. C.style.pointerEvents = "auto"
  15047. }),
  15048. e.addEventListener("mousedown", i("mousedown").bind(this)),
  15049. e.addEventListener("mouseup", i("mouseup").bind(this)),
  15050. t.addEventListener("mouseover", function(t) {
  15051. this.state === I.OPEN && e.classList.remove("has-hotzone")
  15052. }
  15053. .bind(this)),
  15054. e.addEventListener("mouseenter", function(e) {
  15055. this.state !== I.CLOSING && (this.hovering = !0,
  15056. this.emit(d.ENTER))
  15057. }
  15058. .bind(this)),
  15059. e.addEventListener("mouseleave", function(e) {
  15060. this.hovering = !1,
  15061. this.emit(d.LEAVE)
  15062. }
  15063. .bind(this)),
  15064. e.addEventListener("gesturestart", function(e) {
  15065. e.preventDefault()
  15066. });
  15067. var n = e.querySelector(".tag-text-content")
  15068. , r = 0;
  15069. n.addEventListener("touchstart", function(e) {
  15070. r = e.changedTouches[0].clientY
  15071. }),
  15072. n.addEventListener("touchmove", function(t) {
  15073. function i(e) {
  15074. e && (0 === e.scrollTop && t.changedTouches[0].clientY > r || e.scrollTop + e.clientHeight - e.scrollHeight === 0 && t.changedTouches[0].clientY < r) && t.preventDefault()
  15075. }
  15076. return e.classList.contains("overlay") ? i(this.querySelector(".tag-desc")) : void i(this)
  15077. }),
  15078. e.addEventListener("touchmove", function(e) {
  15079. 0 === (n.compareDocumentPosition(e.target) & Node.DOCUMENT_POSITION_CONTAINED_BY) && e.preventDefault()
  15080. })
  15081. }
  15082. ,
  15083. n.prototype.appendDescriptionElements = function(e, t) {
  15084. e.length > 0 && this.div.classList.add("has-text"),
  15085. e.forEach(function(e, i) {
  15086. switch (e.type) {
  15087. case f.TEXT:
  15088. t.appendChild(this.createTextElement(e.text));
  15089. break;
  15090. case f.LINK:
  15091. t.appendChild(this.createLinkElement(e.link))
  15092. }
  15093. }
  15094. .bind(this))
  15095. }
  15096. ,
  15097. n.prototype.appendLoadingSpinner = function() {
  15098. this.loadingSpinner = document.createElement("div"),
  15099. this.loadingSpinner.classList.add("loading-spinner");
  15100. var e = document.createElement("div");
  15101. e.classList.add("gui-spinner-icon"),
  15102. this.loadingSpinner.appendChild(e),
  15103. this.body.appendChild(this.loadingSpinner)
  15104. }
  15105. ,
  15106. n.prototype.onMediaLoadFinished = function() {
  15107. this.loadingSpinner && (this.loadingSpinner.parentNode.removeChild(this.loadingSpinner),
  15108. this.applyOrientation(this.orientation),
  15109. this.loadingSpinner = null)
  15110. }
  15111. ,
  15112. n.prototype.appendMedia = function() {
  15113. if (this.media && this.media.type && "error" !== this.media.type && (!u.valueFromHash("mls", 0) || this.media.type === f.IMAGE)) {
  15114. this.appendLoadingSpinner();
  15115. var e = document.createElement("div");
  15116. e.classList.add("tag-media-content");
  15117. var t = document.createElement("i");
  15118. switch (["icon", "icon-close-thin", "close"].forEach(function(e) {
  15119. t.classList.add(e)
  15120. }),
  15121. this.body.appendChild(t),
  15122. this.body.appendChild(e),
  15123. this.media.type) {
  15124. case f.IMAGE:
  15125. e.appendChild(this.createImageElement(this.media, this.body));
  15126. break;
  15127. case f.VIDEO:
  15128. e.appendChild(this.createVideoElement(this.media, this.body));
  15129. break;
  15130. case f.RICH:
  15131. e.appendChild(this.createEmbedElement(this.media, this.body))
  15132. }
  15133. }
  15134. }
  15135. ,
  15136. n.prototype.createTextElement = function(e) {
  15137. var t = document.createElement("span");
  15138. return t.textContent = e,
  15139. t
  15140. }
  15141. ;
  15142. n.prototype.createLinkElement = function(e) {
  15143. var t = new o(e);
  15144. return t.on(p.LINK_CLICK, this.emit.bind(this, p.LINK_CLICK)),
  15145. t.createDomElement()
  15146. }
  15147. ,
  15148. n.prototype.createImageElement = function(e, t) {
  15149. function i() {
  15150. function e() {
  15151. m || (r.classList.remove("view-image"),
  15152. c.classList.add("overlay"),
  15153. i(),
  15154. window.addEventListener("resize", b),
  15155. c.addEventListener("click", a),
  15156. g.addEventListener("click", l),
  15157. f.addEventListener("click", s),
  15158. m = !0,
  15159. o.emit(p.IMAGE_OPENED))
  15160. }
  15161. function i() {
  15162. t.classList.add("show-info"),
  15163. h.classList.remove("collapsible"),
  15164. h.style.height = "";
  15165. var e = parseFloat(getComputedStyle(I).lineHeight)
  15166. , i = y + e
  15167. , r = c.clientWidth - 2 * v.boundaryWidth - C
  15168. , a = c.clientHeight - 2 * v.boundaryHeight - C - i
  15169. , s = a
  15170. , l = s * n.aspect;
  15171. l > r && (l = r,
  15172. s = l / n.aspect),
  15173. s > a && (s = a,
  15174. l = s * n.aspect),
  15175. l += C,
  15176. s += C + i,
  15177. t.style.width = l + "px",
  15178. t.style.height = s + "px",
  15179. u.style.paddingTop = e + C + "px",
  15180. o.description.length > 0 && (h.classList.add("collapsible"),
  15181. h.style.height = h.clientHeight + 12 + "px",
  15182. E.style.height = "calc(100% - " + I.clientHeight + "px)")
  15183. }
  15184. function a(e) {
  15185. e.target === c && s()
  15186. }
  15187. function s() {
  15188. m && (m = !1,
  15189. r.classList.add("view-image"),
  15190. c.classList.remove("overlay"),
  15191. h.style.height = "",
  15192. u.style.paddingTop = "",
  15193. t.style.width = "",
  15194. t.style.height = "",
  15195. window.removeEventListener("resize", b),
  15196. c.removeEventListener("click", a),
  15197. g.removeEventListener("click", l),
  15198. f.removeEventListener("click", s),
  15199. o.emit(p.IMAGE_CLOSED),
  15200. o.close(!0))
  15201. }
  15202. function l(e) {
  15203. t.classList.toggle("show-info")
  15204. }
  15205. var c = o.div
  15206. , h = c.getElementsByClassName("tag-content")[0]
  15207. , u = c.getElementsByClassName("tag-media-content")[0]
  15208. , f = t.getElementsByClassName("close")[0]
  15209. , g = h.getElementsByClassName("tag-label")[0];
  15210. c.classList.add("has-image"),
  15211. r.classList.add("view-image"),
  15212. c.classList.add(n.aspect >= 1 ? "image-landscape" : "image-portrait"),
  15213. o.applyOrientation(o.orientation);
  15214. var m = !1
  15215. , A = getComputedStyle(h)
  15216. , y = parseFloat(A.paddingTop) + parseFloat(A.paddingBottom)
  15217. , C = 2 * parseFloat(getComputedStyle(u).paddingLeft)
  15218. , I = h.querySelector(".tag-label")
  15219. , E = h.querySelector(".tag-desc")
  15220. , b = function() {
  15221. var e, t, n = 0;
  15222. return function() {
  15223. clearInterval(e),
  15224. clearTimeout(t),
  15225. e = setInterval(function() {
  15226. var e = c.clientHeight;
  15227. n !== e && (i(),
  15228. n = e)
  15229. }, 100),
  15230. t = setTimeout(clearInterval.bind(this, e), 1e3)
  15231. }
  15232. }();
  15233. n.on(p.IMAGE_OPENING, e),
  15234. o.on(d.ACTIVATE, e),
  15235. o.on(p.IMAGE_CLOSED, n.onClosed.bind(n)),
  15236. o.on(d.CLOSING, s)
  15237. }
  15238. var n = new a
  15239. , r = n.createDomElement();
  15240. this.once(d.OPENED, function() {
  15241. n.load(e.src).then(i).catch(function(t) {
  15242. y.warn("Failed to load image:", e.src),
  15243. y.warn("with error:", t)
  15244. }).then(this.onMediaLoadFinished.bind(this))
  15245. });
  15246. var o = this;
  15247. return r
  15248. }
  15249. ,
  15250. n.prototype.createVideoElement = function(e, t) {
  15251. var i = new s({
  15252. autoPlay: !0,
  15253. autoResume: !0,
  15254. startMuted: !1,
  15255. loop: !1
  15256. })
  15257. , n = i.createDomElement();
  15258. return this.once(d.OPENED, function() {
  15259. i.load(e.src).then(function() {
  15260. this.div.classList.add("has-video"),
  15261. this.state !== I.OPEN && this.state !== I.ACTIVE || (i.show(),
  15262. i.play()),
  15263. this.on(d.OPENING, i.show.bind(i)),
  15264. this.on(d.OPENED, i.play.bind(i)),
  15265. this.on(d.CLOSING, i.pause.bind(i)),
  15266. this.on(d.CLOSED, i.hide.bind(i))
  15267. }
  15268. .bind(this)).catch(function(t) {
  15269. y.warn("Failed to embed video:", e.src),
  15270. y.warn("with error:", t)
  15271. }).then(this.onMediaLoadFinished.bind(this))
  15272. }
  15273. .bind(this)),
  15274. n
  15275. }
  15276. ,
  15277. n.prototype.createEmbedElement = function(e, t) {
  15278. var i = new l
  15279. , n = i.createDomElement();
  15280. return this.once(d.OPENED, function() {
  15281. i.load(e.src).then(function() {
  15282. this.div.classList.add("has-embed"),
  15283. this.state !== I.OPEN && this.state !== I.ACTIVE || i.show(),
  15284. this.applyOrientation(this.orientation),
  15285. this.on(d.OPENING, i.show.bind(i)),
  15286. this.on(d.CLOSED, i.hide.bind(i))
  15287. }
  15288. .bind(this)).catch(function(t) {
  15289. y.warn("Failed to embed:", e.src),
  15290. y.warn("with error:", t)
  15291. }).then(this.onMediaLoadFinished.bind(this))
  15292. }
  15293. .bind(this)),
  15294. n
  15295. }
  15296. ,
  15297. n.prototype.open = function(e) {
  15298. return this.openPromise = $.Deferred(),
  15299. this.state === I.ACTIVE ? this.openPromise.resolve().promise() : (this.hovering || this.div.classList.add("has-hotzone"),
  15300. this.openTransition ? e && this.setActiveState() : this.openTransition = c.setTimeout(function() {
  15301. this.state !== I.OPEN && (this.emit(d.OPENING),
  15302. e && this.emit(d.ACTIVATING),
  15303. this.state = I.OPENING,
  15304. this.animateOpen(function() {
  15305. e && this.setActiveState(),
  15306. this.openPromise.resolve()
  15307. }
  15308. .bind(this)))
  15309. }
  15310. .bind(this), m.animation.openDelay),
  15311. c.cancel(this.closeTransition),
  15312. this.closePromise && this.closePromise.reject(),
  15313. this.closeTransition = void 0,
  15314. this.openPromise.promise())
  15315. }
  15316. ,
  15317. n.prototype.close = function(e) {
  15318. return this.closePromise = $.Deferred(),
  15319. !e && this.hovering ? this.closePromise.reject().promise() : (this.closeTransition || (this.closeTransition = c.setTimeout(function() {
  15320. this.state !== I.CLOSED && (this.emit(d.CLOSING),
  15321. this.state = I.CLOSING,
  15322. this.animateClose())
  15323. }
  15324. .bind(this), m.animation.closeDelay)),
  15325. c.cancel(this.openTransition),
  15326. this.openPromise && this.openPromise.reject(),
  15327. this.openTransition = void 0,
  15328. this.closePromise.resolve(),
  15329. this.closePromise.promise())
  15330. }
  15331. ,
  15332. n.prototype.setActiveState = function() {
  15333. this.state !== I.CLOSED && (this.state = I.ACTIVE,
  15334. this.emit(d.ACTIVATE),
  15335. this.div.classList.remove("has-hotzone"))
  15336. }
  15337. ,
  15338. n.prototype.animateOpen = function(e) {
  15339. if (this.state === I.OPENING) {
  15340. if (c.cancel(this.animationTransition),
  15341. u.detectSamsungNative())
  15342. return this.boardOrientation = null,
  15343. this.div.style.visibility = "visible",
  15344. this.emit(d.OPENED),
  15345. this.state = I.OPEN,
  15346. void (e && e());
  15347. this.div.style.webkitTransform = "scale(0)",
  15348. this.div.style.transform = "scale(0)",
  15349. this.div.style.visibility = "visible",
  15350. this.animationTransition = c.start(h.property(this, "animationScale", 1), m.animation.openDuration, function() {
  15351. this.emit(d.OPENED),
  15352. this.state = I.OPEN,
  15353. e && e()
  15354. }
  15355. .bind(this))
  15356. }
  15357. }
  15358. ,
  15359. n.prototype.animateClose = function(e) {
  15360. this.state === I.CLOSING && (c.cancel(this.animationTransition),
  15361. this.animationTransition = c.start(h.property(this, "animationScale", 0), m.animation.closeDuration, function() {
  15362. this.emit(d.CLOSED),
  15363. this.state = I.CLOSED,
  15364. this.div.style.visibility = "hidden",
  15365. this.div.classList.contains("has-hotzone") || this.div.classList.add("has-hotzone"),
  15366. e && e()
  15367. }
  15368. .bind(this)))
  15369. }
  15370. ,
  15371. n.prototype.needsUpdate = function() {
  15372. return this.state !== I.CLOSED
  15373. }
  15374. ,
  15375. n.prototype.update = function(e, t) {
  15376. if (this.needsUpdate()) {
  15377. var i = (this.updateOrientation(e),
  15378. this.calcScale(t))
  15379. , n = {
  15380. x: (e.x + 1) * $("#player").width() / 2,
  15381. y: (e.y + 1) * $("#player").height() / 2
  15382. };
  15383. this.div.screenTransform = this.initialTransform + " translate(" + n.x + "px, " + n.y + "px) scale(" + i * this.animationScale + ")",
  15384. this.div.style.webkitTransform = this.div.screenTransform,
  15385. this.div.style.transform = this.div.screenTransform
  15386. }
  15387. }
  15388. ,
  15389. n.prototype.getDimensions = function() {
  15390. return this.div.getBoundingClientRect()
  15391. }
  15392. ,
  15393. n.prototype.calcScale = function(e) {
  15394. return Math.sqrt(e / 40) * m.boardToDiscRatio
  15395. }
  15396. ,
  15397. n.prototype.updateOrientation = function(e) {
  15398. if (this.state !== I.ACTIVE) {
  15399. var t = 1 / 3
  15400. , i = e.y < -t ? 0 : e.y < t ? 1 : 2
  15401. , n = e.x < -t ? 0 : e.x < t ? 1 : 2
  15402. , r = "";
  15403. r += 0 === n ? "right" : 2 === n ? "left" : "",
  15404. r += 0 === i ? "-down" : 2 === i ? "-up" : "",
  15405. 1 === n && (r = 0 === i ? "bottom" : 2 === i ? "top" : "",
  15406. 1 === i && (r = $("#player").width() > $("#player").height() ? e.x < 0 ? "right" : "left" : e.y < 0 ? "bottom" : "top")),
  15407. 1 === n && 1 === i && r === this.orientation || this.applyOrientation(r)
  15408. }
  15409. }
  15410. ,
  15411. n.prototype.applyOrientation = function(e) {
  15412. this.div.style.transform = this.div.style.webkitTransform = "",
  15413. this.div.classList.remove("tag-container-" + this.orientation),
  15414. this.div.classList.add("tag-container-" + e);
  15415. var t = window.getComputedStyle(this.div);
  15416. this.initialTransform = t.transform || t.webkitTransform,
  15417. "none" === this.initialTransform && (this.initialTransform = "");
  15418. var i = t.transform.slice(7, -1).split(",")
  15419. , n = -i[4]
  15420. , r = -i[5];
  15421. this.div.style.webkitTransformOrigin = n + "px " + r + "px",
  15422. this.div.style.transformOrigin = n + "px " + r + "px",
  15423. this.orientation = e
  15424. }
  15425. ,
  15426. t.exports = n
  15427. }
  15428. ).call(this, "/js/tag/Billboard/Billboard.js")
  15429. }
  15430. , {
  15431. "../../util/browser": 182,
  15432. "../../util/lerp": 188,
  15433. "../../util/logger": 189,
  15434. "../../util/transitions": 195,
  15435. "../Media/EmbedlyEmbed": 125,
  15436. "../Media/EmbedlyPlayer": 126,
  15437. "../Media/Image": 128,
  15438. "../Media/Link": 129,
  15439. "../Media/MediaEvent": 131,
  15440. "../Parser/DescriptionChunkType": 133,
  15441. "../Parser/DescriptionParser": 134,
  15442. "./BillboardEvent": 120,
  15443. "./billboardSettings": 121,
  15444. "./overlaySettings": 122,
  15445. events: 202
  15446. }],
  15447. 120: [function(e, t, i) {
  15448. "use strict";
  15449. t.exports = Object.freeze({
  15450. ENTER: "billboard.enter",
  15451. LEAVE: "billboard.leave",
  15452. OPENING: "billboard.opening",
  15453. OPENED: "billboard.open",
  15454. CLOSING: "billboard.closing",
  15455. CLOSED: "billboard.closed",
  15456. ACTIVATING: "billboard.activating",
  15457. ACTIVATE: "billboard.activate"
  15458. })
  15459. }
  15460. , {}],
  15461. 121: [function(e, t, i) {
  15462. "use strict";
  15463. t.exports = Object.freeze({
  15464. animation: Object.freeze({
  15465. hoverOnClosing: !1,
  15466. openDelay: 100,
  15467. closeDelay: 50,
  15468. openDuration: 200,
  15469. closeDuration: 100
  15470. }),
  15471. boardToDiscRatio: 1.2
  15472. })
  15473. }
  15474. , {}],
  15475. 122: [function(e, t, i) {
  15476. "use strict";
  15477. t.exports = Object.freeze({
  15478. boundaryWidth: 30,
  15479. boundaryHeight: 0
  15480. })
  15481. }
  15482. , {}],
  15483. 123: [function(e, t, i) {//tag
  15484. (function(i) {
  15485. "use strict";
  15486. function n(e, t, i) {
  15487. var n = i.version || "0";
  15488. "0" !== n && I.info("tag defined using version " + n),
  15489. this.model = e,
  15490. this.sid = t,
  15491. this.color = (new r.Color).set(i.color || l.tagDefault),
  15492. this.hoverColor = l._darken(this.color, .2),
  15493. this.floor = null,
  15494. this.floorIndex = i.floor,
  15495. this.mode = s.PANORAMA,
  15496. i.preferred_camera && i.preferred_camera.mode && (this.mode = i.preferred_camera.mode),
  15497. this.obj3d = null,
  15498. this.disc = null,
  15499. this.materials = {
  15500. disc: null,
  15501. pole: null
  15502. },
  15503. this.position = (new r.Vector3).copy(i.position),
  15504. this.discPosition = (new r.Vector3).copy(i.stem.direction),
  15505. this.discWorldPosition = null,
  15506. this.discScale = .05,
  15507. this.poleEnabled = i.stem.enabled,
  15508. this.billboard = new o(i.label,i.description,i.media,this),
  15509. this.visibleTransition = null,
  15510. this.hoveringDisc = !1
  15511. }
  15512. var r = e("three")
  15513. , o = e("./Billboard/Billboard")
  15514. , a = e("../settings")
  15515. , s = e("../enum/Viewmode")
  15516. , l = e("../enum/Colors")
  15517. , c = e("../enum/RenderLayers")
  15518. , h = e("../enum/RenderOrder")
  15519. , u = (e("../util/common"),
  15520. e("../util/math"))
  15521. , d = e("../util/texture")
  15522. , p = e("../objects/Panorama")
  15523. , f = e("../shaders")
  15524. , g = e("../util/transitions")
  15525. , m = e("../util/lerp")
  15526. , v = e("../util/easing")
  15527. , A = e("./Billboard/BillboardEvent")
  15528. , y = e("events").EventEmitter
  15529. , C = e("../util/logger")
  15530. , I = new C(i)
  15531. , 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==")
  15532. , 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")
  15533. , w = new r.PlaneBufferGeometry(1,1);
  15534. n.prototype = Object.create(y.prototype),
  15535. n.raycaster = new r.Raycaster,
  15536. n.prototype.bindEvents = function() {
  15537. this.billboard.on(A.ENTER, this.setHoverState.bind(this)),
  15538. this.billboard.on(A.LEAVE, this.setFreeState.bind(this))
  15539. }
  15540. ,
  15541. n.prototype.build = function() {
  15542. return this.floor = this.model.floors.get(this.floorIndex) || this.model.floors.first(),
  15543. this.floor && (this.billboard.build(this.model.sid),
  15544. this.obj3d = this.buildObject3D(),
  15545. this.floor.add(this.obj3d)),
  15546. this
  15547. }
  15548. ,
  15549. n.prototype.buildObject3D = function() {
  15550. var e = new r.Object3D;
  15551. e.position.copy(this.position);
  15552. var t = r.UniformsUtils.clone(f.tagDisc.uniforms);
  15553. t.bg.value = b,
  15554. t.mask.value = E,
  15555. t.color.value.copy(this.color),
  15556. this.materials.disc = new r.RawShaderMaterial({
  15557. transparent: !0,
  15558. vertexShader: f.tagDisc.vertexShader,
  15559. fragmentShader: f.tagDisc.fragmentShader,
  15560. uniforms: t
  15561. }),
  15562. this.disc = new r.Mesh(w,this.materials.disc),
  15563. this.disc.layers.set(c.TAG),
  15564. this.disc.position.copy(this.discPosition),
  15565. this.disc.renderOrder = h.tagDisc,
  15566. this.disc.tag = this;
  15567. var i = this.buildPole();
  15568. return i.layers.set(c.TAG),
  15569. i.renderOrder = h.tagStem,
  15570. e.add(i),
  15571. e.layers.set(c.TAG),
  15572. e.add(this.disc)
  15573. }
  15574. ,
  15575. n.prototype.buildPole = function() {
  15576. var e = new r.BufferGeometry
  15577. , t = new Float32Array(6);
  15578. return t[0] = t[1] = t[2] = 0,
  15579. t[3] = this.discPosition.x,
  15580. t[4] = this.discPosition.y,
  15581. t[5] = this.discPosition.z,
  15582. e.addAttribute("position", new r.BufferAttribute(t,3)),
  15583. this.materials.pole = new r.LineBasicMaterial({
  15584. linewidth: a.tags.pole.width,
  15585. color: a.tags.pole.color,
  15586. opacity: 0,
  15587. visible: this.poleEnabled,
  15588. transparent: !0,
  15589. depthWrite: !1
  15590. }),
  15591. new r.Line(e,this.materials.pole)
  15592. }
  15593. ,
  15594. n.prototype.setFreeState = function(e) {
  15595. !e && this.hoveringDisc || this.billboard.close(e).then(function() {
  15596. this.materials.disc.uniforms.color.value = this.color
  15597. }
  15598. .bind(this))
  15599. }
  15600. ,
  15601. n.prototype.setHoverState = function(e) {
  15602. this.billboard.open(e),
  15603. this.materials.disc.uniforms.color.value = this.hoverColor
  15604. }
  15605. ,
  15606. n.prototype.hide = function(e, t) {
  15607. var i = $.Deferred();
  15608. if (0 === this.materials.disc.uniforms.opacity.value && !g.isRunning(this.visibleTransition))
  15609. return i.resolve().promise();
  15610. e = e || 0,
  15611. t = t || 0,
  15612. g.cancel(this.visibleTransition);
  15613. var n = this.materials.disc.uniforms.opacity.value / a.tags.disc.opacity
  15614. , r = t + e
  15615. , o = t / r;
  15616. return this.visibleTransition = g.start(function(e) {
  15617. var t = m.property(e.materials.disc.uniforms.opacity, "value", 0)
  15618. , i = m.property(e.materials.pole, "opacity", 0);
  15619. return function(n) {
  15620. t(n),
  15621. e.materials.pole && i(n)
  15622. }
  15623. }(this), r * n, function() {
  15624. i.resolve()
  15625. }, o, v[a.warp.blendEasing]),
  15626. i.promise()
  15627. }
  15628. ,
  15629. n.prototype.show = function(e, t) {
  15630. var i = $.Deferred();
  15631. if (this.materials.disc.uniforms.opacity.value === a.tags.disc.opacity && !g.isRunning(this.visibleTransition))
  15632. return i.resolve().promise();
  15633. e = e || 0,
  15634. t = t || 0,
  15635. g.cancel(this.visibleTransition);
  15636. var n = (a.tags.disc.opacity - this.materials.disc.uniforms.opacity.value) / a.tags.disc.opacity
  15637. , r = t + e
  15638. , o = t / r;
  15639. return this.visibleTransition = g.start(function(e) {
  15640. var t = m.property(e.materials.disc.uniforms.opacity, "value", a.tags.disc.opacity)
  15641. , i = m.property(e.materials.pole, "opacity", a.tags.pole.opacity);
  15642. return function(n) {
  15643. t(n),
  15644. e.materials.pole && i(n)
  15645. }
  15646. }(this), r * n, function() {
  15647. i.resolve()
  15648. }, o, v[a.warp.blendEasing]),
  15649. i.promise()
  15650. }
  15651. ,
  15652. n.prototype.closestPanoTowardTag = function(e, t) {
  15653. var i = []
  15654. , o = []
  15655. , l = this.disc.getWorldPosition();
  15656. if (e === s.PANORAMA) {
  15657. var c = .5
  15658. , h = t.position.clone().sub(l).normalize();
  15659. i.push(p.filters.isPanoAligned()),
  15660. i.push(p.filters.isNeighbourPanoTo(t)),
  15661. i.push(p.filters.inPanoDirection(l, h, c)),
  15662. o.push(p.scoreFunctions.direction(l, h))
  15663. }
  15664. var u = new r.Vector3
  15665. , d = function(e) {
  15666. u.copy(l).sub(e.position);
  15667. var t = -r.Math.radToDeg(Math.atan(u.y / Math.sqrt(u.x * u.x + u.z * u.z)))
  15668. , i = a.tags.navigate.tiltTolerance;
  15669. return a.insideLookLimitDown - i < t && t < a.insideLookLimitUp + i
  15670. }
  15671. , f = function(e) {
  15672. return Math.abs(e.position.x - l.x) > a.tags.visibility.cameraClearance || Math.abs(e.position.z - l.z) > a.tags.visibility.cameraClearance
  15673. };
  15674. i.push(f, d),
  15675. o.push(p.scoreFunctions.distanceSquared(this, -2));
  15676. var g = this.model.panos.sortByScore(i, o);
  15677. if (a.tags.navigate.lineOfSight) {
  15678. for (var m = 0; m < g.length; m++) {
  15679. var v = g[m].item
  15680. , A = v.position.distanceTo(l);
  15681. if (!a.tags.visibility.anyDistance && A > a.tags.visibility.visibleDistance)
  15682. return null;
  15683. n.raycaster.set(v.position, l.clone().sub(v.position).normalize());
  15684. var y = n.raycaster.intersectObjects(this.model.colliders);
  15685. if (0 === y.length || y[0].distance > A)
  15686. return v
  15687. }
  15688. return null
  15689. }
  15690. return g.length > 0 && g[0].item
  15691. }
  15692. ,
  15693. n.prototype.examine = function(e) {
  15694. var t = e.mode
  15695. , i = a.tags.navigate.nearestPano && this.closestPanoTowardTag(t, e.currentPano) || e.currentPano
  15696. , n = this.disc.getWorldPosition();
  15697. this.billboard.setActiveState();
  15698. var o = function() {
  15699. var t = this.billboard.getDimensions()
  15700. , n = new r.Vector3;
  15701. u.convertScreenPositionToNDC(t.left + t.width / 2, t.top + t.height / 2, n),
  15702. n.unproject(e.camera),
  15703. e.flyToPano({
  15704. pano: i,
  15705. lookAtPoint: n
  15706. })
  15707. }
  15708. .bind(this);
  15709. if (t === s.PANORAMA)
  15710. if (i !== e.currentPano) {
  15711. var l = {
  15712. pano: i,
  15713. lookAtPoint: n,
  15714. duration: null,
  15715. maxDistanceOverride: null,
  15716. skipWarpingCheck: !1
  15717. };
  15718. e.flyToPano(l, o)
  15719. } else
  15720. setTimeout(function() {
  15721. this.billboard.open().then(function() {
  15722. o()
  15723. })
  15724. }
  15725. .bind(this), 0);
  15726. else {
  15727. var c = {
  15728. pano: i
  15729. };
  15730. if (n) {
  15731. var h = (new r.Matrix4).lookAt(i.position, n, new r.Vector3(0,1,0));
  15732. c.quaternion = (new r.Quaternion).setFromRotationMatrix(h)
  15733. }
  15734. c.callback = o,
  15735. c.duration = 1500,
  15736. c.mode = s.PANORAMA,
  15737. e.flyToNewMode(c)
  15738. }
  15739. }
  15740. ,
  15741. n.prototype.update = function(e, t) {
  15742. var i = new r.Vector3;
  15743. return function(e, t) {
  15744. this.discWorldPosition = this.disc.getWorldPosition(),
  15745. this.updateDisc(e, t),
  15746. this.billboard.needsUpdate() && (i.copy(this.discWorldPosition).project(t),
  15747. i.z < 1 && (i.y *= -1,
  15748. this.billboard.update(i, this.getDiscRadius(i, t))))
  15749. }
  15750. }(),
  15751. n.prototype.updateDisc = function(e, t) {
  15752. var i = new r.Vector3
  15753. , o = new r.Vector3
  15754. , l = new r.Vector3
  15755. , c = new r.Vector3
  15756. , h = new r.Vector3;
  15757. return function(e, t) {
  15758. var u = a.tags.visibility
  15759. , d = a.tags.disc.scale
  15760. , p = e === s.DOLLHOUSE || e === s.FLOORPLAN ? a.tags.visibility.visibleDistance : t.position.distanceTo(this.discWorldPosition);
  15761. 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)),
  15762. this.obj3d.visible) {
  15763. this.disc.quaternion.copy(t.quaternion);
  15764. var f = d.maxSize - (d.maxSize - d.minSize) * r.Math.smoothstep(p, d.nearBound, d.farBound);
  15765. i.copy(this.discWorldPosition).project(t),
  15766. o.set($("#player").width() / 2, $("#player").height() / 2, 1).multiply(i),
  15767. l.set(f / 2, 0, 0).add(o),
  15768. c.set(2 / $("#player").width(), 2 / $("#player").height(), 1).multiply(l),
  15769. h.copy(c).unproject(t);
  15770. var g = h.distanceTo(this.discWorldPosition)
  15771. , m = 1 + a.tags.disc.scale.responsiveness / 100 * (n.viewportScale() - 1);
  15772. this.discScale = g * m,
  15773. this.disc.scale.set(this.discScale, this.discScale, this.discScale)
  15774. }
  15775. }
  15776. }(),
  15777. n.prototype.getDiscRadius = function(e, t) {
  15778. var i = new r.Vector3;
  15779. return function(e, t) {
  15780. return i.set(-this.discScale / 2, 0, 0).applyQuaternion(t.quaternion).add(this.discWorldPosition).project(t),
  15781. Math.abs(e.x - i.x) * $("#player").width()
  15782. }
  15783. }(),
  15784. n.prototype.tagVisibleOnCurrentFloor = function(e) {
  15785. return !(e === s.DOLLHOUSE || e === s.FLOORPLAN) || this.model.allFloorsVisible || !this.floor.hidden
  15786. }
  15787. ,
  15788. n.prototype.offScreen = function(e, t) {
  15789. var i = e.getWorldPosition().project(t);
  15790. return !(-1 < i.x && i.x < 1 && -1 < i.y && i.y < 1)
  15791. }
  15792. ,
  15793. n.viewportScale = function() {
  15794. return n.viewportWidth === $("#player").width() && n.viewportHeight === $("#player").height() || (n.viewportWidth = $("#player").width(),
  15795. n.viewportHeight = $("#player").height(),
  15796. n.currentViewportScale = Math.sqrt(Math.min(n.viewportWidth, n.viewportHeight) / a.tags.disc.scale.baseViewportSize)),
  15797. n.currentViewportScale
  15798. }
  15799. ,
  15800. t.exports = n
  15801. }
  15802. ).call(this, "/js/tag/tag.js")
  15803. }
  15804. , {
  15805. "../enum/Colors": 19,
  15806. "../enum/RenderLayers": 41,
  15807. "../enum/RenderOrder": 42,
  15808. "../enum/Viewmode": 51,
  15809. "../objects/Panorama": 148,
  15810. "../settings": 166,
  15811. "../shaders": 167,
  15812. "../util/common": 185,
  15813. "../util/easing": 186,
  15814. "../util/lerp": 188,
  15815. "../util/logger": 189,
  15816. "../util/math": 190,
  15817. "../util/texture": 194,
  15818. "../util/transitions": 195,
  15819. "./Billboard/Billboard": 119,
  15820. "./Billboard/BillboardEvent": 120,
  15821. events: 202,
  15822. three: 217
  15823. }],
  15824. 124: [function(e, t, i) {
  15825. (function(i) {
  15826. "use strict";
  15827. function n() {
  15828. this.tagState = y.IDLE,
  15829. this.intersectTag = null,
  15830. this.hoveredTag = null,
  15831. this.activeTag = null,
  15832. this.tagDiscs = [],
  15833. this.raycaster = new r.Raycaster,
  15834. this.modelManager = null,
  15835. this.player = null,
  15836. this.totaltags = 0,
  15837. this.navigatingViaTag = !1,
  15838. this.enabled = !1
  15839. }
  15840. var r = e("three")
  15841. , o = e("../util/logger")
  15842. , a = e("../util/common")
  15843. , s = e("../controls/serializer")
  15844. , l = e("../objects/Snapshot")
  15845. , c = e("../settings")
  15846. , h = e("./Billboard/BillboardEvent")
  15847. , u = e("./Media/MediaEvent")
  15848. , d = e("./Media/LinkType")
  15849. , p = e("../enum/Viewmode")
  15850. , f = e("../enum/WarpStyle")
  15851. , g = e("../enum/BlackoutStyle")
  15852. , m = e("../enum/ModelManagerEvents")
  15853. , v = e("../enum/tagEvents")
  15854. , A = e("../enum/PlayerEvents")
  15855. , y = (e("../util/lerp"),
  15856. e("../enum/TagStates"))
  15857. , C = e("events").EventEmitter
  15858. , I = new o(i);
  15859. a.extend(n, C),
  15860. n.prototype.init = function(e, t) {
  15861. this.modelManager = e,
  15862. this.player = t,
  15863. this.updateModel(),
  15864. this.bindEvents()
  15865. }
  15866. ,
  15867. n.prototype.update = function(e) {
  15868. this.updateTags(this.player.mode, this.player.camera, this.player.currentPano, this.player.flying)
  15869. }
  15870. ,
  15871. n.prototype.updateTags = function(e, t, i, n) {
  15872. for (var r in this.model.tags)
  15873. this.model.tags[r].update(e, t, i, n)
  15874. }
  15875. ,
  15876. n.prototype.updateModel = function() {
  15877. this.model = this.modelManager.getActiveModel(),
  15878. this.gettagsFromModel(),
  15879. this.totaltags = Object.keys(this.model.tags).length
  15880. }
  15881. ,
  15882. n.prototype.gettagsFromModel = function() {
  15883. this.tagDiscs = [];
  15884. for (var e in this.model.tags) {
  15885. var t = this.model.tags[e].disc;
  15886. t && this.tagDiscs.push(t)
  15887. }
  15888. }
  15889. ,
  15890. n.prototype.bindEvents = function() {
  15891. function e() {
  15892. Object.keys(this.model.tags).forEach(function(e) {
  15893. var t = this.model.tags[e];
  15894. t.bindEvents(),
  15895. t.billboard.on(u.LINK_CLICK, function(e) {
  15896. e.type === d.NAVIGATION && this.navigateViaLink(e.url)
  15897. }
  15898. .bind(this)),
  15899. t.billboard.on(u.IMAGE_OPENED, function() {
  15900. this.tagState = y.EXAMINE,
  15901. this.emit(u.IMAGE_OPENED)
  15902. }
  15903. .bind(this)),
  15904. t.billboard.on(h.CLOSING, this.dismissExaminedTag.bind(this))
  15905. }
  15906. .bind(this))
  15907. }
  15908. this.modelManager.on(m.ActiveModelChanged, this.updateModel.bind(this)),
  15909. this.modelManager.on(m.ActiveModelChanged, e.bind(this)),
  15910. this.player.on(A.ModeChanging, this.onPlayerModeChanging.bind(this)),
  15911. this.player.on(A.PanoChosen, this.onPanoChange.bind(this)),
  15912. this.player.on(A.Ready, this.onPlayerReady.bind(this)),
  15913. this.player.on(A.FlyingEnded, this.onPlayerFlyingEnded.bind(this)),
  15914. this.player.on(A.WarpStarted, this.handleWarpStart.bind(this)),
  15915. this.player.on(A.WarpInterrupted, this.handleWarpInterruption.bind(this)),
  15916. e.call(this)
  15917. }
  15918. ,
  15919. n.prototype.navigateViaLink = function(e) {
  15920. var t = s.deserialize(e);
  15921. if (t)
  15922. if (t.mode === p.PANORAMA) {
  15923. try {
  15924. this.player.model.panos.get(t.panoId)
  15925. } catch (e) {
  15926. return void I.warn("Unable to find panorama location", t.panoId)
  15927. }
  15928. this.player.warpToPanoById(t.panoId, t.quaternion, null, null, f.BLACK)
  15929. } else {
  15930. var i = {
  15931. cameraMode: t.mode,
  15932. position: t.position,
  15933. quaternion: t.quaternion,
  15934. scanId: t.panoId,
  15935. orthoZoom: t.zoom,
  15936. floorVisibility: t.floorVisibility,
  15937. thumbUrl: null,
  15938. name: null
  15939. };
  15940. this.player.flyToNewMode({
  15941. mode: t.mode,
  15942. duration: c.warp.outsideTime,
  15943. warpDest: new l(i),
  15944. force: !0
  15945. })
  15946. }
  15947. }
  15948. ,
  15949. n.prototype.handleWarpStart = function(e, t, i, n) {
  15950. this.dismissExaminedTag(),
  15951. t === f.BLACK && (null !== n && void 0 !== n || (n = c.warp.teleportTime),
  15952. e && (i = g.END),
  15953. this.hideShowTagsForBlackoutStyle(i, n))
  15954. }
  15955. ,
  15956. n.prototype.handleWarpInterruption = function(e, t, i) {
  15957. null !== i && void 0 !== i || (i = c.warp.teleportTime),
  15958. this.hideShowTagsForBlackoutStyle(t, i)
  15959. }
  15960. ,
  15961. n.prototype.hideShowTagsForBlackoutStyle = function(e, t) {
  15962. var i = 0
  15963. , n = 0
  15964. , r = t / 2;
  15965. switch (null !== e && void 0 !== e || (e = g.MIDDLE),
  15966. e) {
  15967. case g.END:
  15968. this.hideAlltags(r);
  15969. break;
  15970. case g.BEGINNING:
  15971. this.hideAlltags().done(this.showAlltags.bind(this, r));
  15972. break;
  15973. case g.NONE:
  15974. break;
  15975. case g.MIDDLE:
  15976. i = r,
  15977. n = r,
  15978. this.hideAlltags(n),
  15979. setTimeout(function() {
  15980. this.showAlltags(i)
  15981. }
  15982. .bind(this), n);
  15983. break;
  15984. case g.FADEIN:
  15985. setTimeout(function() {
  15986. this.showAlltags(r)
  15987. }
  15988. .bind(this), r)
  15989. }
  15990. }
  15991. ,
  15992. n.prototype.onPlayerModeChanging = function(e, t) {
  15993. t !== p.PANORAMA && this.dismissExaminedTag(),
  15994. t === p.PANORAMA && player.currentPano && !player.currentPano.isAligned() && (t = p.OUTDOOR);
  15995. var i = t !== p.OUTDOOR;
  15996. i !== this.model.tagsShown && (i ? this.showAlltags(c.tags.startup.fadeInDuration) : this.hideAlltags(c.tags.startup.fadeInDuration))
  15997. }
  15998. ,
  15999. n.prototype.onPanoChange = function(e, t) {
  16000. var i = this.navigatingViaTag;
  16001. if (this.navigatingViaTag = !1,
  16002. !i) {
  16003. this.dismissExaminedTag();
  16004. var n = e && !e.isAligned() ? p.OUTDOOR : p.PANORAMA
  16005. , r = t && !t.isAligned() ? p.OUTDOOR : p.PANORAMA;
  16006. n !== r && (r === p.PANORAMA ? this.showAlltags(c.tags.startup.fadeInDuration, null, !0) : this.hideAlltags(c.tags.startup.fadeInDuration))
  16007. }
  16008. }
  16009. ,
  16010. n.prototype.onPlayerReady = function(e, t, i) {
  16011. this.startAlltags(e, t ? i : null)
  16012. }
  16013. ,
  16014. n.prototype.onPlayerFlyingEnded = function(e, t) {
  16015. this.updateClosestTags(e)
  16016. }
  16017. ,
  16018. n.prototype.dismissExaminedTag = function() {
  16019. this.activeTag && this.tagState === y.EXAMINE && this.dismissActiveTag(),
  16020. this.hoveredTag && (this.hoveredTag.setFreeState(!0),
  16021. this.hoveredTag = null)
  16022. }
  16023. ,
  16024. n.prototype.startAlltags = function(e, t) {
  16025. this.model.shouldShowtags = c.tags.enabled,
  16026. this.enabled = !0,
  16027. e || (this.showAlltags(c.tags.startup.fadeInDuration, c.tags.startup.fadeInDelay),
  16028. t && setTimeout(function() {
  16029. this.activateTag(this.model.getTagBySid(t))
  16030. }
  16031. .bind(this), c.tags.startup.fadeInDuration / 2))
  16032. }
  16033. ,
  16034. n.prototype.showAlltags = function(e, t, i) {
  16035. function n() {
  16036. o++,
  16037. o === this.totaltags && (this.model.tagsShown = !0,
  16038. r.resolve())
  16039. }
  16040. var r = $.Deferred();
  16041. if (!i && this.player.mode === p.PANORAMA && this.player.currentPano && !this.player.currentPano.isAligned() || !this.model.shouldShowtags)
  16042. return r.resolve().promise();
  16043. var o = 0;
  16044. for (var a in this.model.tags) {
  16045. var s = this.model.tags[a];
  16046. s.show(e, t).done(n.bind(this))
  16047. }
  16048. return r.promise()
  16049. }
  16050. ,
  16051. n.prototype.hideAlltags = function(e, t) {
  16052. function i() {
  16053. r++,
  16054. r === this.totaltags && (this.model.tagsShown = !1,
  16055. n.resolve())
  16056. }
  16057. var n = $.Deferred()
  16058. , r = 0;
  16059. for (var o in this.model.tags) {
  16060. var a = this.model.tags[o];
  16061. a.hide(e, t).done(i.bind(this)),
  16062. a === this.activeTag && this.dismissActiveTag()
  16063. }
  16064. return n.promise()
  16065. }
  16066. ,
  16067. n.prototype.enableHovering = function() {
  16068. this.enabled = !0
  16069. }
  16070. ,
  16071. n.prototype.disableHovering = function() {
  16072. this.enabled = !1
  16073. }
  16074. ,
  16075. n.prototype.activateTag = function(e, t) {
  16076. t = t || y.EXAMINE,
  16077. this.activeTag = e,
  16078. this.activeTag.hoveringDisc = !0,
  16079. this.activeTag.setHoverState(t === y.EXAMINE),
  16080. this.tagState = t,
  16081. this.emit(v.TagActivated, e)
  16082. }
  16083. ,
  16084. n.prototype.dismissActiveTag = function() {
  16085. this.activeTag.hoveringDisc = !1,
  16086. this.activeTag.setFreeState(!0);
  16087. var e = this.activeTag;
  16088. this.activeTag = null,
  16089. this.tagState = y.IDLE,
  16090. this.emit(v.TagDismissed, e)
  16091. }
  16092. ,
  16093. n.prototype.clickedOnTag = function(e) {
  16094. var t = function() {
  16095. this.navigatingViaTag = !0,
  16096. this.activeTag.examine(this.player),
  16097. this.emit(v.TagNavigation, this.activeTag)
  16098. }
  16099. .bind(this);
  16100. return this.tagState !== y.EXAMINE ? (this.activateTag(this.intersectTag, y.EXAMINE),
  16101. this.activeTag = this.intersectTag,
  16102. t(),
  16103. !0) : (this.dismissActiveTag(),
  16104. !1)
  16105. }
  16106. ,
  16107. n.prototype.intersecttag = function() {
  16108. var e = new r.Vector3
  16109. , t = new r.Vector3
  16110. , i = new r.Vector3;
  16111. return function(n, r, o) {
  16112. if (!this.enabled)
  16113. return null;
  16114. var a = null
  16115. , s = this.tagDiscs.filter(function(e) {
  16116. return e.parent.visible
  16117. });
  16118. if (s.length > 0) {
  16119. var l = this.model.floors.reduce(function(e, t) {
  16120. return t.hidden ? e : e.concat(t.collider.children)
  16121. }, s);
  16122. e.set(n.x, n.y, -1).unproject(o),
  16123. t.set(n.x, n.y, 1).unproject(o),
  16124. i.copy(t).sub(e).normalize(),
  16125. this.raycaster.set(e, i);
  16126. var c = this.raycaster.intersectObjects(l);
  16127. c.length > 0 && s.indexOf(c[0].object) !== -1 && (a = c[0].object.tag)
  16128. }
  16129. return this.intersectTag = a,
  16130. r && (this.activeTag && a !== this.activeTag && (this.tagState === y.BROWSE || this.tagState === y.EXAMINE && a) && this.dismissActiveTag(),
  16131. a && a !== this.activeTag && (a.listeners(h.ENTER).length < 1 && (a.billboard.on(h.ENTER, function() {
  16132. this.hoveredTag = a
  16133. }
  16134. .bind(this)),
  16135. a.billboard.on(h.LEAVE, function() {
  16136. this.hoveredTag = null
  16137. }
  16138. .bind(this))),
  16139. this.activateTag(a, y.BROWSE))),
  16140. a
  16141. }
  16142. }(),
  16143. n.prototype.rankedtagInDirection = function() {
  16144. var e = []
  16145. , t = []
  16146. , i = new r.Vector3
  16147. , n = new r.Vector3
  16148. , o = new r.Vector3;
  16149. return function(r, a, s, l) {
  16150. var c = 0;
  16151. t.length = 0;
  16152. for (var h = 0; h < this.closesttags.length; h++) {
  16153. var u = this.closesttags[h];
  16154. n.copy(u.position),
  16155. n.add(u.discPosition),
  16156. i.copy(a),
  16157. i.sub(n).negate(),
  16158. i.normalize();
  16159. var d = i.dot(l);
  16160. if (d >= 0) {
  16161. o.copy(n),
  16162. o.project(s);
  16163. var p = this.intersecttag(o, !1, s);
  16164. if (p) {
  16165. if (c >= e.length)
  16166. for (var f = 0; f < 64; f++)
  16167. e.push({
  16168. tag: u,
  16169. dot: d
  16170. });
  16171. var g = e[c];
  16172. g.tag = u,
  16173. g.dot = d,
  16174. g.position = math.projectPositionToCanvas(n, s),
  16175. t.push(g),
  16176. c++
  16177. }
  16178. }
  16179. }
  16180. return t.sort(function(e, t) {
  16181. return e.dot > t.dot ? -1 : e.dot < t.dot ? 1 : 0
  16182. }),
  16183. r < t.length ? t[r].tag : null
  16184. }
  16185. }(),
  16186. n.prototype.updateClosestTags = function() {
  16187. var e = new r.Vector3
  16188. , t = 30;
  16189. return function(i) {
  16190. this.closesttags || (this.closesttags = []),
  16191. this.closesttags.length = 0;
  16192. var n = this.model.tags;
  16193. if (n)
  16194. for (var r in n)
  16195. if (n.hasOwnProperty(r)) {
  16196. var o = n[r]
  16197. , a = o.position;
  16198. e.copy(i),
  16199. e.sub(a).negate();
  16200. var s = e.lengthSq();
  16201. s < t && this.closesttags.push(o)
  16202. }
  16203. }
  16204. }(),
  16205. t.exports = n
  16206. }
  16207. ).call(this, "/js/tag/tagManager.js")
  16208. }
  16209. , {
  16210. "../controls/serializer": 14,
  16211. "../enum/BlackoutStyle": 18,
  16212. "../enum/tagEvents": 32,
  16213. "../enum/ModelManagerEvents": 33,
  16214. "../enum/PlayerEvents": 40,
  16215. "../enum/TagStates": 44,
  16216. "../enum/Viewmode": 51,
  16217. "../enum/WarpStyle": 52,
  16218. "../objects/Snapshot": 153,
  16219. "../settings": 166,
  16220. "../util/common": 185,
  16221. "../util/lerp": 188,
  16222. "../util/logger": 189,
  16223. "./Billboard/BillboardEvent": 120,
  16224. "./Media/LinkType": 130,
  16225. "./Media/MediaEvent": 131,
  16226. events: 202,
  16227. three: 217
  16228. }],
  16229. 125: [function(e, t, i) {
  16230. (function(i) {
  16231. "use strict";
  16232. function n() {
  16233. this.embedWrapper = null,
  16234. this.embedElement = null
  16235. }
  16236. var r = e("../../util/ajax")
  16237. , o = e("./mediaSettings")
  16238. , a = e("../../settings")
  16239. , s = e("../../util/logger")
  16240. , l = new s(i);
  16241. n.prototype.createDomElement = function() {
  16242. return this.embedWrapper = document.createElement("div"),
  16243. this.embedWrapper.classList.add("tag-embed"),
  16244. this.embedWrapper.classList.add("hidden"),
  16245. this.embedWrapper
  16246. }
  16247. ,
  16248. n.prototype.load = function(e) {
  16249. var t = "https://api.embedly.com/1/oembed?key=" + a.appConfig.embedly_key + "&url=" + encodeURIComponent(e) + "&maxwidth=" + o.maxEmbedWidth;
  16250. return new Promise(function(e, i) {
  16251. r.get(t).then(function(t) {
  16252. if (t = JSON.parse(t),
  16253. t.html && t.html.indexOf("<script") === -1) {
  16254. this.embedWrapper.innerHTML = t.html;
  16255. var n = Math.min(t.width, o.maxEmbedWidth) || o.maxEmbedWidth;
  16256. if (this.embedWrapper.style.width = n + "px",
  16257. t.height) {
  16258. var r = t.height / t.width;
  16259. this.embedWrapper.style.height = n * r + "px"
  16260. }
  16261. this.embedElement = this.embedWrapper.firstChild;
  16262. var a = [];
  16263. try {
  16264. a = [].slice.call(this.embedElement.querySelectorAll("a"))
  16265. } catch (e) {
  16266. l.debug("Error getting `a` elements for embed; was it an iframe?")
  16267. }
  16268. a.forEach(function(e) {
  16269. e.setAttribute("target", "_blank")
  16270. }),
  16271. this.embedElement.classList.add("hidden"),
  16272. this.embedWrapper.classList.remove("hidden"),
  16273. e()
  16274. } else
  16275. i("Not a valid embed")
  16276. }
  16277. .bind(this), function(e) {
  16278. i(e.response)
  16279. })
  16280. }
  16281. .bind(this))
  16282. }
  16283. ,
  16284. n.prototype.show = function() {
  16285. this.embedElement && this.embedElement.classList.remove("hidden")
  16286. }
  16287. ,
  16288. n.prototype.hide = function() {
  16289. this.embedElement && this.embedElement.classList.add("hidden")
  16290. }
  16291. ,
  16292. t.exports = n
  16293. }
  16294. ).call(this, "/js/tag/Media/EmbedlyEmbed.js")
  16295. }
  16296. , {
  16297. "../../settings": 166,
  16298. "../../util/ajax": 181,
  16299. "../../util/logger": 189,
  16300. "./mediaSettings": 132
  16301. }],
  16302. 126: [function(e, t, i) {
  16303. (function(i) {
  16304. "use strict";
  16305. function n(e) {
  16306. o.call(this),
  16307. this.options = e,
  16308. this.playerControls = null,
  16309. this.state = s.NOT_READY
  16310. }
  16311. var r = e("../../util/browser")
  16312. , o = e("./EmbedlyEmbed")
  16313. , a = e("../../util/logger")
  16314. , s = (new a(i),
  16315. Object.freeze({
  16316. NOT_READY: "player.not.ready",
  16317. CUED: "player.cued",
  16318. PLAYING: "player.playing",
  16319. PAUSED: "player.paused"
  16320. }));
  16321. n.prototype = Object.create(o.prototype),
  16322. n.prototype.createDomElement = function() {
  16323. return this.embedWrapper = document.createElement("div"),
  16324. this.embedWrapper.classList.add("tag-video"),
  16325. this.embedWrapper.classList.add("hidden"),
  16326. this.embedWrapper
  16327. }
  16328. ,
  16329. n.prototype.load = function(e) {
  16330. var t = function() {
  16331. function e(e) {
  16332. this.playerState = s.CUED,
  16333. this.options.startMuted && this.playerControls.mute()
  16334. }
  16335. function t(e) {
  16336. this.playerState = e
  16337. }
  16338. function i(e) {
  16339. this.playerControls.setCurrentTime(0),
  16340. this.options.loop ? this.playerControls.play() : this.playerControls.pause()
  16341. }
  16342. this.playerControls = new playerjs.Player(this.embedElement),
  16343. this.playerControls.on("ready", e.bind(this)),
  16344. this.playerControls.on("play", t.bind(this, s.PLAYING)),
  16345. this.playerControls.on("pause", t.bind(this, s.PAUSED)),
  16346. this.playerControls.on("ended", i.bind(this))
  16347. }
  16348. .bind(this);
  16349. return o.prototype.load.call(this, e).then(t.bind(this))
  16350. }
  16351. ,
  16352. n.prototype.play = function() {
  16353. var e = r.isMobile();
  16354. return function() {
  16355. this.playerState !== s.NOT_READY && this.playerControls && !e && (this.state === s.CUED && this.options.autoPlay || this.options.autoResume) && this.playerControls.play()
  16356. }
  16357. }(),
  16358. n.prototype.pause = function() {
  16359. this.playerState !== s.NOT_READY && this.playerControls && this.playerControls.pause()
  16360. }
  16361. ,
  16362. t.exports = n
  16363. }
  16364. ).call(this, "/js/tag/Media/EmbedlyPlayer.js")
  16365. }
  16366. , {
  16367. "../../util/browser": 182,
  16368. "../../util/logger": 189,
  16369. "./EmbedlyEmbed": 125
  16370. }],
  16371. 127: [function(e, t, i) {
  16372. (function(i) {
  16373. "use strict";
  16374. function n(e) {
  16375. function t() {
  16376. return a.debug("requesting file from embedly:", e.href),
  16377. r.get(e.href, {
  16378. responseType: e.responseType
  16379. }).then(function(t) {
  16380. return a.debug("requesting file finished:", e.href),
  16381. t
  16382. })
  16383. }
  16384. function i() {}
  16385. return s = new Promise(function(e, n) {
  16386. s.catch(i).then(function() {
  16387. t().then(e, n)
  16388. })
  16389. }
  16390. )
  16391. }
  16392. var r = e("../../util/ajax")
  16393. , o = (e("./mediaSettings"),
  16394. e("../../util/logger"))
  16395. , a = new o(i)
  16396. , s = Promise.resolve();
  16397. t.exports.enqueue = n
  16398. }
  16399. ).call(this, "/js/tag/Media/EmbedlyQueue.js")
  16400. }
  16401. , {
  16402. "../../util/ajax": 181,
  16403. "../../util/logger": 189,
  16404. "./mediaSettings": 132
  16405. }],
  16406. 128: [function(e, t, i) {
  16407. (function(i) {
  16408. "use strict";
  16409. function n() {
  16410. this.imageWrapper = null,
  16411. this.width = 0,
  16412. this.height = 0,
  16413. this.aspect = 1
  16414. }
  16415. var r = e("./MediaEvent")
  16416. , o = e("./EmbedlyQueue")
  16417. , a = e("events").EventEmitter
  16418. , s = e("../../util/logger")
  16419. , l = e("../../settings");
  16420. new s(i);
  16421. n.prototype = Object.create(a.prototype),
  16422. n.prototype.createDomElement = function() {
  16423. return this.imageWrapper = document.createElement("div"),
  16424. this.imageWrapper.classList.add("tag-image"),
  16425. this.imageWrapper.classList.add("hidden"),
  16426. this.imageWrapper.addEventListener("click", function(e) {
  16427. e.stopPropagation(),
  16428. this.emit(r.IMAGE_OPENING),
  16429. this.imageWrapper.style.pointerEvents = "none"
  16430. }
  16431. .bind(this)),
  16432. this.imageWrapper
  16433. }
  16434. ,
  16435. n.prototype.onClosed = function() {
  16436. this.imageWrapper.style.pointerEvents = "auto"
  16437. }
  16438. ,
  16439. n.prototype.load = function(e) {
  16440. var t = Math.max(window.screen.height, window.screen.width)
  16441. , i = "https://i.embed.ly/1/display/resize?key=" + l.appConfig.embedly_key + "&url=" + encodeURIComponent(e) + "&width=" + t + "&height=" + t;
  16442. return new Promise(function(e, t) {
  16443. function n(t) {
  16444. var i = t.target;
  16445. this.width = i.naturalWidth,
  16446. this.height = i.naturalHeight,
  16447. this.aspect = this.width / this.height;
  16448. var n = t.target.src;
  16449. this.imageWrapper.style.backgroundImage = 'url("' + n + '")',
  16450. this.imageWrapper.style.width = this.width + "px",
  16451. this.imageWrapper.style.height = this.height + "px",
  16452. this.imageWrapper.classList.remove("hidden"),
  16453. e()
  16454. }
  16455. o.enqueue({
  16456. href: i,
  16457. responseType: "arraybuffer"
  16458. }).then(function(e) {
  16459. var t = new Uint8Array(e)
  16460. , i = new Blob([t])
  16461. , r = new window.Image;
  16462. r.addEventListener("load", n.bind(this));
  16463. var o = URL.createObjectURL(i);
  16464. r.src = o
  16465. }
  16466. .bind(this), t)
  16467. }
  16468. .bind(this))
  16469. }
  16470. ,
  16471. t.exports = n
  16472. }
  16473. ).call(this, "/js/tag/Media/Image.js")
  16474. }
  16475. , {
  16476. "../../settings": 166,
  16477. "../../util/logger": 189,
  16478. "./EmbedlyQueue": 127,
  16479. "./MediaEvent": 131,
  16480. events: 202
  16481. }],
  16482. 129: [function(e, t, i) {
  16483. "use strict";
  16484. function n(e) {
  16485. this.label = e.label,
  16486. this.href = e.url,
  16487. this.type = this.updateLinkForType(),
  16488. this.domElement = null,
  16489. this.id = c++
  16490. }
  16491. var r = e("./LinkType")
  16492. , o = e("./MediaEvent")
  16493. , a = e("../../util/browser")
  16494. , s = e("../../analytics")
  16495. , l = e("events").EventEmitter
  16496. , c = 0;
  16497. n.prototype = Object.create(l.prototype),
  16498. n.prototype.updateLinkForType = function() {
  16499. function e(e) {
  16500. var t = new RegExp("[#&?]start=([^#&?]*)")
  16501. , i = t.exec(e);
  16502. return i[1]
  16503. }
  16504. function t(e) {
  16505. return e + "&play=1"
  16506. }
  16507. var i = a.valueFromHash("m") || a.valueFromHash("model");
  16508. 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),
  16509. r.NAVIGATION) : (this.href = t(this.href),
  16510. r.MODEL) : r.EXT_LINK
  16511. }
  16512. ;
  16513. var h = {};
  16514. n.prototype.createDomElement = function() {
  16515. function e(e) {
  16516. switch (e.stopPropagation(),
  16517. h[this.id] = !0,
  16518. s.trackAlways("click_tag_link", {
  16519. link_type: this.type,
  16520. link_count: c,
  16521. links_clicked: Object.keys(h).length
  16522. }),
  16523. this.type) {
  16524. case r.MODEL:
  16525. window.location.replace(this.href);
  16526. break;
  16527. case r.EXT_LINK:
  16528. window.open(this.href, "_blank")
  16529. }
  16530. this.emit(o.LINK_CLICK, {
  16531. type: this.type,
  16532. url: this.href
  16533. })
  16534. }
  16535. if (this.domElement = document.createElement("a"),
  16536. this.domElement.classList.add("tag-link"),
  16537. this.domElement.textContent = this.label,
  16538. this.type === r.EXT_LINK) {
  16539. this.domElement.textContent += " ";
  16540. var t = document.createElement("i");
  16541. t.classList.add("icon-ext-link"),
  16542. t.title = "Link to external web site",
  16543. this.domElement.appendChild(t)
  16544. }
  16545. return this.domElement.addEventListener("click", e.bind(this)),
  16546. this.domElement
  16547. }
  16548. ,
  16549. t.exports = n
  16550. }
  16551. , {
  16552. "../../analytics": 4,
  16553. "../../util/browser": 182,
  16554. "./LinkType": 130,
  16555. "./MediaEvent": 131,
  16556. events: 202
  16557. }],
  16558. 130: [function(e, t, i) {
  16559. "use strict";
  16560. t.exports = {
  16561. NAVIGATION: "navigation",
  16562. MODEL: "model",
  16563. EXT_LINK: "ext-link"
  16564. }
  16565. }
  16566. , {}],
  16567. 131: [function(e, t, i) {
  16568. "use strict";
  16569. t.exports = Object.freeze({
  16570. LINK_CLICK: "mtmedia.link",
  16571. IMAGE_LOADED: "mtmedia.image.loaded",
  16572. IMAGE_OPENING: "mtmedia.image.opening",
  16573. IMAGE_OPENED: "mtmedia.image.opened",
  16574. IMAGE_CLOSING: "mtmedia.image.closing",
  16575. IMAGE_CLOSED: "mtmedia.image.closed",
  16576. VIDEO_START: "mtmedia.video.start",
  16577. VIDEO_PAUSE: "mtmedia.video.pause",
  16578. VIDEO_ENDED: "mtmedia.video.end"
  16579. })
  16580. }
  16581. , {}],
  16582. 132: [function(e, t, i) {
  16583. "use strict";
  16584. t.exports = Object.freeze({
  16585. maxEmbedWidth: 350,
  16586. defaultAspectRatio: .75
  16587. })
  16588. }
  16589. , {}],
  16590. 133: [function(e, t, i) {
  16591. "use strict";
  16592. t.exports = Object.freeze({
  16593. TEXT: "text",
  16594. LINK: "link",
  16595. IMAGE: "photo",
  16596. VIDEO: "video",
  16597. RICH: "rich"
  16598. })
  16599. }
  16600. , {}],
  16601. 134: [function(e, t, i) {
  16602. "use strict";
  16603. function n(e) {
  16604. this.capabilities = {
  16605. links: {
  16606. enable: e.supportLinks,
  16607. keepLabels: e.keepLinkLabels
  16608. }
  16609. }
  16610. }
  16611. var r = e("./DescriptionChunkType");
  16612. n.prototype.parse = function(e, t) {
  16613. var i = []
  16614. , n = e.split("[").map(function(e, t) {
  16615. return 0 === t ? e : "[" + e
  16616. });
  16617. return n.forEach(function(e) {
  16618. var n = this.findMarkdown(e);
  16619. if (n) {
  16620. if (n.url.indexOf("javascript:") !== -1)
  16621. return;
  16622. this.addLinkChunk(i, n, t),
  16623. this.addTextChunk(i, e.slice(n.markdown.length))
  16624. } else
  16625. this.addTextChunk(i, e)
  16626. }
  16627. .bind(this)),
  16628. i
  16629. }
  16630. ,
  16631. n.prototype.findMarkdown = function(e) {
  16632. var t = /\[([^\]]*)\]\((.*)\)/
  16633. , i = e.match(t);
  16634. if (i) {
  16635. for (var n = i[2], r = 1, o = 0; o < n.length && ("(" === n[o] ? r++ : ")" === n[o] && r--,
  16636. 0 !== r); )
  16637. o++;
  16638. var a = n.length - o;
  16639. return {
  16640. markdown: i[0].substring(0, i[0].length - a),
  16641. label: i[1],
  16642. url: i[2].substring(0, o)
  16643. }
  16644. }
  16645. }
  16646. ,
  16647. n.prototype.addTextChunk = function(e, t) {
  16648. 0 !== t.length && e.push({
  16649. type: r.TEXT,
  16650. text: t
  16651. })
  16652. }
  16653. ,
  16654. n.prototype.addLinkChunk = function(e, t) {
  16655. if (!this.capabilities.links.enable)
  16656. return void (this.capabilities.links.keepLabels && this.addTextChunk(e, t.label));
  16657. var i = {
  16658. label: t.label,
  16659. url: t.url
  16660. };
  16661. i.url.indexOf("://") === -1 && (i.url = "http://" + i.url),
  16662. e.push({
  16663. type: r.LINK,
  16664. link: i
  16665. })
  16666. }
  16667. ,
  16668. t.exports = n
  16669. }
  16670. , {
  16671. "./DescriptionChunkType": 133
  16672. }],
  16673. 135: [function(e, t, i) {
  16674. (function(i) {
  16675. "use strict";
  16676. var n = e("../util/logger")
  16677. , r = new n(i)
  16678. , o = {
  16679. parseIdsFromChunkName: function(e, t) {
  16680. t.floorId = o.parseFloor(e),
  16681. t.roomId = o.parseRoom(e)
  16682. },
  16683. parseFloor: function(e) {
  16684. var t = e.match(/_group([0-9]+)/);
  16685. if (!t)
  16686. return 0;
  16687. try {
  16688. return parseInt(t[1], 10)
  16689. } catch (e) {
  16690. return r.warn('Non-int value "' + t[1] + '" for mesh group, defaulting to floor 0'),
  16691. 0
  16692. }
  16693. },
  16694. parseRoom: function(e) {
  16695. var t = e.match(/_sub([0-9]+)/);
  16696. if (!t)
  16697. return -1;
  16698. try {
  16699. return parseInt(t[1], 10)
  16700. } catch (e) {
  16701. return r.warn('Non-int value "' + t[1] + '" for mesh subgroup, defaulting to subgroup 0'),
  16702. 0
  16703. }
  16704. }
  16705. };
  16706. t.exports = o
  16707. }
  16708. ).call(this, "/js/model/Chunks.js")
  16709. }
  16710. , {
  16711. "../util/logger": 189
  16712. }],
  16713. 136: [function(e, t, i) {
  16714. (function(i) {
  16715. "use strict";
  16716. function n(e) {
  16717. s.call(this),
  16718. this.model = e,
  16719. this.exploded = !1
  16720. }
  16721. var r = e("../objects/Floor")
  16722. , o = (e("../settings"),
  16723. e("../util/logger"))
  16724. , a = e("../util/transitions")
  16725. , s = e("../util/IndexedCollection")
  16726. , l = e("../util/common")
  16727. , c = e("../util/easing");
  16728. new o(i);
  16729. l.inherit(n, s),
  16730. n.prototype.add = function(e) {
  16731. s.prototype.add.call(this, e),
  16732. this.model.add(e)
  16733. }
  16734. ,
  16735. n.prototype.getIndex = function(e) {
  16736. return e.floorIndex
  16737. }
  16738. ,
  16739. n.prototype.build = function() {
  16740. this.list.forEach(function(e) {
  16741. e.build()
  16742. })
  16743. }
  16744. ,
  16745. n.prototype.size = function() {
  16746. return this.length
  16747. }
  16748. ,
  16749. n.prototype.sort = function() {
  16750. s.prototype.sort.call(this, function(e, t) {
  16751. return e.floorIndex - t.floorIndex
  16752. })
  16753. }
  16754. ,
  16755. n.prototype.nextFloor = function(e, t) {
  16756. return this.index[e.floorIndex + t] || null
  16757. }
  16758. ,
  16759. n.prototype.getFloorAtPoint = function(e) {
  16760. for (var t = null, i = 1 / 0, n = 0; n < this.list.length; n++) {
  16761. var r = this.list[n]
  16762. , o = r.distanceToPoint(e);
  16763. (!t || i > o) && (i = o,
  16764. t = r)
  16765. }
  16766. return t
  16767. }
  16768. ,
  16769. n.prototype.getOrMakeFloor = function(e) {
  16770. var t = this.index[e];
  16771. return t || (t = new r(this.model,e),
  16772. this.add(t)),
  16773. t
  16774. }
  16775. ,
  16776. n.prototype.hide = function() {
  16777. this.list.forEach(function(e) {
  16778. e.hide()
  16779. })
  16780. }
  16781. ,
  16782. n.prototype.show = function() {
  16783. this.list.forEach(function(e) {
  16784. e.show()
  16785. })
  16786. }
  16787. ,
  16788. n.prototype.names = function() {
  16789. return this.list.reduce(function(e, t) {
  16790. return e.concat(t.name)
  16791. }, [])
  16792. }
  16793. ,
  16794. n.prototype.toggleExplodeHorizontal = function() {
  16795. function e(e, t) {
  16796. r.copy(e.position),
  16797. e.position.x = i[e.floorIndex] * t,
  16798. e.position.y = 1 * e.floorIndex * t,
  16799. r.sub(e.position).multiplyScalar(-1),
  16800. e.panos.forEach(function(e) {
  16801. e.translate(r)
  16802. })
  16803. }
  16804. var t, i = [], n = 0;
  16805. this.list.forEach(function(e, r, o) {
  16806. t = r > 0 ? Math.max(o[r - 1].boundingBox.max.x - e.boundingBox.min.x, e.boundingBox.size().x / 2) : 0,
  16807. n += t,
  16808. i[r] = n
  16809. }),
  16810. i = i.map(function(e) {
  16811. return e - n / 2
  16812. });
  16813. var r = this.list[0].position.clone();
  16814. this.exploded ? this.list.forEach(function(t) {
  16815. a.start(function(i) {
  16816. e(t, 1 - i)
  16817. }, 1500, null, 0, c.easeOutExpo)
  16818. }) : this.list.forEach(function(t) {
  16819. a.start(function(i) {
  16820. e(t, i)
  16821. }, 1500, null, 0, c.easeOutExpo)
  16822. }),
  16823. this.exploded = !this.exploded
  16824. }
  16825. ,
  16826. n.prototype.toggleExplodeVertical = function() {
  16827. function e(e, i) {
  16828. var n = n.copy(e.position);
  16829. e.position.y = (5 * e.floorIndex - t.y / 2) * i,
  16830. n.sub(e.position).multiplyScalar(-1),
  16831. e.panos.forEach(function(e) {
  16832. e.translate(n)
  16833. })
  16834. }
  16835. var t = this.model.size;
  16836. this.list[0].position.clone();
  16837. this.exploded ? this.list.forEach(function(t) {
  16838. a.start(function(i) {
  16839. e(t, 1 - i)
  16840. }, 1500, null, 0, c.easeOutExpo)
  16841. }) : this.list.forEach(function(t) {
  16842. a.start(function(i) {
  16843. e(t, i)
  16844. }, 1500, null, 0, c.easeOutExpo)
  16845. }),
  16846. this.exploded = !this.exploded
  16847. }
  16848. ,
  16849. t.exports = n
  16850. }
  16851. ).call(this, "/js/model/FloorCollection.js")
  16852. }
  16853. , {
  16854. "../objects/Floor": 146,
  16855. "../settings": 166,
  16856. "../util/IndexedCollection": 175,
  16857. "../util/common": 185,
  16858. "../util/easing": 186,
  16859. "../util/logger": 189,
  16860. "../util/transitions": 195
  16861. }],
  16862. 137: [function(e, t, i) {
  16863. (function(i) {
  16864. "use strict";
  16865. function n() {
  16866. c.call(this)
  16867. }
  16868. var r = e("../settings")
  16869. , o = e("../util/logger")
  16870. , a = e("../enum/Viewmode")
  16871. , s = e("../objects/Snapshot")
  16872. , l = (e("../util/math"),
  16873. e("../util/common"))
  16874. , c = e("../util/IndexedCollection")
  16875. , h = new o(i);
  16876. l.inherit(n, c),
  16877. n.prototype.getImage = function(e) {
  16878. return e && this.index.hasOwnProperty(e) ? this.index[e] : null
  16879. }
  16880. ,
  16881. n.prototype.filterByModesAndReel = function(e, t) {
  16882. for (var i = [], n = 0; n < t.length; n += 1) {
  16883. var r = t[n]
  16884. , o = this.index[r.sid];
  16885. o && i.push(o)
  16886. }
  16887. var s = e[a.DOLLHOUSE]
  16888. , l = e[a.FLOORPLAN];
  16889. i = i.filter(function(e) {
  16890. if (!e.metadata || void 0 === e.metadata.camera_mode)
  16891. return !0;
  16892. var t;
  16893. try {
  16894. t = a.convertWorkshopModeInt(e.metadata.camera_mode)
  16895. } catch (e) {
  16896. return h.debug(e.message),
  16897. !1
  16898. }
  16899. return t === a.PANORAMA || t === a.FLOORPLAN && l || t === a.DOLLHOUSE && s
  16900. }),
  16901. i.length !== this.list.length && h.info("Disallowed " + (this.list.length - i.length) + " highlight images"),
  16902. this.list = i,
  16903. this.reIndex()
  16904. }
  16905. ,
  16906. n.prototype.getHeroLocations = function(panos) {//改 增加二级location
  16907. if (0 === this.list.length)
  16908. return [];
  16909. var locations = [];
  16910. var deal = (info, container)=>{
  16911. var src = info.thumbnail_signed_src,
  16912. o = info.name || "";
  16913. if (info.metadata && void 0 !== info.metadata.camera_quaternion) {
  16914. if (!r.show360Views.enabled && info.metadata.scan_id) {
  16915. let a = panos.get(info.metadata.scan_id);
  16916. if (a && !a.isAligned()) return
  16917. }
  16918. var cameraMode = a.convertWorkshopModeInt(info.metadata.camera_mode);
  16919. if (cameraMode === a.MESH) return
  16920. if(window.isLocal){
  16921. src = manage.dealURL(src)
  16922. //本地文件莫名少了个"."
  16923. if(src[src.length-1]=='.'){
  16924. src = src.slice(0,-1)
  16925. }
  16926. }
  16927. else src = "one" === g_version ? g_Prefix + src + "?" + randomTime().getTime() : src + "?" + randomTime().getTime()
  16928. var l = {
  16929. cameraMode: cameraMode,
  16930. position: info.metadata.camera_position,
  16931. quaternion: info.metadata.camera_quaternion,
  16932. zoom: info.metadata.zoom,
  16933. panoId: info.metadata.scan_id,
  16934. orthoZoom: info.metadata.ortho_zoom,
  16935. floorVisibility: void 0 !== info.metadata.floor_visibility ? info.metadata.floor_visibility.slice(0) : [],
  16936. thumbUrl: src,
  16937. name: n.filterImageName(o),
  16938. sid: info.sid
  16939. }
  16940. var item = new s(l);
  16941. item.momentTour = info.momentTour
  16942. item.dontRot = info.dontRot
  16943. item.rotTime = info.rotTime
  16944. item.musicInfo = info.musicInfo || g_data2.tourAudio[info.sid] || {}//新的music数据统一写在每个info下,如果有musicInfo则覆盖g_data2.tourAudio
  16945. container.push(item)
  16946. return item
  16947. }
  16948. }
  16949. this.list.forEach(image=>{
  16950. if(image.images){
  16951. var folder = $.extend({}, image )
  16952. folder.heroLocations = [];
  16953. image.images.list.forEach(child=>{
  16954. deal(child, folder.heroLocations);
  16955. })
  16956. folder.musicInfo = folder.musicInfo || {}
  16957. locations.push(folder)
  16958. delete folder.images;
  16959. delete folder.locations;
  16960. }else{
  16961. var item = deal(image, locations);
  16962. }
  16963. })
  16964. return locations
  16965. }
  16966. ,
  16967. n.prototype.getIndex = function(e) {
  16968. return e.sid
  16969. }
  16970. ,
  16971. n.filterImageName = function(e) {
  16972. return "" === e || e.match(/^[0-9.]+_[0-9.]+$/) ? null : e
  16973. }
  16974. ,
  16975. t.exports = n
  16976. }
  16977. ).call(this, "/js/model/ImageCollection.js")
  16978. }
  16979. , {
  16980. "../enum/Viewmode": 51,
  16981. "../objects/Snapshot": 153,
  16982. "../settings": 166,
  16983. "../util/IndexedCollection": 175,
  16984. "../util/common": 185,
  16985. "../util/logger": 189,
  16986. "../util/math": 190
  16987. }],
  16988. 138: [function(e, t, i) {
  16989. (function(i) {
  16990. "use strict";
  16991. function n() {
  16992. u.call(this)
  16993. }
  16994. var r = e("../label/Label")
  16995. , o = e("../settings")
  16996. , a = e("../util/logger")
  16997. , s = e("../util/math")
  16998. , l = e("../util/ajax")
  16999. , c = e("./RoomCollection")
  17000. , h = e("../util/common")
  17001. , u = e("../util/IndexedCollection");
  17002. new a(i);
  17003. h.inherit(n, u),
  17004. n.prototype.getIndex = function(e) {
  17005. return e.labelId
  17006. }
  17007. ,
  17008. n.prototype.associateWithRooms = function(e) {
  17009. this.forEach(function(t) {
  17010. e.forEach(function(e) {
  17011. e.roomId === t.roomId && (t.room = e)
  17012. })
  17013. })
  17014. }
  17015. ,
  17016. n.prototype.createFromLabelData = function(e) {
  17017. e.forEach(function(e) {
  17018. var t = n.parseRoomIndexFromWorkshopRoomId(e.roomId);
  17019. t = c.generateRoomId(e.floorId, t);
  17020. var i = new r(e.sid,e.position || e.positions[0],e.text,e.floorId,t);
  17021. i.position = s.convertWorkshopVector(i.position),
  17022. this.add(i),
  17023. i.build()
  17024. }
  17025. .bind(this))
  17026. }
  17027. ,
  17028. n.prototype.load = function(e, t) {
  17029. return l.get(e, {
  17030. responseType: "json",
  17031. auth: t ? o.authorizationHeader : null
  17032. }).done(function(e) {
  17033. var t = [];
  17034. for (var i in e) {
  17035. var n = e[i];
  17036. t.push(n)
  17037. }
  17038. this.createFromLabelData(t)
  17039. }
  17040. .bind(this))
  17041. }
  17042. ,
  17043. n.parseRoomIndexFromWorkshopRoomId = function(e) {
  17044. var t = -1;
  17045. if (e) {
  17046. if(typeof e == 'number'){//add
  17047. t = parseInt(e)
  17048. }else{
  17049. var i = e.split("_");
  17050. t = parseInt(i[0])
  17051. }
  17052. }
  17053. return t
  17054. },
  17055. t.exports = n
  17056. }
  17057. ).call(this, "/js/model/LabelCollection.js")
  17058. }
  17059. , {
  17060. "../label/Label": 90,
  17061. "../settings": 166,
  17062. "../util/IndexedCollection": 175,
  17063. "../util/ajax": 181,
  17064. "../util/common": 185,
  17065. "../util/logger": 189,
  17066. "../util/math": 190,
  17067. "./RoomCollection": 141
  17068. }],
  17069. 139: [function(e, t, i) {
  17070. (function(i) {
  17071. "use strict";
  17072. function n(e, t) {
  17073. o.Object3D.call(this)
  17074. this.sid = window.number;//t.sid,
  17075. this.data = t,
  17076. this.options = e,
  17077. this.urls = new s(e.urlFiles),
  17078. this.isPublic = void 0 !== t.is_public && t.is_public,
  17079. //创建heroLocations
  17080. this.images = new _(this),
  17081. this.images.extend(t.images),
  17082. this.images.forEach((info)=>{
  17083. if(info.locations){
  17084. info.images = new _(this);
  17085. info.images.extend(info.locations)
  17086. }
  17087. })
  17088. this.heroLocations = []
  17089. //this.heroImage = this.images.getImage(t.icon), //初始画面沒有用到icon
  17090. this.outdoorPanoLocations = [],
  17091. this.floors = new d(this),
  17092. this.floorsEnabled = void 0 === e.floors || e.floors,
  17093. this.changingFloor = !1,
  17094. this.chunks = [],
  17095. this.panos = new A,
  17096. this.colliders = [],
  17097. this.loadPanosPromise = null,
  17098. this.loadMeshTexturesPromise = null,
  17099. this.auxDataPromise = null,
  17100. this.meshTexturesLoaded = !1,
  17101. this.meshTextures = [],
  17102. this.tags = {},
  17103. this.tagsShown = !1,
  17104. this.shouldShowtags = !1,
  17105. this.has360Views = !1,
  17106. this.showingLabels = f.labels.enabled && t.player_options.labels,
  17107. this.supportedModes = {},
  17108. this.supportedModes[c.PANORAMA] = !0,
  17109. this.supportedModes[c.DOLLHOUSE] = !t.player_options || t.player_options.dollhouse && w.valueFromHash("dh", 1),
  17110. this.supportedModes[c.FLOORPLAN] = !t.player_options || t.player_options.floor_plan && w.valueFromHash("dh", 1),
  17111. this.supportedModes[c.TRANSITIONING] = !0,
  17112. this.supportsTiles = this.configureTiling(),
  17113. // this.supportsVR = t.is_vr,
  17114. this.supportsVR = window.DATA.supportsVR || false//true; // 方奕卓 VR功能可配置
  17115. this.mode = c.DOLLHOUSE,
  17116. this.size = null,
  17117. this.center = null,
  17118. this.boundingBox = new o.Box3,
  17119. this.currentFloor = null,
  17120. this.allFloorsVisible = !0,
  17121. this.projectedPano0 = null,
  17122. this.projectedPano1 = null,
  17123. this.floorsEnabled && t.floors && t.floors.indexOf(",") !== -1 && t.floors.split(",").forEach(function(e, t) {
  17124. this.addFloor(new u(this,t,e.trim()))
  17125. }
  17126. .bind(this)),
  17127. this.waitQueue = [],
  17128. this.on("load", function(e) {
  17129. 0 !== this.waitQueue.length && (this.waitQueue = this.waitQueue.filter(function(e) {
  17130. return !e.isLoadedCallback()
  17131. }),
  17132. 0 === this.waitQueue.length && this.emit("waiting-done"))
  17133. }
  17134. .bind(this)),
  17135. this.setupCustomProperties()
  17136. this.hots = {};
  17137. }
  17138. function r() {
  17139. try {
  17140. var e = document.createElement("canvas")
  17141. , t = e.getContext("webgl");
  17142. t || (t = e.getContext("experimental-webgl"));
  17143. var i = t.getParameter(t.MAX_CUBE_MAP_TEXTURE_SIZE);
  17144. return i
  17145. } catch (e) {
  17146. return 0
  17147. }
  17148. }
  17149. var o = e("three")
  17150. , a = e("../util/ajax")
  17151. , s = e("../util/ModelUrls")
  17152. , l = e("../objects/BoundingTextureSkybox")
  17153. , c = e("../enum/Viewmode")
  17154. , h = e("../enum/RenderOrder")
  17155. , u = (e("../enum/AlignmentType"),
  17156. e("../objects/Floor"))
  17157. , d = e("./FloorCollection")
  17158. , p = e("../objects/Chunk")
  17159. , f = (e("../objects/Room"),
  17160. e("../objects/Snapshot"),
  17161. e("../label/Label"),
  17162. e("../util/math"),
  17163. e("../settings"))
  17164. ,ss = e("../shaders")
  17165. , g = e("../util/logger")
  17166. , m = e("../tag/tag")
  17167. , v = (e("../tag/tagManager"),
  17168. e("../objects/Panorama"))
  17169. , A = e("../util/PanoramaCollection")
  17170. , y = e("../loaders/ModelLoader")
  17171. , C = e("../loaders/ModelTextureLoader")
  17172. , I = e("../loaders/SweepDataLoader")
  17173. , E = e("../util/transitions")
  17174. , b = e("../util/common")
  17175. , es = e("../util/easing")
  17176. ,lerp = e("../util/lerp")
  17177. ,tex = e("../util/texture")
  17178. , w = e("./../util/browser")
  17179. , _ = e("./ImageCollection")
  17180. , T = e("./RoomCollection")
  17181. , x = e("./LabelCollection")
  17182. , S = e("./Chunks")
  17183. , cameraLight = e("./util/cameraLight")
  17184. , M = e("./../util/showcase")
  17185. , R = e("../exception/BasicException")
  17186. , P = (e("../constants")
  17187. ,e("events").EventEmitter)
  17188. ,GLCubeFaces = e("../enum/GLCubeFaces")
  17189. //,Hot = e("hot")
  17190. , O = new g(i);
  17191. n.prototype = Object.create(o.Object3D.prototype),
  17192. b.extend(n, P),
  17193. n.prototype.setupCustomProperties = function() {
  17194. var e = f.modelAlpha;
  17195. Object.defineProperty(this, "alpha", {
  17196. get: function() {
  17197. return e
  17198. },
  17199. set: function(t) {
  17200. e = t,
  17201. this.chunks.forEach(function(t) {
  17202. t.material && t.material.uniforms.modelAlpha && (t.material.uniforms.modelAlpha.value = e)
  17203. })
  17204. }
  17205. })
  17206. }
  17207. ,
  17208. n.prototype.configureTiling = function() {
  17209. var e = r();
  17210. if (e < 2048)
  17211. return !1;
  17212. O.warn("Max cube texture size: " + e);
  17213. for (var t = 0; t < f.tiling.tilingFlagNames.length; t++) {
  17214. var i = f.tiling.tilingFlagNames[t];
  17215. if ("1" === w.valueFromHash(i, null))
  17216. return !0;
  17217. if ("0" === w.valueFromHash(i, null))
  17218. return !1
  17219. }
  17220. //--------------------------------------------许钟文-------------------------------------------
  17221. //return true;
  17222. return !!M.modelDataPromisesTiles(this.data) //免去访问mdoeldata.json的vision_version,不明白这是什么
  17223. //--------------------------------------------e n d -------------------------------------------
  17224. }
  17225. ,
  17226. n.prototype.toggleAlpha = function() {
  17227. this.alpha < 1 ? this.alpha = 1 : this.alpha = 0
  17228. }
  17229. ,
  17230. n.prototype.load = function(e) {
  17231. var t = function() {
  17232. return $.when(this.loadPanos(), this.loadMesh())
  17233. }
  17234. , i = this.urls.init().then(t.bind(this));
  17235. return e ? i = i.then(this.loadMeshTextures.bind(this)) : i.then(this.loadMeshTextures.bind(this)),
  17236. this.auxDataPromise = $.when( /*this.loadHighlightReel(), this.loadtags() */this.loadhots(), this.loadLabels()),
  17237. $.when(i, this.auxDataPromise).done(this.build.bind(this)) //不要另外使用active_reel文件
  17238. }
  17239. ,
  17240. n.prototype.loadMesh = function() {
  17241. function e(e) {
  17242. O.error(e),
  17243. n.reject("loading-failed")
  17244. }
  17245. function t(e, t) {
  17246. n.notify(e, t)
  17247. }
  17248. function i(e, t) {
  17249. if (0 === e.length) {
  17250. O.warn("No geometry found for model, loading faux geometry, disabling outside mode"),
  17251. r.supportedModes[c.DOLLHOUSE] = !1,
  17252. r.supportedModes[c.FLOORPLAN] = !1;
  17253. var i = new p({
  17254. geometry: new o.PlaneBufferGeometry(5,5,1,1)
  17255. });
  17256. i.material.visible = !1,
  17257. i.rotateX(-Math.PI / 2),
  17258. i.geometry.computeBoundingBox(),
  17259. e = [i]
  17260. }
  17261. e.forEach(function(e) {
  17262. var t = r.floorsEnabled ? S.parseFloor(e.name) : 0;
  17263. r.addChunk(t, e)
  17264. }),
  17265. r.floors.sort(),
  17266. n.resolve(r)
  17267. }
  17268. var n = $.Deferred()
  17269. , r = this;
  17270. return y.load(r.data.job.uuid, r.urls, i, t, e),
  17271. n.promise()
  17272. }
  17273. ,
  17274. n.prototype.loadMeshTextures = function() {
  17275. return this.loadTexturesPromise ? this.loadTexturesPromise : (this.loadTexturesPromise = C.load(this, this.meshTextures).then(function() {
  17276. this.meshTexturesLoaded = !0
  17277. }
  17278. .bind(this)),
  17279. this.loadTexturesPromise)
  17280. }
  17281. ,
  17282. /* n.prototype.loadtags = function() {//xzw改
  17283. var e = $.Deferred();
  17284. if (!f.tags.enabled)
  17285. return e.resolve();
  17286. //var t = this.options.urlBase + "/api/v1/jsonstore/model/tags/" + this.sid;
  17287. t = "data/" + this.sid + "/tags.json"
  17288. return a.get(t, {
  17289. responseType: "json",
  17290. auth: this.isPublic ? null : f.authorizationHeader
  17291. }).done(function(t) {
  17292. var i = 0
  17293. , n = 0;
  17294. for (var r in t) {
  17295. var o = t[r];
  17296. o.enabled && (n++,
  17297. (o.label.length || o.description.length) && (this.tags[r] = new m(this,r,o),
  17298. i++))
  17299. }
  17300. i !== n && O.warn("Disallowed " + (n - i) + " tags with no text data"),
  17301. e.resolve()
  17302. }
  17303. .bind(this)).fail(function() {
  17304. O.warn("Getting tags failed, not displaying tags."),
  17305. e.resolve()
  17306. }),
  17307. e
  17308. } */
  17309. n.prototype.shineHots = function(){ //xzw
  17310. E.trigger({
  17311. func: function(e) {
  17312. var opa = e <= .5 ? 2 * e : -2 * e + 2
  17313. for(var i in this.hots){
  17314. this.hots[i].mesh.material.uniforms.opac.value = opa;
  17315. }
  17316. }.bind(this),
  17317. cycling: true,
  17318. duration: 3000,
  17319. //easing: "easeInOutQuad",
  17320. name: "hotShine"
  17321. })
  17322. },
  17323. /* n.prototype.createHotItem = function() {
  17324. // console.log(99999,this.hotGroup.children)
  17325. this.hotGroup.children.forEach((hot,index)=>{
  17326. // console.log(99999,index,hot.info.title)
  17327. if(hot.info.actionType.openHot){
  17328. let ul = document.createElement('ul');
  17329. let li = document.createElement('li');
  17330. let span = document.createElement('span');
  17331. span.innerHTML = hot.info.title || '热点';
  17332. // console.log(span.innerHTML);
  17333. li.hot = hot; // 列表每一项对应一个热点
  17334. li.appendChild(span);
  17335. ul.appendChild(li);
  17336. // docFragment.appendChild(li);
  17337. }
  17338. })
  17339. }
  17340. */
  17341. /* n.prototype.loadOverlays = function(overlays){
  17342. var overlays = window.data2 && window.data2.overlays
  17343. overlays && overlays.forEach((info)=>{
  17344. new Overlay(info)
  17345. })
  17346. Overlay.load()
  17347. }
  17348. */
  17349. n.prototype.loadhots = function() {//xzw
  17350. initHot(this)
  17351. var r = $.Deferred();
  17352. var t = g_Prefix+"data/" + this.sid + "/data2.js" +'?'+ randomTime().getTime();
  17353. return a.get(t, {
  17354. responseType: "json",
  17355. auth: this.isPublic ? null : f.authorizationHeader
  17356. }).done(function(e) {
  17357. window.data2 = e;
  17358. this.roomLabels = []
  17359. if(!e){
  17360. console.error("data2 is null")
  17361. }else{
  17362. g_data2 = hotMatcher(e);
  17363. this.hotsCount = 0;
  17364. let create = ()=>{
  17365. //因为热点保存后在hots里的顺序会被修改,所以使用order来记录顺序,这里要重排序:
  17366. if(e.hots){
  17367. var sids = Object.keys(e.hots).sort((a,b)=>{return e.hots[a].order - e.hots[b].order});
  17368. sids.forEach((sid)=>{
  17369. e.hots[sid].sid = sid
  17370. new Hot(e.hots[sid], e.hots[sid].version != 'multi' && "byHot" )
  17371. })
  17372. }
  17373. if(e.overlays){
  17374. e.overlays.forEach((info)=>{
  17375. //if(info.file.includes('m/data/762/edit/20210312_112357584.mp4') )return;
  17376. new Hot(info, 'byOverlay')
  17377. })
  17378. }
  17379. Hot.createHotList();
  17380. Hot.startLoad()
  17381. if(DATA.roomLabels){
  17382. DATA.roomLabels.forEach((data)=>{
  17383. this.roomLabels.push(new RoomLabel(data))
  17384. })
  17385. }
  17386. }
  17387. if(player.currentPano){
  17388. create()
  17389. }else{
  17390. let f = ()=>{
  17391. window.bus.removeEventListener('playerAndModelReady',f)
  17392. create()
  17393. }
  17394. window.bus.addEventListener('playerAndModelReady',f)
  17395. }
  17396. g_index = w.valueFromHash("m");
  17397. }
  17398. /***************************方奕卓 请求data.js数据, 用于初始化热点列表 ****************************/
  17399. /* var dataJsPromise = $.Deferred();
  17400. var dataJsUrl = g_Prefix+"data/" + this.sid + "/hot/js/data.js" +'?'+ randomTime().getTime();
  17401. a.get(dataJsUrl,{
  17402. responseType: "json",
  17403. auth: this.isPublic ? null : f.authorizationHeader
  17404. }).done(function(data) {
  17405. window.hotData = data;
  17406. this.createHotItem(data, this.hots);
  17407. for(let i in this.hots){//add
  17408. data[i] && this.hots[i].initStyleImg(data[i]);
  17409. }
  17410. dataJsPromise.resolve();
  17411. }.bind(this)).fail(function(){
  17412. console.log('Data.js is empty');
  17413. dataJsPromise.resolve();
  17414. }) */
  17415. r.resolve();
  17416. }.bind(this)).fail(function() {
  17417. console.log('没有热点');
  17418. r.resolve()
  17419. }),
  17420. r
  17421. }
  17422. ,
  17423. n.prototype.loadPanos = function() {
  17424. if (this.loadPanosPromise)
  17425. return this.loadPanosPromise;
  17426. var e = new I(this);
  17427. return this.loadPanosPromise = e.load().then(function(e) {
  17428. return this.data.sweeps && Object.keys(this.data.sweeps).length > 0 && (e = e.filter(function(e) {
  17429. if(this.data.sweeps[e.uuid])return this.data.sweeps[e.uuid].enabled
  17430. else console.log(e.uuid)
  17431. }
  17432. .bind(this))),
  17433. this.panos.extend(e.map(function(e) {
  17434. return new v(this,e.uuid,e,this.supportsTiles)
  17435. }
  17436. .bind(this))),
  17437. this.panos.forEach(function(e) {
  17438. e.neighbourUUIDs && (e.neighbourUUIDs.forEach(function(t) {
  17439. var i = this.panos.get(t);
  17440. i && this.panos.setNeighbour(e, i, !0)
  17441. }
  17442. .bind(this)),
  17443. e.neighbourPanos = this.panos.getNeighbours(e) || this.panos.setNeighbour(e, e, !0))
  17444. }
  17445. .bind(this)),
  17446. 0 === this.panos.length && (O.warn("Model has no panos, turning off inside mode"),
  17447. this.supportedModes[c.PANORAMA] = !1),
  17448. $.when(this)
  17449. }
  17450. .bind(this)),
  17451. this.loadPanosPromise
  17452. }
  17453. ,
  17454. n.prototype.loadHighlightReel = function() {//xzw
  17455. var e = $.Deferred()
  17456. // , t = this.options.urlBase + "/api/v1/jsonstore/model/highlights/" + this.sid + "/active_reel";
  17457. ,t = this.options.urlBase + "data/" + this.sid + "/active_reel.json";
  17458. return a.get(t, {
  17459. responseType: "json",
  17460. auth: this.isPublic ? null : f.authorizationHeader
  17461. }).done(function(t) {
  17462. t.reel ? (O.info("Got highlight reel with " + t.reel.length + " items"),
  17463. this.images.filterByModesAndReel(this.supportedModes, t.reel)) : O.info("No highlight reel found"),
  17464. e.resolve()
  17465. }
  17466. .bind(this)).fail(function() {
  17467. O.warn("Getting highlight reel failed, no highlights available"),
  17468. e.resolve()
  17469. }),
  17470. e
  17471. }
  17472. ,
  17473. n.prototype.waitForLoad = function(e, t) {
  17474. t() || (this.waitQueue.push({
  17475. object: e,
  17476. isLoadedCallback: t
  17477. }),
  17478. 1 === this.waitQueue.length && this.emit("waiting"))
  17479. }
  17480. ,
  17481. n.prototype.hide = function() {
  17482. this.floors.hide()
  17483. }
  17484. ,
  17485. n.prototype.show = function() {
  17486. this.floors.show()
  17487. }
  17488. ,
  17489. n.prototype.floorNames = function() {
  17490. return this.floors.names()
  17491. }
  17492. ,
  17493. n.prototype.warpDestFloors = function(e, t) {
  17494. if (!e || this.floors.length !== e.length)
  17495. return void this.toggleAllFloors(!0);
  17496. var i = e.findIndex(function(e) {
  17497. return e
  17498. }
  17499. .bind(this));
  17500. i !== -1 && this.setFloor(this.floors.list[i], null, t)
  17501. }
  17502. ,
  17503. n.prototype.setFloor = function(e, t, i) {
  17504. this.allFloorsVisible && this.emit("allfloors.toggled", !1, this.currentFloor),
  17505. this.allFloorsVisible = !1,
  17506. this._setFloor(e, t, i)
  17507. }
  17508. ,
  17509. n.prototype.toggleAllFloors = function(e) {
  17510. this.allFloorsVisible = void 0 !== e ? e : !this.allFloorsVisible,
  17511. this.emit("allfloors.toggled", this.allFloorsVisible, this.currentFloor),
  17512. this._setFloor(this.currentFloor)
  17513. }
  17514. ,
  17515. n.prototype._setFloor = function(e, t, i) {
  17516. t = t || this.mode,
  17517. this.emit("floor.changed", e, t, this.currentFloor),
  17518. this.currentFloor = e;
  17519. var n;
  17520. if (t === c.PANORAMA) {
  17521. if (this.show(),
  17522. this.shouldShowtags && this.tagsShown)
  17523. for (n in this.tags)
  17524. this.tags[n].show(f.showFloorDuration)
  17525. } else if ((t === c.FLOORPLAN || t === c.DOLLHOUSE) && (this.floors.list.forEach(function(e, t) {
  17526. e.toggle(e === this.currentFloor || this.allFloorsVisible, i || this.allFloorsVisible)
  17527. }
  17528. .bind(this)),
  17529. this.shouldShowtags && this.tagsShown))
  17530. for (n in this.tags) {
  17531. var r = this.tags[n];
  17532. this.allFloorsVisible ? r.show(f.showFloorDuration) : r.floor === this.currentFloor ? r.show(f.showFloorDuration, f.showFloorDelay) : r.hide(f.hideFloorDuration, f.hideFloorDelay)
  17533. }
  17534. var o = this
  17535. , a = e;
  17536. E.start(function() {}, f.showFloorDelay, function() {
  17537. o.floors.forEach(function(e) {
  17538. e.chunks.forEach(function(t) {
  17539. t.renderOrder = e === a ? h.visibleFloor : h.ghostFloor
  17540. })
  17541. })
  17542. }
  17543. .bind(this))
  17544. }
  17545. ,
  17546. n.prototype.toggleExplode = function() {
  17547. this.floors.toggleExplodeHorizontal()
  17548. }
  17549. ,
  17550. n.prototype.toggleExplodeUp = function() {
  17551. this.floors.toggleExplodeVertical()
  17552. }
  17553. ,
  17554. n.prototype.nextFloor = function(e) {
  17555. return this.floors.nextFloor(this.currentFloor, e)
  17556. }
  17557. ,
  17558. n.prototype.addFloor = function(e) {
  17559. this.floors.add(e)
  17560. }
  17561. ,
  17562. n.prototype.getFloorAtPoint = function(e) {
  17563. return this.floors.getFloorAtPoint(e)
  17564. }
  17565. ,
  17566. n.prototype.getTagBySid = function(e) {
  17567. return this.tags[e]
  17568. }
  17569. ,
  17570. n.prototype.addChunk = function(e, t) {
  17571. this.floors.getOrMakeFloor(e).addChunk(t),
  17572. this.chunks.push(t)
  17573. }
  17574. ,
  17575. n.prototype.setMode = function(e) {
  17576. if (!this.supportedModes[e])
  17577. throw new R("Mode not supported for this model: " + e);
  17578. this.mode = e;
  17579. this.skybox.material.transparent = e == "panorama" ? false : true //xzw add // 如果skybox透明,会让其中其他mesh 如热点的透明出问题
  17580. this.chunks.forEach(function(t) {
  17581. t.setMode(e)
  17582. })
  17583. }
  17584. ,
  17585. n.prototype.build = function() {
  17586. this.heroLocations = this.images.getHeroLocations(this.panos);
  17587. var e = function() {
  17588. 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()
  17589. }
  17590. .bind(this)();
  17591. this.has360Views = f.show360Views.enabled && this.heroLocations.some(function(e) {
  17592. return e.cameraMode === c.PANORAMA && this.panos.get(e.panoId) && !this.panos.get(e.panoId).isAligned()
  17593. }
  17594. .bind(this)) || e,
  17595. null === this.heroImage && O.warn("No hero image defined."),
  17596. this.currentFloor = this.floors.last(),
  17597. this.floors.build(),
  17598. this.colliders = this.floors.reduce(function(e, t) {
  17599. return e.concat(t.collider.children)
  17600. }, []),
  17601. this.panos.forEach(function(e) {
  17602. e.build1(),
  17603. e.on("enter", function() {
  17604. e.floor !== this.currentFloor && this.setFloor(e.floor)
  17605. }
  17606. .bind(this))
  17607. }
  17608. .bind(this)),
  17609. this.panos.forEach(function(e) {
  17610. e.build2()
  17611. }),
  17612. this.floors.forEach(function(e) {
  17613. this.boundingBox.union(e.boundingBox)
  17614. }
  17615. .bind(this)),
  17616. this.size = this.boundingBox.size(),
  17617. this.center = this.boundingBox.center(),
  17618. this.floors.forEach(function(e) {
  17619. O.info("Floor " + e + ": " + e.children.length + " chunks, " + e.panos.length + " panos.")
  17620. }
  17621. .bind(this)),
  17622. this.panos.populate_path_graph(),
  17623. this.skybox = new l(this.boundingBox),
  17624. this.skybox.matrixWorldNeedsUpdate = !0,
  17625. this.add(this.skybox);
  17626. /* setTimeout(function() {
  17627. //this.hotsCount && this.shineHots()
  17628. Hot.beginShineHot()
  17629. }
  17630. .bind(this), 1300) */
  17631. //add-----
  17632. {
  17633. let maxCount = browser.isMobile() ? 200000 : 400000
  17634. let noVisiHots = this.hotGroup.children.filter(e=>!e.info.visiblePanos && e.info.texType != 'shine') //只看非热点的,否则数据太多
  17635. let visiHots = this.hotGroup.children.filter(e=>e.info.visiblePanos)
  17636. let c = this.panos.list.length * this.colliders.length * noVisiHots.length
  17637. if(c > maxCount){ //防止加载时间过长,分批计算
  17638. console.log('hot分批setVisiblePanos')
  17639. Hot.visiPanosCountSlice = Math.ceil(maxCount / this.colliders.length / noVisiHots.length)
  17640. Hot.visiEveryDurSlice = browser.isMobile() ? 25 : 16;
  17641. let dur = Math.ceil(this.panos.list.length / Hot.visiPanosCountSlice) * Hot.visiEveryDurSlice
  17642. console.log(Hot.visiPanosCountSlice, Hot.visiEveryDurSlice, dur, Math.round(dur*noVisiHots.length))
  17643. if(noVisiHots.length){
  17644. let i = 0
  17645. let hotVisiInterval = setInterval(()=>{
  17646. noVisiHots[i].setVisiblePanos(noVisiHots[i].info.visiblePanos);
  17647. i++;
  17648. if(i>=noVisiHots.length){
  17649. clearInterval(hotVisiInterval)
  17650. }
  17651. }, dur)
  17652. }
  17653. }
  17654. }
  17655. //---------
  17656. this.createFloorLogo()
  17657. return O.debug("Done building model"),
  17658. v.raycastsDone > 0 && (O.warn("raycasts: " + v.raycastsDone),
  17659. O.warn("raycasts skipped: " + v.raycastsSkipped)),
  17660. this.buildRooms(),
  17661. this.labels.associateWithRooms(this.rooms),
  17662. $.when(this)
  17663. }
  17664. ,
  17665. n.prototype.createFloorLogo = function(){
  17666. console.log('createFloorLogo')
  17667. if(this.floorLogos || !settings.floorlogoURL)return;
  17668. var url = settings.floorlogoURL
  17669. var map = tex.load(url);//可以追加done
  17670. this.floorLogos = [];
  17671. for(var i=0; i<2; i++){ //不可共用uniforms等 [0]在上一个位置,[1]是下一个位置、 是飞入及飞出后的位置
  17672. var material = new o.MeshBasicMaterial({
  17673. opacity:0,
  17674. map:map,
  17675. side: o.DoubleSide,
  17676. transparent: !0,
  17677. depthWrite: !1,
  17678. depthTest:false//改 在chunk\skybox外也可看到
  17679. });
  17680. var logo = new o.Mesh(new o.PlaneGeometry(2,2,1,1),material);
  17681. //var s = (Store.metadata.floorLogoSize || 100)/100;
  17682. //logo.scale.set(s,s,s);
  17683. logo.position.set(0,-1.5,0);
  17684. logo.lookAt(logo.position.clone().add(new o.Vector3(0,1,0)));
  17685. logo.renderOrder = 100;//cover the videoSkybox
  17686. //logo.layers.set(0)
  17687. this.add(logo);
  17688. this.floorLogos.push(logo);
  17689. }
  17690. this.floorLogos[1].visible = false;
  17691. }
  17692. n.prototype.adjustfloorLogoHeight = function(o){
  17693. var h = player.currentPano.floorPosition.y + 0.01;
  17694. this.floorLogos[1].position.setY(h);
  17695. this.floorLogos[0].position.setY(h);
  17696. //publicObjectSet.player.path.currentPanoMarker.mesh.position.y = h
  17697. },
  17698. n.prototype.changefloorLogoOpa = function(o){//改 i, opacity, time, delay
  17699. if(!this.floorLogos) return;
  17700. E.cancelById("flOpa_"+o.index);//先停止之前该logo的透明度变化
  17701. if(o.from!=void 0)this.floorLogos[o.index].material.opacity = o.from;//初始透明度
  17702. if(!o.dur){//立刻
  17703. //this.floorLogos[o.index].material.uniforms.opacity.value = o.opa;
  17704. this.floorLogos[o.index].material.opacity = o.opa;
  17705. }else{
  17706. //E.start(lerp.uniform(this.floorLogos[o.index], "opacity", o.opa), o.dur || 0, null,
  17707. E.start(lerp.property(this.floorLogos[o.index].material, "opacity", o.opa), o.dur || 0, null,
  17708. o.delay||0, es["easeInQuad"], "changefloorLogoOpa", "flOpa_"+o.index)
  17709. }
  17710. },
  17711. n.prototype.updateFloorlogo = function() { //xzw add 更新地标的旋转
  17712. var lastQ, lastP;
  17713. var equals = function(v1, v2, min){
  17714. return Math.abs(v1-v2) < min
  17715. }
  17716. var isSame = function(now, last, k){//如果和上次相同就不改变
  17717. if(!last)return false;
  17718. var R = k.sceneRenderer;
  17719. //var min = R.AFPS < 38 ? 0.005 : R.AFPS < 45 ? 0.0008 : R.AFPS < 50 ? 0.0006 : 0.0003;
  17720. //暂时:
  17721. var min = 0.0008
  17722. var same = equals(now.x , last.x, min) && equals(now.y , last.y, min) && equals(now.z , last.z, min)
  17723. && (now.w!=void 0 ? equals(now.w , last.w, min) : true)
  17724. return same;
  17725. }
  17726. return function(Q, k){
  17727. if(!Q)return;
  17728. /* if(Config.ifFish && window.lowFPS){
  17729. this.fLCompute++;
  17730. if(R.AFPS < 38){
  17731. if(k.flyingToTag && k.flying && k.fLCompute %4 !=1) return; //点击tag过渡
  17732. else if(k.flying && k.fLCompute%2 !=1) return;
  17733. k.fLCompute %= 4;
  17734. }else if(R.AFPS < 45){
  17735. if(k.flyingToTag && k.flying && k.fLCompute %3 !=1) return; //点击tag过渡
  17736. else if(k.flying && k.fLCompute%2 !=1) return;
  17737. k.fLCompute %= 6;
  17738. }else{
  17739. if(k.flyingToTag && k.flying && k.fLCompute %2 !=1) return;
  17740. //else if(k.flying && k.fLCompute%2 !=1) return;
  17741. k.fLCompute %= 2;
  17742. }
  17743. } */
  17744. var sameQ, sameP, quaternion, visible;
  17745. for(var i=0;i<2;i++){
  17746. var logo = this.floorLogos[i];
  17747. if(!logo.visible || logo.material.uniforms.opacity.value==0) continue;
  17748. visible = true;
  17749. }
  17750. if(!visible)return; //如果两个都不可见,就不更改,如果有一个可见,就都改
  17751. var c = k.cameraControls.activeControl;
  17752. var sameQ = c ? ( c.lat < 10 ? equals(c.lon, lastQ, 0.1) : equals(c.lon, lastQ, 1) ): false;
  17753. sameQ || (lastQ = c ? c.lon : null); //相机旋转是否改变了
  17754. for(var i=0;i<2;i++){
  17755. var logo = this.floorLogos[i];
  17756. if(!sameQ){
  17757. if(!quaternion){
  17758. var a = new THREE.Vector3(0,0,-1);
  17759. a.applyQuaternion(Q);
  17760. a.setY(0);
  17761. var _ = (new THREE.Matrix4).lookAt(a,new THREE.Vector3, new THREE.Vector3(0,1,0));
  17762. quaternion = (new THREE.Quaternion).setFromRotationMatrix(_)
  17763. var a = new THREE.Quaternion( 0, 0.7071067811865476, 0.7071067811865476 , 0)//计算得
  17764. quaternion.multiply(a);
  17765. }
  17766. logo.quaternion.copy(quaternion);
  17767. }
  17768. }
  17769. }
  17770. }()
  17771. n.prototype.loadLabels = function() {//xzw
  17772. this.labels = new x(this);
  17773. var e = $.Deferred();
  17774. //加载俯视图的标签 注释这个备注就会加载
  17775. //原先是labels, 改为showLabels,因为之前的somedata写的labels都是true
  17776. window.DATA.showingLabels ? this.showingLabels = true : '';
  17777. if (!this.showingLabels)
  17778. return e.resolve();
  17779. // var t = this.options.urlBase + "/api/v1/jsonstore/model/labels/" + this.sid;
  17780. var t = g_Prefix + "data/" + this.sid + "/labels.json";
  17781. return this.labels.load(t, !this.isPublic).done(e.resolve.bind(e)).fail(function() {
  17782. O.warn("Getting labels failed, not displaying labels."),
  17783. e.resolve()
  17784. }),
  17785. e
  17786. }
  17787. ,
  17788. n.prototype.buildRooms = function() {
  17789. this.rooms = new T(this),
  17790. this.rooms.createFromChunks(this.chunks),
  17791. this.rooms.calcRoomBoundaries()
  17792. }
  17793. ,
  17794. n.prototype.updateProjectedPanos = function() {
  17795. this.projectedPano0 && this.projectedPano1 && this.setProjectedPanos(this.projectedPano0, this.projectedPano1, !1)
  17796. }
  17797. ,
  17798. n.prototype.setProjectedPanos = function(e, t, i) {
  17799. void 0 !== i && null !== i || (i = !0),
  17800. i = !!i,
  17801. this.projectedPano0 = e,
  17802. this.projectedPano1 = t,
  17803. this.skybox.material.setProjectedPanos(e, t, i),
  17804. this.chunks.forEach(function(n) {
  17805. n.materialInside.setProjectedPanos(e, t, i)
  17806. })
  17807. }
  17808. ,
  17809. n.prototype.setSide = function(e) {
  17810. this.floors.forEach(function(t) {
  17811. t.collider.material.side = e
  17812. })
  17813. }
  17814. ,
  17815. n.prototype.heroCount = function() {
  17816. return this.heroLocations ? this.heroLocations.length : 0
  17817. }
  17818. ,
  17819. n.prototype.getHeroDescriptorByIndex = function(e=[]) {//改 因增加了二级目录
  17820. if (e[0] < 0)
  17821. return O.warn("Model.getHeroDescriptorByHeroIndex() -> heroIndex is less than 0."),
  17822. null;
  17823. if (this.heroCount() < 1)
  17824. return O.warn("Model.getHeroDescriptorByIndex() -> No hero locations in this model"),
  17825. null;
  17826. var t = this.heroLocations[e[0]];
  17827. if(t.heroLocations && e[1]!=void 0){
  17828. t = t.heroLocations[e[1]];
  17829. }
  17830. return void 0 === t ? (O.warn("Model.getHeroDescriptorByIndex() -> Index " + e + " is not a validindex"),
  17831. null) : t
  17832. }
  17833. ,
  17834. n.prototype.findPanoramicHero = function() {
  17835. for (var e in this.heroLocations)
  17836. if (this.heroLocations[e].cameraMode === c.PANORAMA)
  17837. return this.heroLocations[e];
  17838. return null
  17839. }
  17840. ,
  17841. n.prototype.listImagePanos = function() {
  17842. var e = []
  17843. , t = this;
  17844. return this.images.forEach(function(i) {
  17845. if (i.metadata && i.metadata.scan_id) {
  17846. var n = t.panos.get(i.metadata.scan_id);
  17847. n && (t.supportsTiles || n.isLoaded("high") || e.push(n))
  17848. }
  17849. }),
  17850. e
  17851. }
  17852. ,
  17853. n.prototype.fadePanoMarkers = function(/* e, t */opacity, dur, o = {}) {//改
  17854. //this.panos.fadeMarkerOpacity(e, t)
  17855. if(window.DATA.hideFloorMarker)return
  17856. var currentPano = player.currentPano
  17857. opacity = void 0 == opacity ? _settings.panorama.markerOpacity : opacity //不传opacity代表显示
  17858. var hideWhenFlyOut = () => {
  17859. var shows = [],
  17860. hides = []
  17861. player.model.panos.forEach(pano => {
  17862. hides.push(pano)
  17863. })
  17864. this.panos.fadeMarkerOpacity(0, dur, [{ toOp: 0, member: hides }])
  17865. }
  17866. if (opacity == 0) {
  17867. hideWhenFlyOut()
  17868. } else {
  17869. if (player.mode == 'panorama' && currentPano) {
  17870. var shows = [], hides = []
  17871. player.model.panos.forEach(pano => { //是邻近点就显示否则隐藏
  17872. if (currentPano.neighbourPanos[pano.id]) {
  17873. shows.push(pano)
  17874. } else {
  17875. hides.push(pano)
  17876. }
  17877. })
  17878. this.panos.fadeMarkerOpacity(opacity, dur, [
  17879. { toOp: opacity, member: shows },
  17880. { toOp: 0, member: hides },
  17881. ])
  17882. } else if (player.modeTran.split('-')[1] != 'panorama') {
  17883. //飞出后marker隐藏
  17884. hideWhenFlyOut()
  17885. }
  17886. }
  17887. }
  17888. ,
  17889. n.prototype.setSweepVisibility = function(e) {
  17890. this.panos.forEach(function(t) {
  17891. t.marker && (t.marker.visible = e)
  17892. })
  17893. }
  17894. ,
  17895. n.prototype.outsideAllowed = function() {
  17896. return this.supportedModes[c.DOLLHOUSE] && this.supportedModes[c.FLOORPLAN]
  17897. }
  17898. ,
  17899. n.prototype.addHighMapCube = function() {
  17900. //创建8*8的tile cube
  17901. if (player.qualityManager.getMaxZoomClass() == '4k' && player.qualityManager.maxRenderTargetSize == 2048) {
  17902. var geo = new THREE.PlaneGeometry(1, 1, 1, 1)
  17903. var cube = new THREE.Object3D()
  17904. cube.tiles = []
  17905. for (var cubeIndex = 0; cubeIndex < 6; cubeIndex++) {
  17906. var face = new THREE.Object3D()
  17907. for (var i = 0; i < 8; i++) {
  17908. for (var j = 0; j < 8; j++) {
  17909. var tile = new THREE.Mesh(geo, new THREE.MeshBasicMaterial({ side: 2 }))
  17910. tile.position.set(i - 3.5, j - 3.5, -4)
  17911. if (highMapAddColor) {
  17912. tile.material.opacity = 0.4
  17913. var colorHue = Math.random()
  17914. tile.material.color = new THREE.Color().setHSL(colorHue, 0.6, 0.9)
  17915. }
  17916. tile.material.transparent = true
  17917. tile.material.depthTest = tile.material.depthWrite = false //防止chunk比cube近从而被遮
  17918. tile.visible = false
  17919. tile.tileX = i
  17920. tile.tileY = j
  17921. tile.cubeFace = cubeIndex
  17922. tile.renderOrder = 2//RenderOrder.highTileCube
  17923. cube.tiles.push(tile)
  17924. face.add(tile)
  17925. }
  17926. }
  17927. switch (cubeIndex) {
  17928. case GLCubeFaces.GL_TEXTURE_CUBE_MAP_POSITIVE_X:
  17929. face.rotation.set(0, Math.PI / 2, 0)
  17930. break
  17931. case GLCubeFaces.GL_TEXTURE_CUBE_MAP_NEGATIVE_X:
  17932. face.rotation.set(0, -Math.PI / 2, 0)
  17933. break
  17934. case GLCubeFaces.GL_TEXTURE_CUBE_MAP_POSITIVE_Y:
  17935. var rot1 = new THREE.Quaternion().setFromAxisAngle(new THREE.Vector3(0, 1, 0), Math.PI)
  17936. var rot2 = new THREE.Quaternion().setFromAxisAngle(new THREE.Vector3(1, 0, 0), Math.PI / 2)
  17937. face.quaternion.copy(rot1).multiply(rot2)
  17938. //face.rotation.set(Math.PI/2,0,0);
  17939. break
  17940. case GLCubeFaces.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y:
  17941. //face.rotation.set(-Math.PI/2,0,0);
  17942. var rot1 = new THREE.Quaternion().setFromAxisAngle(new THREE.Vector3(0, 1, 0), Math.PI)
  17943. var rot2 = new THREE.Quaternion().setFromAxisAngle(new THREE.Vector3(1, 0, 0), -Math.PI / 2)
  17944. face.quaternion.copy(rot1).multiply(rot2)
  17945. break
  17946. case GLCubeFaces.GL_TEXTURE_CUBE_MAP_POSITIVE_Z:
  17947. face.rotation.set(0, Math.PI, 0)
  17948. break
  17949. case GLCubeFaces.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z:
  17950. face.rotation.set(0, 0, 0)
  17951. }
  17952. face.scale.set(1, -1, 1)
  17953. cube.add(face)
  17954. }
  17955. cube.name = 'highMapCube'
  17956. this.highMapCube = cube
  17957. this.add(cube)
  17958. cube.scale.set(0.21, 0.21, 0.21) //camera.near is 0.1
  17959. this.highMapCube.visible = false
  17960. this.highMapCube.texLoadedCount = 0
  17961. player.once("pano.chosen",()=>{//wait sceneRenderer
  17962. player.sceneRenderer.on('after-render', e => {
  17963. if (this.highMapCube.visibleTiles) {
  17964. this.updateTiles()
  17965. }
  17966. if (player && player.lastFrameChanged) {
  17967. common.intervalTool.isWaiting(
  17968. 'update4kTiles',
  17969. () => {
  17970. let vectorForward = player.getDirection()
  17971. this.updateTiles(vectorForward)
  17972. },
  17973. 500
  17974. )
  17975. }
  17976. })
  17977. })
  17978. }
  17979. }
  17980. /*
  17981. highMapCube会遮住场景中所有物体, 如果一定要显示的话,只能类似potree中的那样渲染一个深度贴图出来(model无需贴图),然后其他所有物体的shader中都加入一段代码。(貌似本身已经支持了?)
  17982. */
  17983. n.prototype.isHighMapLoaded = function(cubeFace, tileX, tileY){
  17984. var tile = this.highMapCube.children[cubeFace].children[tileX * 8 + tileY]
  17985. return !!tile.material.map
  17986. }
  17987. n.prototype.updateTiles = function(direction) {
  17988. if (!this.highMapCube || !this.highMapCube.visible) return
  17989. if (this.highMapCube.tiles.filter(e => e.image).length <= 10) return //加载的太少了
  17990. //performance.mark('updateTiles-start')
  17991. if (direction) {
  17992. let camera = player.cameraControls.cameras.panorama
  17993. let hfov = THREE.Math.degToRad(cameraLight.getHFOVForCamera(camera, $("#player").width(), $("#player").height())) / 2
  17994. let vfov = THREE.Math.degToRad(camera.fov) / 2
  17995. /* let hcos = Math.cos(hfov / 2)
  17996. let vcos = Math.cos(vfov / 2) */
  17997. let list = this.highMapCube.tiles
  17998. list.forEach(e => {
  17999. //屏幕外的不显示
  18000. let pos = e.getWorldPosition(new THREE.Vector3())
  18001. let dir = new THREE.Vector3().subVectors(pos, this.highMapCube.position).normalize()
  18002. let hcos_ = dir.clone().setY(direction.y).normalize().dot(direction) //在direction的斜面上水平角度差
  18003. let hRad = Math.acos(hcos_)
  18004. let vRad = -200
  18005. if (hRad > hfov + 0.08) {
  18006. e.score = -100
  18007. } else {
  18008. vRad = Math.abs(Math.acos(dir.y) - Math.acos(direction.y))
  18009. if (vRad > vfov + 0.08) {
  18010. e.score = -100
  18011. } else {
  18012. e.score = -(hRad / hfov + vRad / vfov)
  18013. }
  18014. }
  18015. e.scores = hRad.toFixed(3) + ', ' + vRad.toFixed(3)
  18016. if (e.score == -100) {
  18017. this.resetTile(e)
  18018. }
  18019. })
  18020. this.highMapCube.visibleTiles = list.filter(e => e.score > -100)
  18021. //list.forEach(e=>e.scoreLabel.setText(e.scores))
  18022. }
  18023. let needRecover = this.highMapCube.visibleTiles.filter(e => !e.material.map)
  18024. if (needRecover.length) {
  18025. let maxCount = 1//common.getBestCount({ name: '4kmaxTileRecover', minCount: 0, maxCount: 2, durBound1: 1.5, durBound2: 6, ifLog: false, maxHistory: 2 })
  18026. let count = 0
  18027. needRecover.forEach((e, i) => {
  18028. //只更新若干个,因为太耗时了, 其余的等下帧更新
  18029. if (count >= maxCount) return
  18030. let r = this.recoverTile(e)
  18031. if (r) count++
  18032. })
  18033. }
  18034. }
  18035. n.prototype.getHighImage = function(image, cubeFace, tileX, tileY){
  18036. this.gotSomeHighImg = true; //标记,需要马上updateTiles
  18037. let tile = this.highMapCube.children[cubeFace].children[tileX * 8 + tileY]
  18038. tile.image = image //先记录下来
  18039. }
  18040. n.prototype.updateHighMap = function(image, cubeFace, tileX, tileY) {
  18041. let tile = this.highMapCube.children[cubeFace].children[tileX * 8 + tileY]
  18042. if (image) tile.image = image //先记录下来
  18043. if (tile.material.map) return
  18044. if (this.highMapCube.visibleTiles && !this.highMapCube.visibleTiles.includes(tile) /* this.highMapCube.texLoadedCount >= this.getMaxTileCount() */) {
  18045. return
  18046. }
  18047. //简易创建贴图
  18048. var tex = player.sceneRenderer.initSizedTexture2D(512, THREE.ClampToEdgeWrapping)
  18049. //var loaded = this.$app.core.get('Player').model.isHighMapLoaded(tile.cubeFace, tile.tileX, tile.tileY)
  18050. player.sceneRenderer.uploadTexture2D(image, tex, 0, 0, 512, 512) //只替换tex对应的img,不新建
  18051. /* var tex = new THREE.Texture()
  18052. tex.image = image
  18053. tex.flipY = false
  18054. tex.wrapS = tex.wrapT = THREE.ClampToEdgeWrapping
  18055. tex.generateMipmaps = false
  18056. tex.minFilter = THREE.LinearFilter
  18057. tex.needsUpdate = true */
  18058. tile.material.map = tex
  18059. if (highMapAddColor) {
  18060. tile.material.opacity = 1
  18061. //tile.material.transparent = false
  18062. }
  18063. tile.visible = true
  18064. tile.material.needsUpdate = true //发现每次开始放大但还未放大到4k时也会把之前加载过的4k加载
  18065. //console.log('updateHighMap',cubeFace, tileX, tileY)
  18066. }
  18067. n.prototype.recoverTile = function(tile) {
  18068. if (tile.material.map) return
  18069. if (tile.image) {
  18070. this.updateHighMap(tile.image, tile.cubeFace, tile.tileX, tile.tileY)
  18071. return true
  18072. } else {
  18073. //console.log('no image')
  18074. }
  18075. }
  18076. n.prototype.resetTile = function(tile, kill) {
  18077. if (kill) {
  18078. //完全消灭
  18079. tile.image = null
  18080. }
  18081. let map = tile.material.map
  18082. if (map) {
  18083. /* map.dispose()
  18084. map.loaded = !1
  18085. map.version = 0 */
  18086. var h = player.sceneRenderer.renderer.properties.get(map)
  18087. player.sceneRenderer.renderer.getContext().deleteTexture(h.__webglTexture)
  18088. tile.material.map = null
  18089. if (highMapAddColor) {
  18090. tile.material.opacity = 0.4
  18091. }
  18092. tile.material.needsUpdate = true
  18093. tile.visible = false
  18094. //this.highMapCube.texLoadedCount --
  18095. //console.log('resetTile' , tile.cubeFace, tile.tileX, tile.tileY )
  18096. }
  18097. }
  18098. n.prototype.resetHighMap = function() {
  18099. if (!this.highMapCube) return
  18100. this.highMapCube.children.forEach(e =>
  18101. e.children.forEach(tile => {
  18102. this.resetTile(tile, true)
  18103. })
  18104. )
  18105. //this.highMapCube.texLoadedCount = 0
  18106. this.highMapCube.visibleTiles = null
  18107. this.hideHighMap()
  18108. }
  18109. n.prototype.setHighMap = function(pano) {
  18110. if (!this.highMapCube) return
  18111. this.highMapCube.position.copy(pano.position)
  18112. this.highMapCube.quaternion.copy(pano.quaternion)
  18113. }
  18114. n.prototype.showHighMap = function() {
  18115. if (!this.highMapCube) return
  18116. this.highMapCube.visible = true
  18117. }
  18118. n.prototype.hideHighMap = function() {
  18119. if (!this.highMapCube) return
  18120. this.highMapCube.visible = false
  18121. }
  18122. //缩小后继续显示cube呢还是不显示? 不显示的话,就要把cube上的复制到renderTarget上……会不会又崩溃,or没加载的显示???
  18123. t.exports = n
  18124. }
  18125. ).call(this, "/js/model/Model.js")
  18126. }
  18127. , {
  18128. "../constants": 8,
  18129. "../enum/AlignmentType": 17,
  18130. "../enum/RenderOrder": 42,
  18131. "../enum/Viewmode": 51,
  18132. "../exception/BasicException": 55,
  18133. "../label/Label": 90,
  18134. "../loaders/ModelLoader": 105,
  18135. "../loaders/ModelTextureLoader": 106,
  18136. "../loaders/SweepDataLoader": 107,
  18137. "../tag/tag": 123,
  18138. "./util/cameraLight": 184,
  18139. "../tag/tagManager": 124,
  18140. "../objects/BoundingTextureSkybox": 143,
  18141. "../objects/Chunk": 144,
  18142. "../objects/Floor": 146,
  18143. "../objects/Panorama": 148,
  18144. "../objects/Room": 150,
  18145. "../objects/Snapshot": 153,
  18146. "../settings": 166,
  18147. "../shaders": 167,
  18148. "../util/ModelUrls": 177,
  18149. "../util/PanoramaCollection": 178,
  18150. "../util/ajax": 181,
  18151. "../util/common": 185,
  18152. "../util/easing": 186,
  18153. "../util/lerp": 188,
  18154. "../util/logger": 189,
  18155. "../util/math": 190,
  18156. "../util/texture": 194,
  18157. "../util/transitions": 195,
  18158. "./../util/browser": 182,
  18159. "./../util/showcase": 193,
  18160. "./Chunks": 135,
  18161. "./FloorCollection": 136,
  18162. "./ImageCollection": 137,
  18163. "./LabelCollection": 138,
  18164. "./RoomCollection": 141,
  18165. events: 202,
  18166. three: 217,
  18167. "hot": "hot" ,
  18168. "../enum/GLCubeFaces":25 ,
  18169. }],
  18170. 140: [function(e, t, i) {
  18171. "use strict";
  18172. function n() {
  18173. this.modelMap = {},
  18174. this.activeModel = null,
  18175. this.modelCount = 0,
  18176. this.tileDownloader = null,
  18177. this.panoRenderer = null
  18178. }
  18179. var r = (e("three"),
  18180. e("../util/common"))
  18181. , o = e("../exception/BasicException")
  18182. , a = e("../enum/ModelManagerEvents")
  18183. , s = e("../enum/PanoRendererEvents")
  18184. , l = e("events").EventEmitter;
  18185. n.prototype.init = function(e, t, i) {
  18186. this.tileDownloader = e,
  18187. this.panoRenderer = t,
  18188. this.qualityManager = i,
  18189. this.bindEvents()
  18190. }
  18191. ,
  18192. n.prototype.bindEvents = function() {
  18193. this.panoRenderer.on(s.TileRenderSuccess, this.onTileRendered.bind(this))
  18194. }
  18195. ,
  18196. n.prototype.onTileRendered = function(e, t, i, n) {}
  18197. ,
  18198. n.prototype.addModel = function(e) {
  18199. this.modelMap[e.sid] = e,
  18200. 0 === this.modelCount && this.activateModel(e.sid),
  18201. this.modelCount++,
  18202. this.emit(a.ModelAdded)
  18203. }
  18204. ,
  18205. n.prototype.getModel = function(e) {
  18206. return this.modelMap[e]
  18207. }
  18208. ,
  18209. n.prototype.activateModel = function(e) {
  18210. var t = this.modelMap[e];
  18211. if (!t)
  18212. throw new o("Tried to activate invalid model!");
  18213. var i = this.activeModel;
  18214. this.activeModel = t,
  18215. this.tileDownloader.setPanoData(t.panos, t.listImagePanos(), t.sid),
  18216. this.tileDownloader.setUrls(t.urls),
  18217. t.panos.forEach(function(e) {
  18218. e.attachToPanoRenderer(this.panoRenderer),
  18219. e.tileDownloader = this.tileDownloader,
  18220. e.qualityManager = this.qualityManager
  18221. }
  18222. .bind(this)),
  18223. this.emit(a.ActiveModelChanged, {
  18224. oldModel: i,
  18225. model: t
  18226. })
  18227. }
  18228. ,
  18229. n.prototype.getActiveModel = function() {
  18230. return this.activeModel
  18231. }
  18232. ,
  18233. r.extend(n, l),
  18234. t.exports = n
  18235. }
  18236. , {
  18237. "../enum/ModelManagerEvents": 33,
  18238. "../enum/PanoRendererEvents": 35,
  18239. "../exception/BasicException": 55,
  18240. "../util/common": 185,
  18241. events: 202,
  18242. three: 217
  18243. }],
  18244. 141: [function(e, t, i) {
  18245. (function(i) {
  18246. "use strict";
  18247. function n() {
  18248. s.call(this)
  18249. }
  18250. var r = e("../objects/Room")
  18251. , o = (e("../settings"),
  18252. e("../util/logger"))
  18253. , a = (e("../util/transitions"),
  18254. e("../util/easing"),
  18255. e("../util/common"))
  18256. , s = e("../util/IndexedCollection")
  18257. , l = e("./Chunks");
  18258. new o(i);
  18259. a.inherit(n, s),
  18260. n.prototype.getIndex = function(e) {
  18261. return e.roomId
  18262. }
  18263. ,
  18264. n.prototype.calcRoomBoundaries = function() {
  18265. this.forEach(function(e) {
  18266. e.calcBoundaries()
  18267. })
  18268. }
  18269. ,
  18270. n.prototype.createFromChunks = function(e) {
  18271. var t = {
  18272. floorId: -1,
  18273. roomId: -1
  18274. }
  18275. , i = {};
  18276. e.forEach(function(e) {
  18277. l.parseIdsFromChunkName(e.name, t);
  18278. var o = i[t.roomId];
  18279. if (!o) {
  18280. var a = n.generateRoomId(t.floorId, t.roomId);
  18281. o = new r(t.floorId,a),
  18282. this.add(o),
  18283. i[t.roomId] = o
  18284. }
  18285. o.addChunk(e)
  18286. }
  18287. .bind(this)),
  18288. this.calcRoomBoundaries()
  18289. }
  18290. ,
  18291. n.generateRoomId = function(e, t) {
  18292. return e + "_" + t
  18293. }
  18294. ,
  18295. t.exports = n
  18296. }
  18297. ).call(this, "/js/model/RoomCollection.js")
  18298. }
  18299. , {
  18300. "../objects/Room": 150,
  18301. "../settings": 166,
  18302. "../util/IndexedCollection": 175,
  18303. "../util/common": 185,
  18304. "../util/easing": 186,
  18305. "../util/logger": 189,
  18306. "../util/transitions": 195,
  18307. "./Chunks": 135
  18308. }],
  18309. 142: [function(e, t, i) {
  18310. "use strict";
  18311. function n(e, t, i) {
  18312. e = e.clone().expandByScalar(0.01);//改
  18313. var n = e.size()
  18314. , o = new r.BoxGeometry(n.x,n.y,n.z);
  18315. o.boundingBox = e,
  18316. r.Mesh.call(this, o, t),
  18317. this.position.copy(e.center()),
  18318. this.frustumCulled = !1,
  18319. i && this.add(new r.WireframeHelper(this))
  18320. }
  18321. var r = e("three");
  18322. n.prototype = Object.create(r.Mesh.prototype),
  18323. n.prototype.constructor = n,
  18324. t.exports = n
  18325. }
  18326. , {
  18327. three: 217
  18328. }],
  18329. 143: [function(e, t, i) {
  18330. (function(i) {
  18331. "use strict";
  18332. function n(e) {
  18333. h.time("Computing a nice bounding cubemap");
  18334. var t = new a({
  18335. side: r.BackSide,
  18336. transparent: !0
  18337. });
  18338. t.uniforms.modelAlpha.value = 0,
  18339. t.uniforms.opacity.value = 1 - s.modelAlpha,
  18340. this.renderOrder = l.boundingSkybox,
  18341. o.call(this, e, t),
  18342. h.timeEnd("Computing a nice bounding cubemap")
  18343. }
  18344. var r = e("three")
  18345. , o = (e("../enum/Viewmode"),
  18346. e("../shaders"),
  18347. e("./BoundingMesh"))
  18348. , a = e("../materials/ModelTextureMaterial")
  18349. , s = e("../settings")
  18350. , l = e("../enum/RenderOrder")
  18351. , c = e("../util/logger")
  18352. , h = new c(i);
  18353. n.prototype = Object.create(o.prototype),
  18354. n.prototype.constructor = n,
  18355. t.exports = n
  18356. }
  18357. ).call(this, "/js/objects/BoundingTextureSkybox.js")
  18358. }
  18359. , {
  18360. "../enum/RenderOrder": 42,
  18361. "../enum/Viewmode": 51,
  18362. "../materials/ModelTextureMaterial": 118,
  18363. "../settings": 166,
  18364. "../shaders": 167,
  18365. "../util/logger": 189,
  18366. "./BoundingMesh": 142,
  18367. three: 217
  18368. }],
  18369. 144: [function(e, t, i) {
  18370. "use strict";
  18371. function n(e) {
  18372. this.materialInside = new s({
  18373. side: r.DoubleSide
  18374. });
  18375. var t = r.UniformsUtils.clone(o.modelOutside.uniforms);
  18376. this.materialOutside = new r.RawShaderMaterial({
  18377. fragmentShader: o.modelOutside.fragmentShader,
  18378. vertexShader: o.modelOutside.vertexShader,
  18379. uniforms: t,
  18380. side: r.FrontSide,
  18381. name: "chunkOut"
  18382. }),
  18383. r.Mesh.call(this, e.geometry, this.materialInside),
  18384. this.name = e.name || "",
  18385. this.textureName = e.textureName,
  18386. this.meshUrl = e.meshUrl
  18387. }
  18388. var r = e("three")
  18389. , o = e("../shaders")
  18390. , a = e("../enum/Viewmode")
  18391. , s = e("../materials/ModelTextureMaterial");
  18392. n.prototype = Object.create(r.Mesh.prototype),
  18393. n.prototype.setTextureMap = function(e) {
  18394. this.materialInside.uniforms.map.value = e,
  18395. this.materialOutside.uniforms.map.value = e
  18396. }
  18397. ,
  18398. n.prototype.setMode = function(e) {
  18399. var t = e === a.DOLLHOUSE || e === a.FLOORPLAN ? this.materialOutside : this.materialInside;
  18400. t.side = e === a.PANORAMA ? r.DoubleSide : r.FrontSide,
  18401. t.transparent = this.material.transparent,
  18402. t.uniforms.opacity.value = this.material.uniforms.opacity.value,
  18403. this.material = t
  18404. }
  18405. ,
  18406. t.exports = n
  18407. }
  18408. , {
  18409. "../enum/Viewmode": 51,
  18410. "../materials/ModelTextureMaterial": 118,
  18411. "../shaders": 167,
  18412. three: 217
  18413. }],
  18414. 145: [function(e, t, i) {
  18415. "use strict";
  18416. function n(e) {
  18417. this.chunksize = e || 10,
  18418. this.chunks = {},
  18419. this.boundingBoxes = {},
  18420. this.children = [],
  18421. this.offset = new r.Vector3(0,.5,0),
  18422. this.material = new r.MeshBasicMaterial({
  18423. color: 16777215 * Math.random(),
  18424. side: r.DoubleSide
  18425. })
  18426. }
  18427. var r = e("three");
  18428. e("../enum/Viewmode");
  18429. n.prototype.add = function(e) {
  18430. var t, i, n, o, a, s, l, c, h, u, d, p, f, g, m = e.attributes;
  18431. m ? (t = m.position.array,
  18432. i = void 0 !== e.index ? e.index.array : void 0) : (t = e.vertices,
  18433. n = e.faces);
  18434. var v = new r.Vector3;
  18435. if (i)
  18436. for (o = 0,
  18437. a = i.length; o < a; o += 3) {
  18438. var A = 3 * i[o]
  18439. , y = 3 * i[o + 1]
  18440. , C = 3 * i[o + 2];
  18441. s = (t[A] + t[y] + t[C]) / 3,
  18442. l = (t[A + 1] + t[y + 1] + t[C + 1]) / 3,
  18443. c = (t[A + 2] + t[y + 2] + t[C + 2]) / 3,
  18444. h = Math.floor(s / this.chunksize),
  18445. u = Math.floor(l / this.chunksize),
  18446. d = Math.floor(c / this.chunksize),
  18447. p = h + "." + u + "." + d,
  18448. p in this.chunks ? (g = this.chunks[p],
  18449. f = this.boundingBoxes[p]) : (g = this.chunks[p] = [],
  18450. f = this.boundingBoxes[p] = new r.Box3),
  18451. 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]),
  18452. f.expandByPoint(v.set(t[A], t[A + 1], t[A + 2])),
  18453. f.expandByPoint(v.set(t[y], t[y + 1], t[y + 2])),
  18454. f.expandByPoint(v.set(t[C], t[C + 1], t[C + 2]))
  18455. }
  18456. else
  18457. for (o = 0,
  18458. a = t.length; o < a; o += 9)
  18459. s = (t[o] + t[o + 3] + t[o + 6]) / 3,
  18460. l = (t[o + 1] + t[o + 4] + t[o + 7]) / 3,
  18461. c = (t[o + 2] + t[o + 5] + t[o + 8]) / 3,
  18462. h = Math.floor(s / this.chunksize),
  18463. u = Math.floor(l / this.chunksize),
  18464. d = Math.floor(c / this.chunksize),
  18465. p = h + "." + u + "." + d,
  18466. p in this.chunks ? (g = this.chunks[p],
  18467. f = this.boundingBoxes[p]) : (g = this.chunks[p] = [],
  18468. f = this.boundingBoxes[p] = new r.Box3),
  18469. 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]),
  18470. f.expandByPoint(v.set(t[o], t[o + 1], t[o + 2])),
  18471. f.expandByPoint(v.set(t[o + 3], t[o + 4], t[o + 5])),
  18472. f.expandByPoint(v.set(t[o + 6], t[o + 7], t[o + 8]))
  18473. }
  18474. ,
  18475. n.prototype.build = function() {
  18476. var e = new r.Object3D;
  18477. e.material = this.material;
  18478. for (var t in this.chunks) {
  18479. var i = this.chunks[t]
  18480. , n = new r.BufferGeometry;
  18481. n.addAttribute("position", new r.BufferAttribute(new Float32Array(i),3)),
  18482. n.boundingBox = this.boundingBoxes[t];
  18483. var o = new r.Mesh(n,this.material);
  18484. o.material.visible = !1,
  18485. e.add(o),
  18486. this.chunks[t] = []
  18487. }
  18488. return e
  18489. }
  18490. ,
  18491. t.exports = n
  18492. }
  18493. , {
  18494. "../enum/Viewmode": 51,
  18495. three: 217
  18496. }],
  18497. 146: [function(e, t, i) {
  18498. "use strict";
  18499. var r = e("three")
  18500. , o = e("../settings")
  18501. , a = e("../util/common")
  18502. , s = e("../util/lerp")
  18503. , l = e("./ChunkedCollider")
  18504. , c = e("../util/transitions")
  18505. , h = e("../util/easing")
  18506. , u = (e("../objects/Panorama"),
  18507. e("../enum/RenderOrder"))
  18508. , d = e("../localization/localize");
  18509. function n(e, t, i) {
  18510. r.Object3D.call(this),
  18511. this.model = e,
  18512. this.floorIndex = t,
  18513. this.lang = o.languageTag,
  18514. this.name = i || o.languageTag === "cn" ? "Floor " + (t + 1) + "" : "第" + (t + 1) + "层",
  18515. this.panos = [],
  18516. this.chunks = [],
  18517. this.colliderBuilder = new l(3),
  18518. this.collider = null,
  18519. this.center = null,
  18520. this.boundingBox = new r.Box3,
  18521. this.size = null,
  18522. this.hidden = !1,
  18523. this.conservativeBoundingBox = new r.Box3,
  18524. this.debugColor = 16777215 * Math.random(),
  18525. this.transition = null
  18526. }
  18527. n.prototype = Object.create(r.Object3D.prototype),
  18528. n.prototype.enter = function(e) {
  18529. this.model.setFloor(this, e)
  18530. }
  18531. ,
  18532. n.prototype.hide = function(e) {
  18533. if (!this.hidden || this.transition) {
  18534. this.chunks.forEach(function(e) {
  18535. e.material.transparent = !0
  18536. }),
  18537. c.cancel(this.transition);
  18538. var t = e ? 0 : o.hideFloorDuration + o.hideFloorDelay
  18539. , i = e ? 0 : o.hideFloorDelay / t;
  18540. this.transition = c.start(s.allUniforms(this.chunks, "opacity", .08), t, function() {
  18541. this.hidden = !0
  18542. }
  18543. .bind(this), i, h.easeInOutQuad)
  18544. }
  18545. }
  18546. ,
  18547. n.prototype.show = function(e) {
  18548. if (this.hidden || this.transition) {
  18549. this.hidden = !1,
  18550. c.cancel(this.transition);
  18551. var t = e ? o.showFloorDuration : o.showFloorDuration + o.showFloorDelay
  18552. , i = e ? 0 : o.showFloorDelay / t;
  18553. this.transition = c.start(s.allUniforms(this.chunks, "opacity", 1), t, function() {
  18554. this.hidden || this.chunks.forEach(function(e) {
  18555. e.material.transparent = !1
  18556. })
  18557. }
  18558. .bind(this), i, h.easeInOutQuad)
  18559. }
  18560. }
  18561. ,
  18562. n.prototype.toggle = function(e, t) {
  18563. e = void 0 === e ? this.hidden : e,
  18564. e ? this.show(t) : this.hide(t)
  18565. }
  18566. ,
  18567. n.prototype.containsPoint = function(e) {
  18568. return this.collider.children.some(function(t) {
  18569. return t.geometry.boundingBox || t.geometry.computeBoundingBox(),
  18570. t.geometry.boundingBox.containsPoint(e)
  18571. })
  18572. }
  18573. ,
  18574. n.prototype.distanceToPoint = function(e) {
  18575. var t = null
  18576. , i = 1 / 0;
  18577. return this.collider.children.forEach(function(n) {
  18578. n.geometry.boundingBox || n.geometry.computeBoundingBox();
  18579. var r = n.geometry.boundingBox.distanceToPoint(e);
  18580. (!t || i > r) && (i = r,
  18581. t = n)
  18582. }),
  18583. i
  18584. }
  18585. ,
  18586. n.prototype.addChunk = function(e) {
  18587. e.renderOrder = u.ghostFloor,
  18588. this.add(e),
  18589. this.chunks.push(e),
  18590. this.boundingBox.union(e.geometry.boundingBox),
  18591. this.size = this.boundingBox.size(),
  18592. this.colliderBuilder.add(e.geometry)
  18593. }
  18594. ,
  18595. n.prototype.addPano = function(e) {
  18596. this.panos.push(e),
  18597. this.add(e.skyboxMesh),
  18598. e.marker && this.add(e.marker);
  18599. if(e.neighbourUUIDs && e.neighbourUUIDs.length){//add 有相邻点才算入bound 因为拍摄有bug,会出现floorPosition为000,且position位置很偏的点,它们一般都是不可见点。
  18600. var t = new r.Vector3(1,1,1)
  18601. , i = (new r.Box3).setFromCenterAndSize(e.position, t);
  18602. this.boundingBox.union(i)
  18603. }
  18604. }
  18605. ,
  18606. n.prototype.build = function() {
  18607. this.collider = this.colliderBuilder.build(!0),
  18608. this.add(this.collider),
  18609. this.center = this.boundingBox.center(),
  18610. this.conservativeBoundingBox.copy(this.boundingBox),
  18611. this.conservativeBoundingBox.min.y = a.lowerMedian(this.collider.children.map(function(e) {
  18612. return e.geometry.boundingBox.min.y
  18613. }), 5),
  18614. this.conservativeBoundingBox.max.y = a.lowerMedian(this.collider.children.map(function(e) {
  18615. return e.geometry.boundingBox.max.y
  18616. }), 5),
  18617. this.colliderBuilder = null
  18618. }
  18619. ,
  18620. n.prototype.toShortString = function() {
  18621. return a.nth(this.floorIndex + 1)
  18622. }
  18623. ,
  18624. n.prototype.toString = function() {
  18625. return this.name
  18626. }
  18627. ,
  18628. t.exports = n
  18629. }
  18630. , {
  18631. "../enum/RenderOrder": 42,
  18632. "../localization/localize": 108,
  18633. "./strings-cn-CN": 109,
  18634. "../objects/Panorama": 148,
  18635. "../settings": 166,
  18636. "../util/common": 185,
  18637. "../util/easing": 186,
  18638. "../util/lerp": 188,
  18639. "../util/transitions": 195,
  18640. "./ChunkedCollider": 145,
  18641. three: 217
  18642. }],
  18643. 147: [function(e, t, i) {
  18644. "use strict";
  18645. function n(e) {
  18646. this.player = e,
  18647. this.obj3d = null,
  18648. this.UP = new r.Vector3(0,1,0)
  18649. }
  18650. var r = e("three")
  18651. , o = e("../settings");
  18652. n.prototype.prefs = {
  18653. linewidth: 3,
  18654. height: .07,
  18655. opacity: .45,
  18656. endScale: .05
  18657. },
  18658. n.prototype.discard = function() {
  18659. if (this.obj3d) {
  18660. var e = this.obj3d.parent;
  18661. e && e.remove(this.obj3d)
  18662. }
  18663. this.obj3d = null
  18664. }
  18665. ,
  18666. n.prototype.draw = function() {
  18667. if (this.discard(),
  18668. o.showNeighbors) {
  18669. var e = this.player.currentPano.floor;
  18670. this.obj3d = new r.Object3D;
  18671. var t = this.player.model.panos.getNeighbours(this.player.currentPano)
  18672. , i = this.player.currentPano.floorPosition.clone().sub(this.player.model.position);
  18673. i.y += this.prefs.height;
  18674. var n = .1525
  18675. , a = .127
  18676. , s = .0127
  18677. , l = .1
  18678. , c = .19
  18679. , h = .2032
  18680. , u = .2286
  18681. , d = .255
  18682. , p = new r.Matrix4;
  18683. for (var f in t)
  18684. if (t[f]) {
  18685. var g = this.player.model.panos.get(f)
  18686. , m = (g.position.clone().sub(this.player.model.position),
  18687. g.position.clone().sub(g.floorPosition))
  18688. , v = g.floorPosition.clone().sub(this.player.model.position);
  18689. v.y += this.prefs.height;
  18690. var A = new r.Geometry;
  18691. 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)),
  18692. 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)),
  18693. p.identity().setPosition(m),
  18694. A.applyMatrix(p),
  18695. A.vertices.push(new r.Vector3(0,-this.prefs.endScale,0)),
  18696. 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)),
  18697. p.lookAt(v, i, this.UP).setPosition(v),
  18698. A.applyMatrix(p),
  18699. A.vertices.push(v, i);
  18700. var y = new r.Line(A,new r.LineBasicMaterial({
  18701. color: g.debugColor.getHex(),
  18702. transparent: !0,
  18703. opacity: this.prefs.opacity,
  18704. depthWrite: !1,
  18705. name: "sLine" + f,
  18706. linewidth: this.prefs.linewidth
  18707. }));
  18708. this.obj3d.add(y)
  18709. }
  18710. e.add(this.obj3d)
  18711. }
  18712. }
  18713. ,
  18714. n.prototype.update = function() {
  18715. o.showNeighbors && this.obj3d && this.obj3d.updateMatrixWorld()
  18716. }
  18717. ,
  18718. t.exports = n
  18719. }
  18720. , {
  18721. "../settings": 166,
  18722. three: 217
  18723. }],
  18724. 148: [function(e, t, i) {
  18725. (function(i) {
  18726. "use strict";
  18727. function n(e, t, i, n) {
  18728. this.model = e,
  18729. this.id = t,
  18730. this.alignmentType = i.alignmentType || l.ALIGNED,
  18731. this.neighbourUUIDs = i.neighbours || null,
  18732. this.neighbourPanos = null,
  18733. this.floor = null,
  18734. this.floorIndex = i.floor,
  18735. this.failedLoadingAt = 0,
  18736. this.maxLoadRetries = 4,
  18737. this.origin = i.position.clone(),
  18738. this.position = this.alignmentType === l.UNALIGNED ? new r.Vector3(0,-5,0) : i.position.clone(),
  18739. this.quaternion = i.quaternion.clone(),
  18740. this.skyboxMesh = new r.Mesh(E),
  18741. this.skyboxMesh.position.copy(this.position),
  18742. this.skyboxMesh.quaternion.copy(this.quaternion),
  18743. this.skyboxMesh.name = "skybox",
  18744. this.skyboxMesh.visible = !1,
  18745. this.skyboxMesh.updateMatrix(),
  18746. this.skyboxMesh.updateMatrixWorld(),
  18747. this.marker = null,
  18748. this.showFloorMarker = !window.DATA.hideFloorMarker;
  18749. this.isAligned() && (this.marker = new r.Mesh(b,new r.MeshBasicMaterial({
  18750. map: w,
  18751. side: r.DoubleSide,
  18752. opacity: 0,
  18753. transparent: !0,
  18754. depthWrite: !1
  18755. })),
  18756. this.marker.visible = this.showFloorMarker,
  18757. this.marker.renderOrder = s.panoMarker,
  18758. this.marker.name = "marker",
  18759. this.marker.pano = this,
  18760. this.marker.layers.set(v.PANOMARKERS),
  18761. this.marker.updateMatrixWorld(),
  18762. a.colorMarkerOnLoad && this.on("load", function() {
  18763. this.marker.material.color.set(65280)
  18764. })),
  18765. this.debugColor = (new r.Color).setHSL(.06 + .53 * Math.random(), .8 + .2 * Math.random(), .5 + .2 * Math.random()),
  18766. this.floorPosition = i.puck ? i.puck.clone() : null,
  18767. this.tiled = n,
  18768. this.tiled ? this.solidSkybox = null : (this.solidSkybox = new r.Texture([null, null, null, null, null, null]),
  18769. this.solidSkybox.flipY = !1,
  18770. a.minimalMemoryMode && (this.solidSkybox.minFilter = r.LinearFilter,
  18771. this.solidSkybox.magFilter = r.LinearFilter,
  18772. this.solidSkybox.generateMipmaps = !1)),
  18773. this.zoomed = !1,
  18774. this.panoRenderer = null,
  18775. this.qualityManager = null,
  18776. this.tileDownloader = null,
  18777. this.tiledPanoRenderTarget = null,
  18778. this.minimumTiledPanoLoaded = !1,
  18779. this.highestPartialTileRenderOpCompleted = 0,
  18780. this.highestFullTileRenderOpCompleted = 0,
  18781. this.shouldRedrawOnBaseLoaded = !1,
  18782. this.lockUntilRenderingComplete = !1,
  18783. a.colorMarkerOnLoad && this.on("load", function() {
  18784. this.marker.material.color.set(65280)
  18785. });
  18786. /********************************************************************fyz改vr from徐世廷*************************************************************/
  18787. var e = new r.TextureLoader;
  18788. e.setCrossOrigin(!0);
  18789. var g = e.load("static/images/texture.jpg");
  18790. if (this.vrMarker = new r.Mesh(new r.OctahedronGeometry(.1,0),new r.MeshLambertMaterial({
  18791. color: 16777215,
  18792. transparent: !0,
  18793. opacity: .75,
  18794. map: g
  18795. })),
  18796. this.vrMarker.boluoType = "vr",
  18797. this.vrMarker.position.z = 1,
  18798. this.vrMarker.enabled = !0,
  18799. this.vrMarker.visible = !1,
  18800. window.vrMarkers = window.vrMarkers || [],
  18801. window.vrMarkers.push(this.vrMarker),
  18802. this.marker && this.marker.add(this.vrMarker),
  18803. a.showAxis && (this.skyboxMesh.add(new r.ArrowHelper(new r.Vector3(0,1,0),new r.Vector3(0,0,0),1,255)),
  18804. this.skyboxMesh.add(new r.ArrowHelper(new r.Vector3(0,0,1),new r.Vector3(0,0,0),1,16711680)),
  18805. this.skyboxMesh.add(new r.ArrowHelper(new r.Vector3(1,0,0),new r.Vector3(0,0,0),1,65280))),
  18806. this.adjustAngleEnable) {
  18807. var i = new r.Quaternion;
  18808. i.setFromAxisAngle(new r.Vector3(1,0,0), this.adjustAngleX),
  18809. this.skyboxMesh.quaternion.multiply(i);
  18810. var m = new r.Quaternion;
  18811. m.setFromAxisAngle(new r.Vector3(0,1,0), this.adjustAngleY),
  18812. this.skyboxMesh.quaternion.multiply(m);
  18813. var n = new r.Quaternion;
  18814. n.setFromAxisAngle(new r.Vector3(0,0,1), this.adjustAngleZ),
  18815. this.skyboxMesh.quaternion.multiply(n),
  18816. this.skyboxMesh.updateMatrix(),
  18817. this.skyboxMesh.updateMatrixWorld(),
  18818. this.model.updateProjectedPanos()
  18819. }
  18820. /**************************************************************************************************************************************/
  18821. }
  18822. var r = e("three")
  18823. , o = e("../util/logger")
  18824. , a = e("../settings")
  18825. , s = (e("../enum/Viewmode"),
  18826. e("../enum/RenderOrder"))
  18827. , l = e("../enum/AlignmentType")
  18828. , c = (e("../util/common"),
  18829. e("../util/transitions"))
  18830. , h = e("../util/lerp")
  18831. , u = e("../util/ajax")
  18832. , d = e("../util/texture")
  18833. , p = e("../util/panorama")
  18834. , f = (e("../enum/TileDownloaderEvents"),
  18835. e("../enum/PanoramaEvents"))
  18836. , g = e("../enum/PanoRendererEvents")
  18837. , m = e("../enum/PanoSizeClass")
  18838. , v = e("../enum/RenderLayers")
  18839. , A = (e("../scene/SceneRenderer"),
  18840. e("../enum/GLCubeFaces"),
  18841. e("../exception/BasicException"))
  18842. , y = e("../tile/TileUtils")
  18843. , C = e("events").EventEmitter
  18844. , I = new o(i)
  18845. , E = new r.SphereBufferGeometry(.1)
  18846. , b = new r.PlaneBufferGeometry(.4,.4,1,1)
  18847. , w = d.load("static/images/marker-256x256.png");
  18848. w.anisotropy = browser.isMobile() ? 1 : 3 //add
  18849. n.prototype = Object.create(C.prototype),
  18850. n.prototype.enter = function() {
  18851. var e = null;
  18852. return function() {
  18853. this.setZoomed(!1),
  18854. this.emit("enter", {
  18855. oldPano: e,
  18856. newPano: this
  18857. }),
  18858. e = this
  18859. this.model.setHighMap(this) //add
  18860. }
  18861. }(),
  18862. n.prototype.exit = function() {
  18863. this.tiled ? (this.clearWaitDeferreds(),
  18864. this.minimumTiledPanoLoaded = !1,
  18865. this.tiledPanoRenderTarget = null,
  18866. this.setZoomed(!1),
  18867. this.panoRenderer.deactivateTiledPano(this),
  18868. this.highestPartialTileRenderOpCompleted = 0,
  18869. this.highestFullTileRenderOpCompleted = 0) : (this.solidSkybox.dispose(),
  18870. this.solidSkybox.loaded = !1,
  18871. this.solidSkybox.version = 0),
  18872. this.emit("exit")
  18873. }
  18874. ,
  18875. n.prototype.hoverOn = function(e) {
  18876. this.marker && (c.start(h.property(this.marker.material, "opacity", a[e].markerOpacityOnHover), 250),
  18877. a.navigation.panoScores & a.navigation.mouseDirection && this.addTextSprite("HIT", 12525854))
  18878. }
  18879. ,
  18880. n.prototype.hoverOff = function(e) {
  18881. this.marker && c.start(h.property(this.marker.material, "opacity", a[e].markerOpacity), 250)
  18882. }
  18883. ,
  18884. n.prototype.build1 = function() {
  18885. 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),
  18886. this.floor.addPano(this),
  18887. this.floorPosition = this.floorPosition || this.raycastFloorPosition(),
  18888. this.neighbourPanos = this.neighbourPanos || this.findNeighourPanos(),
  18889. a.colorMarkerByFloor && this.marker && this.marker.material.color.set(this.floor.debugColor)
  18890. }
  18891. ,
  18892. n.prototype.build2 = function() {
  18893. this.floorPosition = this.floorPosition || this.interpolateFloorPosition(),
  18894. this.height = this.position.distanceTo(this.floorPosition),
  18895. this.placeMarker()
  18896. }
  18897. ,
  18898. n.prototype.interpolateFloorPosition = function() {
  18899. var e = this.model.panos.filter(n.filters.isNeighbourPanoTo(this)).filter(function(e) {
  18900. return !!e.floorPosition
  18901. }).sort(function(e, t) {
  18902. return e.position.distanceTo(this.position) - t.position.distanceTo(this.position)
  18903. }
  18904. .bind(this))
  18905. , t = this.position.clone();
  18906. return e.length >= 2 ? t.y = (e[0].floorPosition.y + e[1].floorPosition.y) / 2 : t.add(a.noMeshFloorPositionOffset),
  18907. t
  18908. }
  18909. ,
  18910. n.prototype.raycastFloorPosition = function() {
  18911. I.warn("Performance warning: Raycasting to find floor position");
  18912. var e = new r.Raycaster(this.position,new r.Vector3(0,-1,0))
  18913. , t = e.intersectObjects(this.model.colliders);
  18914. return t.length ? t[0].point : null
  18915. }
  18916. ,
  18917. n.prototype.raycastToFindFloor = function() {
  18918. 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)];
  18919. return function() {
  18920. I.warn("Performance warning: Raycasting to find floor index");
  18921. for (var t = 0; t < e.length; t++) {
  18922. var i = new r.Raycaster(this.position.clone(),e[t].clone())
  18923. , n = i.intersectObjects(this.model.colliders);
  18924. if (n.length)
  18925. return n[0].object.parent.parent
  18926. }
  18927. return null
  18928. }
  18929. }(),
  18930. n.prototype.placeMarker = function() {
  18931. this.marker && (this.marker.position.copy(this.floorPosition),
  18932. this.marker.position.y += .05,
  18933. this.marker.lookAt(new r.Vector3(0,1,0).add(this.marker.position)))
  18934. }
  18935. ,
  18936. n.prototype.translate = function(e) {
  18937. this.position.add(e),
  18938. this.floorPosition.add(e)
  18939. }
  18940. ,
  18941. n.prototype.findClosestMidtpointPanoTo = function(e) {
  18942. (new r.Vector3).addVectors(this.position, e.position).divideScalar(2);
  18943. return this.model.panos.find([n.filters.notIn([this, e])], [n.sortFunctions.distanceToPoint(point)])
  18944. }
  18945. ,
  18946. n.prototype.attachToPanoRenderer = function(e) {
  18947. this.panoRenderer = e,
  18948. this.panoRenderer.on(g.TileRenderSuccess, this.onTileRendered.bind(this)),
  18949. this.panoRenderer.on(g.PanoRenderComplete, this.onPanoRendered.bind(this)),
  18950. this.panoRenderer.on(g.TileRenderFailure, this.onTileRenderFail.bind(this)),
  18951. this.panoRenderer.on(g.UploadAttemptedForAllTiles, this.onUploadAttemptedForAllTiles.bind(this))
  18952. }
  18953. ;
  18954. var _ = {};
  18955. n.prototype.getWaitDeferred = function(e) {
  18956. var t = _[this.id];
  18957. t || (t = {},
  18958. _[this.id] = t);
  18959. var i = t[e];
  18960. return i || (i = {
  18961. deferred: $.Deferred(),
  18962. active: !1
  18963. },
  18964. t[e] = i),
  18965. i
  18966. }
  18967. ,
  18968. n.prototype.resetWaitDeferred = function(e) {
  18969. var t = this.getWaitDeferred(e);
  18970. t.active = !1,
  18971. t.deferred = $.Deferred()
  18972. }
  18973. ,
  18974. n.prototype.clearWaitDeferreds = function() {
  18975. var e = _[this.id];
  18976. e || (e = {},
  18977. _[this.id] = e);
  18978. for (var t in e)
  18979. if (e.hasOwnProperty(t)) {
  18980. var i = e[t];
  18981. i.active = !1,
  18982. i.deferred = $.Deferred()
  18983. }
  18984. }
  18985. ,
  18986. n.prototype.loadTiledPano = function() {
  18987. var e = (new r.Vector3,
  18988. [])
  18989. , t = [];
  18990. return function(i, n, r, o, a, s) {
  18991. null !== o && void 0 !== o || (o = !0),
  18992. null !== a && void 0 !== a || (a = !0);
  18993. var l = this.getWaitDeferred(i)
  18994. , c = l.deferred
  18995. , h = null
  18996. , u = null;
  18997. if (r && ("number" == typeof r ? h = r : (h = r.hFov,
  18998. u = r.vFov)),
  18999. !this.isLoaded(i)) {
  19000. if (!l.active) {
  19001. if (l.active = !0,
  19002. r) {
  19003. var d = y.matchingTilesInDirection(this, i, n, h, u);
  19004. e[this.id + ":" + i] = {
  19005. tileCount: 0,
  19006. targetTileCount: d
  19007. },
  19008. I.info("Loading partial pano: " + this.id + " with " + d + " tiles")
  19009. }
  19010. t[this.id] || (t[this.id] = !0,
  19011. this.on(f.LoadComplete, function(e, t) {
  19012. var i = this.getWaitDeferred(e).deferred;
  19013. i && "pending" === i.state() && this.highestPartialTileRenderOpCompleted >= e && (i.resolve(e, t),
  19014. this.resetWaitDeferred(e))
  19015. }
  19016. .bind(this)),
  19017. this.on(f.LoadFailed, function(e) {
  19018. var t = this.getWaitDeferred(e).deferred;
  19019. t && "pending" === t.state() && this.highestPartialTileRenderOpCompleted >= e && (t.reject(e),
  19020. this.resetWaitDeferred(e))
  19021. }
  19022. .bind(this)),
  19023. this.on(f.TileLoaded, function(t, i, n) {
  19024. var r = this.getWaitDeferred(t).deferred;
  19025. if (r && "pending" === r.state()) {
  19026. r.notify(t, i, n);
  19027. var o = e[this.id + ":" + t];
  19028. o && (o.tileCount++,
  19029. o.tileCount === o.targetTileCount && (this.onPanoRendered(this.id, t, n, !0),
  19030. r.resolve(t, n),
  19031. this.resetWaitDeferred(t)))
  19032. }
  19033. }
  19034. .bind(this)))
  19035. }
  19036. this.tileDownloader.clearForceQueue(),
  19037. this.tileDownloader.forceQueueTilesForPano(this, i, n, h, u, s),
  19038. this.tiledPanoRenderTarget = this.panoRenderer.activateTiledPano(this, Math.min(2048, this.qualityManager.getMaxNavPanoSize()) , o), //不要超过2048否则漫游到下一个点时卡顿
  19039. this.panoRenderer.renderPanoTiles(this.id, n, a)
  19040. }
  19041. return c.promise()
  19042. }
  19043. }(),
  19044. n.prototype.onUploadAttemptedForAllTiles = function(e, t, i) {
  19045. if (e === this.id) {
  19046. var n = this.qualityManager.getPanoSize(m.BASE);
  19047. t === n && this.shouldRedrawOnBaseLoaded && (this.shouldRedrawOnBaseLoaded = !1,
  19048. this.panoRenderer.resetRenderStatus(this.id, !0, !1),
  19049. this.panoRenderer.renderPanoTiles(this.id, null, !0, !0))
  19050. }
  19051. }
  19052. ,
  19053. n.prototype.onTileRendered = function(e, t, i, n) {
  19054. e === this.id && this.emit(f.TileLoaded, t, i, n)
  19055. }
  19056. ,
  19057. n.prototype.onPanoRendered = function(e, t, i, n) {
  19058. e === this.id && (this.minimumTiledPanoLoaded = !0,
  19059. this.updateSkyboxForZoomLevel(),
  19060. t > this.highestPartialTileRenderOpCompleted && (this.highestPartialTileRenderOpCompleted = t),
  19061. !n && t > this.highestFullTileRenderOpCompleted && (this.highestFullTileRenderOpCompleted = t),
  19062. this.emit("load", t),
  19063. this.model.emit("load", this),
  19064. this.emit(f.LoadComplete, t, i))
  19065. }
  19066. ,
  19067. n.prototype.setZoomed = function(e) {
  19068. this.zoomed = e,
  19069. this.updateSkyboxForZoomLevel()
  19070. if(e){ //add
  19071. if(player.qualityManager.getNavZoomClass() != '1k' ){
  19072. this.model.showHighMap()
  19073. }
  19074. }else{
  19075. this.model.hideHighMap()
  19076. }
  19077. }
  19078. ,
  19079. n.prototype.ensureSkyboxReadyForRender = function() {
  19080. this.tiled || (this.solidSkybox.loaded || (this.solidSkybox.needsUpdate = !0),
  19081. this.solidSkybox.loaded = !0)
  19082. }
  19083. ,
  19084. n.prototype.updateSkyboxForZoomLevel = function() {
  19085. this.minimumTiledPanoLoaded && this.model.updateProjectedPanos()
  19086. }
  19087. ,
  19088. n.prototype.getSkyboxTexture = function() {
  19089. //return this.tiled ? this.minimumTiledPanoLoaded ? this.zoomed ? this.panoRenderer.zoomRenderTarget.texture : this.tiledPanoRenderTarget.texture : null : this.solidSkybox
  19090. if(!this.tiled){
  19091. return this.solidSkybox
  19092. }
  19093. if(this.minimumTiledPanoLoaded)
  19094. {
  19095. if(this.zoomed && (this.qualityManager.maxRenderTargetSize > this.qualityManager.maxNavPanoSize|| player.qualityManager.getNavZoomClass() == '4k' ))//change 如果放大后和不放大都是2k就不用这个
  19096. {
  19097. return this.panoRenderer.zoomRenderTarget.texture;
  19098. }
  19099. else
  19100. {
  19101. this.tiledPanoRenderTarget.texture.mapping = THREE.UVMapping//add
  19102. return this.tiledPanoRenderTarget.texture;
  19103. }
  19104. }
  19105. else
  19106. {
  19107. return null;
  19108. }
  19109. }
  19110. ,
  19111. n.prototype.onTileRenderFail = function(e, t, i) {
  19112. e === this.id && this.emit(f.LoadFailed, t)
  19113. }
  19114. ,
  19115. n.prototype.isLoaded = function(e) {
  19116. if (this.tiled) {
  19117. if (e && "string" == typeof e)
  19118. throw new A("Wrong panoSize given to Panorama.isLoaded(); a tiled pano uses PanoSizeClass");
  19119. return !!this.minimumTiledPanoLoaded && (!e || this.highestPartialTileRenderOpCompleted >= e)
  19120. }
  19121. if (e && "number" == typeof e)
  19122. throw new A("Wrong panoSize given to Panorama.isLoaded(); a non-tiled pano uses high/low.");
  19123. return !!this.solidSkybox.high || e in this.solidSkybox
  19124. }
  19125. ,
  19126. n.prototype.loadCube = function(e) {
  19127. if (this.isLoaded(e))
  19128. return I.info("Skipping load of pano, already loaded"),
  19129. $.when();
  19130. this.emit("loading", e),
  19131. this.model.emit("loading", this);
  19132. var t = p.getCubemapUrls(this.model.urls, this.id, e)
  19133. , i = t.filter(function(e) {
  19134. return !e
  19135. });
  19136. "low" === e && i.length > 0 && (I.info("Pano", this.id, "not available in low res, loading high res right away"),
  19137. e = "high",
  19138. t = p.getCubemapUrls(this.model.urls, this.id, e));
  19139. var n = 0
  19140. , r = [0, 1, 2, 3, 4, 5].map(function(e, i, n) {
  19141. return u.getImage(t[i])
  19142. }
  19143. .bind(this));
  19144. return $.when(r[0], r[1], r[2], r[3], r[4], r[5]).then(function(t, i, n, r, o, a) {
  19145. return this.solidSkybox[e] = [t, i, n, r, o, a],
  19146. "high" !== e && this.solidSkybox.high || (this.solidSkybox.image = this.solidSkybox[e],
  19147. this.solidSkybox.low = null),
  19148. this.solidSkybox.needsUpdate = !0,
  19149. this.emit("load", e),
  19150. this.model.emit("load", this),
  19151. this
  19152. }
  19153. .bind(this), function() {
  19154. I.error("Downloading cubemap for pano", this.id, "failed"),
  19155. this.failedLoadingAt = Date.now()
  19156. }
  19157. .bind(this), function() {
  19158. return $.when(++n, 6)
  19159. })
  19160. }
  19161. ,
  19162. n.raycastsSkipped = 0,
  19163. n.raycastsDone = 0,
  19164. n.prototype.findNeighourPanos = function() {
  19165. return this.model.panos.setNeighbour(this.id, this.id, !1),
  19166. this.model.panos.forEach(function(e) {
  19167. if (e !== this && (!this.model.panos.neighbourMap[this.id] || void 0 === this.model.panos.neighbourMap[this.id][e.id])) {
  19168. var t = this.position.distanceTo(e.position);
  19169. if (t > a.panoramaNeighbourMaxDistance)
  19170. return this.model.panos.setNeighbour(this, e, !1),
  19171. void n.raycastsSkipped++;
  19172. var i = e.position.clone().sub(this.position).normalize()
  19173. , o = new r.Raycaster(this.position,i.clone(),0,t)
  19174. , s = o.intersectObjects(this.model.colliders);
  19175. n.raycastsDone++,
  19176. this.model.panos.setNeighbour(this, e, 0 === s.length),
  19177. 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)))
  19178. }
  19179. }
  19180. .bind(this)),
  19181. this.model.panos.neighbourMap[this.id]
  19182. }
  19183. ,
  19184. n.prototype.worldPosition = function() {
  19185. return this.position
  19186. }
  19187. ,
  19188. n.prototype.addTextSprite = function(e, t) {
  19189. this.removeTextSprite();
  19190. var i = document.createElement("canvas")
  19191. , n = i.getContext("2d");
  19192. i.width = 256,
  19193. i.height = 256;
  19194. var o = "Arial"
  19195. , a = 60;
  19196. n.font = "bold " + a + "px " + o,
  19197. n.fillStyle = "white";
  19198. var s = n.measureText(e).width;
  19199. n.fillText(e, (i.width - s) / 2, (i.height + a) / 2);
  19200. var l = new r.Texture(i);
  19201. l.needsUpdate = !0;
  19202. var c = new r.SpriteMaterial({
  19203. map: l,
  19204. color: t || 16428055
  19205. });
  19206. this.text3d = new r.Sprite(c),
  19207. this.text3d.position.copy(this.skyboxMesh.position),
  19208. this.floor.add(this.text3d)
  19209. }
  19210. ,
  19211. n.prototype.removeTextSprite = function() {
  19212. this.text3d && (this.floor.remove(this.text3d),
  19213. this.text3d = null)
  19214. }
  19215. ,
  19216. n.prototype.isAligned = function() {
  19217. return this.alignmentType === l.ALIGNED
  19218. }
  19219. ,
  19220. n.filters = {
  19221. inDirection: function(e, t, i) {
  19222. return function(n) {
  19223. var r = n.position.clone().sub(e).normalize();
  19224. return r.dot(t) > i
  19225. }
  19226. },
  19227. inFloorDirection: function(e, t, i) {
  19228. return function(n) {
  19229. var r = n.floorPosition.clone().sub(e).normalize();
  19230. return r.dot(t) > i
  19231. }
  19232. },
  19233. inPanoDirection: function(e, t, i) {
  19234. return i = a.navigation.panoScores ? a.navigation.filterStrictness : i,
  19235. function(n) {
  19236. var r = n.floorPosition.clone().sub(e).normalize()
  19237. , o = n.position.clone().sub(e).normalize();
  19238. return r.dot(t) > i || o.dot(t) > i
  19239. }
  19240. },
  19241. atFloor: function(e) {
  19242. return function(t) {
  19243. return !e || t.floor === e
  19244. }
  19245. },
  19246. not: function(e) {
  19247. return function(t) {
  19248. return t !== e
  19249. }
  19250. },
  19251. notIn: function(e) {
  19252. return function(t) {
  19253. return e.indexOf(t) === -1
  19254. }
  19255. },
  19256. isLoaded: function() {
  19257. return function(e) {
  19258. return e.isLoaded()
  19259. }
  19260. },
  19261. isNotLoaded: function() {
  19262. return function(e) {
  19263. return !e.isLoaded()
  19264. }
  19265. },
  19266. isCloseEnoughTo: function(e, t) {
  19267. return function(i) {
  19268. return e.distanceTo(i.floorPosition) < t
  19269. }
  19270. },
  19271. hasMinimumHeightDifferenceTo: function(e, t) {
  19272. return function(i) {
  19273. return Math.abs(i.position.y - e.y) > t
  19274. }
  19275. },
  19276. isNotBehindNormal: function(e, t) {
  19277. var i = new r.Vector3;
  19278. return t = t.clone(),
  19279. function(n) {
  19280. var r = i.copy(n.position).sub(e).normalize();
  19281. return r.dot(t) > 0
  19282. }
  19283. },
  19284. isNeighbourPanoTo: function(e) {
  19285. return function(t) {
  19286. return !e || !e.neighbourPanos || !!e.neighbourPanos[t.id]
  19287. }
  19288. },
  19289. isNeighbourOfNeighbourTo: function(e) {
  19290. return function(t) {
  19291. return !!e.neighbourPanos[t.id] || e.neighbourUUIDs.some(function(i) {
  19292. var n = e.model.panos.get(i);
  19293. return !!n && n.neighbourPanos[t.id]
  19294. })
  19295. }
  19296. },
  19297. isNotRecentlyFailed: function(e) {
  19298. return function(t) {
  19299. return Date.now() - t.failedLoadingAt > e
  19300. }
  19301. },
  19302. isOnVisibleFloor: function() {
  19303. return function(e) {
  19304. return !e.floor.hidden
  19305. }
  19306. },
  19307. isPanoAligned: function() {
  19308. return function(e) {
  19309. return e.isAligned()
  19310. }
  19311. }
  19312. },
  19313. n.sortFunctions = {
  19314. distanceToPoint: function(e) {
  19315. return function(t, i) {
  19316. return t.position.distanceTo(e) - i.position.distanceTo(e)
  19317. }
  19318. },
  19319. floorDistanceToPoint: function(e) {
  19320. return function(t, i) {
  19321. return t.floorPosition.distanceTo(e) - i.floorPosition.distanceTo(e)
  19322. }
  19323. },
  19324. choose: function(e) {
  19325. return function(t, i) {
  19326. return e.id === t.id ? -1 : e.id === i.id ? 1 : 0
  19327. }
  19328. }
  19329. },
  19330. n.scoreFunctions = {
  19331. distance: function(e, t) {
  19332. return t = t || a.navigation.distanceFactor,
  19333. function(i) {
  19334. return e ? e.position.distanceTo(i.position) * t : 0
  19335. }
  19336. },
  19337. distanceSquared: function(e, t) {
  19338. return t = t || a.navigation.distanceFactor,
  19339. function(i) {
  19340. return e ? e.position.distanceToSquared(i.position) * t : 0
  19341. }
  19342. },
  19343. direction: function(e, t) {
  19344. return function(i) {
  19345. var n = i.position.clone().sub(e).normalize();
  19346. return n.dot(t) * a.navigation.directionFactor
  19347. }
  19348. },
  19349. angle: function(e, t) {
  19350. return function(i) {
  19351. var n = i.position.clone().sub(e).normalize();
  19352. return n.angleTo(t) * a.navigation.angleFactor
  19353. }
  19354. },
  19355. inFieldOfView: function(e, t) {
  19356. return function(i) {
  19357. var n = i.position.clone().sub(e).normalize();
  19358. return n.dot(t) > .75 ? 10 : -1
  19359. }
  19360. },
  19361. optionality: function(e) {
  19362. return function(t) {
  19363. var i = t.neighbourUUIDs.filter(function(t) {
  19364. return !(t in e.neighbourUUIDs) && t !== e.id
  19365. });
  19366. return i.length * a.navigation.optionalityFactor
  19367. }
  19368. },
  19369. penalizeHeightDifferenceUnder: function(e, t) {
  19370. return function(i) {
  19371. return e.y - i.position.y < t ? -20 : 0
  19372. }
  19373. }
  19374. },
  19375. t.exports = n
  19376. }
  19377. ).call(this, "/js/objects/Panorama.js")
  19378. }
  19379. , {
  19380. "../enum/AlignmentType": 17,
  19381. "../enum/GLCubeFaces": 25,
  19382. "../enum/PanoRendererEvents": 35,
  19383. "../enum/PanoSizeClass": 36,
  19384. "../enum/PanoramaEvents": 37,
  19385. "../enum/RenderLayers": 41,
  19386. "../enum/RenderOrder": 42,
  19387. "../enum/TileDownloaderEvents": 45,
  19388. "../enum/Viewmode": 51,
  19389. "../exception/BasicException": 55,
  19390. "../scene/SceneRenderer": 158,
  19391. "../settings": 166,
  19392. "../tile/TileUtils": 174,
  19393. "../util/ajax": 181,
  19394. "../util/common": 185,
  19395. "../util/lerp": 188,
  19396. "../util/logger": 189,
  19397. "../util/panorama": 191,
  19398. "../util/texture": 194,
  19399. "../util/transitions": 195,
  19400. events: 202,
  19401. three: 217
  19402. }],
  19403. 149: [function(e, t, i) {
  19404. "use strict";
  19405. function n(e) {
  19406. var t = r.UniformsUtils.clone(c.waypoint.uniforms);
  19407. t.map.value = d,
  19408. t.opacity.value = 0,
  19409. t.color.value.set(o.reticuleColor),
  19410. t.showMouseMarker = !window.DATA.hideMouseMarker;
  19411. r.Mesh.call(this, new r.PlaneBufferGeometry(.4,.4,1,1), new r.RawShaderMaterial({
  19412. side: r.DoubleSide,
  19413. depthWrite: !1,
  19414. depthTest: !1,
  19415. transparent: !0,
  19416. vertexShader: c.waypoint.vertexShader,
  19417. fragmentShader: c.waypoint.fragmentShader,
  19418. uniforms: t,
  19419. name: "waypoint",
  19420. opacity: 0,
  19421. visible: t.showMouseMarker // 显示/隐藏鼠标标志
  19422. })),
  19423. this.layers.set(h.RETICULE),
  19424. this.renderOrder = u.reticule,
  19425. this.player = e,
  19426. this.direction = new r.Vector3,
  19427. this.hidden = !0,
  19428. this.mouseLastMoveTime = Date.now()
  19429. }
  19430. var r = e("three")
  19431. , o = e("../settings")
  19432. , a = e("../util/transitions")
  19433. , s = e("../util/texture")
  19434. , l = e("../util/lerp")
  19435. , c = e("../shaders")
  19436. , h = e("../enum/RenderLayers")
  19437. , u = e("../enum/RenderOrder")
  19438. , d = s.load("static/images/reticule-256x256.png");
  19439. d.anisotropy = browser.isMobile() ? 1 : 4; //各向异性
  19440. n.prototype = Object.create(r.Mesh.prototype),
  19441. n.prototype.move = function(e, t, i) {
  19442. this.hidden = i,
  19443. this.mouseLastMoveTime = Date.now()
  19444. }
  19445. ,
  19446. n.prototype.hide = function() {
  19447. this.hidden || (this.hidden = !0,
  19448. a.start(l.property(this.material.uniforms.opacity, "value", 0), o.reticuleOpacityTransitionTime))
  19449. }
  19450. ,
  19451. n.prototype.show = function() {
  19452. this.hidden = !1,
  19453. this.material.opacity <= 0 && a.start(l.property(this.material.uniforms.opacity, "value", o[this.player.mode].reticuleOpacity), o.reticuleOpacityTransitionTime)
  19454. }
  19455. ,
  19456. n.prototype.update = function() {
  19457. Date.now() - this.mouseLastMoveTime > o.hideReticuleTimeout && !this.hidden && this.hide()
  19458. }
  19459. ,
  19460. n.prototype.updatePosition = function(e, t) {
  19461. if (!this.hidden) {
  19462. if (!t)
  19463. return this.hide();
  19464. var i = t.point
  19465. , n = e.distanceTo(i)
  19466. , r = 1 + .01 * n;
  19467. n < 1 && (r -= 1 - n),
  19468. this.show(),
  19469. this.scale.set(r, r, r),
  19470. this.direction = this.direction.multiplyScalar(.8),
  19471. this.direction.add(t.face.normal.clone().multiplyScalar(.2)),
  19472. this.position.copy(i).add(t.face.normal.clone().multiplyScalar(.01)),
  19473. this.lookAt(this.position.clone().add(this.direction))
  19474. }
  19475. }
  19476. ,
  19477. n.prototype.writeAstag = function() {
  19478. var e = Math.floor(4294967296 * (1 + Math.random())).toString(16) + Math.floor(16 * (1 + Math.random())).toString(16)
  19479. , t = new Date;
  19480. this.tagCount = "undefined" == typeof this.tagCount ? 1 : this.tagCount + 1;
  19481. var i = {
  19482. enabled: !0,
  19483. version: "0",
  19484. created: t.toISOString(),
  19485. created_by: "APITest",
  19486. position: this.position.clone(),
  19487. stem: {
  19488. enabled: o.tags.pole.enabled,
  19489. direction: this.direction.multiplyScalar(o.tags.pole.height)
  19490. },
  19491. label: "tag " + this.tagCount,
  19492. description: "Description " + e,
  19493. floor: function(e) {
  19494. if (e.currentFloor) {
  19495. var t = e.floors.indexOf(e.currentFloor);
  19496. return t > -1 ? t : void 0
  19497. }
  19498. }(this.player.model),
  19499. type: "info",
  19500. metadata: {
  19501. preferred_camera: {
  19502. mode: this.player.mode
  19503. }
  19504. }
  19505. };
  19506. console.log("--------------------------"),
  19507. console.log(JSON.stringify(i));
  19508. var n = this.player.model.addtag(e, i).build();
  19509. n && (n.disc && this.player.tagDiscs.push(n.disc),
  19510. n.visible || n.show(o.tags.startup.fadeInDuration))
  19511. }
  19512. ,
  19513. t.exports = n
  19514. }
  19515. , {
  19516. "../enum/RenderLayers": 41,
  19517. "../enum/RenderOrder": 42,
  19518. "../settings": 166,
  19519. "../shaders": 167,
  19520. "../util/lerp": 188,
  19521. "../util/texture": 194,
  19522. "../util/transitions": 195,
  19523. three: 217
  19524. }],
  19525. 150: [function(e, t, i) {
  19526. "use strict";
  19527. function n(e, t) {
  19528. this.chunks = [],
  19529. this.floorId = e,
  19530. this.roomId = t,
  19531. this.position = new r.Vector3
  19532. }
  19533. var r = e("three");
  19534. n.prototype.addChunk = function(e) {
  19535. this.chunks.push(e)
  19536. }
  19537. ,
  19538. n.prototype.calcBoundaries = function() {
  19539. 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++) {
  19540. var s = this.chunks[a]
  19541. , l = s.geometry.attributes.position;
  19542. if (l)
  19543. for (var c = 0; c < l.array.length; c += 3)
  19544. e.set(l.array[c], l.array[c + 1], l.array[c + 2]),
  19545. t.add(e),
  19546. 0 === c ? (i.copy(e),
  19547. n.copy(e)) : (i.max(e),
  19548. n.min(e)),
  19549. o++
  19550. }
  19551. o > 0 ? (t.multiplyScalar(1 / o),
  19552. this.average = t) : this.average = null,
  19553. this.boundsMax = i,
  19554. this.boundsMin = n,
  19555. this.center = new r.Vector3,
  19556. this.center.copy(i).sub(n).multiplyScalar(.5).add(n)
  19557. }
  19558. ,
  19559. t.exports = n
  19560. }
  19561. , {
  19562. three: 217
  19563. }],
  19564. 151: [function(e, t, i) {
  19565. (function(i) {
  19566. "use strict";
  19567. function n(e, t, i) {
  19568. this.obj3d = null,
  19569. this.nodes = [],
  19570. this.colorHull = [],
  19571. this.shortPaths = {},
  19572. this.floorHull = null,
  19573. this.cameraHull = null,
  19574. this.floorPathDistance = 0,
  19575. this.floorCurvePoints = null,
  19576. this.floorCurveColors = null,
  19577. this.camCurvePoints = null,
  19578. this.warpDestHeroLoc = null,
  19579. this.warpDestPano = null,
  19580. this.warpPathPoints = null,
  19581. this.warpPathLengths = [0],
  19582. this.warpLength = 0,
  19583. this.closeWarpDistance = 4,
  19584. this.UP = A.UP.clone(),
  19585. this.longestStep = 0,
  19586. this.upcomingTransType = null,
  19587. this.burnsDir = 1, //导览在DOLLHOUSE停留时的旋转方向 1 或 -1
  19588. this.prevNextDist = 0,
  19589. this.nextI = 0,
  19590. this.activeTransType = null,
  19591. this.lastTransType = null,
  19592. this.bunnyObj = null,
  19593. this.director = e,
  19594. this.player = t,
  19595. this.playerControls = i,
  19596. this.modelManager = t.modelManager,
  19597. this.updateModel(),
  19598. this.updateDefaultsFromModelData(),
  19599. this.bindEvents(),
  19600. this.warping = !1,
  19601. this.waitingToWarp = !1,
  19602. this.warpInterrupted = !1,
  19603. this.warpInterruptionBlackoutStyle = null,
  19604. this.warpInterruptionTravelTime = null
  19605. }
  19606. var r = e("three")
  19607. , o = e("../util/logger")
  19608. , a = e("../enum/Viewmode")
  19609. , s = e("../enum/RenderOrder")
  19610. , l = e("../enum/WarpStyle")
  19611. , c = e("../settings")
  19612. , h = e("../util/math")
  19613. , u = e("../util/lerp")
  19614. , d = e("../util/easing")
  19615. , p = e("../util/transitions")
  19616. , f = e("../objects/Snapshot")
  19617. , g = e("../effects")
  19618. , m = e("../shaders")
  19619. , v = (e("../gui/gui"),
  19620. e("../util/texture"))
  19621. , A = e("../enum/Vectors")
  19622. , y = (e("../model/ModelManager"),
  19623. new o(i))
  19624. , C = e("../enum/PlayerEvents")
  19625. , I = e("../enum/BlackoutStyle")
  19626. , E = e("../enum/ModelManagerEvents")
  19627. , b = e("../constants")
  19628. , w = {
  19629. 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"),
  19630. pathEnd: v.load("static/images/End.png"),
  19631. 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==")
  19632. };
  19633. n.prototype.setScene = function(e) {
  19634. this.createCpm(e),
  19635. this.createBunnyObj(e)
  19636. }
  19637. ,
  19638. n.prototype.updateModel = function() {
  19639. this.model = this.modelManager.getActiveModel()
  19640. }
  19641. ,
  19642. n.prototype.bindEvents = function() {
  19643. this.modelManager.on(E.ActiveModelChanged, this.updateModel.bind(this))
  19644. }
  19645. ,
  19646. n.prototype.updateDefaultsFromModelData = function() {
  19647. this.model.data
  19648. }
  19649. ,
  19650. n.prototype.pointPathDistance = function(e) {
  19651. for (var t = 0, i = 1; i < e.length; i += 1)
  19652. t += e[i - 1].distanceTo(e[i]);
  19653. return t
  19654. }
  19655. ,
  19656. n.prototype.pointPathLengths = function(e) {
  19657. for (var t = [0], i = 1; i < e.length; i += 1)
  19658. t.push(t[i - 1] + e[i - 1].distanceTo(e[i]));
  19659. return t
  19660. }
  19661. ,
  19662. n.prototype.interpAlongPath = function(e, t, i) {
  19663. var n, o = new r.Vector3, a = t[t.length - 1];
  19664. if (i < 1) {
  19665. n = i * a;
  19666. for (var s = 1; s < t.length; s += 1)
  19667. if (t[s] > n) {
  19668. var l = (n - t[s - 1]) / (t[s] - t[s - 1]);
  19669. return o.copy(e[s]),
  19670. o.sub(e[s - 1]),
  19671. o.multiplyScalar(l),
  19672. o.add(e[s - 1]),
  19673. o
  19674. }
  19675. } else
  19676. o.copy(e[e.length - 1]);
  19677. return o
  19678. }
  19679. ,
  19680. n.prototype.pathHeight = function() {
  19681. return this.player.mode !== a.FLOORPLAN ? c.path.height : c.path.outsideHeight
  19682. }
  19683. ,
  19684. n.prototype.createBunnyObj = function(e) {
  19685. this.bunnyObj || (this.bunnyObj = new r.AxisHelper(.1),
  19686. this.bunnyObj.visible = c.warp.showBunny),
  19687. this.bunnyObj.parent && this.bunnyObj.parent.remove(bunnyObj),
  19688. e.add(this.bunnyObj)
  19689. }
  19690. ,
  19691. n.prototype.createCpm = function(e) {
  19692. if (!this.currentPanoMarker) {
  19693. var t = this.makeWaypointObj(w.pathEnd, "Current");
  19694. t.material.uniforms.opacity.value = 0,
  19695. this.currentPanoMarker = {
  19696. mesh: t,
  19697. placed: !1
  19698. }
  19699. }
  19700. this.currentPanoMarker.mesh.parent && this.currentPanoMarker.mesh.parent.remove(this.currentPanoMarker.mesh),
  19701. this.placeCpm(),
  19702. this.currentPanoMarker.mesh.parent || e.add(this.currentPanoMarker.mesh)
  19703. }
  19704. ,
  19705. n.prototype.placeCpm = function() {
  19706. if (c.path.mapGuides && this.player.currentPano && this.player.currentPano.isAligned()) {
  19707. var e = this.player.currentPano.floor;
  19708. this.currentPanoMarker.mesh.parent !== this.player.currentPano.floor && (this.currentPanoMarker.mesh.parent && this.currentPanoMarker.mesh.parent.remove(this.currentPanoMarker.mesh),
  19709. e.add(this.currentPanoMarker.mesh)),
  19710. this.currentPanoMarker.mesh.position.copy(this.player.currentPano.floorPosition).sub(e.position),
  19711. this.currentPanoMarker.mesh.position.y += this.pathHeight(),
  19712. this.currentPanoMarker.placed = !0
  19713. } else
  19714. this.popOutCpm()
  19715. }
  19716. ,
  19717. n.prototype.fadeInCpm = function(e) {
  19718. 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)
  19719. }
  19720. ,
  19721. n.prototype.fadeOutCpm = function(e) {
  19722. p.start(u.property(this.currentPanoMarker.mesh.material.uniforms.opacity, "value", 0), e)
  19723. }
  19724. ,
  19725. n.prototype.popInCpm = function() {
  19726. c.path.mapGuides && this.currentPanoMarker.placed && this.fadeInCpm(2)
  19727. }
  19728. ,
  19729. n.prototype.popOutCpm = function() {
  19730. this.fadeOutCpm(2)
  19731. }
  19732. ,
  19733. n.prototype.brushPrefs = {
  19734. linewidth: 7,
  19735. strokeWidth: 15,
  19736. cvSegments: 48,
  19737. paveStep: .1,
  19738. paveWidth: .2,
  19739. lookBlendDist: 3,
  19740. maxTurn: r.Math.degToRad(2)
  19741. },
  19742. n.prototype.panoPathDistance = function(e) {
  19743. var t = this.model.panos;
  19744. if (!e || e.length < 2)
  19745. return 0;
  19746. for (var i = [], n = 0; n < e.length; n += 1)
  19747. i.push(t.get(e[n]).floorPosition);
  19748. return this.pointPathDistance(i)
  19749. }
  19750. ,
  19751. n.prototype.loadTileTexture = function(e) {
  19752. var t = v.load(e, function(t) {
  19753. t.wrapS = r.RepeatWrapping,
  19754. t.wrapT = r.RepeatWrapping,
  19755. t.needsUpdate = !0,
  19756. y.debug('path texture "' + e + '" is ready')
  19757. }, function() {
  19758. y.error('path texture "' + e + '" failed')
  19759. });
  19760. return t.mapping = r.UVMapping,
  19761. t
  19762. }
  19763. ,
  19764. n.prototype.buildWarpDestinationDescriptor = function(e, t, i, n, r, o) {
  19765. var a = {
  19766. cameraMode: n,
  19767. position: e,
  19768. quaternion: t,
  19769. panoId: i,
  19770. orthoZoom: o,
  19771. floorVisibility: r,
  19772. thumbUrl: null,
  19773. name: null
  19774. };
  19775. return new f(a)
  19776. }
  19777. ,
  19778. n.prototype.buildWarpDestinationDescriptorFromHero = function(e) {
  19779. return this.buildWarpDestinationDescriptor(e.position, e.quaternion, this.getHeroId(e), e.cameraMode, e.floorVisibility, e.orthoZoom)
  19780. }
  19781. ,
  19782. n.prototype.setWarpDestination = function(e) {
  19783. this.warpDestHeroLoc = e
  19784. }
  19785. ,
  19786. n.prototype.setWarpDestinationByHeroIndex = function(e) {
  19787. var t = this.getHeroDescriptorByHeroIndex(e);
  19788. return null !== t && (this.setWarpDestination(t),
  19789. !0)
  19790. }
  19791. ,
  19792. n.prototype.setWarpDestinationByPano = function(e, t) {
  19793. var i = this.model.panos.get(e.id);
  19794. return !!i && this.setWarpDestinationByPanoId(e.id, t)
  19795. }
  19796. ,
  19797. n.prototype.setWarpDestinationByPanoId = function(e, t) {
  19798. var i = this.model.panos.get(e);
  19799. if (i) {
  19800. t = t || new r.Quaternion;
  19801. var n = this.buildWarpDestinationDescriptor(i.position, t, i.id, "panorama", [], -1);
  19802. return this.setWarpDestination(n),
  19803. !0
  19804. }
  19805. return !1
  19806. }
  19807. ,
  19808. n.prototype.getHeroDescriptorByHeroIndex = function(e) {
  19809. var t = this.model.heroCount();
  19810. /* if (null !== this.warpDestHeroLoc && t < 2)
  19811. return y.info("ShowPath.getHeroDescriptorByHeroIndex() -> Only one hero location is available."),
  19812. this.model.getHeroDescriptorByIndex(0); */
  19813. var i = this.model.getHeroDescriptorByIndex(e);
  19814. if (i) {
  19815. var n = i.isPano() ? i.panoId : i.cameraMode;
  19816. y.debug('ShowPath.getHeroDescriptorByHeroIndex() -> New brush/warp destination: "' + n + '" out of ' + t + " choices.")
  19817. }
  19818. return i
  19819. }
  19820. ,
  19821. n.prototype.getHeroDescriptorByPano = function(e) {
  19822. var t = this.model.panos.get(e.id);
  19823. return t ? this.getHeroDescriptorByPanoId(e.id) : null
  19824. }
  19825. ,
  19826. n.prototype.getHeroDescriptorByPanoId = function(e) {
  19827. var t = this.getHeroIndexFromPanoId(e);
  19828. return this.getHeroDescriptorByHeroIndex(t)
  19829. }
  19830. ,
  19831. n.prototype.getHeroIndexFromPanoId = function(e) {
  19832. for (var t = 0; t < this.model.heroLocations.length; t++) {
  19833. var i = this.model.heroLocations[t]
  19834. , n = this.getHeroId(i);
  19835. if (n && n === e)
  19836. return t
  19837. }
  19838. return -1
  19839. }
  19840. ,
  19841. n.prototype.getHeroPano = function(e) {
  19842. if (null === e)
  19843. return y.warn("getHeroPano(): no destination"),
  19844. null;
  19845. var t = this.getHeroId(e)
  19846. , i = this.model.panos.get(t);
  19847. return void 0 === i && (i = null,
  19848. "" !== t && y.debug('unable to find pano "' + t + '"')),
  19849. i
  19850. }
  19851. ,
  19852. n.prototype.getHeroId = function(e) {
  19853. return e.panoId
  19854. }
  19855. ,
  19856. n.prototype.setWarpDestPano = function() {
  19857. return this.warpDestPano = this.getHeroPano(this.warpDestHeroLoc),
  19858. this.warpDestPano
  19859. }
  19860. ,
  19861. n.prototype.brushToWarpPano = function(e, t) {
  19862. if (this.discardPathObject(),
  19863. !this.setWarpDestPano())
  19864. return !1;
  19865. if (this.warpDestHeroLoc.cameraMode !== a.PANORAMA && y.warn("Can only brush from pano to pano"),
  19866. !this.warpDestPano)
  19867. return y.info("No brush"),
  19868. !1;
  19869. if (!this.player.currentPano)
  19870. return y.debug("No current pano, visibility undefined"),
  19871. !1;
  19872. if (!this.warpDestPano)
  19873. return y.info("No wPano, visibility undefined"),
  19874. !1;
  19875. if (!this.warpDestPano.isAligned())
  19876. return y.debug("Cannot brush to unaligned pano"),
  19877. !1;
  19878. var i = (e === l.STD || e === l.WALK) && c.path.mapGuides
  19879. , n = !0;
  19880. if (this.player.currentPano.id === this.warpDestPano.id)
  19881. y.debug("Already at destination pano");
  19882. else {
  19883. this.nodes = this.findShortestPath(this.player.currentPano, this.warpDestPano),
  19884. n = void 0 === this.nodes || null === this.nodes || this.nodes.length < 1,
  19885. this.obj3d = new r.Object3D,
  19886. y.debug('Brushing from "' + this.player.currentPano.id + '" to "' + this.warpDestPano.id + '" (' + (this.nodes ? this.nodes.length : 0) + ")"),
  19887. n ? (y.info('No "walkable" route, using fall-back warp style transition'),
  19888. e = t) : (this.setPathHulls(this.nodes),
  19889. this.setFloorCurves(),
  19890. 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)))),
  19891. this.player.currentPano.floor.add(this.obj3d);
  19892. var o = this.player.mode === a.DOLLHOUSE || this.player.mode === a.FLOORPLAN
  19893. , s = e === l.STD;
  19894. if (!n && (i || s)) {
  19895. if (o) {
  19896. var h = this.makeStartMarker(this.floorHull[0], this.floorCurvePoints);
  19897. this.obj3d.add(h)
  19898. }
  19899. var u = this.makeEndMarker(this.floorHull[this.floorHull.length - 1]);
  19900. this.obj3d.add(u)
  19901. }
  19902. this.appearSlow()
  19903. }
  19904. return this.upcomingTransType = e,
  19905. !n
  19906. }
  19907. ,
  19908. n.prototype.findShortestPath = function(e, t) {
  19909. if (!e || !t)
  19910. return null;
  19911. var i = c.warp.walkExtraPanosDistance
  19912. , n = e.id + ":" + t.id + ":" + i;
  19913. if (this.shortPaths.hasOwnProperty(n))
  19914. return this.shortPaths[n] ? this.shortPaths[n].slice() : null;
  19915. var r = t.id + ":" + e.id + ":" + i;
  19916. if (this.shortPaths.hasOwnProperty(r))
  19917. return this.shortPaths[r] ? this.shortPaths[r].slice().reverse() : null;
  19918. var o = this.model.panos.aStarSearch(e, t);
  19919. return this.model.panos.includeNodesNearPath(o, i),
  19920. this.shortPaths[n] = o ? o.slice() : null,
  19921. o
  19922. }
  19923. ,
  19924. n.prototype.makePathHulls = function(e) {
  19925. var t, i, n, r, o, a = 0, s = [], l = [], h = [], u = this.model.panos;
  19926. t = u.get(e[0]),
  19927. r = t.floor.floorIndex;
  19928. for (var d = 0; d < e.length; d += 1)
  19929. t = u.get(e[d]),
  19930. i = t.floorPosition.clone().sub(this.model.position),
  19931. i.y += this.pathHeight(),
  19932. s.push(i),
  19933. l.push(t.position.clone()),
  19934. n = t.floor.floorIndex,
  19935. h.push(n > r ? c.path.colorUp : n < r ? c.path.colorDown : c.path.color),
  19936. d > 0 && (o = l[d].distanceTo(l[d - 1]),
  19937. o > a && (a = o));
  19938. return a > this.longestStep && (this.longestStep = a,
  19939. y.debug("path contains " + a + " meter segment")),
  19940. {
  19941. floor: s,
  19942. camera: l,
  19943. color: h
  19944. }
  19945. }
  19946. ,
  19947. n.prototype.makeFloorCurves = function(e, t, i) {
  19948. var n = this.player.mode === a.PANORAMA ? c.path.waypointIndoorRadius : c.path.waypointRadius
  19949. , o = this.pointPathDistance(e) - 2 * n
  19950. , s = e.slice(0)
  19951. , l = s[1].clone().sub(s[0]);
  19952. l.y = 0,
  19953. l.normalize().multiplyScalar(n),
  19954. s[0] = (new r.Vector3).copy(s[0]).add(l),
  19955. l = s[s.length - 2].clone().sub(s[s.length - 1]),
  19956. l.y = 0,
  19957. l.normalize().multiplyScalar(n),
  19958. s[s.length - 1] = (new r.Vector3).copy(s[s.length - 1]).add(l);
  19959. var h = new r.CatmullRomCurve3(s)
  19960. , u = Math.floor(o / i);
  19961. u = 4 * Math.floor(u / 4),
  19962. u = Math.max(4, u);
  19963. for (var d, p, f, g = h.getSpacedPoints(u), m = [], v = new r.Vector3, A = 0; A < g.length; A += 1) {
  19964. f = 0,
  19965. d = g[A].distanceTo(e[0]);
  19966. for (var y = 1; y < e.length; y += 1)
  19967. v.copy(g[A]).sub(e[y]),
  19968. v.y *= 4,
  19969. p = v.length(),
  19970. p < d && (f = y);
  19971. m.push(t[f])
  19972. }
  19973. return {
  19974. distance: o,
  19975. points: g,
  19976. colors: m
  19977. }
  19978. }
  19979. ,
  19980. n.prototype.makeCameraCurvePoints = function(e, t) {
  19981. var i = this.pointPathDistance(e)
  19982. , n = new r.CatmullRomCurve3(e);
  19983. return n.getSpacedPoints(Math.max(2, Math.floor(i / t)))
  19984. }
  19985. ,
  19986. n.prototype.makeCameraCurveTangents = function(e, t) {
  19987. var i = this.pointPathDistance(e)
  19988. , n = new r.CatmullRomCurve3(e)
  19989. , o = Math.max(2, Math.floor(i / t));
  19990. o || (o = 5);
  19991. for (var a = [], s = 0; s <= o; s++)
  19992. a.push(n.getTangentAt(s / o));
  19993. return a
  19994. }
  19995. ,
  19996. n.prototype.setPathHulls = function(e) {
  19997. var t = this.makePathHulls(e);
  19998. this.floorHull = t.floor,
  19999. this.cameraHull = t.camera,
  20000. this.colorHull = t.color
  20001. }
  20002. ,
  20003. n.prototype.setFloorCurves = function() {
  20004. var e = this.makeFloorCurves(this.floorHull, this.colorHull, this.brushPrefs.paveStep);
  20005. this.floorPathDistance = e.distance,
  20006. this.floorCurvePoints = e.points,
  20007. this.floorCurveColors = e.colors
  20008. }
  20009. ,
  20010. n.prototype.setCameraCurvePoints = function() {
  20011. this.camCurvePoints = this.makeCameraCurvePoints(this.cameraHull, c.warp.stepFactor * this.brushPrefs.paveStep)
  20012. }
  20013. ,
  20014. n.prototype.chooseWarpPath = function(e) {
  20015. var t, i, n, o = this.playerControls.cameras[a.PANORAMA];
  20016. if (this.player.currentPano === this.warpDestPano || !e)
  20017. return this.warpPathPoints = null,
  20018. this.warpLength = 0,
  20019. !1;
  20020. this.nodes = this.findShortestPath(this.player.currentPano, this.warpDestPano),
  20021. void 0 === this.nodes || null === this.nodes || this.nodes.length < 1 ? (y.debug("warp path to unreachable node"),
  20022. t = this.warpDestPano.position.clone().sub(o.position),
  20023. i = t.clone().negate(),
  20024. t.multiplyScalar(.15).add(o.position),
  20025. i.multiplyScalar(.15).add(this.warpDestPano.position),
  20026. t.y = o.position.y,
  20027. i.y = this.warpDestPano.position.y,
  20028. n = new r.CubicBezierCurve3(o.position.clone(),t,i,this.warpDestPano.position.clone()),
  20029. this.warpPathPoints = n.getSpacedPoints(this.brushPrefs.cvSegments)) : (y.debug("follow warp path (path distance was " + this.nodes.length + " nodes, " + this.floorPathDistance + ")"),
  20030. this.setCameraCurvePoints(),
  20031. this.warpPathPoints = this.camCurvePoints.slice(0)),
  20032. this.warpLength = 0,
  20033. this.warpPathLengths = [0];
  20034. 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) {
  20035. s.copy(this.warpPathPoints[d - 1]).sub(this.warpPathPoints[d]);
  20036. var p = s.length();
  20037. s.y *= c.warp.climbEffort;
  20038. var f = s.length() / p;
  20039. if (d > 1) {
  20040. s.setY(0).normalize(),
  20041. l.copy(this.warpPathPoints[d - 2]).sub(this.warpPathPoints[d - 1]).setY(0).normalize();
  20042. var g = Math.min(1, s.dot(l))
  20043. , m = 1 + (c.warp.brakeStrength - 1) * (1 - r.Math.smoothstep(g, u, h));
  20044. f = Math.max(m, f)
  20045. }
  20046. this.warpLength += p * f,
  20047. this.warpPathLengths[d] = this.warpLength
  20048. }
  20049. return !0
  20050. }
  20051. ,
  20052. n.prototype.drawPathRibbon = function(e, t) {
  20053. this.bunnyObj.visible = c.warp.showBunny;
  20054. 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) {
  20055. h.copy(e[u]),
  20056. 0 === u ? h.sub(e[u + 1]) : h.sub(e[u - 1]).negate(),
  20057. h.normalize(),
  20058. n.crossVectors(h, A.UP),
  20059. n.multiplyScalar(i);
  20060. var d = (new r.Vector3).copy(e[u]).add(o);
  20061. d.sub(n),
  20062. l.vertices.push(d),
  20063. d = (new r.Vector3).copy(e[u]).add(o),
  20064. d.add(n),
  20065. l.vertices.push(d)
  20066. }
  20067. var p, f = 0;
  20068. for (u = 0; u < e.length - 1; u += 1) {
  20069. var g = 2 * u
  20070. , v = f;
  20071. f += e[u + 1].distanceTo(e[u]);
  20072. var y = f
  20073. , C = t[u]
  20074. , I = t[u + 1];
  20075. p = new r.Face3(g,g + 1,g + 2),
  20076. p.vertexColors = [new r.Color(C), new r.Color(C), new r.Color(I)],
  20077. l.faces.push(p),
  20078. l.faceVertexUvs[0].push([new r.Vector2(0,v), new r.Vector2(1,v), new r.Vector2(0,y)]),
  20079. p = new r.Face3(g + 2,g + 1,g + 3),
  20080. p.vertexColors = [new r.Color(I), new r.Color(C), new r.Color(I)],
  20081. l.faces.push(p),
  20082. l.faceVertexUvs[0].push([new r.Vector2(0,y), new r.Vector2(1,v), new r.Vector2(1,y)])
  20083. }
  20084. l.computeFaceNormals(),
  20085. l.computeVertexNormals();
  20086. var E, b;
  20087. this.player.mode === a.PANORAMA ? (b = r.UniformsUtils.clone(m.ribbon.uniforms),
  20088. b.map.value = w.path,
  20089. b.opacity.value = 0,
  20090. b.color.value.set(c.path.color),
  20091. E = new r.RawShaderMaterial({
  20092. side: r.DoubleSide,
  20093. depthWrite: !1,
  20094. transparent: !0,
  20095. vertexShader: m.ribbon.vertexShader,
  20096. fragmentShader: m.ribbon.fragmentShader,
  20097. uniforms: b,
  20098. name: "ribbonT",
  20099. opacity: 0
  20100. })) : E = new r.MeshBasicMaterial({
  20101. color: 16777215,
  20102. side: r.DoubleSide,
  20103. name: "ribbonOut",
  20104. vertexColors: r.VertexColors
  20105. });
  20106. var _ = new r.Mesh(l,E);
  20107. return _.name = "ribbon",
  20108. this.player.mode === a.PANORAMA && (_.renderOrder = s.ribbon),
  20109. _
  20110. }
  20111. ,
  20112. n.prototype.drawPathPavement = function(e) {
  20113. for (var t, i = .25, n = new r.Vector3, o = new r.Geometry, s = new r.Vector3, l = 0; l < e.length; l += 1)
  20114. s.copy(e[l]),
  20115. 0 === l ? s.sub(e[l + 1]).negate() : s.sub(e[l - 1]),
  20116. s.normalize(),
  20117. n.crossVectors(s, A.UP),
  20118. n.multiplyScalar(this.brushPrefs.paveWidth),
  20119. t = (new r.Vector3).copy(e[l]),
  20120. t.sub(n),
  20121. o.vertices.push(t),
  20122. o.vertices.push((new r.Vector3).copy(e[l])),
  20123. t = (new r.Vector3).copy(e[l]),
  20124. t.add(n),
  20125. o.vertices.push(t);
  20126. var h, u, d;
  20127. for (l = 0; l < e.length - 1; l += 1)
  20128. h = 3 * l + 1,
  20129. u = l * i,
  20130. d = u + i,
  20131. o.faces.push(new r.Face3(h - 1,h,h + 3)),
  20132. o.faceVertexUvs[0].push([new r.Vector2(0,u), new r.Vector2(.5,u), new r.Vector2(.5,d)]),
  20133. o.faces.push(new r.Face3(h + 3,h + 2,h - 1)),
  20134. o.faceVertexUvs[0].push([new r.Vector2(.5,d), new r.Vector2(0,d), new r.Vector2(0,u)]),
  20135. o.faces.push(new r.Face3(h + 3,h,h + 1)),
  20136. o.faceVertexUvs[0].push([new r.Vector2(.5,d), new r.Vector2(.5,u), new r.Vector2(1,u)]),
  20137. o.faces.push(new r.Face3(h + 3,h + 1,h + 4)),
  20138. o.faceVertexUvs[0].push([new r.Vector2(.5,d), new r.Vector2(1,u), new r.Vector2(1,d)]);
  20139. var p = this.player.mode === a.PANORAMA ? new r.MeshBasicMaterial({
  20140. color: c.path.color,
  20141. side: r.DoubleSide,
  20142. transparent: !0,
  20143. depthWrite: !1,
  20144. opacity: 0,
  20145. name: "paveT",
  20146. map: w.path
  20147. }) : new r.MeshBasicMaterial({
  20148. color: c.path.color,
  20149. side: r.DoubleSide,
  20150. transparent: !0,
  20151. depthWrite: !1,
  20152. opacity: 1,
  20153. name: "paveO",
  20154. map: w.path
  20155. });
  20156. return new r.Mesh(o,p)
  20157. }
  20158. ,
  20159. n.prototype.hintPrefs = {
  20160. rad: .18,
  20161. width: .0125,
  20162. depth: .0625,
  20163. setBack: -.04,
  20164. markRad: .25,
  20165. markInnerRad: .16
  20166. },
  20167. n.prototype.makeWaypointObj = function(e, t) {
  20168. var i = new r.Geometry
  20169. , n = this.player.mode === a.PANORAMA ? c.path.waypointIndoorRadius : c.path.waypointRadius
  20170. , o = this.pathHeight();
  20171. 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)),
  20172. i.faces.push(new r.Face3(0,1,2), new r.Face3(2,3,0)),
  20173. i.faceVertexUvs[0].push([new r.Vector2(0,0), new r.Vector2(1,0), new r.Vector2(1,1)]),
  20174. i.faceVertexUvs[0].push([new r.Vector2(1,1), new r.Vector2(0,1), new r.Vector2(0,0)]);
  20175. var s = r.UniformsUtils.clone(m.waypoint.uniforms);
  20176. s.map.value = e,
  20177. s.opacity.value = 0,
  20178. s.color.value.set(c.path.color);
  20179. var l = {
  20180. side: r.DoubleSide,
  20181. depthWrite: !1,
  20182. transparent: !0,
  20183. vertexShader: m.waypoint.vertexShader,
  20184. fragmentShader: m.waypoint.fragmentShader,
  20185. uniforms: s,
  20186. name: "waypoint",
  20187. opacity: 0
  20188. };
  20189. this.player.mode !== a.PANORAMA && (l.depthTest = !1,
  20190. l.name = "wayPtOut");
  20191. var h = new r.RawShaderMaterial(l)
  20192. , u = new r.Mesh(i,h);
  20193. return u.name = t,
  20194. u
  20195. }
  20196. ,
  20197. n.prototype.makeStartMarker = function(e, t) {
  20198. var i = (new r.Vector3).copy(t[1]).sub(t[0]);
  20199. i.y = 0,
  20200. i.normalize();
  20201. var n = Math.acos(i.x)
  20202. , o = this.makeWaypointObj(w.pathStart, "Start");
  20203. return o.rotateOnAxis(new r.Vector3(0,1,0), n),
  20204. o.position.copy(e),
  20205. o
  20206. }
  20207. ,
  20208. n.prototype.makeEndMarker = function(e) {
  20209. var t = this.makeWaypointObj(w.pathEnd, "End")
  20210. , i = this.model.panos.get(this.nodes[0]).floor.floorIndex
  20211. , n = this.model.panos.get(this.nodes[this.nodes.length - 1]).floor.floorIndex;
  20212. return i < n ? t.material.uniforms.color.value.set(c.path.colorUp) : i > n && t.material.uniforms.color.value.set(c.path.colorDown),
  20213. t.position.copy(e),
  20214. t
  20215. }
  20216. ,
  20217. n.prototype.pathClean = function(e) {
  20218. if (e) {
  20219. for (var t in e.children)
  20220. this.pathClean(e.children[t]);
  20221. e.geometry && e.geometry.dispose(),
  20222. e.material && e.material.dispose()
  20223. }
  20224. }
  20225. ,
  20226. n.prototype.discardPathObject = function() {
  20227. if (this.obj3d) {
  20228. var e = this.obj3d.parent;
  20229. e && e.remove(this.obj3d),
  20230. this.pathClean(this.obj3d)
  20231. }
  20232. this.obj3d = null,
  20233. this.popInCpm()
  20234. }
  20235. ,
  20236. n.prototype.discardSlow = function() {
  20237. if (this.obj3d) {
  20238. if (this.player.mode !== a.PANORAMA)
  20239. return void this.discardPathObject();
  20240. for (var e, t = this, i = 0, n = function() {
  20241. this.discardPathObject()
  20242. }
  20243. .bind(this), r = 0; r < t.obj3d.children.length; r += 1)
  20244. e = t.obj3d.children[r],
  20245. 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]),
  20246. i += 1,
  20247. n = null);
  20248. 0 === i && this.discardPathObject(),
  20249. this.player.mode !== a.PANORAMA && this.fadeInCpm(c.path.fadeInTime - 3)
  20250. }
  20251. }
  20252. ,
  20253. n.prototype.appearSlow = function() {
  20254. var e, t = this;
  20255. this.fadeOutCpm(c.path.fadeInTime);
  20256. for (var i = this.player.mode === a.PANORAMA ? c.path.opacity : 1, n = 0; n < t.obj3d.children.length; n += 1)
  20257. e = t.obj3d.children[n],
  20258. 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]))
  20259. }
  20260. ,
  20261. n.prototype.update = function() {
  20262. this.obj3d && this.obj3d.updateMatrixWorld()
  20263. }
  20264. ,
  20265. n.prototype.calcBurnsAmount = function(e) {//计算导览点旋转角
  20266. var t = r.Math.degToRad(c.warp.burnsAngle);
  20267. if (this.player.mode === a.PANORAMA) {
  20268. var i = this.burnsDir * t;
  20269. if (this.upcomingTransType === l.BLACK)
  20270. return i;
  20271. var n = e;
  20272. if (null === n)
  20273. return y.warn("Transition request for non-highlight"),
  20274. i;
  20275. var o = this.getHeroDescriptorByHeroIndex(n);
  20276. if (null === o)
  20277. return i;
  20278. if (!o.isPano())
  20279. return i;
  20280. var s = this.getHeroPano(o)
  20281. , h = this.playerControls.cameras[a.PANORAMA]
  20282. , u = A.FORWARD.clone().applyQuaternion(h.quaternion).setY(0).normalize()
  20283. , d = Math.min(r.Math.degToRad(c.warp.minBurnsAngle), t)
  20284. , p = function(e) {
  20285. var i = Math.acos(Math.min(1, e.dot(u)))
  20286. , n = (new r.Vector3).crossVectors(u, e);
  20287. return Math.max(d, Math.min(Math.abs(i), t)) * Math.sign(n.y)
  20288. };
  20289. if (s === this.player.currentPano)
  20290. return i = p(A.FORWARD.clone().applyQuaternion(o.quaternion).setY(0).normalize());
  20291. var f = this.findShortestPath(this.player.currentPano, s);
  20292. if (void 0 === f || null === f || f.length < 1)
  20293. return y.debug("Empty path ahead..."),
  20294. i;
  20295. var g = this.makePathHulls(f)
  20296. , m = new r.CatmullRomCurve3(g.camera)
  20297. , v = Math.min(.1, c.warp.lookAheadDist / m.getLength());
  20298. return i = p(m.getPointAt(v).clone().sub(h.position).setY(0).normalize())
  20299. }
  20300. return this.player.mode === a.DOLLHOUSE ? .02 * this.burnsDir : this.burnsDir
  20301. }
  20302. ,
  20303. n.prototype.waitNextStep = function(e, t, time) {//xzw 改时间
  20304. var i = (time==void 0)? c.warp.tourStepDelay : time;
  20305. i==void 0 && (i = this.lastTransType === l.BLACK ? b.tourStepDelaySlideShow : b.tourStepDelayDefault);
  20306. var n = new r.Euler
  20307. , o = new r.Vector3;
  20308. y.debug("Starting wait: " + (void 0 !== t));
  20309. var currentLocation = this.model.heroLocations[this.director.currentItem[0]]
  20310. var s = currentLocation.dontRot || this.calcBurnsAmount(e)
  20311. , h = function() {
  20312. this.endWarpState(),
  20313. this.player.mode === a.DOLLHOUSE && (this.playerControls.cameras[a.DOLLHOUSE].controls.rotationAcceleration.x = 0),
  20314. t && t()
  20315. }
  20316. .bind(this)
  20317. , u = function(e, t) {
  20318. if (this.warpInterrupted)
  20319. return h(),
  20320. !0;
  20321. var r = t || 1e3 / 60;
  20322. if (c.warp.doBurns && !currentLocation.dontRot )
  20323. if (this.player.mode === a.PANORAMA) {
  20324. var l = this.playerControls.cameras[a.PANORAMA];
  20325. n.setFromQuaternion(l.quaternion, c.warp.eOrder);
  20326. var u = i == 0 ? s : r * s / i;
  20327. u = Math.sign(u) * Math.max(u, 0.0001) //add 如果音频长的话,使旋转可见,否则以为停住了
  20328. n.y += u,
  20329. o.set(0, 0, -1),
  20330. o.applyEuler(n),
  20331. o.add(l.position),
  20332. l.controls.lookAt(o),
  20333. l.controls.lookVector.copy(o)
  20334. ,l.lookAt(o)
  20335. } else
  20336. this.player.mode === a.DOLLHOUSE ? this.playerControls.controls[a.DOLLHOUSE].rotationAcceleration.x = s : this.playerControls.controls[a.FLOORPLAN].absoluteScale *= .9996
  20337. }
  20338. .bind(this);
  20339. this.startWarpState(),
  20340. p.start(u, i, h, 0, d.easeInOutQuad, "wait")
  20341. }
  20342. ,
  20343. n.prototype.warpToNonPano = function(e) {
  20344. if (this.discardPathObject(),
  20345. this.warpDestHeroLoc.cameraMode === a.DOLLHOUSE || this.warpDestHeroLoc.cameraMode === a.FLOORPLAN) {
  20346. var t = function() {
  20347. e && e()
  20348. }
  20349. .bind(this);
  20350. this.player.flyToNewMode({
  20351. mode: this.warpDestHeroLoc.cameraMode,
  20352. duration: c.warp.outsideTime,
  20353. warpDest: this.warpDestHeroLoc,
  20354. callback: t,
  20355. force: !0
  20356. })
  20357. } else
  20358. y.warn("no warp destination!!!"),
  20359. e && e()
  20360. }
  20361. ,
  20362. n.prototype._resetWarpShaderParams = function(e) {//
  20363. this.player.mode === a.PANORAMA && (void 0 !== e.material.uniforms.blackout && (e.material.uniforms.blackout.value = 0),
  20364. void 0 !== e.material.uniforms.modelAlpha && (e.material.uniforms.modelAlpha.value = 0))
  20365. /* if(momentTourBlackNewType && "newBlack" in e.material.defines){
  20366. delete e.material.defines.newBlack;
  20367. e.material.needsUpdate = true
  20368. } */
  20369. }
  20370. ,
  20371. n.prototype._clearWarpShading = function() {
  20372. for (var e = this.model.chunks, t = 0; t < e.length; t += 1)
  20373. this._resetWarpShaderParams(e[t]),
  20374. e[t].visible = !0;
  20375. this._resetWarpShaderParams(this.model.skybox)
  20376. }
  20377. ,
  20378. n.prototype._warpStopFlying = function() {
  20379. this.activeTransType = null,
  20380. this.placeCpm()
  20381. }
  20382. ,
  20383. n.prototype._wrapupTravelOnlyBits = function() {
  20384. this._warpStopFlying(),
  20385. this.warpPathPoints && (this.player.currentPano.exit(),
  20386. this.warpDestPano.enter(),
  20387. this.player.currentPano = this.warpDestPano),
  20388. this.player.spider.draw(),
  20389. this.placeCpm()
  20390. }
  20391. ,
  20392. n.prototype._wrapupTravel = function(e) {
  20393. this._wrapupTravelOnlyBits(),
  20394. this.warpCameraAim(e)
  20395. }
  20396. ,
  20397. n.prototype._wrapupWarpShading = function(e) {
  20398. this._clearWarpShading(),
  20399. this._wrapupTravel(e)
  20400. }
  20401. ,
  20402. n.prototype.wrapupWarpShadingOnly = function(e, t) {
  20403. t !== I.END && this._clearWarpShading(),
  20404. this._wrapupTravelOnlyBits(),
  20405. this.upcomingTransType = null,
  20406. e && e()
  20407. }
  20408. ,
  20409. n.prototype._warpCameraAim = function(e, t) {//到每个片段终点时转向终点朝向。
  20410. var i = this.warpDestHeroLoc.quaternion
  20411. , n = this.playerControls.cameras[a.PANORAMA]
  20412. , o = new r.Vector3(0,0,1).applyQuaternion(i).normalize()
  20413. , s = new r.Vector3(0,0,1).applyQuaternion(n.quaternion).normalize()
  20414. , l = s.dot(o)
  20415. , u = r.Math.radToDeg(Math.acos(l))
  20416. , f = new r.Euler(0,0,0,c.warp.eOrder).setFromQuaternion(i, c.warp.eOrder)
  20417. , g = (new r.Euler).setFromQuaternion(n.quaternion, c.warp.eOrder)
  20418. , m = new r.Euler(f.x - g.x,f.y - g.y,f.z - g.z,c.warp.eOrder);
  20419. m.y = h.constrainedTurn(m.y),
  20420. this.burnsDir = Math.sign(m.y);
  20421. var v = new r.Euler(0,0,0,c.warp.eOrder)
  20422. , A = new r.Vector3
  20423. , C = function(e, t) {
  20424. return !!this.warpInterrupted || (v.x = g.x + e * m.x,
  20425. v.y = g.y + e * m.y,
  20426. v.z = g.z + e * m.z,
  20427. A.set(0, 0, -1),
  20428. A.applyEuler(v),
  20429. A.add(n.position),
  20430. n.controls.lookAt(A),
  20431. n.controls.lookVector.copy(A),
  20432. void n.lookAt(A))
  20433. }
  20434. .bind(this);
  20435. /* return u > c.warp.minRotation ? (p.start(C, e, t, 0, d[c.warp.movementEasing])
  20436. ,(this.warpDestHeroLoc.zoom != this.player.zoomLevel) && //add 原地转向最终方位时
  20437. this.player.smoothZoomFovTo(null, this.warpDestHeroLoc.zoom , e)
  20438. ):
  20439. (y.info("Aim angle only is " + u.toPrecision(3) + " degrees, skipping explicit re-aim")
  20440. ,void (t && t())
  20441. ) */
  20442. (this.warpDestHeroLoc.zoom != this.player.zoomLevel) && //add 原地转向最终方位时
  20443. this.player.smoothZoomFovTo(null, this.warpDestHeroLoc.zoom , e)
  20444. return u > c.warp.minRotation ? p.start(C, e, t, 0, d[c.warp.movementEasing]) :
  20445. (y.info("Aim angle only is " + u.toPrecision(3) + " degrees, skipping explicit re-aim")
  20446. ,void (t && t())
  20447. )
  20448. }
  20449. ,
  20450. n.prototype._warpBendAim = function(e, t, i, n) {
  20451. var o = n || 0
  20452. , s = this.playerControls.cameras[a.PANORAMA]
  20453. , l = new r.Euler(0,0,0,c.warp.eOrder).setFromQuaternion(this.warpDestHeroLoc.quaternion, c.warp.eOrder)
  20454. , u = (new r.Euler).setFromQuaternion(s.quaternion, c.warp.eOrder)
  20455. , f = new r.Euler(l.x - u.x,l.y - u.y,l.z - u.z,c.warp.eOrder);
  20456. f.y = h.constrainedTurn(f.y);
  20457. var g = Math.min(r.Math.degToRad(c.warp.softBendTilt), Math.abs(f.x));
  20458. f.x = g * Math.sign(f.x),
  20459. g = Math.min(r.Math.degToRad(Math.max(0, c.warp.softBendAngle)), g),
  20460. this.burnsDir = Math.sign(f.y),
  20461. g *= Math.sign(f.y),
  20462. f.y = g;
  20463. var m = new r.Euler(0,0,0,c.warp.eOrder)
  20464. , v = new r.Vector3
  20465. , A = function(e, t) {
  20466. if (e < .5)
  20467. m.x = u.x + e * f.x,
  20468. m.y = u.y + e * f.y,
  20469. m.z = u.z + e * f.z;
  20470. else {
  20471. var i = (1 - e) * c.warp.softBendEnd;
  20472. m.x = l.x - i * f.x,
  20473. m.y = l.y - i * f.y,
  20474. m.z = l.z - i * f.z
  20475. }
  20476. v.set(0, 0, -1),
  20477. v.applyEuler(m),
  20478. v.add(s.position);
  20479. s.controls.lookAt(v),
  20480. s.controls.lookVector.copy(v),
  20481. s.lookAt(v);
  20482. }
  20483. .bind(this);
  20484. if(momentTourBlackNewType){
  20485. A(1)
  20486. }else return p.start(A, t, i, o, d[c.warp.movementEasing])
  20487. }
  20488. ,
  20489. n.prototype._warpStepCameraAim = function(e, t, i) {
  20490. var n = this.playerControls.cameras[a.PANORAMA]
  20491. , o = new r.Euler(0,0,0,c.warp.eOrder).setFromQuaternion(this.warpDestHeroLoc.quaternion, c.warp.eOrder)
  20492. , s = (new r.Euler).setFromQuaternion(n.quaternion, c.warp.eOrder)
  20493. , l = new r.Euler(o.x - s.x,o.y - s.y,o.z - s.z,c.warp.eOrder);
  20494. l.y = h.constrainedTurn(l.y),
  20495. this.burnsDir = Math.sign(l.y);
  20496. var u = new r.Euler(0,0,0,c.warp.eOrder)
  20497. , f = new r.Vector3
  20498. , g = function(e, t) {
  20499. e < .5 ? u.copy(s) : u.copy(o),
  20500. f.set(0, 0, -1),
  20501. f.applyEuler(u),
  20502. f.add(n.position),
  20503. n.controls.lookAt(f),
  20504. n.controls.lookVector.copy(f),
  20505. n.lookAt(f)
  20506. }
  20507. .bind(this);
  20508. return p.start(g, t, i, 0, d[c.warp.movementEasing])
  20509. }
  20510. ,
  20511. n.prototype.setBurnsDir = function() {
  20512. var e = this.playerControls.cameras[a.PANORAMA]
  20513. , t = new r.Euler(0,0,0,c.warp.eOrder).setFromQuaternion(this.warpDestHeroLoc.quaternion, c.warp.eOrder)
  20514. , i = (new r.Euler).setFromQuaternion(e.quaternion, c.warp.eOrder)
  20515. , n = new r.Euler(t.x - i.x,t.y - i.y,t.z - i.z,c.warp.eOrder);
  20516. n.y = h.constrainedTurn(n.y),
  20517. this.burnsDir = Math.sign(n.y)
  20518. }
  20519. ,
  20520. n.prototype.stepWarpPath = function(firstPos, e ) {
  20521. var i = this.playerControls.cameras[a.PANORAMA];
  20522. var n = this.warpPathPoints ? this.warpPathPoints[0] : firstPos
  20523. if (!n){
  20524. return i.position.copy(this.warpDestPano.position),
  20525. !0;
  20526. }
  20527. /* if (!this.warpPathPoints)
  20528. return i.position.copy(this.warpDestPano.position),
  20529. !0;
  20530. var n = this.warpPathPoints[0] */
  20531. var o = this.warpDestPano.position;
  20532. /* console.log(firstPos)
  20533. console.log(o) */
  20534. if (null !== this.nodes && this.cameraHull && this.cameraHull.length > 1) {
  20535. var s = new r.Vector3;
  20536. 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),
  20537. i.position.copy(s)
  20538. } else
  20539. e < .5 ? i.position.copy(n) : i.position.copy(o)
  20540. }
  20541. ,
  20542. n.prototype.interruptAndFastForward = function(e, t) {
  20543. this.warping && (this.warpInterrupted = !0,
  20544. this.warpInterruptionBlackoutStyle = e,
  20545. this.warpInterruptionTravelTime = t,
  20546. null !== this.warpInterruptionBlackoutStyle && void 0 !== this.warpInterruptionBlackoutStyle || (this.warpInterruptionBlackoutStyle = I.MIDDLE),
  20547. null !== this.warpInterruptionTravelTime && void 0 !== this.warpInterruptionTravelTime || (this.warpInterruptionTravelTime = c.minWarpTime))
  20548. }
  20549. ,
  20550. n.prototype.warpCameraAim = function(e) {
  20551. var t = c.warp.minWarpTime;
  20552. if (this.upcomingTransType === l.BLACK)
  20553. t = c.warp.teleportTime;
  20554. else {
  20555. var i = this.playerControls.cameras[a.PANORAMA]
  20556. , n = new r.Euler(0,0,0,c.warp.eOrder).setFromQuaternion(this.warpDestHeroLoc.quaternion, c.warp.eOrder)
  20557. , o = (new r.Euler).setFromQuaternion(i.quaternion, c.warp.eOrder)
  20558. , s = new r.Euler(n.x - o.x,n.y - o.y,n.z - o.z,c.warp.eOrder);
  20559. s.y = h.constrainedTurn(s.y);
  20560. var u = 1e3 * Math.abs(s.y) / r.Math.degToRad(c.warp.maxAimPerSec);
  20561. t = Math.max(t, u)
  20562. }
  20563. var d = function() {
  20564. this._warpStopFlying(),
  20565. this.discardSlow(),
  20566. e && e()
  20567. }
  20568. .bind(this);
  20569. this._warpCameraAim(t, d)
  20570. }
  20571. ,
  20572. n.prototype.warpCommonParameters = function(e, t, i, n) {
  20573. this.model.skybox.material.uniforms.blackout.value = n;
  20574. var r = u.uniform(this.model.skybox, "progress", 1)
  20575. , o = u.allUniforms(this.model.chunks, "progress", 1)
  20576. , a = !1
  20577. , s = function() {
  20578. if (this.warpInterrupted)
  20579. return a = !0,
  20580. !0
  20581. }
  20582. .bind(this)
  20583. , l = function(e, t) {
  20584. return i && a ? (this.model.skybox.material.uniforms.progress.value = 0,
  20585. !0) : void r(e, t)
  20586. }
  20587. .bind(this)
  20588. , h = function(e, t) {
  20589. return i && a ? (o(0),
  20590. !0) : void o(e, t)
  20591. }
  20592. .bind(this);
  20593. p.start(s, e, null, t, null, "safeHaltWatch"),
  20594. p.start(l, e, null, t, d[c.warp.blendEasing], "skyboxProgress"),
  20595. p.start(h, e, null, t, d[c.warp.blendEasing], "chunkProgress")
  20596. }
  20597. ,
  20598. n.prototype.warpTravel_STD = function(e) {
  20599. 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),
  20600. 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;
  20601. w += this.warpLength * c.warp.timePerMeter,
  20602. c.warp.flySpeed > .01 && (w = 1e3 * this.warpLength / c.warp.flySpeed);
  20603. var _ = !1
  20604. , T = this.warpDestHeroLoc.quaternion
  20605. , x = new r.Vector3(0,0,-1).applyQuaternion(T).normalize()
  20606. , S = this.warpPathPoints[this.warpPathPoints.length - 1].clone().sub(this.warpPathPoints[this.warpPathPoints.length - 2]).normalize()
  20607. , M = S.dot(x)
  20608. , R = r.Math.radToDeg(Math.acos(M))
  20609. , P = function(e) {
  20610. var t = o
  20611. , i = r.Math.smoothstep(e, 0, t) * (1 - r.Math.smoothstep(e, 1 - t, 1));
  20612. return i
  20613. }
  20614. , O = function() {
  20615. return E.lookAt(C, t, A.UP),
  20616. s.setFromRotationMatrix(E, c.warp.eOrder),
  20617. m.setFromQuaternion(n.quaternion, c.warp.eOrder),
  20618. b.set(s.x - m.x, s.y - m.y, s.z - m.z, c.warp.eOrder),
  20619. h.constrainedTurn(b.y)
  20620. }
  20621. .bind(this)
  20622. , L = function(e, t) {
  20623. if (this.warpInterrupted)
  20624. return _ = !0,
  20625. !0
  20626. }
  20627. .bind(this)
  20628. , D = function(e, t) {
  20629. return _ || !this.warpPathPoints ? (g.blur(0),
  20630. !0) : void g.blur(e)
  20631. }
  20632. .bind(this)
  20633. , N = u.allUniforms(this.model.chunks, "modelAlpha", 1)
  20634. , B = function(e, t) {
  20635. return _ || !this.warpPathPoints ? (N(0),
  20636. !0) : void N(e, t)
  20637. }
  20638. .bind(this)
  20639. , F = function(e, t) {
  20640. if (!this.warpPathPoints)
  20641. return n.position.copy(this.warpDestPano.position),
  20642. !0;
  20643. if (_)
  20644. return !0;
  20645. var i = this.interpAlongPath(this.warpPathPoints, this.warpPathLengths, e);
  20646. n.position.copy(i),
  20647. C = this.interpAlongPath(this.warpPathPoints, this.warpPathLengths, .99 * e)
  20648. }
  20649. .bind(this)
  20650. , V = function(e, n) {
  20651. return this.warpPathPoints ? !!_ || void (t = this.interpAlongPath(this.warpPathPoints, this.warpPathLengths, Math.min(e + i, 1))) : (y.debug("Lost bunny."),
  20652. !0)
  20653. }
  20654. .bind(this)
  20655. , U = function(e, o) {
  20656. if (_)
  20657. return y.debug(">>>> Walkthrough interupted at t=" + e),
  20658. !0;
  20659. if (!this.warpPathPoints)
  20660. return !0;
  20661. var a = this.warpLength * e
  20662. , l = r.Math.smoothstep(a, 0, this.brushPrefs.lookBlendDist)
  20663. , u = r.Math.smoothstep(a, this.warpLength - this.brushPrefs.lookBlendDist, this.warpLength);
  20664. c.warp.matchCam && (l *= 1 - u),
  20665. E.lookAt(C, t, A.UP),
  20666. s.setFromRotationMatrix(E, c.warp.eOrder),
  20667. m.setFromQuaternion(n.quaternion, c.warp.eOrder),
  20668. b.set(s.x - m.x, s.y - m.y, s.z - m.z, c.warp.eOrder),
  20669. b.y = h.constrainedTurn(b.y),
  20670. s.x = m.x + l * b.x,
  20671. s.y = m.y + l * b.y,
  20672. s.z = m.z + l * b.z,
  20673. b.set(s.x - v.x, s.y - v.y, s.z - v.z, c.warp.eOrder),
  20674. b.y = h.constrainedTurn(b.y);
  20675. var d = r.Math.degToRad(c.warp.maxTurnPerSec) * o / 1e3;
  20676. b.y = Math.sign(b.y) * Math.min(d, Math.abs(b.y)),
  20677. v.x = v.x + b.x * c.warp.turnFriction,
  20678. v.y = v.y + b.y * c.warp.turnFriction,
  20679. v.z = v.z + b.z * c.warp.turnFriction,
  20680. v.x = Math.max(r.Math.degToRad(c.warp.minDownAngle), v.x);
  20681. var p = t.clone().sub(C).normalize();
  20682. if (R < c.warp.maxAimRotation && u > 0) {
  20683. var g = 1 - u;
  20684. p.x = p.x * g + u * S.x,
  20685. p.y = p.y * g + u * S.y,
  20686. p.z = p.z * g + u * S.z,
  20687. p.normalize()
  20688. }
  20689. this.bunnyObj.position.copy(n.position).add(p),
  20690. f.set(0, 0, -1).applyEuler(v).normalize(),
  20691. f.multiplyScalar(8),
  20692. f.add(n.position),
  20693. e > 1 - i && c.warp.matchCam || (n.controls.lookAt(f),
  20694. n.controls.lookVector.copy(f),
  20695. n.lookAt(f))
  20696. }
  20697. .bind(this)
  20698. , k = function() {
  20699. _ ? (this.discardSlow(),
  20700. this.upcomingTransType = l.BLACK,
  20701. this.warpTravel_BLACK(-.5, this.warpInterruptionTravelTime, I.BEGINNING, e)) : this._wrapupWarpShading(e)
  20702. }
  20703. .bind(this);
  20704. V(0);
  20705. var H = c.warp.motionLeadTime + 1e3 * Math.abs(O()) / r.Math.degToRad(c.warp.maxTurnPerSec);
  20706. w += H;
  20707. var G = H / w;
  20708. this.warpCommonParameters(w, G, !0, I.NONE),
  20709. p.start(L, w, null, 0, null, "_haltWatcher"),
  20710. c.warp.blur > 0 && (g.blurStrength = c.warp.blur,
  20711. p.start(D, w, null, G, P, "blurring")),
  20712. p.start(B, w, null, G, P, "modelAlpha"),
  20713. p.start(F, w, null, G, d[c.warp.blendEasing], "followPath"),
  20714. p.start(V, w, null, G, d[c.warp.blendEasing], "goBunny"),
  20715. p.start(U, w, k, 0, d[c.warp.blendEasing], "lookAtBunny")
  20716. }
  20717. ,
  20718. n.prototype.warpTravel_BLACK = function(e, t, i, n) {
  20719. var r = e || 0;
  20720. void 0 !== t && null !== t || (t = c.warp.teleportTime)
  20721. //add
  20722. var done = ()=>{
  20723. Hot.updateVisibles([this.player.currentPano]) //更新热点显示
  20724. this.player.transitionPos({type:"beforeFlytopano", pano:this.player.currentPano, dur:100})//add
  20725. }
  20726. if(momentTourBlackNewType){
  20727. player.sceneRenderer.effects.transitionMaskPass.start(player.sceneRenderer)
  20728. var camera = this.playerControls.cameras[a.PANORAMA];
  20729. var end = this.warpDestHeroLoc.position
  20730. camera.position.copy(end)
  20731. setTimeout(()=>{
  20732. player.sceneRenderer.effects.transitionMaskPass.stop()
  20733. this.wrapupWarpShadingOnly(n, i);
  20734. done()
  20735. },t)
  20736. }else{
  20737. var o = function() {
  20738. this.wrapupWarpShadingOnly(n, i);
  20739. done()
  20740. }
  20741. .bind(this);
  20742. var firstPos = this.player.position.clone()//add
  20743. p.start(this.stepWarpPath.bind(this, firstPos), t, o, r, d[c.warp.blendEasing], "stepMotion")
  20744. }
  20745. this.warpCommonParameters(t, r, !1, i)
  20746. this.model.chunks.concat(this.model.skybox).forEach(function(e) {// 改
  20747. if(window.momentTourBlackNewType){
  20748. e.material.uniforms.blackout.value = 5//i 改
  20749. //e.material.defines.newBlack = ''
  20750. //e.material.needsUpdate = true
  20751. }else{
  20752. e.material.uniforms.blackout.value = i
  20753. }
  20754. }),
  20755. this._warpBendAim(null, t, null, r);
  20756. }
  20757. ,
  20758. n.prototype.flightStepWalk = function(e, t, i) {
  20759. var n = .001
  20760. , o = 1
  20761. , a = 1.2
  20762. , s = new r.Vector3
  20763. , h = new r.Vector3
  20764. , u = function(e, t) {
  20765. //导览速度
  20766. var i = Math.min(this.player.position.distanceTo(e.position), c.transition.flytimeMaxDistanceThreshold)
  20767. // , r = i * c.transition.flytimeDistanceMultiplier + c.transition.flyTime;
  20768. , r = i * c.warp.flytimeDistanceMultiplier + c.warp.flyTime;
  20769. h.copy(A.FORWARD),
  20770. this.player.getDirection(h),
  20771. s.copy(t).sub(e.position).normalize();
  20772. var l = s.dot(h)
  20773. , u = Math.acos(l)
  20774. , d = u / r;
  20775. d > n && (r *= d / n,
  20776. u < o && (r *= a))
  20777. return r / DATA.tourWalkSpeed * 100 // 改
  20778. };
  20779. return function(e, t, i) {
  20780. if (this.warpInterrupted)
  20781. i && i();
  20782. else if (this.activeTransType !== l.WALK)
  20783. this._clearWarpShading(),
  20784. this._warpStopFlying(),
  20785. this.player.spider.draw(),
  20786. this.placeCpm(),
  20787. i && i();
  20788. else if (this.player.currentPano !== e) {
  20789. var n = {
  20790. pano: e,
  20791. lookAtPoint: t,
  20792. duration: null,
  20793. maxDistanceOverride: c.warp.walkMaxDist,
  20794. skipWarpingCheck: !1,
  20795. constantMoveSpeed: !0
  20796. };
  20797. if(e == this.warpDestPano){//到达终点前,放大到终点的zoom
  20798. n.zoomLevel = this.warpDestHeroLoc.zoom
  20799. }
  20800. n.duration = u.call(this, e, t),
  20801. this.player.nonInterruptingFlyToPano(n, i)
  20802. } else
  20803. i && i()
  20804. }
  20805. }(),
  20806. n.prototype.makeWalkFlightFunc = function(e, t, i) {
  20807. return this.flightStepWalk.bind(this, e, t, i)
  20808. }
  20809. ,
  20810. n.prototype.warpTravel_WALK = function() {
  20811. var e = [];
  20812. return function(t) {
  20813. var i = this.player.model.panos;
  20814. e.length = 0;
  20815. for (var n = null, o = !1, a = 0; a < this.nodes.length; a++) {
  20816. var s = this.nodes[a]
  20817. , l = i.get(s);
  20818. a === this.nodes.length - 1;
  20819. o = n && l.position.distanceTo(n.position) < c.warp.walkMinDist,
  20820. n && o || (e.push(s),
  20821. n = l)
  20822. }
  20823. o && this.nodes.length > 1 && (e[e.length - 1] = this.nodes[this.nodes.length - 1]);
  20824. var h = e.length
  20825. , u = i.get(e[h - 1])
  20826. , d = new Array(h + 1);
  20827. d[d.length - 1] = function() {
  20828. t && t()
  20829. }
  20830. .bind(this);
  20831. for (var p = h - 1, f = d.length - 1; f > 0; f -= 1) {
  20832. var g = e[p];
  20833. u = i.get(g);
  20834. var m = new r.Vector3;
  20835. this.getLookAtForWalkingTourNode(e, p, m),
  20836. d[f - 1] = this.makeWalkFlightFunc(u, m, d[f]),
  20837. p--
  20838. }
  20839. d[0]()
  20840. }
  20841. }(),
  20842. n.prototype.getLookAtForWalkingTourNode = function() {
  20843. var e = new r.Vector3
  20844. , t = new r.Vector3
  20845. , i = new r.Vector3
  20846. , n = new r.Vector3
  20847. , o = new r.Vector3
  20848. , a = .65
  20849. , s = .75
  20850. , l = .2
  20851. , c = .4
  20852. , h = .2
  20853. , u = 3;
  20854. return function(r, d, p) {
  20855. var f = r.length;
  20856. if (d >= f)
  20857. return !1;
  20858. var g = 1
  20859. , m = 1;
  20860. t.set(0, 0, 0),
  20861. o.set(0, 0, 0);
  20862. for (var v = null, A = d; A < d + u && !(A >= f); A++) {
  20863. if (v = this.player.model.panos.get(r[A]),
  20864. this.getOrientationForWalkingTourNode(r, A, i),
  20865. A === d && e.copy(i),
  20866. n.copy(i),
  20867. A > d) {
  20868. var y = n.dot(e) < a;
  20869. g *= y ? l : s,
  20870. m *= y ? h : c
  20871. }
  20872. i.multiplyScalar(g),
  20873. t.add(i),
  20874. o.lerp(v.position, m)
  20875. }
  20876. return t.normalize(),
  20877. p.copy(o),
  20878. p.add(t),
  20879. !0
  20880. }
  20881. }(),
  20882. n.prototype.getOrientationForWalkingTourNode = function(e, t, i) {
  20883. var n = e.length;
  20884. if (t >= n)
  20885. return !1;
  20886. if (t === n - 1)
  20887. i.copy(A.FORWARD).applyQuaternion(this.warpDestHeroLoc.quaternion);
  20888. else {
  20889. var r = this.player.model.panos.get(e[t])
  20890. , o = this.player.model.panos.get(e[t + 1]);
  20891. i.copy(o.position).sub(r.position)
  20892. }
  20893. return i.normalize(),
  20894. !0
  20895. }
  20896. ,
  20897. n.prototype.warpCameraTravel = function(e, t, i, n) {
  20898. if (this.activeTransType = this.upcomingTransType,
  20899. this.lastTransType = this.activeTransType,
  20900. this.upcomingTransType = null,
  20901. !e) {
  20902. var r = function() {
  20903. this._wrapupTravel(n)
  20904. }
  20905. .bind(this)
  20906. , o = {
  20907. pano: this.warpDestPano,
  20908. lookAtPoint: null,
  20909. duration: null,
  20910. maxDistanceOverride: null,
  20911. skipWarpingCheck: !1
  20912. };
  20913. return void this.player.flyToPano(o, r)
  20914. }
  20915. this.activeTransType === l.BLACK ? this.warpTravel_BLACK(null, i, t, n) : this.activeTransType === l.WALK ? this.warpTravel_WALK(function() {
  20916. this._clearWarpShading(),
  20917. this._warpStopFlying(),
  20918. this.player.spider.draw(),
  20919. this.placeCpm(),
  20920. n && n()
  20921. }
  20922. .bind(this)) : this.warpTravel_STD(n)
  20923. }
  20924. ,
  20925. n.prototype.startWarpState = function() {
  20926. this.warping = !0,
  20927. this.warpInterrupted = !1,
  20928. this.warpInterruptionBlackoutStyle = null,
  20929. this.warpInterruptionTravelTime = null
  20930. }
  20931. ,
  20932. n.prototype.endWarpState = function() {
  20933. this.warping = !1
  20934. }
  20935. ,
  20936. n.prototype.warpToPano = function(e, t, i, n) {
  20937. if (this.warping)
  20938. return void y.warn("Cannot warp when already warping");
  20939. if (this.upcomingTransType = e,
  20940. this.activeTransType = null,
  20941. !this.setWarpDestPano())
  20942. return this.upcomingTransType = null,
  20943. void this.warpToNonPano(n);
  20944. if (this.player.mode !== a.PANORAMA)
  20945. return this.upcomingTransType = null,
  20946. this.discardSlow(),
  20947. void this.player.flyToNewMode({
  20948. mode: a.PANORAMA,
  20949. pano: this.warpDestPano,
  20950. duration: c.warp.outsideTime,
  20951. warpDest: this.warpDestHeroLoc,
  20952. callback: n,
  20953. force: !0
  20954. });
  20955. if (!this.warpDestPano)
  20956. return y.warn("no warp destination, callback dropped"),
  20957. void (this.upcomingTransType = null);
  20958. 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)
  20959. , o = this.chooseWarpPath(r);
  20960. if (o && this.upcomingTransType !== l.WALK) {
  20961. var s = function() {
  20962. this.waitingToWarp = !1,
  20963. this.warpToPano(e, t, i, n)
  20964. }
  20965. .bind(this);
  20966. if (this.player.checkAndWaitForPanoLoad(this.warpDestPano, "high", "low", this.player.basePanoSize, s))
  20967. return void (this.waitingToWarp = !0)
  20968. }
  20969. this.player.currentPano || (y.warn("Arrived at a very strange spot!"),
  20970. this.player.currentPano = this.warpDestPano,
  20971. this.placeCpm(),
  20972. this.fadeOutCpm(c.path.fadeOutTime),
  20973. this.player.spider.draw()),
  20974. y.debug("Warping to pano ", this.warpDestPano.position),
  20975. this.upcomingTransType !== l.WALK && this.player.emit(C.PanoChosen, this.player.currentPano, this.warpDestPano),
  20976. this.startWarpState();
  20977. var h = function() {
  20978. this.endWarpState(),
  20979. n && n()
  20980. }
  20981. .bind(this);
  20982. o ? this.warpCameraTravel(r, t, i, h) : this.warpCameraAim(h)
  20983. //this.player.smoothZoomToDefault(c.zoom.restoreTime);
  20984. }
  20985. ,
  20986. t.exports = n
  20987. }
  20988. ).call(this, "/js/objects/ShowPath.js")
  20989. }
  20990. , {
  20991. "../constants": 8,
  20992. "../effects": 16,
  20993. "../enum/BlackoutStyle": 18,
  20994. "../enum/ModelManagerEvents": 33,
  20995. "../enum/PlayerEvents": 40,
  20996. "../enum/RenderOrder": 42,
  20997. "../enum/Vectors": 50,
  20998. "../enum/Viewmode": 51,
  20999. "../enum/WarpStyle": 52,
  21000. "../gui/gui": 65,
  21001. "../model/ModelManager": 140,
  21002. "../objects/Snapshot": 153,
  21003. "../settings": 166,
  21004. "../shaders": 167,
  21005. "../util/easing": 186,
  21006. "../util/lerp": 188,
  21007. "../util/logger": 189,
  21008. "../util/math": 190,
  21009. "../util/texture": 194,
  21010. "../util/transitions": 195,
  21011. three: 217
  21012. }],
  21013. 152: [function(e, t, i) {
  21014. "use strict";
  21015. function n() {
  21016. var e = new r.SphereBufferGeometry(a.skyboxRadius,20,5)
  21017. , t = new r.RawShaderMaterial({
  21018. fragmentShader: o.skysphere.fragmentShader,
  21019. vertexShader: o.skysphere.vertexShader,
  21020. uniforms: r.UniformsUtils.clone(o.skysphere.uniforms),
  21021. side: r.BackSide,
  21022. name: "skysphere"
  21023. });
  21024. t.uniforms.radius.value = e.parameters.radius,
  21025. r.Mesh.call(this, e, t)
  21026. }
  21027. var r = e("three")
  21028. , o = e("../shaders")
  21029. , a = e("../settings");
  21030. n.prototype = Object.create(r.Mesh.prototype),
  21031. n.prototype.constructor = n,
  21032. t.exports = n
  21033. }
  21034. , {
  21035. "../settings": 166,
  21036. "../shaders": 167,
  21037. three: 217
  21038. }],
  21039. 153: [function(e, t, i) {
  21040. (function(i) {
  21041. "use strict";
  21042. function n(e) {
  21043. o.call(this, e),
  21044. this.sid = e.sid,//xzw add
  21045. this.panoId = e.panoId,
  21046. this.orthoZoom = e.orthoZoom,
  21047. this.floorVisibility = e.floorVisibility,
  21048. this.thumbUrl = e.thumbUrl,
  21049. this.name = e.name,
  21050. this.zoom = e.zoom
  21051. }
  21052. var r = (e("three"),
  21053. e("../util/logger"))
  21054. , o = (e("../settings"),
  21055. e("../enum/Viewmode"),
  21056. e("../util/common"),
  21057. e("../util/transitions"),
  21058. e("../util/lerp"),
  21059. e("../util/ajax"),
  21060. e("../util/texture"),
  21061. e("./View"));
  21062. e("events").EventEmitter,
  21063. new r(i);
  21064. n.prototype = Object.create(o.prototype),
  21065. n.prototype.isPano = function() {
  21066. return this.panoId && "" !== this.panoId && this.panoId != "outside"
  21067. }
  21068. ,
  21069. t.exports = n
  21070. }
  21071. ).call(this, "/js/objects/Snapshot.js")
  21072. }
  21073. , {
  21074. "../enum/Viewmode": 51,
  21075. "../settings": 166,
  21076. "../util/ajax": 181,
  21077. "../util/common": 185,
  21078. "../util/lerp": 188,
  21079. "../util/logger": 189,
  21080. "../util/texture": 194,
  21081. "../util/transitions": 195,
  21082. "./View": 154,
  21083. events: 202,
  21084. three: 217
  21085. }],
  21086. 154: [function(e, t, i) {
  21087. (function(i) {
  21088. "use strict";
  21089. function n(e) {
  21090. e = e || {},
  21091. this.position = new r.Vector3,
  21092. this.quaternion = new r.Quaternion,
  21093. this.update(e)
  21094. }
  21095. var r = e("three")
  21096. , o = e("../util/logger")
  21097. , a = (e("../settings"),
  21098. e("../enum/Viewmode"),
  21099. e("../util/common"),
  21100. e("../util/transitions"),
  21101. e("../util/lerp"),
  21102. e("../util/ajax"),
  21103. e("../util/texture"),
  21104. e("events").EventEmitter);
  21105. new o(i);
  21106. n.prototype = Object.create(a.prototype),
  21107. n.prototype.isValid = function() {
  21108. return !!this.cameraMode
  21109. }
  21110. ,
  21111. n.prototype.update = function(e) {
  21112. return this.cameraMode = e.cameraMode || this.cameraMode,
  21113. this.pano = e.pano || this.pano,
  21114. e.position && this.position.copy(e.position),
  21115. e.quaternion && this.quaternion.copy(e.quaternion),
  21116. this
  21117. }
  21118. ,
  21119. t.exports = n
  21120. }
  21121. ).call(this, "/js/objects/View.js")
  21122. }
  21123. , {
  21124. "../enum/Viewmode": 51,
  21125. "../settings": 166,
  21126. "../util/ajax": 181,
  21127. "../util/common": 185,
  21128. "../util/lerp": 188,
  21129. "../util/logger": 189,
  21130. "../util/texture": 194,
  21131. "../util/transitions": 195,
  21132. events: 202,
  21133. three: 217
  21134. }],
  21135. 155: [function(e, t, i) {//player.js
  21136. (function(i) {
  21137. "use strict";
  21138. function n(e) {
  21139. this.currentPano = null,
  21140. this.nextPano = null,
  21141. this.camera = null,
  21142. this.paused = !1,
  21143. this.flying = !1,
  21144. this.sceneIntersectionPlane = null,
  21145. this.target = new r.Vector3,
  21146. this.mouse = new r.Vector3(1.1,1.1,.5),
  21147. this.mouseAtMouseDown = new r.Vector2,
  21148. this.mouseCouldBeClickToMove = !1,
  21149. this.mouseLastMoveTime = Date.now(),
  21150. this.mouseDown = !1,
  21151. this.mouseDownTimer = null,
  21152. this.couldBeLongTap = !1,
  21153. this.containsMouse = !1, //
  21154. this.isTouchEvent = !1,
  21155. this.isPanoHover = !1,
  21156. this.reticule = new a(this),
  21157. this.panoMarkers = [],
  21158. this.spider = new h(this),
  21159. this.quaternion = new r.Quaternion,
  21160. this.position = new r.Vector3(15,10,15),
  21161. this.previousState = null,
  21162. this.lastInsideView = new c,
  21163. this.last360View = new c,
  21164. this.raycaster = new r.Raycaster,
  21165. this.intersect = null,
  21166. this.lastChangeTime = Date.now(),
  21167. this.history = new I,
  21168. this.cameraControls = null,
  21169. this.path = null,
  21170. this.model = null,
  21171. this.domElement = null,
  21172. this.cachedPanoCandidates = null,
  21173. this.basePanoSize = 0,
  21174. this.standardPanoSize = 0,
  21175. this.highPanoSize = 0,
  21176. this.ultraHighPanoSize = 0,
  21177. this.zoomLevel = 1,
  21178. this.zooming = 0,
  21179. this.zoomSpeed = .5,
  21180. this.scrollZoomSpeed = .06,
  21181. this.zoomSpeedAdjust = .05,
  21182. this.defaultZoomIncrement = .2,
  21183. this.baseFov = f.insideFOV,
  21184. this.zoomFov = this.baseFov,
  21185. this.zoomEnabled = !0,
  21186. this.preRenderingEnabled = !1,
  21187. this.setupCustomProperties(e),
  21188. this.zoomStats = new L
  21189. window.player = this
  21190. this.modeTran = ''
  21191. }
  21192. var r = e("three")
  21193. , o = e("./util/logger")
  21194. , a = e("./objects/Reticule")
  21195. , s = e("./objects/Panorama")
  21196. , l = e("./objects/ShowPath")
  21197. , c = e("./objects/View")
  21198. , h = (e("./objects/Snapshot"),
  21199. e("./objects/NSpider"))
  21200. , u = e("./enum/Viewmode")
  21201. , d = (e("./enum/TagStates"),
  21202. e("./enum/Vectors"))
  21203. , p = e("./enum/Keys")
  21204. , f = (e("./enum/AlignmentType"),
  21205. e("./settings"))
  21206. , g = e("./util/common")
  21207. , m = (e("./util/browser"),
  21208. e("./util/math"))
  21209. , v = e("./util/lerp")
  21210. , A = e("./util/easing")
  21211. , y = e("./util/transitions")
  21212. , C = e("events").EventEmitter
  21213. , I = (e("./shaders"),
  21214. e("./util/history"))
  21215. , E = (e("./util/camera"),
  21216. e("./model/ModelManager"),
  21217. e("./enum/PathDiscardMode"))
  21218. , b = e("./enum/PathDisplayMode")
  21219. , w = e("./enum/PlayerEvents")
  21220. , _ = e("./enum/ControlEvents")
  21221. , T = e("./enum/ModelManagerEvents")
  21222. , x = e("./enum/WarpStyle")
  21223. , S = e("./enum/BlackoutStyle")
  21224. , M = e("./exception/BasicException")
  21225. , R = e("./enum/PanoSizeClass")
  21226. , P = (e("./tile/TileDownloader"),
  21227. e("./tile/TilePrioritizer"))
  21228. , O = (e("./enum/PanoramaEvents"),
  21229. e("./enum/ZoomEvents"))
  21230. , L = e("./util/ZoomStats")
  21231. , D = e("./constants")
  21232. , N = e("./util/common")
  21233. , B = e("./util/cameraLight")
  21234. //, Hot = e('hot')
  21235. , F = new o(i)
  21236. , V = Object.freeze({
  21237. FlyToPano: y.getUniqueId(),
  21238. FlyToNewMode: y.getUniqueId(),
  21239. FlyToSameMode: y.getUniqueId(),
  21240. FlyToViewFloor: y.getUniqueId(),
  21241. LookTransition: y.getUniqueId(),
  21242. ZoomTransition: y.getUniqueId()
  21243. });
  21244. n.prototype = Object.create(C.prototype),
  21245. n.prototype.init = function(e) {
  21246. this.modelManager = e.modelManager,
  21247. this.tileDownloader = e.tileDownloader,
  21248. this.panoRenderer = e.panoRenderer,
  21249. this.qualityManager = e.qualityManager,
  21250. this.domElement = e.container,
  21251. this.camera = e.camera,
  21252. this.tagManager = e.tagManager,
  21253. this.cameraControls = e.controls,
  21254. this.path = new l(e.director,this,e.controls),
  21255. this.basePanoSize = this.qualityManager.getPanoSize(R.BASE),
  21256. this.standardPanoSize = this.qualityManager.getPanoSize(R.STANDARD),
  21257. this.highPanoSize = this.qualityManager.getPanoSize(R.HIGH),
  21258. this.ultraHighPanoSize = this.qualityManager.getPanoSize(R.ULTRAHIGH),
  21259. this.tileDownloader.processPriorityQueue = !1,
  21260. this.tileDownloader.tilePrioritizer = new P(this.qualityManager,this.basePanoSize,this.standardPanoSize,this.highPanoSize,this.ultraHighPanoSize),
  21261. this.bindEvents(e.container),
  21262. this.updateModel()
  21263. this.modeTran = ''
  21264. }
  21265. //xzw add: 截图
  21266. function dataURLtoBlob(dataurl) {
  21267. var arr = dataurl.split(','), mime = arr[0].match(/:(.*?);/)[1],
  21268. bstr = atob(arr[1]), n = bstr.length, u8arr = new Uint8Array(n);
  21269. while(n--){
  21270. u8arr[n] = bstr.charCodeAt(n);
  21271. };
  21272. return new Blob([u8arr], {type:mime});
  21273. }
  21274. n.prototype.screenShot = function(o){
  21275. if(this.flying || this.flyingToTag) return;
  21276. var R = this.sceneRenderer;
  21277. R.updateScreenSize(o);
  21278. for(var i in this.model.panos.index){
  21279. if(!this.model.panos.index[i].marker) continue;
  21280. this.model.panos.index[i].marker.forceHide = this.model.panos.index[i].marker.visible;
  21281. this.model.panos.index[i].marker.visible = false;
  21282. }
  21283. for(var i in this.model.hots){
  21284. this.model.hots[i].mesh.visible = false;
  21285. }
  21286. this.reticule.visible = false;
  21287. this.reticule.forceUnvisible = true;
  21288. this.path.currentPanoMarker.mesh.visible = false;
  21289. setTimeout(function(){//因resize效用没办法立即生效(原因未知),故而延后
  21290. R.renderer.clear(true,true,true);
  21291. R.renderer.render(R.scene, R.camera);
  21292. var imgData = R.renderer.domElement.toDataURL(o.type,0.9);
  21293. o.f && o.f(imgData)
  21294. R.updateScreenSize({resize:true});
  21295. this.reticule.visible = true;
  21296. for(var i in this.model.hots){
  21297. this.model.hots[i].mesh.visible = true;
  21298. }
  21299. for(var i in this.model.panos.index){
  21300. this.model.panos.index[i].marker.visible = this.model.panos.index[i].marker.forceHide;
  21301. }
  21302. this.path.currentPanoMarker.mesh.visible = true;
  21303. R.renderer.render(R.scene, R.camera);
  21304. }.bind(this),30) //这个数字不能太小
  21305. }
  21306. var scaleImg = e("scaleImg");
  21307. var ResizeImg = function(img, option){
  21308. var img2; //不能直接改img 否则可能触发第二次img.onload
  21309. var compress = function(ratio,type){
  21310. var image = img2 || img;
  21311. var c = document.createElement('canvas');
  21312. c.width = image.width; c.height = image.height;
  21313. var ctx = c.getContext('2d');
  21314. ctx.drawImage(image,0,0,image.width,image.height);
  21315. img2 = scaleImg(ratio/* option.maxSize/oldSize */, c, type/* option.type||"png" */);//最大不能超过0.8M
  21316. }
  21317. var reCom = function(){ //如果有了img2 就只需要img2 否则创造新的img2
  21318. var image = img2 || img;
  21319. var blob = dataURLtoBlob(image.src);
  21320. if(option.maxWeight && blob.size > option.maxWeight){
  21321. compress(option.maxWeight/blob.size, "jpeg")
  21322. blob = dataURLtoBlob(image.src);
  21323. }
  21324. if(!img2){
  21325. img2 = new Image();
  21326. }
  21327. img2.base64Src = image.src;
  21328. img2.src = window.URL.createObjectURL(blob);
  21329. }
  21330. var oldSize = Math.max(img.width, img.height);
  21331. if(option.toType != "png"){//不是非要png的话
  21332. if(option.oldType == "jpeg"){//jpeg先判断尺寸,然后是尺寸
  21333. if(oldSize > option.maxSize){
  21334. compress(option.maxSize/oldSize, "jpeg");
  21335. }
  21336. reCom();
  21337. }else if(option.oldType == "png"){//png先判断数据量 如果数据量达标,就无视大小(有可能超出大小)
  21338. if(option.maxWeight && option.weight > option.maxWeight){//如果一开始大小不大就不压缩 还是png
  21339. compress(oldSize>option.maxSize ? option.maxSize/oldSize : 1, "jpeg");
  21340. reCom();
  21341. }
  21342. }
  21343. }else{
  21344. //?貌似png会越压缩越大?
  21345. }
  21346. return img2 || img;
  21347. }
  21348. var _fixType=function(type) {
  21349. type = type.toLowerCase().replace(/jpg/i, 'jpeg');
  21350. var r = type.match(/png|jpeg|bmp|gif/)[0];
  21351. return 'image/' + r;
  21352. };
  21353. var saveFile=function(data, filename){
  21354. var save_link = document.createElementNS('http://www.w3.org/1999/xhtml', 'a');
  21355. save_link.href = data;
  21356. save_link.download = filename;
  21357. var event = document.createEvent('MouseEvents');
  21358. event.initMouseEvent('click', true, false, window, 0, 0, 0, 0, 0, false, false, false, false, 0, null);
  21359. save_link.dispatchEvent(event);
  21360. };
  21361. n.prototype.getWrapShot = function(){ //获取导览点截图/初始画面和信息
  21362. var info = this.getSnapAngleInfo();
  21363. var str = ',{\r\t' + info;
  21364. var arg = arguments[0];
  21365. this.screenShot({ width:g_snapShotWidth*4, height:g_snapShotHeight*4, type:"image/jpeg", f:function(imgData){
  21366. if (arg && arg.__callback) {
  21367. return arg.__callback(imgData, info)
  21368. }
  21369. var img = new Image();
  21370. img.src = imgData;
  21371. img.onload = function(){
  21372. var img2 = ResizeImg(this,{maxSize: g_snapShotWidth, oldType:"jpeg"}); //暂定缩略图大小
  21373. img2.src.replace(_fixType("image/jpeg"),'image/octet-stream');
  21374. var filename = "snap" + (new Date()).getTime();
  21375. saveFile(img2.src,filename + ".jpg");
  21376. str +=(',\r\t"thumbnail_signed_src":"'+filename+'.jpg",');
  21377. str +=('\r\t"sid":"'+filename+'",');
  21378. str +=('\r\t"name":"'+filename+'"\r}');
  21379. logData(str)
  21380. }
  21381. }});
  21382. }
  21383. ,
  21384. n.prototype.getSnapAngleInfo = function(){
  21385. var info = {};
  21386. var str = '"metadata":{';
  21387. var q = this.camera.quaternion.clone();
  21388. switch (this.mode) {
  21389. case "panorama":
  21390. info.scan_id = this.currentPano.id;
  21391. str += ('"scan_id":"'+this.currentPano.id+'",');
  21392. break;
  21393. case "floorplan":
  21394. info.camera_mode = 1;
  21395. q = (new r.Quaternion).setFromAxisAngle(new r.Vector3(0,1,0), r.Math.degToRad(90))
  21396. q.multiply(this.camera.quaternion);
  21397. str += ('"camera_mode":1,');
  21398. //str += ('"ortho_zoom":'+m.toPrecision(this.cameraControls.activeControl.currentScale * $("#player").height() / $("#player").width() * D.workshopApsect * 16, 4)+",");
  21399. str += ('"ortho_zoom":'+ m.toPrecision(this.cameraControls.activeControl.currentScale, 4 )+",");
  21400. break;
  21401. case "dollhouse":
  21402. info.camera_mode = 2;
  21403. str += ('"camera_mode":2,');
  21404. break;
  21405. }
  21406. info.camera_position = m.toPrecision(this.camera.position.toArray(),4);
  21407. console.log(info.camera_position)
  21408. if(window.screenSta === 'tour'){ // fyz 导览截屏需要做额外的
  21409. /**fyz 对相机截屏的角度进行校对 */
  21410. var out = new r.Quaternion(q.x, q.y, q.z, q.w)
  21411. out.multiply(new r.Quaternion(Math.sqrt(2) / 2, Math.sqrt(2) / 2, 0, 0).conjugate())
  21412. out.x *= -1;
  21413. out.w *= -1;
  21414. info.camera_quaternion = m.toPrecision(out.toArray(),4);
  21415. }else{
  21416. info.camera_quaternion = m.toPrecision(q.toArray(),4);;
  21417. }
  21418. info.zoom = this.zoomLevel;
  21419. console.log(info.camera_quaternion)
  21420. // str += ( '"camera_position":['+ info.camera_position + '],"camera_quaternion":['+info.camera_quaternion+"]}");
  21421. // fyz 扩展编辑页面, 加上导览点缩放值
  21422. str += ( '"camera_position":['+ info.camera_position + '],"camera_quaternion":['+info.camera_quaternion+'], "zoom":' + info.zoom + '}');
  21423. return str;
  21424. }
  21425. //------end
  21426. n.prototype.setupCustomProperties = function(e) {
  21427. var t = e || u.PANORAMA;
  21428. Object.defineProperty(this, "mode", {
  21429. get: function() {
  21430. return t
  21431. },
  21432. set: function(e) {
  21433. var i = t;
  21434. t = e,
  21435. this.onModeUpdated(i, t)
  21436. }
  21437. })
  21438. }
  21439. ,
  21440. n.prototype.isInMode = function() {
  21441. for (var e = 0; e < arguments.length; e++)
  21442. if (this.mode === arguments[e])
  21443. return !0;
  21444. return !1
  21445. }
  21446. ,
  21447. n.prototype.isOutsideMode = function(e) {
  21448. return e = e || this.mode,
  21449. e === u.DOLLHOUSE || e === u.FLOORPLAN
  21450. }
  21451. ,
  21452. n.prototype.is360View = function(e, t) {
  21453. return e === u.PANORAMA && t && !t.isAligned()
  21454. }
  21455. ,
  21456. n.prototype.setScene = function(e) {
  21457. this.sceneIntersectionPlane = e.plane,
  21458. this.path.setScene(e),
  21459. this.moveReticuleToScene(e)
  21460. }
  21461. ,
  21462. n.prototype.moveReticuleToScene = function(e) {
  21463. this.reticule.parent && this.reticule.parent.remove(this.reticule),
  21464. e.add(this.reticule)
  21465. }
  21466. ,
  21467. n.prototype.updateModel = function() {
  21468. function e(e, t, n) {
  21469. this.mode === u.DOLLHOUSE && e !== n && i.call(this, e.center.y)
  21470. }
  21471. function t(e, t) {
  21472. if (this.mode === u.DOLLHOUSE) {
  21473. var n = e ? this.model.center.y : n = t.center.y;
  21474. i.call(this, n)
  21475. }
  21476. }
  21477. function i(e) {
  21478. var t = this.cameraControls.cameras[u.DOLLHOUSE]
  21479. , i = this.cameraControls.controls[u.DOLLHOUSE]
  21480. , n = t.position.y + (e - i.target.y)
  21481. , r = f.showFloorDuration + f.showFloorDelay;
  21482. y.start(v.property(i.target, "y", e), r, null, f.flydown.movementDelay, A[f.flydown.movementEasing], null, V.FlyToViewFloor),
  21483. y.start(v.property(t.position, "y", n), r, null, f.flydown.movementDelay, A[f.flydown.movementEasing], null, V.FlyToViewFloor)
  21484. }
  21485. this.model = this.modelManager.getActiveModel(),
  21486. this.model.on("floor.changed", e.bind(this)),
  21487. this.model.on("allfloors.toggled", t.bind(this)),
  21488. this.on(w.PanoChosen, this.model.setProjectedPanos.bind(this.model));
  21489. /*******************************************************************VR fyz改 from徐世廷*******************************************************************/
  21490. var e2 = this;
  21491. this.model.panos.list.forEach(function(a) {
  21492. a.vrMarker.addEventListener("click", function() {
  21493. e2.flyToPano({
  21494. pano: a
  21495. })
  21496. })
  21497. })
  21498. /********************************************************************************************************************************************/
  21499. this.model.addHighMapCube()//add
  21500. this.on(w.FlyingStarted, this.model.resetHighMap.bind(this.model))
  21501. }
  21502. ,
  21503. n.prototype.updateModelDependentData = function() {
  21504. this.cameraControls.setModelForControls(this.model),
  21505. this.getPanoMarkersFromModel(this.model)
  21506. }
  21507. ,
  21508. n.prototype.onModelChanged = function() {
  21509. this.updateModel(),
  21510. this.updateModelDependentData()
  21511. }
  21512. ,
  21513. n.prototype.getPanoMarkersFromModel = function(e) {
  21514. this.panoMarkers = e.panos.list.reduce(function(e, t) {
  21515. return t.marker ? e.concat(t.marker) : e
  21516. }, [])
  21517. }
  21518. ,
  21519. n.prototype.handleControlMove = function(e) {
  21520. this.emit(w.Move, e)
  21521. }
  21522. ,
  21523. n.prototype.handleControlInputStart = function(e) {
  21524. this.emit(w.InputStart, e)
  21525. }
  21526. ,
  21527. n.prototype.onModeUpdated = function(e, t) {
  21528. this.cameraControls.activateControls(t),
  21529. this.emit(w.ModeChanged, e, t)
  21530. }
  21531. ,
  21532. n.prototype.isWarping = function() {//是否导览缓慢走向某个点
  21533. return this.path.warping
  21534. }
  21535. ,
  21536. n.prototype.isWaitingToWarp = function() {
  21537. return this.path.waitingToWarp
  21538. }
  21539. ,
  21540. n.prototype.getLabelScaleFactor = function() {
  21541. if (this.isOutsideMode()) {
  21542. var e = 10
  21543. , t = Math.sqrt(this.cameraControls.controls[u.FLOORPLAN].currentScale / e);
  21544. return t
  21545. }
  21546. return .5
  21547. }
  21548. ,
  21549. /* n.prototype.changeMusic = function() {//xzw add
  21550. if(!this.director.tourIsPlaying) this.director.bgmReplay()
  21551. } */
  21552. n.prototype.bindEvents = function(e) {
  21553. e !== document && e.setAttribute("tabindex", -1),
  21554. e.addEventListener("mousedown", this.onMouseDown.bind(this)),
  21555. e.addEventListener("mousemove", this.onMouseMove.bind(this)),
  21556. e.addEventListener("mouseover", this.onMouseOver.bind(this)),
  21557. e.addEventListener("mouseout", this.onMouseOut.bind(this)),
  21558. e.addEventListener("mouseup", this.onMouseUp.bind(this)),
  21559. this.modelManager.on(T.ActiveModelChanged, this.onModelChanged.bind(this)),
  21560. e.addEventListener("touchstart", this.onTouchStart.bind(this)),
  21561. e.addEventListener("touchmove", this.onTouchMove.bind(this)),
  21562. e.addEventListener("touchend", this.onTouchEnd.bind(this)),
  21563. e.addEventListener("pointerdown", this.onPointerDown.bind(this)),
  21564. e.addEventListener("pointermove", this.onPointerMove.bind(this)),
  21565. e.addEventListener("pointerup", this.onPointerUp.bind(this)),
  21566. e.addEventListener("pointerout", this.onPointerOut.bind(this)),
  21567. e.addEventListener("pointercancel", this.onPointerCancel.bind(this)),
  21568. document.addEventListener("keydown", this.onKeyDown.bind(this)),
  21569. this.cameraControls.on(_.Move, this.handleControlMove.bind(this)),
  21570. this.cameraControls.on(_.InputStart, this.handleControlInputStart.bind(this)),
  21571. this.cameraControls.on(_.Pinch, this.handleControlPinch.bind(this)),
  21572. this.cameraControls.on(_.Scroll, this.handleControlScroll.bind(this)),
  21573. window.addEventListener("snapshotBegin", this.getWrapShot.bind(this)),//xzw add
  21574. //window.addEventListener("tourAudioEnded", this.changeMusic.bind(this));//xzw add
  21575. // lzb
  21576. window.getSeft && getSeft(this);
  21577. }
  21578. ,
  21579. n.prototype.onMouseDown = function(e) {
  21580. e.currentTarget !== document && e.currentTarget.focus(),
  21581. 0 === e.button && (this.handleInputStart.call(this, e.clientX, e.clientY, !1),
  21582. this.updateIntersect())
  21583. }
  21584. ,
  21585. n.prototype.onMouseMove = function(e) {
  21586. this.isTouchEvent = !1,
  21587. this.handleInputMove.call(this, e.clientX, e.clientY, !1)
  21588. }
  21589. ,
  21590. n.prototype.onMouseOver = function(e) {
  21591. this.containsMouse = !0,
  21592. !this.mouseDown || 0 !== e.which && 0 !== e.buttons || (this.mouseDown = !1)
  21593. }
  21594. ,
  21595. n.prototype.onMouseOut = function(e) {
  21596. this.containsMouse = !1
  21597. }
  21598. ,
  21599. n.prototype.onMouseUp = function(e) {
  21600. this.handleInputEnd.call(this, e.clientX, e.clientY, !1);
  21601. }
  21602. ,
  21603. n.prototype.onTouchStart = function(e) {
  21604. if (e.currentTarget !== document && e.currentTarget.focus(),
  21605. !this.mouseDown) {
  21606. this.couldBeLongTap = !0;
  21607. var t = g.average(e.changedTouches, "clientX")
  21608. , i = g.average(e.changedTouches, "clientY");
  21609. this.handleInputStart.call(this, t, i, !0),
  21610. this.mouseDownTimer = setTimeout(function() {
  21611. this.updateIntersect(),
  21612. this.handleInputEnd.call(this, t, i, !0)
  21613. }
  21614. .bind(this), f.input.longTapThreshold)
  21615. }
  21616. }
  21617. ,
  21618. n.prototype.onTouchMove = function(e) {
  21619. var t = g.average(e.changedTouches, "clientX")
  21620. , i = g.average(e.changedTouches, "clientY");
  21621. this.handleInputMove.call(this, t, i, !0)
  21622. }
  21623. ,
  21624. n.prototype.onTouchEnd = function(e) {
  21625. if (clearTimeout(this.mouseDownTimer),
  21626. this.mouseDown) {
  21627. this.couldBeLongTap = !1,
  21628. this.updateIntersect();
  21629. var t = g.average(e.changedTouches, "clientX")
  21630. , i = g.average(e.changedTouches, "clientY");
  21631. this.handleInputEnd.call(this, t, i, !0)
  21632. }
  21633. //add
  21634. if (this.intersectHot) this.intersectHot.setHoverState(false)
  21635. this.intersectHot = null
  21636. Hot.mobileAutoPlay(this)
  21637. }
  21638. ,
  21639. n.prototype.onPointerDown = function(e) {
  21640. return e.currentTarget !== document && e.currentTarget.focus(),
  21641. this.mouseDown || "mouse" === e.pointerType ? this.onMouseDown(e) : (this.couldBeLongTap = !0,
  21642. this.handleInputStart.call(this, e.clientX, e.clientY, !0),
  21643. void (this.mouseDownTimer = setTimeout(function() {
  21644. this.updateIntersect(),
  21645. this.handleInputEnd.call(this, e.clientX, e.clientY, !0)
  21646. }
  21647. .bind(this), f.input.longTapThreshold)))
  21648. }
  21649. ,
  21650. n.prototype.onPointerMove = function(e) {
  21651. "mouse" !== e.pointerType ? this.handleInputMove.call(this, e.clientX, e.clientY, !0) : this.onMouseMove(e)
  21652. }
  21653. ,
  21654. n.prototype.onPointerUp = function(e) {
  21655. return this.mouseDown && "mouse" !== e.pointerType ? (clearTimeout(this.mouseDownTimer),
  21656. this.couldBeLongTap = !1,
  21657. this.updateIntersect(),
  21658. void this.handleInputEnd.call(this, e.clientX, e.clientY, !0)) : this.onMouseUp(e)
  21659. }
  21660. ,
  21661. n.prototype.onPointerOut = function(e) {
  21662. this.mouseDown = !1
  21663. }
  21664. ,
  21665. n.prototype.onPointerCancel = function(e) {
  21666. this.mouseDown = !1
  21667. }
  21668. ,
  21669. n.prototype.onKeyDown = function(e) {
  21670. var t = function() {
  21671. this.cameraControls.activeControl && this.cameraControls.activeControl.emit(_.Move, "key")
  21672. }
  21673. .bind(this)
  21674. , i = e.which;
  21675. switch (i) {
  21676. case p.F:
  21677. t(),
  21678. this.changeFloor(-1);
  21679. break;
  21680. case p.R:
  21681. t(),
  21682. this.changeFloor(1)
  21683. }
  21684. if (this.mode === u.PANORAMA)
  21685. switch (i) {
  21686. case p.UPARROW:
  21687. case p.W:
  21688. this.flyLocalDirection(d.FORWARD.clone());
  21689. break;
  21690. case p.DOWNARROW:
  21691. case p.S:
  21692. this.flyLocalDirection(d.BACK.clone());
  21693. break;
  21694. case p.A:
  21695. this.flyLocalDirection(d.LEFT.clone());
  21696. break;
  21697. case p.D:
  21698. this.flyLocalDirection(d.RIGHT.clone())
  21699. }
  21700. }
  21701. ,
  21702. n.prototype.handleScrollPinchZoom = function() {
  21703. return function(e) {
  21704. var t = e
  21705. , i = this.zoomLevel;
  21706. this.zoomBy(t),
  21707. this.currentPano && this.zoomStats.addZoomAction(i, this.zoomLevel, this.currentPano.id)
  21708. }
  21709. }(),
  21710. n.prototype.handleControlPinch = function(e) {
  21711. f.zoom.enabled ? this.handleScrollPinchZoom(1 - e) : this.flyLocalDirection(new r.Vector3(0,0,e).normalize())
  21712. }
  21713. ,
  21714. n.prototype.handleControlScroll = function(e) {
  21715. f.zoom.enabled ? (e > 0 ? e = 1 + this.scrollZoomSpeed : e < 0 && (e = 1 - this.scrollZoomSpeed),
  21716. 0 !== e && this.handleScrollPinchZoom(e)) : this.flyLocalDirection(new r.Vector3(0,0,-e).normalize())
  21717. }
  21718. ,
  21719. n.prototype.handleInputStart = function(e, t, i) {
  21720. //许钟文加
  21721. var pad = this.handelPadding(e, t);
  21722. e = pad.x;
  21723. t = pad.y;
  21724. this.isTouchEvent = i,
  21725. m.convertScreenPositionToNDC(e, t, this.mouse),
  21726. m.convertScreenPositionToNDC(e, t, this.mouseAtMouseDown),
  21727. this.mouseCouldBeClickToMove = !0,
  21728. this.mouseDown = !0;
  21729. Hot.mobileAutoPlay(this)
  21730. }
  21731. ,
  21732. n.prototype.handelPadding = function(x, y) {
  21733. //去除player左边和上面的宽高,因为pc的player左上有其他element 许钟文
  21734. if (!this.pad)
  21735. this.pad = {
  21736. x: dom.getOffset("left", $("#player")[0]),
  21737. y: dom.getOffset("top", $("#player")[0])
  21738. }
  21739. return {
  21740. x: x - this.pad.x,
  21741. y: y - this.pad.y
  21742. }
  21743. }
  21744. n.prototype.handleInputMove = function(e, t, i) {
  21745. //许钟文加
  21746. var pad = this.handelPadding(e, t);
  21747. e = pad.x;
  21748. t = pad.y;
  21749. this.isTouchEvent = i,
  21750. m.convertScreenPositionToNDC(e, t, this.mouse),
  21751. this.mouseAtMouseDown.distanceTo(this.mouse) > f.input.moveToleranceNDC && (this.mouseCouldBeClickToMove = !1,
  21752. this.couldBeLongTap = !1,
  21753. clearTimeout(this.mouseDownTimer)),
  21754. this.mouseLastMoveTime = Date.now(),
  21755. this.reticule.move(e, t, i)
  21756. }
  21757. ,
  21758. n.prototype.handleInputEnd = function(e, t, i) {//xzw
  21759. if (this.isTouchEvent = i,
  21760. this.mouseDown = !1,
  21761. this.cameraControls.controls[u.PANORAMA].emit("interaction.direct"),
  21762. !i && this.couldBeLongTap)
  21763. return !0;
  21764. if (this.handleLongTap())
  21765. return !0;
  21766. if (this.mouseCouldBeClickToMove) {
  21767. if (this.flying)
  21768. return this.path.activeTransType === x.WALK && this.emit(w.WarpInterruptedWithFlyTo, this.path.activeTransType),
  21769. !0;
  21770. //add----
  21771. if(this.checkHotClick())//add
  21772. return !0;
  21773. if(this.hoveringPlane){
  21774. this.clickOverlay(this.hoveringPlane)
  21775. return;
  21776. }
  21777. if (this.cameraControls.activeControl && this.cameraControls.activeControl.emit(_.Move, this.isTouchEvent ? "touch" : "mouse"),
  21778. this.history.invalidate(),
  21779. this.intersect)
  21780. return this.flyToPanoClosestToMouse();
  21781. if (this.mode === u.PANORAMA) {
  21782. var n = this.closestPanoInDirection(this.getMouseDirection());
  21783. return n ? this.flyToPano({
  21784. pano: n
  21785. }) : this.bump(this.getMouseDirection())
  21786. }
  21787. }
  21788. this.intersect && this.closestPano && this.closestPano.hoverOff(this.mode)
  21789. }
  21790. ,
  21791. n.prototype.handleLongTap = function() {
  21792. if (this.couldBeLongTap && (!this.isPanoHover || this.mode !== u.PANORAMA))
  21793. return this.cameraControls.activeControl && this.cameraControls.activeControl.emit(_.LongTap, "touch"),
  21794. !0
  21795. }
  21796. ,
  21797. n.prototype.checktagClick = function() {
  21798. if (this.tagManager.intersectTag) {
  21799. var e = this.isTouchEvent
  21800. , t = this.tagManager.clickedOnTag(e, this);
  21801. return e || t || y.cancelById(V.LookTransition),
  21802. !0
  21803. }
  21804. if (this.tagManager.activeTag)
  21805. return this.tagManager.dismissActiveTag(),
  21806. !1
  21807. }
  21808. ,
  21809. n.prototype.rankedtagInDirection = function(e, t) {
  21810. return this.tagManager.rankedtagInDirection(e, this.position, this.camera, t)
  21811. }
  21812. ,
  21813. n.prototype.start = function(e) {
  21814. //-------------------
  21815. //-------------------
  21816. var t = e.mode
  21817. , i = e.pano
  21818. , n = e.position
  21819. , rr = e.quaternion
  21820. , o = e.tag
  21821. , a = e.quickstart
  21822. , s = $.Deferred();
  21823. this.updateModelDependentData(),
  21824. this.updateFromControls(),
  21825. this.findDefaultViews();
  21826. var l = this.is360View(t, i);
  21827. return !this.model.outsideAllowed() || l || a ? this.startInside(i, n, rr, o, s) : this.startOutside(e, s),
  21828. s.done(function(e) {
  21829. this.emit(w.Ready, l, e, o)
  21830. }
  21831. .bind(this)),
  21832. s.promise()
  21833. }
  21834. ,
  21835. n.prototype.startOutside = function(e, t) {
  21836. var i = e.mode
  21837. , n = e.pano
  21838. , r = e.position
  21839. , o = e.quaternion
  21840. , a = e.zoom
  21841. , s = e.floorVisibility
  21842. , l = e.tag;
  21843. this.emit(w.StartOutside, f[i].transitionTime),
  21844. this.isOutsideMode(i) ? (this.model.warpDestFloors(s, !0),
  21845. y.cancelById(V.FlyToViewFloor),
  21846. i === u.FLOORPLAN ? this.floorplanMode(r, o, a) : this.dollhouseMode(r, o),
  21847. t.resolve(!1)) : this.startInsideWithFlyin(n, r, o, l, t)
  21848. }
  21849. ,
  21850. n.prototype.startInside = function(e, t, i, n, r) {
  21851. r = r || $.Deferred(),
  21852. this.currentPano = e;
  21853. window.bus.dispatchEvent({type:'playerAndModelReady'})
  21854. this.ready = true
  21855. var o = e && !e.isAligned();
  21856. if (t = o ? e.position : t || e.position,
  21857. i = i || e.quaternion,
  21858. e) {
  21859. var a = this.startInside.bind(this, e, t, i, n, r);
  21860. if (this.checkAndWaitForPanoLoad(e, "high", "low", this.basePanoSize, a))
  21861. return
  21862. }
  21863. //add
  21864. this.transitionPos({type:"beforeFlytopano", pano:this.currentPano, dur:0})
  21865. //this.updateHotVisible()
  21866. Hot.updateVisibles([this.currentPano])
  21867. this.modeTran = "panorama-panorama"
  21868. return this.mode = u.PANORAMA,
  21869. e.floor.enter(this.mode),
  21870. this.emit(w.PanoChosen, this.currentPano, this.currentPano),
  21871. this.switchCameraMode(this.mode, i),
  21872. this.emit(w.StartInside, o),
  21873. r.resolve(!0),
  21874. r
  21875. }
  21876. ,
  21877. n.prototype.startInsideWithFlyin = function(e, t, i, n, r) {
  21878. if (r = r || $.Deferred(),
  21879. this.dollhouseMode(),
  21880. !e)
  21881. return F.warn("Player.startInsideWithFlyin() -> targetPano is invalid."),
  21882. r.resolve(!1),
  21883. r;
  21884. t = t || e.position;
  21885. var o = i || this.cameraControls.activeControl.camera.quaternion
  21886. , a = e.position;
  21887. return this.fitDollhouse(a, t, o),
  21888. setTimeout(function(t) {
  21889. this.cameraControls.activeControl && (this.cameraControls.activeControl.maxDistance = t);
  21890. var n = {
  21891. mode: u.PANORAMA,
  21892. pano: e,
  21893. quaternion: i,
  21894. callback: function() {
  21895. this.emit(w.FlyinFinished),
  21896. r.resolve(!0)
  21897. }
  21898. .bind(this)
  21899. };
  21900. this.flyToNewMode(n)
  21901. }.bind(this, this.cameraControls.activeControl.maxDistance), f.startupFlyinDelay),
  21902. r
  21903. }
  21904. ,
  21905. n.prototype.checkAndWaitForPanoLoad = function() {
  21906. var e = {}
  21907. , t = {}
  21908. , i = 5e3
  21909. , n = function() {
  21910. for (var n in e)
  21911. if (e.hasOwnProperty(n) && e[n]) {
  21912. var r = performance.now() - t[n];
  21913. if (r < i)
  21914. return !0
  21915. }
  21916. return !1
  21917. };
  21918. return function(r, o, a, s, l, c, h, u, d, p) {
  21919. if (n())
  21920. return !0;
  21921. var f = function(t, i, n) {
  21922. N.delayOneFrame(function() {
  21923. e[t] = !1,
  21924. l && l(i, n)
  21925. }
  21926. .bind(this))
  21927. }
  21928. .bind(this, r.id)
  21929. , g = function(t, i) {
  21930. N.delayOneFrame(function() {
  21931. e[t] = !1,
  21932. c && c(i)
  21933. }
  21934. .bind(this))
  21935. }
  21936. .bind(this, r.id);
  21937. try {
  21938. return null !== u && void 0 !== u || (u = !0),
  21939. 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),
  21940. e[r.id] && (t[r.id] = performance.now()),
  21941. e[r.id]
  21942. } catch (n) {
  21943. throw e[r.id] = !1,
  21944. t[r.id] = performance.now() - i,
  21945. n
  21946. }
  21947. }
  21948. }(),
  21949. n.prototype.checkAndWaitForWholePanoLoad = function(e, t, i, n, r) {
  21950. if (!e)
  21951. throw new M("Player.checkAndWaitForWholePanoLoad() -> Cannot load texture for null pano.");
  21952. return r && this.model.waitForLoad(e, function() {
  21953. return e.isLoaded(i)
  21954. }),
  21955. !e.isLoaded(t) && (e.loadCube(t).done(n),
  21956. !0)
  21957. }
  21958. ,
  21959. n.prototype.checkAndWaitForTiledPanoLoad = function() {
  21960. var e = new r.Vector3;
  21961. return function(t, i, n, r, o, a, s, l) {
  21962. if (!t)
  21963. throw new M("Player.checkAndWaitForTiledPanoLoad() -> Cannot load texture for null pano.");
  21964. // 周恩光加 loadTiledPano有时会在progress中卡住,此时判断为成功加载
  21965. let isDone = false
  21966. let handle
  21967. return e.copy(d.FORWARD),
  21968. this.getDirection(e),
  21969. !t.isLoaded(i) && (
  21970. a && this.model.waitForLoad(t, function() {
  21971. return t.isLoaded(i)
  21972. }),
  21973. t.loadTiledPano(i, e, null, s, l)
  21974. .done(function(e, t) {
  21975. isDone = true
  21976. n && n(e, t)
  21977. }.bind(this))
  21978. .fail(function(e) {
  21979. r && r(e)
  21980. }.bind(this))
  21981. .progress(function(e, t, i) {
  21982. handle && clearTimeout(handle)
  21983. handle = setTimeout(() => {
  21984. if(isDone == false) n && n(e, t)
  21985. }, 3000) // 卡住3秒判断为加载成功
  21986. o && o(e, t, i)
  21987. }.bind(this)),
  21988. !0
  21989. )
  21990. }
  21991. }(),
  21992. n.prototype.switchCameraMode = function(e, t) {
  21993. var i = this.cameraControls.controls[e]
  21994. , n = i.camera;
  21995. switch (e) {
  21996. case u.PANORAMA:
  21997. n.position.copy(this.currentPano.position);
  21998. var o = t ? d.FORWARD.clone().applyQuaternion(t) : this.getDirection().setY(0).normalize();
  21999. i.lookAt(o.add(n.position));
  22000. break;
  22001. case u.DOLLHOUSE:
  22002. /* var a = this.position.clone();
  22003. 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),
  22004. n.position.copy(a),
  22005. i.target.copy(this.target.clone().setY(this.model.center.y));
  22006. break; */
  22007. //for多楼层 且 让模型刚好适应屏幕
  22008. var box = this.model.boundingBox.clone();
  22009. box.applyMatrix4(this.camera.matrixWorld);//将 boundingbox、也就是模型, 转换到当前相机朝向
  22010. var boxSize = box.size() //其中boxSize.x是模型在当前相机视角下的横向宽度,当飞出后,该宽度要刚好占满窗口宽度
  22011. var fov = B.getHFOVFromVFOV(f.insideFOV, n.aspect, 1); //获得在当前窗口的横向的fov
  22012. var distance = Math.abs(boxSize.x) / 2 / Math.tan(THREE.Math.degToRad(fov / 2))//根据上面获得的参数得到target到相机的距离
  22013. //console.log(boxSize.x,distance, boxSize.length() / 2)
  22014. distance += boxSize.length() / 2 //由于此时模型从中心向相机的部分由于近大远小仍超出屏幕,所以将target放在靠近模型靠近相机的这一端,故而再加上box的对角线长度的一半, 虽然本该加上Math.sqrt(boxSize.z*boxSize.z +boxSize.y+boxSize.y)/2,但是这样模型显得比较满
  22015. if(this.mode === u.PANORAMA){
  22016. i.target.copy(this.model.center);
  22017. var vec = this.getDirection().negate().setY(1).normalize()//获得朝向
  22018. }else{
  22019. i.target.copy(this.target.clone().setY(this.model.center.y))
  22020. var vec = d.DOWN.clone().applyQuaternion(this.quaternion).setY(1).normalize()
  22021. }
  22022. vec.multiplyScalar(distance )
  22023. n.position.copy(i.target.clone().add(vec))
  22024. break
  22025. case u.FLOORPLAN:
  22026. n.position.copy(this.model.center).setY(f.floorplan.cameraHeight),
  22027. i.target.copy(this.model.center).setY(0),
  22028. i.zoomToContain(this.model.size),
  22029. i.rotateToView(this.model.size, this.getDirection())
  22030. }
  22031. i.update(0)
  22032. }
  22033. ,
  22034. n.prototype.update = function() {
  22035. var e = (new r.Vector3,
  22036. {})
  22037. , t = [];
  22038. return function(i) {
  22039. this.updatePersistentZooming(i),
  22040. this.updateFromControls(i),
  22041. this.getCurrentNodePanos(t)
  22042. this.lastFrameChanged = false
  22043. if(this.hasChanged(e) ) {
  22044. this.lastFrameChanged = e.cameraChanged3 ? 'level3' : e.cameraChanged2 ? 'level2' : e.cameraChanged ? 'level1' : false
  22045. this.lastChangeTime = Date.now(),
  22046. !this.mouseDown && this.containsMouse && this.updateIntersect(),
  22047. this.emit(w.ViewChanged, e)
  22048. }
  22049. if(e.cameraChanged2){ //变化要更大些
  22050. }
  22051. if(e.cameraChanged){
  22052. this.mode == "panorama" && window.cad && cad.setSign({ x: this.position.x, y: this.position.z }, this.cameraControls.controls.panorama.lon);
  22053. /* for(var i in this.model.hots){
  22054. this.model.hots[i].updateTitle(this)
  22055. } */
  22056. Hot.updateHots()
  22057. }
  22058. this.model.supportsTiles && (this.updateTileDownloader(t),
  22059. this.updatePanoRenderer(t)),
  22060. this.updatePreRendering(t),
  22061. this.reticule.update(),
  22062. this.path.update(),
  22063. this.spider.update(),
  22064. this.cachedPanoCandidates && f.navigation.panoScores && this.model.panos.showPanoScores(this.cachedPanoCandidates),
  22065. this.updateControlLocks(),
  22066. this.model.supportsTiles && this.updateZoomPano()
  22067. }
  22068. }(),
  22069. /* n.prototype.controlVideosPlay = function() {//判断box视频是否可见 不可见就暂停
  22070. var lastMode, lastPano;
  22071. return function(){
  22072. var mode = this.mode;
  22073. var pano = mode == "panorama" ? this.currentPano : "";
  22074. if(mode != "panorama" || pano != lastPano){
  22075. overlay.noBlock = null
  22076. }
  22077. this.overlayGroup.children.forEach((overlay)=>{
  22078. if(overlay.overlayType == "video" ){
  22079. var matrix = overlay.plane.matrixWorld;
  22080. var inSight = false;
  22081. var cameraDir = this.getDirection();
  22082. var planeDir = (new r.Vector3).copy(d.FORWARD).applyQuaternion(overlay.plane.quaternion)
  22083. var vertexes = []
  22084. if(cameraDir.angleTo(planeDir)>Math.PI/2){//朝向相机视线
  22085. for(let i=0; i<4; i++){
  22086. var vertex = overlay.plane.geometry.vertices[i].clone().applyMatrix4(matrix)
  22087. vertexes.push(vertex)
  22088. if(overlay.noBlock == null){
  22089. if(!m.ifShelter(vertex)){
  22090. overlay.noBlock = true
  22091. }
  22092. inSight = true; break;
  22093. }else{
  22094. overlay.noBlock = true
  22095. }
  22096. if(m.getPos2d(vertex, this.camera, $("#player")[0]).inSight){
  22097. inSight = true; break;
  22098. }
  22099. }
  22100. }
  22101. overlay.inSight = inSight
  22102. if(!inSight)overlay.plane.material.map.image.pause()
  22103. else overlay.plane.material.map.image.play()//maybe fail
  22104. }
  22105. })
  22106. lastMode = mode, lastPano = pano
  22107. }
  22108. }() */
  22109. n.prototype.updatePersistentZooming = function(e) {
  22110. 1 === this.zooming ? this.zoomBy(1 + this.zoomSpeed * e) : this.zooming === -1 && this.zoomBy(1 - this.zoomSpeed * e)
  22111. }
  22112. ,
  22113. n.prototype.updateControlLocks = function() {
  22114. this.currentPano && this.model.supportsTiles && (this.cameraControls.controls[u.PANORAMA].locked = !this.currentPano.highestFullTileRenderOpCompleted && this.currentPano.lockUntilRenderingComplete)
  22115. }
  22116. ,
  22117. n.prototype.updatePanoRenderer = function() {
  22118. var e = new r.Vector3;
  22119. return function(t) {
  22120. var i = this.nextPano || this.currentPano;
  22121. this.panoRenderer.hasQueuedTiles() && i && (e.copy(d.FORWARD),
  22122. this.getDirection(e),
  22123. this.panoRenderer.updateDirection(e))
  22124. }
  22125. }(),
  22126. n.prototype.cleanupInactivePanos = function() {
  22127. var e = []
  22128. , t = [];
  22129. return function() {
  22130. e.length = 0,
  22131. e.push(this.currentPano),
  22132. this.nextPano && e.push(this.nextPano),
  22133. t.length = 0;
  22134. for (var i = 0; i < this.panoRenderer.activePanos.length; i++)
  22135. t.push(this.panoRenderer.activePanos[i]);
  22136. for (var n = 0; n < t.length; n++) {
  22137. for (var r = t[n], o = !0, a = 0; a < e.length; a++)
  22138. r.id === e[a].id && (o = !1);
  22139. o && r.exit()
  22140. }
  22141. }
  22142. }(),
  22143. n.prototype.updatePreRendering = function() {
  22144. var e = {};
  22145. return function(t) {
  22146. if (1 === f.tiling.preRenderTourPanos && this.preRenderingEnabled) {
  22147. var i = this.nextPano || this.currentPano;
  22148. if (i && t && t.length > 1) {
  22149. var n = t.findIndex(function(e) {
  22150. if (e.id === i.id)
  22151. return !0
  22152. });
  22153. if (n >= 0 && n + 1 < t.length) {
  22154. var r = t[n + 1];
  22155. r.isLoaded(this.basePanoSize) || e[r.id] || (window.setTimeout(function(t) {
  22156. this.checkAndWaitForPanoLoad(t, "high", "low", this.basePanoSize, null, null, null, !1, !1, !1),
  22157. window.setTimeout(function(t) {
  22158. e[t.id] = !1
  22159. }
  22160. .bind(this, t), f.tiling.panoPreRenderRepeatDelay)
  22161. }
  22162. .bind(this, r), f.tiling.panoPreRenderDelay),
  22163. e[r.id] = !0)
  22164. }
  22165. }
  22166. }
  22167. }
  22168. }(),
  22169. n.prototype.enablePreRendering = function() {
  22170. this.preRenderingEnabled = !0
  22171. }
  22172. ,
  22173. n.prototype.disablePreRendering = function() {
  22174. this.preRenderingEnabled = !1,
  22175. this.cleanupInactivePanos()
  22176. }
  22177. ,
  22178. n.prototype.updateTileDownloader = function() {
  22179. var e = new r.Vector3;
  22180. return function(t) {
  22181. var i = this.nextPano || this.currentPano;
  22182. i && (e.copy(d.FORWARD),
  22183. this.getDirection(e),
  22184. this.tileDownloader.tilePrioritizer.updateCriteria(i, this.position, e, t.length > 0 ? t : null),
  22185. this.tileDownloader.processPriorityQueue = !0)
  22186. }
  22187. }(),
  22188. n.prototype.updateFromControls = function(e) {
  22189. null !== e && void 0 !== e || (e = 0),
  22190. this.cameraControls.activeControl && (this.cameraControls.activeControl.update(e),
  22191. this.quaternion.copy(this.cameraControls.activeControl.camera.quaternion),
  22192. this.position.copy(this.cameraControls.activeControl.camera.position),
  22193. this.target.copy(this.cameraControls.activeControl.target),
  22194. this.cameraControls.activeControl.camera.updateProjectionMatrix(),
  22195. this.camera.projectionMatrix.copy(this.cameraControls.activeControl.camera.projectionMatrix)),
  22196. this.camera.position.copy(this.position),
  22197. this.camera.quaternion.copy(this.quaternion),
  22198. this.camera.updateMatrix(),
  22199. this.camera.updateMatrixWorld()
  22200. }
  22201. ,
  22202. n.prototype.hasChanged = function(e) {
  22203. /* if (!this.previousState)
  22204. return this.previousState = {
  22205. allFloorsVisible: this.model.allFloorsVisible,
  22206. position: this.position.clone(),
  22207. quaternion: this.quaternion.clone(),
  22208. mouse: this.mouse.clone(),
  22209. labelScaleFactor: this.getLabelScaleFactor(),
  22210. currentFloor: this.model.currentFloor,
  22211. projectionMatrix: this.camera.projectionMatrix.clone(),
  22212. worldMatrix: this.camera.matrixWorld.clone(),
  22213. mode: this.mode,
  22214. modelPosition: this.model.position.clone(),
  22215. modelCenter: this.model.center.clone(),
  22216. zoomLevel: this.zoomLevel
  22217. },
  22218. !0;
  22219. 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;
  22220. return e.allFloorsVisible = this.model.allFloorsVisible !== this.previousState.allFloorsVisible,
  22221. e.moved = !this.position.equals(this.previousState.position),
  22222. e.rotated = !this.quaternion.equals(this.previousState.quaternion),
  22223. e.mouseMoved = !this.mouse.equals(this.previousState.mouse),
  22224. e.labelScaleFactor = this.getLabelScaleFactor() !== this.previousState.labelScaleFactor,
  22225. e.floorChanged = this.model.currentFloor !== this.previousState.currentFloor,
  22226. e.cameraProjectionChanged = !this.camera.projectionMatrix.equals(this.previousState.projectionMatrix),
  22227. e.cameraWorldMatrixChanged = !this.camera.matrixWorld.equals(this.previousState.worldMatrix),
  22228. e.modeChanged = this.mode !== this.previousState.mode,
  22229. e.modelPositionChanged = !this.model.position.equals(this.previousState.modelPosition),
  22230. e.modelCenterChanged = !this.model.center.equals(this.previousState.modelCenter),
  22231. e.nextPanoActive = null !== this.nextPano,
  22232. e.zoomLevel = this.zoomLevel !== this.previousState.zoomLevel,
  22233. this.previousState.allFloorsVisible = this.model.allFloorsVisible,
  22234. this.previousState.position.copy(this.position),
  22235. this.previousState.quaternion.copy(this.quaternion),
  22236. this.previousState.mouse.copy(this.mouse),
  22237. this.previousState.labelScaleFactor = this.getLabelScaleFactor(),
  22238. this.previousState.currentFloor = this.model.currentFloor,
  22239. this.previousState.projectionMatrix.copy(this.camera.projectionMatrix),
  22240. this.previousState.worldMatrix.copy(this.camera.matrixWorld),
  22241. this.previousState.mode = this.mode,
  22242. this.previousState.modelPosition.copy(this.model.position),
  22243. this.previousState.modelCenter.copy(this.model.center),
  22244. this.previousState.zoomLevel = this.zoomLevel,
  22245. !t */
  22246. if (!this.previousState)
  22247. {
  22248. this.previousState = {
  22249. allFloorsVisible: this.model.allFloorsVisible,
  22250. position: this.position.clone(),
  22251. quaternion: this.quaternion.clone(),
  22252. mouse: this.mouse.clone(),
  22253. //labelScaleFactor: this.getLabelScaleFactor(),
  22254. currentFloor: this.model.currentFloor,
  22255. projectionMatrix: this.camera.projectionMatrix.clone(),
  22256. worldMatrix: this.camera.matrixWorld.clone(),
  22257. mode: this.mode,
  22258. modelPosition: this.model.position.clone(),
  22259. modelCenter: this.model.center.clone(),
  22260. zoomLevel: this.zoomLevel
  22261. };
  22262. e.cameraChanged = e.cameraChanged2 = true;
  22263. return !0;
  22264. }
  22265. //许钟文改 分成相机是否改变cameraChanged 和其他
  22266. 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)
  22267. 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 ;
  22268. e.cameraChanged = !a;
  22269. e.allFloorsVisible = this.model.allFloorsVisible !== this.previousState.allFloorsVisible,
  22270. e.moved = !this.position.equals(this.previousState.position),
  22271. e.rotated = !this.quaternion.equals(this.previousState.quaternion),
  22272. e.mouseMoved = !this.mouse.equals(this.previousState.mouse),
  22273. // e.labelScaleFactor = this.getLabelScaleFactor() !== this.previousState.labelScaleFactor,
  22274. e.floorChanged = this.model.currentFloor !== this.previousState.currentFloor,
  22275. e.cameraProjectionChanged = !this.camera.projectionMatrix.equals(this.previousState.projectionMatrix),
  22276. e.cameraWorldMatrixChanged = !this.camera.matrixWorld.equals(this.previousState.worldMatrix),
  22277. e.modeChanged = this.mode !== this.previousState.mode,
  22278. e.modelPositionChanged = !this.model.position.equals(this.previousState.modelPosition),
  22279. e.modelCenterChanged = !this.model.center.equals(this.previousState.modelCenter),
  22280. e.nextPanoActive = null !== this.nextPano,
  22281. e.zoomLevel = this.zoomLevel !== this.previousState.zoomLevel
  22282. /* if(e.cameraChanged){//
  22283. 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)
  22284. }else e.cameraChanged2 = false */
  22285. if(e.cameraChanged){
  22286. e.cameraChanged2 = e.cameraProjectionChanged || !MathLight.closeTo(this.quaternion, this.previousState.quaternion, 5) || !MathLight.closeTo(this.position, this.previousState.position, 4)
  22287. e.cameraChanged3 = e.cameraProjectionChanged || !MathLight.closeTo(this.quaternion, this.previousState.quaternion, 3) || !MathLight.closeTo(this.position, this.previousState.position, 3)
  22288. } else {
  22289. e.cameraChanged2 = false
  22290. e.cameraChanged3 = false
  22291. }
  22292. this.previousState.allFloorsVisible = this.model.allFloorsVisible,
  22293. this.previousState.position.copy(this.position),
  22294. this.previousState.quaternion.copy(this.quaternion),
  22295. this.previousState.mouse.copy(this.mouse),
  22296. //this.previousState.labelScaleFactor = this.getLabelScaleFactor(),
  22297. this.previousState.currentFloor = this.model.currentFloor,
  22298. this.previousState.projectionMatrix.copy(this.camera.projectionMatrix),
  22299. this.previousState.worldMatrix.copy(this.camera.matrixWorld),
  22300. this.previousState.mode = this.mode,
  22301. this.previousState.modelPosition.copy(this.model.position),
  22302. this.previousState.modelCenter.copy(this.model.center),
  22303. this.previousState.zoomLevel = this.zoomLevel;
  22304. //console.log("cameraChanged2 "+ e.cameraChanged2 + ", mouseMoved "+e.mouseMoved)
  22305. return !t
  22306. }
  22307. ,
  22308. n.prototype.updateIntersect = function() {
  22309. var e = this.flying || this.isWarping()
  22310. , t = this.isOutsideMode() && this.cameraControls.controls[this.mode].isEngaged()
  22311. , i = y.getById(V.LookTransition)
  22312. , n = !(e || t || this.isTouchEvent || i.length && i[0].running);
  22313. {//clear:
  22314. if(this.intersectHot) this.intersectHot.setHoverState(false)
  22315. this.intersectHot = null
  22316. $("#player").css("cursor", "")
  22317. }
  22318. var deal = ()=>{
  22319. if(this.intersect && this.intersect.object.visible ){
  22320. if("hotSprite" == this.intersect.object.type){
  22321. this.intersectHot = this.intersect.object
  22322. while(!(this.intersectHot instanceof Hot)){
  22323. this.intersectHot = this.intersectHot.parent
  22324. }
  22325. $(`.toolRight .spotList ul li[data-spid=${this.intersectHot.sid}]`).addClass("active")
  22326. this.intersectHot.setHoverState(true)
  22327. }
  22328. }
  22329. }
  22330. if(this.model.hotGroup){
  22331. var hots = this.model.hotGroup.children.filter(e=> e.info.actionType.examine || e.info.actionType.fastTran || e.info.actionType.openHot || e.info.actionType.playAndPause)
  22332. this.intersect = this.getMouseIntersect(null, hots.concat(this.model.colliders));
  22333. if(this.intersect){
  22334. deal()
  22335. let intersect = this.intersect
  22336. if(this.intersectHot){
  22337. this.intersect = null
  22338. $("#player").css("cursor", "pointer");
  22339. }else{
  22340. if(intersect.object.parent.parent.hidden ){//楼层已隐藏
  22341. this.intersect = null
  22342. }
  22343. }
  22344. }
  22345. }
  22346. this.intersect = this.getMouseIntersect(),
  22347. this.intersect && this.updateClosestPano(this.intersect),
  22348. this.closestPano || this.closestPanoInDirection(this.getMouseDirection()) ? (this.reticule.updatePosition(this.position, this.intersect),
  22349. f.navigation.panoScores && !f.navigation.mouseDirection && this.closestPanoInDirection(this.getDirection())) : this.reticule.hide()
  22350. }
  22351. ,
  22352. n.prototype.checkHotClick = function() {
  22353. if(this.intersectHot){
  22354. if(this.intersectHot.texType == "video" && this.intersectHot.info.actionType.playAndPause){
  22355. this.intersectHot.switchPlay(!!this.intersectHot.pausedByUser)
  22356. }
  22357. this.intersectHot.examine(this)
  22358. return true;
  22359. }
  22360. },
  22361. n.prototype.getMouseDirection = function(e) {
  22362. e = e || this.mouse;
  22363. var t = new r.Vector3(e.x,e.y,-1).unproject(this.camera)
  22364. , i = new r.Vector3(e.x,e.y,1).unproject(this.camera);
  22365. return i.sub(t).normalize()
  22366. }
  22367. ,
  22368. n.prototype.hoverOverlay = function(mesh){
  22369. if(!mesh){
  22370. this.hoveringPlane = null;
  22371. $("#player").css("cursor",this.currentCursor || "" );
  22372. }else{
  22373. var overlay = mesh.parent;
  22374. $("#player").css("cursor","pointer");
  22375. this.hoveringPlane = overlay;
  22376. return true;
  22377. }
  22378. },
  22379. n.prototype.clickOverlay = function(overlay){
  22380. if(this.openOverlay && !overlay)return;
  22381. var plane = overlay.plane;
  22382. /* if(overlay.overlayType == "video"){
  22383. if(plane.material.map.image.paused) plane.material.map.image.play()
  22384. else plane.material.map.image.pause()
  22385. } */
  22386. if(overlay.overlayType == "video"){
  22387. overlay.switchPlay(!!overlay.pausedByUser)
  22388. }
  22389. /* if(window.EditOverlay &&EditOverlay.editing){
  22390. if(EditOverlay.editPlane && overlay != EditOverlay.editPlane) EditOverlay.closeOverlayPanel('cancel')
  22391. $('#overlayProp').removeClass('atRight').removeClass('hide')
  22392. EditOverlay.endAddPlane();
  22393. EditOverlay.updateOverlayPanel(overlay)
  22394. EditOverlay.controlSelectOverlay(overlay)
  22395. return;
  22396. } */
  22397. },
  22398. n.prototype.getMouseIntersect = function(e, t) {//xzw change
  22399. e = e || this.mouse.clone(),
  22400. t = t || this.model.floors.reduce(function(e, t) {
  22401. return t.hidden ? e : e.concat(t.collider.children)
  22402. }, this.mode === u.PANORAMA ? this.panoMarkers : []);
  22403. var i = new r.Vector3(e.x,e.y,-1).unproject(this.camera);
  22404. this.raycaster.set(i, this.getMouseDirection(e));
  22405. var n = this.raycaster.intersectObjects(t, true);//add true
  22406. var o = n[0];
  22407. if(o){
  22408. o.face && (o.normal = o.face.normal.applyQuaternion(o.object.quaternion),
  22409. this.position.clone().sub(o.point).dot(o.normal) < 0 && o.normal.negate(),
  22410. this.currentPano ? o.onFloor = o.point.y < this.position.y - .5 * this.currentPano.height : o.onFloor = o.point.y < this.position.y - .5,
  22411. o.horizontal = .8 < o.normal.y);
  22412. return o
  22413. }
  22414. }
  22415. ,
  22416. n.prototype.updateClosestPano = function(e) {
  22417. var t = [s.filters.isPanoAligned()];
  22418. if (this.mode === u.PANORAMA) {
  22419. if (!this.currentPano)
  22420. return;
  22421. t.push(s.filters.not(this.currentPano)),
  22422. t.push(s.filters.isNeighbourPanoTo(this.currentPano)),
  22423. t.push(s.filters.inFloorDirection(this.currentPano.floorPosition, this.getDirection(), .25)),
  22424. t.push(s.filters.isCloseEnoughTo(e.point, f.panoFloorClickRadius)),
  22425. t.push(s.filters.isNotBehindNormal(e.point, e.normal))
  22426. } else{
  22427. t.push(s.filters.isOnVisibleFloor()),
  22428. t.push(this.checkHasNeighbor)//add
  22429. this.mode !== u.FLOORPLAN && t.push(s.filters.inDirection(this.position, this.getDirection(), .25));
  22430. }
  22431. var i = this.model.panos.find(t, [s.sortFunctions.floorDistanceToPoint(e.point)]);
  22432. i !== this.closestPano ? (i && (this.isPanoHover = !0),
  22433. this.emit(w.ClosestPanoChanging, this.closestPano, i, this.mode),
  22434. this.closestPano = i) : this.isPanoHover = !1
  22435. }
  22436. ,
  22437. n.prototype.dollhouseMode = function(e, t) {
  22438. this.emit(w.ModeChanging, this.mode, u.DOLLHOUSE),
  22439. this.mode = u.DOLLHOUSE,
  22440. this.cameraControls.controls[u.DOLLHOUSE].reset();
  22441. var i = new r.Vector3(this.model.center.x,0,this.model.center.z)
  22442. , n = new r.Vector3(15,10,15);
  22443. if (e && t) {
  22444. var o = d.FORWARD.clone().applyQuaternion(t)
  22445. , a = this.model.center.clone().sub(e)
  22446. , s = a.dot(o);
  22447. s > 0 ? (i = o.clone().multiplyScalar(s).add(e),
  22448. n.copy(e)) : F.warn("Tried to initiate dollhouse mode that wasn't looking at the model", e, t)
  22449. }
  22450. this.cameraControls.controls[u.DOLLHOUSE].resetRanges(0, !0),
  22451. this.cameraControls.controls[u.DOLLHOUSE].target.copy(i),
  22452. this.cameraControls.cameras[u.DOLLHOUSE].position.copy(n),
  22453. this.updateFromControls(),
  22454. this.model.alpha = 1,
  22455. this.model.skybox.material.uniforms.opacity.value = 0
  22456. }
  22457. ,
  22458. n.prototype.insideMode = function(e, t) {
  22459. var i = $.Deferred()
  22460. , n = t || null;
  22461. if (this.mode !== u.PANORAMA && this.mode !== u.TRANSITIONING) {
  22462. var r = [s.filters.isPanoAligned()];
  22463. this.model.currentFloor && r.push(s.filters.atFloor(this.model.currentFloor)),
  22464. e = e || this.currentPano || this.model.panos.find(r, [s.sortFunctions.distanceToPoint(this.cameraControls.activeControl.target)]),
  22465. this.flyToNewMode({
  22466. mode: u.PANORAMA,
  22467. pano: e,
  22468. callback: n
  22469. }).done(i.resolve.bind(i)).fail(i.reject.bind(i))
  22470. } else {
  22471. var o = this.mode === u.PANORAMA ? "Already in panorama mode" : "Cannot change mode during mode transition";
  22472. i.reject(o)
  22473. }
  22474. return i.promise()
  22475. }
  22476. ,
  22477. n.prototype.fitDollhouse = function(e, t, i) {//许钟文改 飞入前寻找和初始视角最合适的位置
  22478. //if(urlHasValue('oldEntry')){
  22479. //搬自一代。
  22480. var maxY = this.model.boundingBox.max.y;
  22481. var n = d.FORWARD.clone().applyQuaternion(i)
  22482. , i = n.clone().add(e);
  22483. this.cameraControls.activeControl.target.copy(i),
  22484. this.cameraControls.activeControl.camera.position.set(0, maxY * 2.4, 0).add(e).add(n.multiplyScalar(-10))
  22485. //return;
  22486. /* //this.camera.position.copy(this.model.center);
  22487. //this.camera.updateMatrixWorld()
  22488. this.switchCameraMode("dollhouse", i) */
  22489. //}//下面是二代代码,看不太懂。因为有的场景在靠近一端的某个方向截取的初始视角会甩镜头,也就是不是下去之后的方向
  22490. //直接用一代的这个 效果和二代几乎一样,且不会甩
  22491. /* var n = d.FORWARD.clone().applyQuaternion(i);
  22492. this.cameraControls.activeControl.target.copy(n).add(e);
  22493. var o = d.RIGHT.clone().applyQuaternion(i)
  22494. , a = d.UP.clone()
  22495. , s = o.clone().applyAxisAngle(a, Math.PI / 2)
  22496. , l = this.model.boundingBox.max.clone()
  22497. , c = this.model.boundingBox.min.clone()
  22498. , 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)]
  22499. , u = 0
  22500. , p = 0
  22501. , g = 0;
  22502. h.forEach(function(e, t, i) {
  22503. var n = Math.abs(e.dot(o))
  22504. , r = e.dot(s);
  22505. n > u && (u = n,
  22506. p = r),
  22507. r > g && (g = r)
  22508. });
  22509. 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)))
  22510. , v = s.clone().multiplyScalar(p).add(t)
  22511. , A = s.clone().multiplyScalar(g).add(t);
  22512. p = u / Math.tan(this.cameraControls.activeControl.camera.fov / 2 * this.cameraControls.activeControl.camera.aspect * (Math.PI / 180));
  22513. g = m / Math.tan(this.cameraControls.activeControl.camera.fov / 2 * (Math.PI / 180));
  22514. p = Math.max(p, 10),
  22515. g = Math.max(g, 10);
  22516. var y = n.clone().multiplyScalar(-p).add(v).sub(t).length()
  22517. , C = n.clone().multiplyScalar(-g).add(v).sub(t).length();
  22518. this.cameraControls.activeControl.maxDistance = f.skyboxRadius - 1;
  22519. y >= C ? this.cameraControls.activeControl.camera.position.set(0, 6, 0).add(v).add(n.multiplyScalar(1.1 * -p))
  22520. : this.cameraControls.activeControl.camera.position.set(0, 6, 0).add(A).add(n.multiplyScalar(1.1 * -g))
  22521. */
  22522. }
  22523. ,
  22524. n.prototype.floorplanMode = function(e, t, i) {
  22525. this.mode = u.FLOORPLAN;
  22526. var n = this.cameraControls.controls[u.FLOORPLAN];
  22527. n.reset();
  22528. var r = e ? e : this.model.center;
  22529. if (n.target.copy(r).setY(0),
  22530. n.camera.position.copy(r).setY(f.floorplan.cameraHeight),
  22531. i ? (n.currentScale = i / ($("#player").width() / $("#player").height()),
  22532. n.absoluteScale = n.currentScale) : n.zoomToContain(this.model.size),
  22533. t) {
  22534. var o = d.LEFT.clone().applyQuaternion(t);
  22535. n.rotateLeft(-Math.atan2(o.x, o.z))
  22536. } else
  22537. n.rotateToView(this.model.size, this.getDirection());
  22538. n.update(0)
  22539. }
  22540. ,
  22541. n.prototype.nonInterruptingFlyToPano = function(e, t) {
  22542. return e.skipWarpingCheck = !0,
  22543. this.flyToPano(e, t)
  22544. }
  22545. ,
  22546. n.prototype.updateMarkerVisi = function() {//加
  22547. if(this.mode != "panorama")return;
  22548. this.model.panos.list.forEach((pano)=>{
  22549. if(!pano.marker)return;
  22550. pano.marker.material.visible = !!pano.neighbourPanos[this.currentPano.id];
  22551. })
  22552. }
  22553. ,
  22554. /* n.prototype.updateHotVisible = function(pano){
  22555. var hots = this.model.hots;
  22556. pano = pano || this.currentPano;
  22557. for (var index in hots){
  22558. var visible;
  22559. if(this.mode != "panorama"){
  22560. visible = true;
  22561. }else{
  22562. //hots[index].mesh.material.depthTest = false;
  22563. visible = !hots[index].visiblePanos || hots[index].visiblePanos.indexOf(pano.id) > -1
  22564. }
  22565. hots[index].mesh.visible = visible;
  22566. }
  22567. }
  22568. */
  22569. n.prototype.flyToPano = function(e, t) {
  22570. var i = e.pano
  22571. , aim = e.lookAtPoint
  22572. , aimQua = e.quaternion //ADD
  22573. , o = e.duration
  22574. , a = e.aimDuration
  22575. , s = e.maxDistanceOverride
  22576. , l = e.skipWarpingCheck
  22577. , c = e.constantMoveSpeed
  22578. , h = null
  22579. , p = null
  22580. if (aim){
  22581. var _ = (new r.Matrix4).lookAt(i.position, aim, d.UP)
  22582. aimQua = (new r.Quaternion).setFromRotationMatrix(_)
  22583. }
  22584. else aimQua = aimQua
  22585. var zoomLevel = e.zoomLevel || 1 //add
  22586. if(this.flying) return t && t(e)
  22587. window.specialScene && specialScene.special().specifySpot && specialScene.special().specifySpot(i);
  22588. if (this.isWarping() && !l && (this.path.activeTransType === x.BLACK || this.path.activeTransType === x.STD))
  22589. return F.warn("Player.flyToPano() -> Cannot fly when warping"),
  22590. t && t(),
  22591. !1;
  22592. if (this.updateLastView(),
  22593. this.mode !== u.PANORAMA) {
  22594. var m;
  22595. void this.flyToNewMode({
  22596. mode: u.PANORAMA,
  22597. pano: i,
  22598. duration: o,
  22599. quaternion: aimQua ,
  22600. callback: t
  22601. })
  22602. }
  22603. if (!i || (h = g.deepExtend(e),
  22604. p = function() {
  22605. N.delayOneFrame(function() {
  22606. this.flyToPano(h, t)
  22607. }
  22608. .bind(this))
  22609. }
  22610. .bind(this),
  22611. !this.checkAndWaitForPanoLoad(i, "high", "low", this.basePanoSize, p))) {
  22612. var C = function(e) {
  22613. t && t(e)
  22614. }
  22615. .bind(this);
  22616. this.currentPano || (this.currentPano = i,
  22617. this.path.placeCpm(),
  22618. this.path.fadeOutCpm(f.path.fadeOutTime),
  22619. this.spider.draw());
  22620. var I = o;
  22621. if ("number" != typeof o) {
  22622. var E = s || f.transition.flytimeMaxDistanceThreshold;
  22623. I = Math.min(this.currentPano.position.distanceTo(i.position), E) * f.transition.flytimeDistanceMultiplier + f.transition.flyTime
  22624. }
  22625. if (f.transition.flySpeed > .01 && (I = 1e3 * this.currentPano.position.distanceTo(i.position) / f.transition.flySpeed),
  22626. zoomLevel !== this.zoomLevel)
  22627. switch (f.zoom.transitionStyle) {
  22628. case 1:
  22629. this.smoothZoomFovTo(null, zoomLevel, zoomLevel == 1 ? I / 2 : I); //改
  22630. break;
  22631. case 2:
  22632. return h = g.deepExtend(e),
  22633. p = this.flyToPano.bind(this, h, t),
  22634. void this.smoothZoomFovTo(null, zoomLevel, f.zoom.restoreTime * (this.zoomLevel - 1), p)
  22635. }
  22636. if (aimQua) {
  22637. y.cancelById(V.LookTransition),
  22638. I *= f.transition.aimSlowFactor;
  22639. var b = this.cameraControls.activeControl.camera.quaternion.clone()
  22640. , S = b.clone()
  22641. , M = new r.Vector3;
  22642. if (i === this.currentPano) {
  22643. var R = d.FORWARD.clone().applyQuaternion(b)
  22644. , P = d.FORWARD.clone().applyQuaternion(aimQua)
  22645. , O = R.angleTo(P);
  22646. return void 0 !== a && null !== a || (a = 1 * Math.sqrt(O) / f.tags.navigate.rotateSpeedFactor * 1e3),
  22647. void y.start(function(e) {
  22648. S.copy(b),
  22649. v.quaternion(S, aimQua)(e),
  22650. M.copy(d.FORWARD).applyQuaternion(S).add(this.cameraControls.activeControl.camera.position),
  22651. this.cameraControls.activeControl.lookAt(M)
  22652. }
  22653. .bind(this), a, C, 0, A[f.transition.movementEasing], null, V.LookTransition)
  22654. }
  22655. }
  22656. if (i === this.currentPano )
  22657. return void C();
  22658. this.flying = !0;
  22659. var L = this.position.clone()
  22660. , D = this.currentPano;
  22661. F.debug("Flying to pano ", i.position),
  22662. this.emit(w.PanoChosen, this.currentPano, i),
  22663. this.emit(w.FlyingStarted, i.position, L, i, D)
  22664. //---------before fly--------------- add
  22665. //this.updateHotVisible(i); //更新热点显示
  22666. this.transitionPos({type:"beforeFlytopano", pano:i, dur:I})//add
  22667. Hot.updateVisibles([this.currentPano, i])
  22668. //地标变化
  22669. if(this.model.floorLogos){
  22670. this.model.changefloorLogoOpa({index:0, opa:0, dur: p, delay:0.7})//this.model.floorLogoFade(0, _duration*0.5, 0.7);
  22671. this.model.floorLogos[1].position.copy(i.floorPosition.clone().sub(this.model.position));
  22672. //this.model.adjustfloorLogoHeight();
  22673. this.model.floorLogos[1].material.opacity = 0;//uniforms.opacity.value = 0;
  22674. this.model.floorLogos[1].visible = true;
  22675. this.model.changefloorLogoOpa({index:1, opa:1, dur: 250})//this.model.floorLogoShow(1,250);
  22676. }
  22677. //=======================================
  22678. this.nextPano = i
  22679. aimQua && y.start(function(e) {
  22680. S.copy(b),
  22681. v.quaternion(S, aimQua)(e),
  22682. M.copy(d.FORWARD).applyQuaternion(S).add(this.cameraControls.activeControl.camera.position),
  22683. this.cameraControls.activeControl.lookAt(M)
  22684. }
  22685. .bind(this), I, null, 0, A[f.transition.movementEasing], null, V.LookTransition);
  22686. var B = c ? null : A[f.transition.movementEasing];
  22687. this.nextPano = i,
  22688. y.start(v.uniform(this.model.skybox, "progress", 1), I, null, 0, A[f.transition.blendEasing], "skyFly", V.FlyToPano),
  22689. y.start(v.allUniforms(this.model.chunks, "progress", 1), I, null, 0, A[f.transition.blendEasing], "chunkFly", V.FlyToPano),
  22690. y.start(v.vector(this.cameraControls.cameras[u.PANORAMA].position, i.position), I, function(e) {
  22691. this.flying = !1,
  22692. this.currentPano !== i && this.currentPano.exit(),
  22693. i.enter(),
  22694. this.currentPano = i,
  22695. this.nextPano = null,
  22696. this.path.placeCpm(),
  22697. this.path.fadeOutCpm(f.path.fadeOutTime),
  22698. this.spider.draw(),
  22699. this.emit(w.FlyingEnded, i.position, L, i, D),
  22700. this.updateMarkerVisi(),//add
  22701. C(e)
  22702. //add:
  22703. if(this.mode == "panorama" ){
  22704. if(this.model.floorLogos){
  22705. this.model.floorLogos[0].position.copy(this.model.floorLogos[1].position)
  22706. //this.model.adjustfloorLogoHeight()
  22707. this.model.changefloorLogoOpa({index:0,opa:1,dur:0});//this.model.floorLogos[0].material.uniforms.opacity.value = 1;
  22708. this.model.floorLogos[1].visible = false;
  22709. }
  22710. this.model.fadePanoMarkers()//add
  22711. Hot.updateVisibles([this.currentPano])//add
  22712. }
  22713. }
  22714. .bind(this), 0, B, "camFly", V.FlyToPano)
  22715. }
  22716. }
  22717. ,
  22718. n.prototype.warpToPano = function(o={}) {
  22719. }
  22720. n.prototype.blackToPano = function(o={}) {//add 瞬间过渡
  22721. //o.panoId = "8bc9156b288d48459e4e0f74d7051ef1"
  22722. if(this.flying || this.isWarping() )return;
  22723. if(this.flying || this.isWarping() )return;
  22724. let pano = o.pano || this.model.panos.index[o.panoId]
  22725. if (this.mode !== u.PANORAMA) {
  22726. var m;
  22727. void this.flyToNewMode({
  22728. mode: u.PANORAMA,
  22729. pano ,
  22730. duration: o.duration,
  22731. quaternion: o.quaternion ,
  22732. //callback: t
  22733. })
  22734. }
  22735. let oldPos = this.position.clone();
  22736. let oldPano = this.currentPano
  22737. this.path.warpDestPano = pano
  22738. var retry = ()=>{
  22739. this.waitingToWarp = !1,
  22740. this.blackToPano(o)
  22741. }
  22742. if (this.checkAndWaitForPanoLoad(pano, "high", "low", this.basePanoSize, retry))
  22743. return void (this.waitingToWarp = !0)
  22744. this.emit("pano.chosen", oldPano, pano)
  22745. /* if(window.momentTourBlackNewType == 1) { */
  22746. this.flying = true
  22747. this.nextPano = pano //提前加载高清图片
  22748. this.path.warpDestHeroLoc = {
  22749. panoId : o.panoId,
  22750. position: pano.position,
  22751. quaternion: o.quaternion || this.quaternion.clone()
  22752. }
  22753. this.path.warpTravel_BLACK(null, 1500,1, ()=>{
  22754. pano != this.currentPano && this.currentPano.exit()
  22755. pano.enter()
  22756. this.currentPano = pano
  22757. this.emit("flying.ended", pano.position, oldPos, pano, oldPano)
  22758. this.flying = false
  22759. this.nextPano = null
  22760. this.updateMarkerVisi();//add
  22761. } )
  22762. }
  22763. window._transitionPosId = 9999
  22764. n.prototype.transitionPos = function(o={}) {//渐变overlay和热点的位置
  22765. y.cancelById(_transitionPosId)
  22766. var begin = function(object, pos, qua, scale){
  22767. if(pos){
  22768. if(!same(object.position, pos, 0.01)){
  22769. y.start(v.vector(object.position, pos), o.dur, (e)=>{
  22770. },0, A[f.transition.movementEasing], "transitionPos", _transitionPosId)
  22771. }
  22772. if(qua && !same(object.quaternion, qua, 1e-6)){
  22773. y.start(v.quaternion(object.quaternion, qua), o.dur, (e)=>{
  22774. },0, A[f.transition.movementEasing], "transitionPos", _transitionPosId)
  22775. }
  22776. if(scale && !same(object.scale, scale, 0.001)){
  22777. y.start(v.vector(object.scale, scale), o.dur, (e)=>{
  22778. },0, A[f.transition.movementEasing], "transitionPos", _transitionPosId)
  22779. }
  22780. }
  22781. }
  22782. var same = function(vec1, vec2, diff){
  22783. var s = Math.abs(vec1.x-vec2.x) < diff && Math.abs(vec1.y-vec2.y) < diff && Math.abs(vec1.z-vec2.z) < diff
  22784. if(s && vec1.w) s = Math.abs(vec1.w-vec2.w) < diff
  22785. return s
  22786. }
  22787. var sid = o.pano != void 0 ? o.pano.id : "outside";
  22788. for(let i in this.model.hots){//是否判断visible?
  22789. var hot = this.model.hots[i];
  22790. var panoData = hot.info.transformAtPanos[sid];
  22791. var useCustom = !panoData
  22792. //if(hot.usingTransformData || !useCustom){
  22793. var pos = useCustom ? hot.info.position : panoData.pos;
  22794. begin(hot, pos/* , qua */ )
  22795. //}
  22796. }
  22797. }
  22798. window._tranOutsideFocus = 4399
  22799. n.prototype.focusPoint = function(o={}){//当在外时,聚焦相机到这一点
  22800. console.log("focusPoint")
  22801. if(this.mode == "floorplan"){
  22802. var modelSize = o.modelSize || new THREE.Vector3(8,8,8);//可视范围
  22803. var control = this.cameraControls.controls.floorplan;
  22804. var absoluteScale = control.getDefaultAbsoluteScale(modelSize)
  22805. var currentScale = control.absoluteScale;
  22806. var currentTarget = control.target.clone()
  22807. y.cancelById(window._tranOutsideFocus, true);
  22808. y.start(function(progress){
  22809. control.absoluteScale = absoluteScale*progress + currentScale*(1-progress);
  22810. control.target = o.aim.clone().multiplyScalar(progress).add(currentTarget.clone().multiplyScalar(1-progress))
  22811. control.camera.position.copy(control.target.clone().add(control.offset)) //维持角度
  22812. }.bind(this) , o.dur || 600, null/* cancelFuc */, 0, A[f.transition.movementEasing], "outsideFocus", window._tranOutsideFocus, null/* cancelFuc */);
  22813. }else if(player.mode == "dollhouse"){
  22814. var control = player.cameraControls.controls.dollhouse;
  22815. var radius = o.radius || 8;
  22816. var currentTarget = control.target.clone()
  22817. var dir = control.offset.clone().normalize()
  22818. var currentRadius = control.offset.length();
  22819. y.cancelById(window._tranOutsideFocus, true);
  22820. y.start(function(progress){
  22821. control.target = o.aim.clone().multiplyScalar(progress).add(currentTarget.clone().multiplyScalar(1-progress))
  22822. let radius_ = radius*progress+currentRadius*(1-progress)
  22823. control.camera.position.copy(control.target.clone().add(dir.clone().multiplyScalar(radius_)))
  22824. }.bind(this) , o.dur || 600, null/* cancelFuc */, 0, A[f.transition.movementEasing], "outsideFocus", window._tranOutsideFocus, null/* cancelFuc */);
  22825. }else if(this.mode == 'panorama'){
  22826. this.flyToPano({
  22827. lookAtPoint: o.aim.clone() ,
  22828. pano: this.currentPano,
  22829. aimDuration: o.dur || 600
  22830. })
  22831. }
  22832. }
  22833. /*
  22834. 切换到某个模式后再执行函数
  22835. */
  22836. n.prototype.FlyToMode = function(mode, f1, duration){
  22837. var f2;
  22838. if (this.mode == mode) {
  22839. f1 && f1()
  22840. } else {
  22841. f2 = f1;
  22842. if (this.mode == "transitioning" && this.modeTran.split('-')[1] != mode) {//正飞向其他模式,就要先飞完再飞进来然后执行
  22843. this.afterCModeFuc = function() {
  22844. /* objects.gui.modeChange[mode](null, {
  22845. fuc: f2 这个写法会使得先添加的回调fuc取代之后添加的afterCModeFuc,所以统一改为afterCModeFuc
  22846. }); */
  22847. this.afterCModeFuc = f2
  22848. this.flyToNewMode({mode:mode, pano: mode == "panorama" && this.currentPano,
  22849. //callback : f2
  22850. });
  22851. //这个fuc在trainsitioning状态下传入是无效的,所以后面得用afterCModeFuc。但是执行完afterCModeFuc,afterCModeFuc会变为null,所以里面得用fuc。。orz
  22852. }.bind(this)
  22853. } else {
  22854. if(this.afterCModeFuc)console.log("已经有afterCModeFuc了!!!!!!!!!!!!!!!")
  22855. this.afterCModeFuc = f2;//飞入后执行
  22856. try{ //在场景刚开始加载 control还没建好时这句可能会报错所以用try。 不用callback而用 afterCModeFuc也是这个原因,因为会有别的函数可以飞入然后执行它
  22857. this.flyToNewMode({mode:mode, pano: mode == "panorama" && this.currentPano, duration:duration});
  22858. }catch(e){
  22859. console.log('FlyToMode遇到问题?')
  22860. }
  22861. }
  22862. }
  22863. }
  22864. n.prototype.fastForwardActivePanoFlight = function(e) {
  22865. e = e || f.transition.fastForwardFactor / 10 * 4 + 1
  22866. y.adjustSpeed(V.FlyToPano, e)
  22867. y.adjustSpeed(V.LookTransition, e)
  22868. }
  22869. ,
  22870. n.prototype.flyToPanoClosestToMouse = function() {
  22871. if (Date.now() - this.mouseLastMoveTime > 50 && (this.intersect = this.getMouseIntersect(),
  22872. this.intersect && this.updateClosestPano(this.intersect)),
  22873. this.closestPano)
  22874. return this.flyToPano({
  22875. pano: this.closestPano
  22876. });
  22877. var e = this.getMouseDirection();
  22878. this.flyDirection(e) || this.flyToPano({
  22879. pano: this.currentPano
  22880. })
  22881. }
  22882. ,
  22883. n.prototype.flyLocalDirection = function(e) {
  22884. var t = this.getDirection(e)
  22885. , i = 1 === e.z ? .4 : .75
  22886. , n = 1 === Math.abs(e.x);
  22887. return this.flyDirection(t, i, n)
  22888. }
  22889. ,
  22890. n.prototype.flyDirection = function(e, t, i) {
  22891. Hot.closePopup();//xzw add
  22892. var n = $.Deferred();
  22893. this.history.invalidate();
  22894. var r = this.closestPanoInDirection(e, t, i);
  22895. return r ? this.flyToPano({
  22896. pano: r
  22897. }, n.resolve.bind(n, !0)) : (this.bump(e),
  22898. n.resolve(!1)),
  22899. n.promise()
  22900. }
  22901. ,
  22902. n.prototype.closestPanoInDirection = function(e, t, i) {
  22903. return this.rankedPanoInDirection(0, e, t, i)
  22904. }
  22905. ,
  22906. n.prototype.rankedPanoInDirection = function() {
  22907. var e = {
  22908. pano: null,
  22909. candidates: []
  22910. };
  22911. return function(t, i, n, r) {
  22912. t || (t = 0),
  22913. n = void 0 !== n ? n : .75;
  22914. var o = r ? "angle" : "direction";
  22915. return this.model.panos.findRankedByScore(t,
  22916. [s.filters.isPanoAligned(),
  22917. s.filters.not(this.currentPano),
  22918. s.filters.isNeighbourPanoTo(this.currentPano),
  22919. s.filters.inPanoDirection(this.position, i, n)],
  22920. [s.scoreFunctions.distanceSquared(this.currentPano),
  22921. s.scoreFunctions[o](this.position, i)], e),
  22922. this.cachedPanoCandidates = e.candidates,
  22923. e.pano
  22924. }
  22925. }(),
  22926. n.prototype.bump = function(e) {
  22927. if (this.mode === u.PANORAMA && !this.flying && !this.isWarping()) {
  22928. 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;
  22929. if (s)
  22930. t = function() {
  22931. y.start(v.property(this.cameraControls.cameras[u.PANORAMA], "zoom", a > 0 ? 1.04 : .96), o, i, 0, A.easeInOutSine, "bumpZStart")
  22932. }
  22933. .bind(this),
  22934. i = function() {
  22935. y.start(v.property(this.cameraControls.cameras[u.PANORAMA], "zoom", 1), 5 * o, n, 0, A.easeInOutSine, "bumpZRelax")
  22936. }
  22937. .bind(this);
  22938. else {
  22939. var l = this.camera.position.clone()
  22940. , c = e.clone();
  22941. this.raycaster.set(l, c);
  22942. var h = this.model.floors.reduce(function(e, t) {
  22943. return e.concat(t.collider.children)
  22944. }, [])
  22945. , d = this.raycaster.intersectObjects(h)
  22946. , p = d.length > 0 ? d[0].distance / 25 : .04
  22947. , g = l.clone().add(c.multiplyScalar(p));
  22948. t = function() {
  22949. y.start(v.vector(this.cameraControls.cameras[u.PANORAMA].position, g), o, i, 0, A.easeInOutSine, "bumpTStart")
  22950. }
  22951. .bind(this),
  22952. i = function() {
  22953. y.start(v.vector(this.cameraControls.cameras[u.PANORAMA].position, l), 5 * o, n, 0, A.easeInOutSine, "bumpTRelax")
  22954. }
  22955. .bind(this)
  22956. }
  22957. n = function() {
  22958. this.flying = !1
  22959. }
  22960. .bind(this),
  22961. this.flying = !0,
  22962. t()
  22963. }
  22964. }
  22965. ,
  22966. n.prototype.changeFloor = function(e) {
  22967. if (!this.is360View(this.mode, this.currentPano))
  22968. if (this.mode === u.PANORAMA) {
  22969. var t = this.history.reversePano(e);
  22970. t && t.isAligned() ? this.flyToPano({
  22971. pano: t
  22972. }) : this.changeFloorByScore(e)
  22973. } else
  22974. this.model.setFloor(this.model.nextFloor(e) || this.model.currentFloor)
  22975. }
  22976. ,
  22977. n.prototype.changeFloorByScore = function() {
  22978. var e = {
  22979. pano: null,
  22980. candidates: []
  22981. };
  22982. return function(t) {
  22983. var i = this.model.nextFloor(t);
  22984. 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),
  22985. void (e.pano ? (this.cachedPanoCandidates = e.candidates,
  22986. this.history.push(t, this.currentPano),
  22987. this.flyToPano({
  22988. pano: e.pano
  22989. })) : F.warn("No pano found on selected floor, not moving there."))) : void F.debug("player.changeFloor(" + t + "): no such floor")
  22990. }
  22991. }(),
  22992. n.prototype.gotoFloor = function(e) {
  22993. var t = e - this.model.currentFloor.floorIndex;
  22994. this.changeFloor(t)
  22995. }
  22996. ,
  22997. n.prototype.getDirection = function(e) {
  22998. return e = e ? e : (new r.Vector3).copy(d.FORWARD),
  22999. e.applyQuaternion(this.camera.quaternion)
  23000. }
  23001. ,
  23002. n.prototype.flyToSameMode = function(e, t, i, n, o) {
  23003. if (o = o || $.Deferred(),
  23004. this.mode === u.TRANSITIONING)
  23005. return F.warn("should not be transitioning here"),
  23006. n && n(!1),
  23007. o.reject().promise();
  23008. var a = i || !1
  23009. , s = i ? i.position : this.position
  23010. , l = this.position.clone()
  23011. , c = this.currentPano;
  23012. if (F.debug("New pose in mode " + this.mode),
  23013. !e || (retryCallback = function() {
  23014. N.delayOneFrame(function() {
  23015. this.flyToSameMode(e, t, i, n, o)
  23016. }
  23017. .bind(this))
  23018. }
  23019. .bind(this),
  23020. !this.checkAndWaitForPanoLoad(e, "high", "low", this.basePanoSize, retryCallback))) {
  23021. var h = function() {
  23022. this.emit(w.FlyingEnded, s, l, e, c),
  23023. n && n(!0)
  23024. }
  23025. .bind(this)
  23026. , d = f[this.mode]
  23027. , p = void 0 !== t ? t : d.transitionTime
  23028. , g = new r.Vector3
  23029. , C = new r.Vector3;
  23030. if (this.emit(w.FlyingStarted, s, l, e, c),
  23031. this.mode === u.PANORAMA)
  23032. F.warn("we should not be here for panorama views");
  23033. else if (this.mode === u.DOLLHOUSE)
  23034. if (a) {
  23035. var I = new r.Vector3(0,1,0);
  23036. this.cameraControls.controls[u.DOLLHOUSE].resetRanges(1, !0),
  23037. this.model.warpDestFloors(i.floorVisibility),
  23038. C.copy(i.position);
  23039. var E = new r.Vector3(0,0,-1).applyQuaternion(i.quaternion)
  23040. , b = new r.Raycaster(C.clone(),E.clone(),0,1 / 0)
  23041. , _ = b.intersectObjects(this.model.colliders)
  23042. , T = 3;
  23043. _.length ? (g.copy(_[0].point),
  23044. T = .75 * C.distanceTo(g)) : (g.copy(E).multiplyScalar(3).add(C),
  23045. F.debug("Tried to restore dollhouse mode that did not intersect...", i.position, i.quaternion));
  23046. var x = (new r.Matrix4).lookAt(C, g, I)
  23047. , S = (new r.Euler).setFromRotationMatrix(x, f.warp.eOrder)
  23048. , M = g.distanceTo(C)
  23049. , R = (new r.Matrix4).lookAt(this.cameraControls.cameras[u.DOLLHOUSE].position, this.cameraControls.controls[u.DOLLHOUSE].target, I)
  23050. , P = (new r.Euler).setFromRotationMatrix(R, f.warp.eOrder)
  23051. , O = this.cameraControls.cameras[u.DOLLHOUSE].position.distanceTo(this.cameraControls.controls[u.DOLLHOUSE].target);
  23052. this.cameraControls.controls[u.DOLLHOUSE].resetRanges(Math.min(O, T), !0);
  23053. var L = new r.Euler(S.x - P.x,S.y - P.y,S.z - P.z,f.warp.eOrder);
  23054. L.y = L.y > Math.PI ? L.y -= 2 * Math.PI : L.y < -Math.PI ? L.y += 2 * Math.PI : L.y,
  23055. this.path.burnsDir = Math.sign(L.y);
  23056. var D = new r.Euler(0,0,0,f.warp.eOrder)
  23057. , B = new r.Vector3;
  23058. y.start(v.vector(this.cameraControls.controls[u.DOLLHOUSE].target, g), p, null, f.flydown.movementDelay, A[f.flydown.movementEasing], null, V.FlyToSameMode),
  23059. y.start(function(e, t) {
  23060. D.x = P.x + e * L.x,
  23061. D.y = P.y + e * L.y,
  23062. D.z = P.z + e * L.z;
  23063. var i = O + e * (M - O);
  23064. B.set(0, 0, i).applyEuler(D).add(this.cameraControls.controls[u.DOLLHOUSE].target),
  23065. this.cameraControls.cameras[u.DOLLHOUSE].position.copy(B).add(this.model.position)
  23066. }
  23067. .bind(this), p, null, f.flydown.movementDelay, A[f.flydown.movementEasing], null, V.FlyToSameMode),
  23068. y.start(function(e, t) {
  23069. this.cameraControls.controls[u.DOLLHOUSE].update(),
  23070. this.quaternion.copy(this.cameraControls.cameras[u.DOLLHOUSE].quaternion),
  23071. this.position.copy(this.cameraControls.cameras[u.DOLLHOUSE].position)
  23072. }
  23073. .bind(this), p, null, f.flydown.movementDelay, A[f.flydown.movementEasing], null, V.FlyToSameMode)
  23074. } else
  23075. F.warn("invalid warp destination in flyToSameMode()? ignore it then");
  23076. else if (this.path.placeCpm(),
  23077. this.path.fadeInCpm(f.path.fadeInTime),
  23078. i) {
  23079. this.model.warpDestFloors(i.floorVisibility);
  23080. var U = this.cameraControls.cameras[u.FLOORPLAN]
  23081. , k = this.cameraControls.controls[u.FLOORPLAN]
  23082. , H = k.target.clone()
  23083. , G = i.position.clone().sub(H)
  23084. , z = U.position.clone().sub(k.target)
  23085. , W = z.length()
  23086. , j = new r.Vector3(-1,0,0).applyQuaternion(i.quaternion).normalize()
  23087. , Y = Math.atan2(k.offset.x, k.offset.z)
  23088. , X = Math.atan2(j.x, j.z)
  23089. , Z = k.absoluteScale
  23090. , q = m.convertWorkshopOrthoZoom(i.orthoZoom);
  23091. y.start(function(e, t) {
  23092. k.target.copy(G).multiplyScalar(e).add(H);
  23093. var i = Y + (X - Y) * e;
  23094. k.offset.x = W * Math.sin(i),
  23095. k.offset.z = W * Math.cos(i),
  23096. U.position.copy(k.target).add(k.offset),
  23097. k.absoluteScale = Z + e * (q - Z),
  23098. k.update(),
  23099. this.quaternion.copy(U.quaternion),
  23100. this.position.copy(U.position),
  23101. this.target.copy(k.target),
  23102. this.camera.projectionMatrix.copy(U.projectionMatrix)
  23103. }
  23104. .bind(this), p, null, 0, A[f.flydown.movementEasing], null, V.FlyToSameMode)
  23105. } else
  23106. F.info("flyToSameMode() funny floorplan view? skipping");
  23107. return y.setTimeout(function(e) {
  23108. this.mode = e,
  23109. h(),
  23110. o.resolve(!0)
  23111. }
  23112. .bind(this, this.mode), p, V.FlyToSameMode),
  23113. this.mode = u.TRANSITIONING,
  23114. o.promise()
  23115. }
  23116. }
  23117. ,
  23118. n.prototype.flyToNewMode = function(e, t) {
  23119. Hot.closePopup();//xzw add
  23120. e = e || {};
  23121. var i = e.mode
  23122. , n = e.pano
  23123. , o = e.duration
  23124. , a = e.warpDest
  23125. , s = e.callback
  23126. , l = e.force
  23127. , c = e.quaternion;
  23128. if (t = t || $.Deferred(),
  23129. this.isWarping())
  23130. return F.warn("Player.flyToNewMode() -> Cannot fly when warping"),
  23131. s && s(!1),
  23132. t.reject("Cannot change mode during tour transition").promise();
  23133. if (this.mode === u.TRANSITIONING)
  23134. return s && s(!1),
  23135. t.reject("Cannot change mode during mode transition").promise();
  23136. if (i === this.mode)
  23137. return l ? (this.flyToSameMode(n, o, a, s).done(t.resolve.bind(t)).fail(t.reject.bind(t)),
  23138. t.promise()) : (s && s(!1),
  23139. t.reject("Already in " + i + " mode").promise());
  23140. var h = a || !1;
  23141. F.debug("Switching mode to " + i);
  23142. var d = function() {
  23143. N.delayOneFrame(function() {
  23144. this.flyToNewMode(e, t)
  23145. }
  23146. .bind(this))
  23147. }
  23148. .bind(this);
  23149. if (n && this.checkAndWaitForPanoLoad(n, "low", "low", this.basePanoSize, d))
  23150. return t.promise();
  23151. if (!this.model.meshTexturesLoaded && this.isOutsideMode(i))
  23152. return F.info("Waiting for model textures to be loaded before going out to dollhouse"),
  23153. this.model.waitForLoad(this.model, function() {
  23154. return this.model.meshTexturesLoaded;
  23155. }
  23156. .bind(this)),
  23157. this.model.loadMeshTextures().done(d),
  23158. t.promise();
  23159. this.history.invalidate(),
  23160. this.updateLastView();
  23161. var p = this.mode
  23162. , C = this.cameraControls.cameras[i];
  23163. e = g.deepExtend({}, f[i], f[p + "-" + i]);
  23164. var I = void 0 !== o ? o : e.transitionTime;
  23165. this.emit(w.ModeChanging, p, i, n, I),
  23166. n && (this.currentPano = n),
  23167. this.switchCameraMode(i, c),
  23168. y.cancelById(V.LookTransition);
  23169. //before fly---------------------
  23170. this.modeTran = p + "-" + i; //add
  23171. if(this.mode == "panorama"){
  23172. if(this.model.floorLogos){
  23173. this.model.floorLogos[0].visible = false;
  23174. this.model.floorLogos[1].visible = false;
  23175. }
  23176. }
  23177. if(i == "panorama"){
  23178. this.transitionPos({type:"beforeFlyIn", pano:n, dur:I})//add
  23179. }else{
  23180. this.transitionPos({type:"beforeFlyOut", dur:I/2})//add
  23181. }
  23182. window.bus.dispatchEvent({type:'playerAndModelReady'})
  23183. this.ready = true
  23184. //------------------------------------
  23185. var _ = (new r.Vector3).copy(this.position);
  23186. if (i === u.PANORAMA){
  23187. this.emit(w.PanoChosen, n, n),
  23188. setTimeout(function() {
  23189. n.floor.enter(i)
  23190. }
  23191. .bind(this), I / 2),
  23192. this.path.fadeOutCpm(f.path.fadeOutTime);
  23193. if(this.model.floorLogos){
  23194. this.model.floorLogos[0].position.copy(n.floorPosition.clone().sub(this.model.position));//改
  23195. this.model.floorLogos[1].position.copy(this.model.floorLogos[0].position);//for floorIcon position
  23196. }
  23197. }else if (i === u.DOLLHOUSE) {
  23198. if (h && (this.model.stayPut = !0),
  23199. a ? (this.cameraControls.controls[u.DOLLHOUSE].resetRanges(1, !0),
  23200. this.model.warpDestFloors(a.floorVisibility)) : this.model.toggleAllFloors(!0),
  23201. this.path.placeCpm(),
  23202. this.path.fadeInCpm(f.path.fadeInTime),
  23203. h) {
  23204. var T = new r.Vector3(this.model.center.x,0,this.model.center.z);
  23205. _.set(15, 10, 15);
  23206. var M = new r.Vector3(0,0,-1).applyQuaternion(a.quaternion)
  23207. , R = new r.Raycaster(a.position.clone(),M.clone(),0,1 / 0)
  23208. , P = R.intersectObjects([this.sceneIntersectionPlane]);
  23209. P.length ? (T.copy(P[0].point),
  23210. _.copy(a.position),
  23211. 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),
  23212. this.cameraControls.controls[u.DOLLHOUSE].resetRanges(3, !0)),
  23213. this.cameraControls.controls[u.DOLLHOUSE].target.copy(T),
  23214. _.add(this.model.position),
  23215. C.position.copy(_),
  23216. this.cameraControls.controls[u.DOLLHOUSE].update()
  23217. }
  23218. } else if (this.path.placeCpm(),
  23219. this.path.fadeInCpm(f.path.fadeInTime),
  23220. a) {
  23221. this.model.warpDestFloors(a.floorVisibility);
  23222. var O = this.cameraControls.cameras[u.FLOORPLAN]
  23223. , L = this.cameraControls.controls[u.FLOORPLAN]
  23224. , D = O.position.clone().sub(L.target)
  23225. , B = new r.Vector3(-1,0,0).applyQuaternion(a.quaternion).normalize()
  23226. , U = Math.atan2(B.x, B.z);
  23227. L.target.copy(a.position);
  23228. var k = D.length();
  23229. L.offset.x = k * Math.sin(U),
  23230. L.offset.y = 0,
  23231. L.offset.z = k * Math.cos(U),
  23232. O.position.copy(L.target).add(L.offset);
  23233. L.target.clone().sub(C.position);
  23234. C.quaternion.copy(a.quaternion),
  23235. L.currentScale = m.convertWorkshopOrthoZoom(a.orthoZoom),
  23236. L.absoluteScale = L.currentScale,
  23237. L.update()
  23238. } else
  23239. this.model.currentFloor.enter(i);
  23240. var H = this.currentPano
  23241. , G = this.position.clone();
  23242. return this.emit(w.FlyingStarted, _, G, n, this.currentPano),
  23243. this.flying = !0,
  23244. this.isOutsideMode(i) && this.is360View(p, H) ? (h || i !== u.DOLLHOUSE || (C.position.set(15, 10, 15),
  23245. C.controls.target.set(this.model.center.x, 0, this.model.center.z),
  23246. C.controls.update()),
  23247. e.blackoutStyle = S.FADEIN,
  23248. I = f.show360Views.transitionTime,
  23249. this.fade360View(I, C, e)) : this.isOutsideMode(p) && this.is360View(i, n) ? (h && this.switchCameraMode(i, h.quaternion),
  23250. this.mode = i,
  23251. this.path && this.path.popOutCpm(),
  23252. e.blackoutStyle = S.END,
  23253. I = f.show360Views.transitionTime,
  23254. this.fade360View(I, C, e)) : (y.start(v.property(this.model, "alpha", e.modelAlpha, null), I * e.modelAlphaLength, null, e.modelAlphaDelay, null, V.FlyToNewMode),
  23255. y.start(v.vector(this.position, C.position), I, null, f.flydown.movementDelay, A[f.flydown.movementEasing], null, V.FlyToNewMode),
  23256. y.start(v.quaternion(this.quaternion, C.quaternion), I * e.rotationDuration, null, e.rotationDelay, A[f.flydown.rotationEasing], null, V.FlyToNewMode),
  23257. y.start(v.matrix4(this.camera.projectionMatrix, C.projectionMatrix), I * e.cameraMatrixDuration, null, e.cameraMatrixDelay, e.cameraMatrixEase, null, V.FlyToNewMode),
  23258. y.start(v.uniform(this.model.skybox, "opacity", e.skyboxOpacity), I * e.skyboxOpacityLength, null, e.skyboxOpacityDelay, null, V.FlyToNewMode),
  23259. y.start(v.property(this.reticule.material.uniforms.opacity, "value", 0), I, null, V.FlyToNewMode)),
  23260. y.setTimeout(function() {
  23261. this.flying = !1,
  23262. p === u.PANORAMA && i !== u.PANORAMA ? this.currentPano.exit() : p !== u.PANORAMA && i === u.PANORAMA && (this.currentPano !== H && H.exit(),
  23263. this.currentPano.enter(),
  23264. this.path.placeCpm(),
  23265. this.path.fadeOutCpm(f.path.fadeOutTime),
  23266. this.spider.draw()),
  23267. p === u.DOLLHOUSE && this.cameraControls.controls[u.DOLLHOUSE].resetRanges(),
  23268. this.mode = i,
  23269. this.emit(w.FlyingEnded, _, G, this.currentPano, H)
  23270. //add:
  23271. this.updateMarkerVisi() ;
  23272. this.mode == u.PANORAMA&&this.model.floorLogos&&(
  23273. this.model.changefloorLogoOpa({index:0, from:0, opa:1, dur: 150 }),//this.model.floorLogoShow(0,150);
  23274. this.model.floorLogos[0].visible = true
  23275. )
  23276. if (this.afterCModeFuc) {
  23277. //手动加的函数
  23278. var cf = this.afterCModeFuc;
  23279. this.afterCModeFuc = null;//因为可能在执行afterCModeFuc时需要再添加afterCModeFuc所以要置空的话提前
  23280. cf();
  23281. }
  23282. if(this.mode == u.PANORAMA){
  23283. Hot.updateVisibles([this.currentPano])
  23284. this.model.fadePanoMarkers()
  23285. }else{
  23286. Hot.updateVisibles(true)
  23287. this.model.hotGroup.children.forEach(overlay=>{
  23288. if(overlay.animateInfo){
  23289. GifTexDeal.start(overlay.animation)
  23290. }
  23291. })
  23292. }
  23293. h && p !== u.PANORAMA && i === u.PANORAMA ? this.startWarp(b.Retain, E.Retain, x.BLACK, null, null, s) : (s && s(),
  23294. t.resolve())
  23295. }
  23296. .bind(this), I, V.FlyToNewMode),
  23297. this.mode = u.TRANSITIONING,
  23298. t.promise()
  23299. }
  23300. ,
  23301. n.prototype.fade360View = function(e, t, i) {
  23302. this.tagManager.hideShowTagsForBlackoutStyle(i.blackoutStyle, e),
  23303. $(this.domElement).fadeOut(.5 * e, function() {
  23304. this.model.skybox.material.uniforms.opacity.value = i.skyboxOpacity,
  23305. this.model.alpha = i.modelAlpha,
  23306. this.position.copy(t.position),
  23307. this.quaternion.copy(t.quaternion),
  23308. this.camera.projectionMatrix.copy(t.projectionMatrix),
  23309. $(this.domElement).fadeIn(.5 * e)
  23310. }
  23311. .bind(this))
  23312. }
  23313. ,
  23314. n.prototype.findDefaultViews = function() {
  23315. this.findDefaultView(this.lastInsideView, !0),
  23316. this.findDefaultView(this.last360View, !1)
  23317. }
  23318. ,
  23319. n.prototype.findDefaultView = function(e, t) {
  23320. var i, n = this.model.heroLocations, r = this.model.panos, o = n.findIndex(function(e) {
  23321. if (e.cameraMode !== u.PANORAMA)
  23322. return !1;
  23323. var i = r.get(e.panoId);
  23324. return i && i.isAligned() === t
  23325. });
  23326. o >= 0 ? (i = r.get(n[o].panoId),
  23327. e.update({
  23328. cameraMode: u.PANORAMA,
  23329. pano: i,
  23330. position: n[o].position,
  23331. quaternion: n[o].quaternion
  23332. })) : (o = r.list.findIndex(function(e) {
  23333. return e.isAligned() === t
  23334. }),
  23335. o >= 0 ? (i = r.list[o],
  23336. e.update({
  23337. cameraMode: u.PANORAMA,
  23338. pano: i,
  23339. position: i.position
  23340. })) : F.warn("There are no", t ? "inside" : "360º", "views in this model"))
  23341. }
  23342. ,
  23343. n.prototype.updateLastView = function() {
  23344. if (this.mode === u.PANORAMA) {
  23345. var e = this.currentPano.isAligned() ? this.lastInsideView : this.last360View;
  23346. e.update({
  23347. pano: this.currentPano,
  23348. position: this.position,
  23349. quaternion: this.quaternion
  23350. })
  23351. }
  23352. }
  23353. ,
  23354. n.prototype.goToLastView = function(e, t) {
  23355. var i = $.Deferred()
  23356. , n = i.resolve.bind(i)
  23357. , r = i.reject.bind(i)
  23358. , o = e ? this.lastInsideView : this.last360View;
  23359. return this.isInMode(u.PANORAMA) && this.currentPano.isAligned() !== e && this.updateLastView(),
  23360. this.isInMode(u.PANORAMA) ? (this.path && this.path.popOutCpm(),
  23361. this.fadeToView(e, o, f.show360Views.transitionTime, t).done(n).fail(r)) : this.isOutsideMode() && this.flyToNewMode({
  23362. mode: o.cameraMode,
  23363. pano: o.pano,
  23364. quaternion: o.quaternion,
  23365. callback: t
  23366. }).done(n).fail(r),
  23367. i.promise()
  23368. }
  23369. ,
  23370. n.prototype.fadeToView = function(e, t, i, n) {
  23371. var r = $.Deferred()
  23372. , o = r.resolve.bind(r)
  23373. , a = r.reject.bind(r);
  23374. if (!t.isValid() || t.cameraMode === u.PANORAMA && !t.pano)
  23375. return F.warn("Tried to fade to an illegal view", t.cameraMode),
  23376. a("Cannot go to illegal view"),
  23377. r.promise();
  23378. var s = (f[t.cameraMode],
  23379. function() {
  23380. $(this.domElement).fadeIn(.5 * i),
  23381. n && n(),
  23382. o()
  23383. }
  23384. .bind(this))
  23385. , l = e ? S.FADEIN : S.END;
  23386. return this.tagManager.hideShowTagsForBlackoutStyle(l, i),
  23387. $(this.domElement).fadeOut(.5 * i, function() {
  23388. this.model.fadePanoMarkers(e ? f.panorama.markerOpacity : 0),
  23389. t.cameraMode === u.PANORAMA ? this.flyToPano({
  23390. pano: t.pano,
  23391. lookAtPoint: d.FORWARD.clone().applyQuaternion(t.quaternion).add(t.pano.position),
  23392. duration: 0
  23393. }, s) : this.flyToNewMode({
  23394. mode: t.cameraMode,
  23395. quaternion: t.quaternion,
  23396. duration: 0,
  23397. callback: s
  23398. })
  23399. }
  23400. .bind(this)),
  23401. r.promise()
  23402. }
  23403. ,
  23404. n.prototype.startWarp = function(e, t, i, n, r, o) {
  23405. if (this.cameraControls.activeControl && (this.cameraControls.activeControl.enabled = !1),
  23406. this.flying)
  23407. return F.warn("Player.startWarp() -> Cannot warp when flying"),
  23408. o && o(),
  23409. !1;
  23410. null !== e && void 0 !== e || (e = b.Show),
  23411. this.history.invalidate()
  23412. e !== b.Retain ? this.path.brushToWarpPano(i, x.BLACK) || (i = x.BLACK) : i = this.path.upcomingTransType;
  23413. var a = this.path.warpDestPano && !this.path.warpDestPano.isAligned();
  23414. return this.emit(w.WarpStarted, a, i, n, r),
  23415. n = n || S.MIDDLE,
  23416. this.path.warpToPano(i, n, r, function() {
  23417. t === E.Slow ? this.path.discardSlow() : t === E.Standard && this.path.discardPathObject(),
  23418. this.emit(w.WarpEnded, i),
  23419. this.cameraControls.activeControl && (this.cameraControls.activeControl.enabled = !0),
  23420. o && o()
  23421. }
  23422. .bind(this)),
  23423. e === b.Hide && this.path.discardPathObject(),
  23424. !0
  23425. }
  23426. ,
  23427. n.prototype.warpToPanoById = function(e, t, i, n, r, o, a, s) {
  23428. return this.path.setWarpDestinationByPanoId(e, t) ? this.startWarp(i, n, r, o, a, s) : (F.warn("Player.warpToPanoById() -> Could not setWarpDestinationByPanoId()"),
  23429. s && s(),
  23430. !1)
  23431. }
  23432. ,
  23433. n.prototype.warpToPanoByHeroIndex = function(e, t, i, n, r, o, a) {
  23434. return this.path.setWarpDestinationByHeroIndex(e) ? this.startWarp(t, i, n, r, o, a) : (F.warn("Player.warpToPanoByHeroIndex() -> Could not setWarpDestinationByHeroIndex()"),
  23435. a && a(),
  23436. !1)
  23437. }
  23438. ,
  23439. n.prototype.warpToPano = function(e, t, i, n, r, o, a, s) {
  23440. return this.warpToPanoById(e.id, t, i, n, r, o, a, s)
  23441. }
  23442. ,
  23443. n.prototype.warpToNonPanoByHeroIndex = function(e, t) {
  23444. return this.path.setWarpDestinationByHeroIndex(e) ? (this.path.warpToNonPano(t),
  23445. !0) : (F.warn("Player.warpToNonPanoByHeroIndex() -> Could not setWarpDestinationByHeroIndex()"),
  23446. t && t(),
  23447. !1)
  23448. }
  23449. ,
  23450. n.prototype.aimTourCamera = function(e, t, i, n) {
  23451. return F.debug("player.aimTourCamera(" + e + ") calling warpToPanoByHeroIndex(" + e + ")"),
  23452. this.warpToPanoByHeroIndex(e, t, i, null, null, null, n)
  23453. }
  23454. ,
  23455. n.prototype.showPathToHeroLocation = function(e) {
  23456. this.path.setWarpDestinationByHeroIndex(e) && this.path.brushToWarpPano(x.STD, x.BLACK)
  23457. }
  23458. ,
  23459. n.prototype.tourInterlude = function(e, t) {
  23460. this.history.invalidate();
  23461. this.path.discardSlow();
  23462. //xzw:
  23463. var defaultRotTime = DATA.tourRotTime * 1000
  23464. var timeEachItem = 2e3 / (DATA.tourWalkSpeed + DATA.tourBlackSpeed) * 200 //预估时间假设每个item飞的时间(如果距离远就少了)
  23465. var currentLocation = this.model.heroLocations[this.director.currentItem[0]]
  23466. var rotTime
  23467. if(currentLocation.rotTime == void 0 || currentLocation.rotTime == ''){
  23468. var restChildCount = currentLocation.heroLocations ? (currentLocation.heroLocations.length-this.director.currentItem[1]-1) : 0
  23469. var hasMusic = currentLocation && currentLocation.musicInfo.music
  23470. if(hasMusic){
  23471. var audioObj = SoundManager.list.find(e=>e.name == 'tour')
  23472. var current = audioObj.audio.currentTime * 1e3 // || 0 //g_tourAudio ? 1e3 * g_tourAudio.currentTime : 0
  23473. rotTime = currentLocation.musicInfo.time - current
  23474. if(restChildCount){//如果当前folder中还有剩下的item,平分一下时间
  23475. rotTime = (rotTime-timeEachItem*restChildCount) / (restChildCount+1);
  23476. }
  23477. }else{
  23478. rotTime = defaultRotTime
  23479. }
  23480. rotTime = Math.max(0, rotTime)
  23481. Log("rotTime "+rotTime +" at item "+this.director.currentItem + (hasMusic ? (",musicCurrentTime:"+current+'音乐总长:'+currentLocation.musicInfo.time) : ''),"#E8E")
  23482. }else{
  23483. rotTime = currentLocation.rotTime * 1000
  23484. Log("rotTime "+rotTime +" at item "+this.director.currentItem,"#E8E")
  23485. }
  23486. this.path.waitNextStep(e, function() {
  23487. t && t()
  23488. }.bind(this), rotTime)
  23489. }
  23490. ,
  23491. n.prototype.stopInterlude = function() {
  23492. this.interruptAndFastForward(null, 0)
  23493. }
  23494. ,
  23495. n.prototype.interruptAndFastForward = function(e, t) {
  23496. //Log('interruptAndFastForward' , '#f00')
  23497. this.isWarping() && this.emit(w.WarpInterrupted, this.path.activeTransType, e, t),
  23498. this.flying && this.emit(w.FlyingInterrupted),
  23499. this.path.interruptAndFastForward(e, t)
  23500. }
  23501. ,
  23502. n.prototype.setSize = function(e, t) {
  23503. var i = e / t;
  23504. this.baseFov = B.clampVFOV(f.insideFOV, f.insideFOVMax, e, t);
  23505. var n = B.getHFOVFromVFOV(f.insideFOV, e, t);
  23506. n > f.insideFOVMax ? this.baseFov = B.getVFOVFromHFOV(f.insideFOVMax, e, t) : this.baseFov = f.insideFOV;
  23507. for (var r in this.cameraControls.cameras) {
  23508. var o = this.cameraControls.cameras[r];
  23509. o.fov = this.baseFov * (1 / this.zoomLevel),
  23510. o.updateAspect(i)
  23511. }
  23512. }
  23513. ,
  23514. n.prototype.toJSON = function() {
  23515. var e = {};
  23516. return this.cameraControls.activeControl ? (e = this.cameraControls.activeControl.toJSON(),
  23517. e.camera_mode = u.toInt(this.mode),
  23518. this.isOutsideMode() ? this.model.allFloorsVisible ? e.floor_visibility = [] : e.floor_visibility = this.model.floors.list.map(function(e) {
  23519. return e.hidden ? 0 : 1
  23520. }) : u.PANORAMA && (e.scan_id = this.currentPano.id),
  23521. e) : e
  23522. }
  23523. ,
  23524. n.prototype.getCurrentNodePanos = function(e) {
  23525. this.model.panos.map;
  23526. if (e.length = 0, this.path.nodes){
  23527. var momentTour = this.director.getMomentTour(this.director.destinationItem)
  23528. if(momentTour == 'black'){ //改 upcomingPanos如果是black的只需要起点和终点
  23529. if(this.path.nodes.length){
  23530. e.push(this.model.panos.get(this.path.nodes[0]))
  23531. }
  23532. if(this.path.nodes.length>1){
  23533. e.push(this.model.panos.get(this.path.nodes[this.path.nodes.length-1]))
  23534. }
  23535. }else{
  23536. for (var t = 0; t < this.path.nodes.length; t++) {
  23537. var i = this.path.nodes[t];
  23538. e.push(this.model.panos.get(i))
  23539. }
  23540. }
  23541. }
  23542. }
  23543. ,
  23544. n.prototype.zoomIncrementally = function(e) {
  23545. var t = this.zoomLevel;
  23546. this.zoomTo(this.zoomLevel + e),
  23547. t !== this.zoomLevel && this.currentPano && this.zoomStats.addZoomAction(t, this.zoomLevel, this.currentPano.id)
  23548. }
  23549. ,
  23550. n.prototype.zoomInIncrementally = function(e) {
  23551. e = e || this.defaultZoomIncrement,
  23552. this.zoomIncrementally(e)
  23553. }
  23554. ,
  23555. n.prototype.zoomOutIncrementally = function(e) {
  23556. e = e || -this.defaultZoomIncrement,
  23557. this.zoomIncrementally(e)
  23558. }
  23559. ,
  23560. n.prototype.zoomBy = function(e) {
  23561. this.zoomTo(this.zoomLevel * e)
  23562. }
  23563. ,
  23564. n.prototype.zoomIn = function() {
  23565. this.zoomBy(1 + this.zoomSpeed)
  23566. }
  23567. ,
  23568. n.prototype.zoomOut = function() {
  23569. this.zoomBy(1 - this.zoomSpeed)
  23570. }
  23571. ,
  23572. n.prototype.zoomTo = function(e, t) {
  23573. if (t || f.zoom.enabled && this.mode === u.PANORAMA && this.zoomEnabled) {
  23574. if (e < f.zoom.min && (e = f.zoom.min),
  23575. e > f.zoom.max && (e = f.zoom.max),
  23576. e > this.zoomLevel ? (this.emit(O.ZoomIn),
  23577. e === f.zoom.max && this.emit(O.ZoomMax)) : e < this.zoomLevel && (this.emit(O.ZoomOut),
  23578. e === f.zoom.min && this.emit(O.ZoomMin)),
  23579. this.cameraControls.activeControl) {
  23580. var i = this.cameraControls.activeControl.camera;
  23581. this.zoomLevel = e,
  23582. i.fov = this.baseFov * (1 / this.zoomLevel),
  23583. i.updateProjectionMatrix(),
  23584. this.zoomFov = i.fov
  23585. }
  23586. }
  23587. }
  23588. ,
  23589. n.prototype.increaseZoomSpeed = function() {
  23590. this.zoomSpeed = this.clampZoomSpeed(this.zoomSpeed + this.zoomSpeedAdjust)
  23591. }
  23592. ,
  23593. n.prototype.decreaseZoomSpeed = function() {
  23594. this.zoomSpeed = this.clampZoomSpeed(this.zoomSpeed - this.zoomSpeedAdjust)
  23595. }
  23596. ,
  23597. n.prototype.clampZoomSpeed = function(e) {
  23598. return e < 0 ? 0 : e
  23599. }
  23600. ,
  23601. n.prototype.activatePersistentZooming = function(e) {
  23602. this.zooming = e ? 1 : -1
  23603. }
  23604. ,
  23605. n.prototype.deactivatePersistentZooming = function() {
  23606. this.zooming = 0
  23607. }
  23608. ,
  23609. n.prototype.zoomDefault = function() {
  23610. this.zoomTo(1, !0)
  23611. }
  23612. ,
  23613. window.fovTranId = 333;//add
  23614. n.prototype.smoothZoomToDefault = function(e, t) {
  23615. y.cancelById(window.fovTranId)
  23616. var i, n = this.zoomLevel,
  23617. r = function(e) {
  23618. e > 1 && (e = 1),
  23619. i = n * (1 - e) + e,
  23620. this.zoomTo(i, !0)
  23621. }.bind(this),
  23622. o = function() {
  23623. this.zoomDefault(),
  23624. t && window.setTimeout(t, 50)
  23625. }.bind(this);
  23626. y.start(r, e, o, null, 0, A[f.transition.blendEasing], null, window.fovTranId)
  23627. }
  23628. n.prototype.smoothZoomFovTo = function (fov, zoomLevel, dur, callback) {//add
  23629. y.cancelById(window.fovTranId)
  23630. console.log("smoothZoomFovTo "+zoomLevel)
  23631. var i,
  23632. n = this.zoomLevel,
  23633. aimLevel = zoomLevel || this.baseFov / fov
  23634. if (n == aimLevel) return
  23635. var fun = function (e) {
  23636. e > 1 && (e = 1), (i = n * (1 - e) + e * aimLevel),
  23637. this.zoomTo(i, !0)
  23638. }.bind(this)
  23639. y.start(fun, dur, callback, null, 0, A[f.transition.blendEasing], null, window.fovTranId)
  23640. }
  23641. n.prototype.updateZoomPano = function() {
  23642. if (!this.panoRenderer.zoomPanoRenderingDisabled && this.mode === u.PANORAMA && this.currentPano) {
  23643. let navTileClass = this.qualityManager.getNavZoomClass()
  23644. let tileClass = this.qualityManager.getMaxZoomClass()
  23645. if(navTileClass == '4k'){
  23646. var r = true
  23647. }else{
  23648. var levelThreshold1 = navTileClass == '1k' ? 1.1 : 1.5 , levelThreshold2 = 1.8 //levelThreshold2不能比zoom.max大也就是不能超过2,否则zoom.max将无法提升到3
  23649. var t = this.zoomLevel > levelThreshold1
  23650. , i = this.flying && this.nextPano && this.nextPano !== this.currentPano
  23651. , n = !i && !this.isWarping()
  23652. , r = t //&& n ; // 允许flying状态下加载4K图
  23653. }
  23654. this.tileDownloader.tilePrioritizer.setZoomingActive(r),
  23655. this.panoRenderer.setZoomingActive(r, this.currentPano, !0);
  23656. var o = function(pano, ifZoom) {
  23657. this.panoRenderer.resetRenderStatus(pano.id, !1, !0, this.qualityManager.getMaxNavPanoSize()),
  23658. this.panoRenderer.clearAllQueuedUploadsForPano(pano.id),
  23659. this.panoRenderer.renderPanoTiles(pano.id, null, !1, !1),
  23660. pano.setZoomed(ifZoom)
  23661. }.bind(this);
  23662. if(navTileClass == '4k'){
  23663. if (!this.currentPano.zoomed) {
  23664. o(this.currentPano, !0);
  23665. this.panoRenderer.enableUltraHighQualityMode(function() {//开启4k getMaxZoomPanoSize
  23666. this.qualityManager.useUltraHighResolutionPanos && (f.zoom.max = D.ultraHighQualityMaxZoom);
  23667. o(this.currentPano, !0)
  23668. }
  23669. .bind(this));
  23670. }
  23671. }else{
  23672. let zoomLevelRes = this.qualityManager.zoomLevelResolution
  23673. if (r && (!this.currentPano.zoomed || zoomLevelRes && zoomLevelRes != '4k')) {//needZoom
  23674. this.currentPano.zoomed || o(this.currentPano, !0);
  23675. if(navTileClass == '1k' && tileClass != '1k' && this.zoomLevel < levelThreshold2){
  23676. this.panoRenderer.enableHighQuality( function() {//开启2k
  23677. if(tileClass != '4k'){
  23678. o(this.currentPano, !0);
  23679. }
  23680. }.bind(this));
  23681. }else{
  23682. this.panoRenderer.enableUltraHighQualityMode(function() {//开启4k getMaxZoomPanoSize
  23683. this.qualityManager.useUltraHighResolutionPanos && !f.zoom.overridemax && (f.zoom.max = D.ultraHighQualityMaxZoom)
  23684. o(this.currentPano, !0)
  23685. }.bind(this));
  23686. }
  23687. } else {
  23688. !t && this.currentPano.zoomed && o(this.currentPano, !1);
  23689. }
  23690. //有三个级别的话,需要标记zoomLevelResolution,以便更新maxZoomPanoSize判断能下载的最高级别
  23691. if(r && navTileClass == '1k' && tileClass == '4k' ){ //目前只有手机端navTileClass == '1k'
  23692. var change = (zoomedFlag)=>{
  23693. this.qualityManager.updateMaximums()//更新maxZoomPanoSize
  23694. this.panoRenderer.setupZoomRenderTarget() //更新renderTarget
  23695. //this.currentPano.setZoomed(t);//更新uniforms贴图
  23696. if(this.qualityManager.zoomLevelResolution == '4k'){
  23697. this.model.showHighMap()
  23698. }else{
  23699. this.model.hideHighMap()
  23700. }
  23701. }
  23702. this.qualityManager.zoomLevelResolution = this.zoomLevel >= levelThreshold2 ? '4k' : this.zoomLevel > levelThreshold1? '2k' : '1k'
  23703. if(this.oldZoomLevel < levelThreshold2 && this.zoomLevel >= levelThreshold2){//1k/2k-4k
  23704. change()
  23705. o(this.currentPano, t)
  23706. }else if(this.oldZoomLevel <= levelThreshold1 && this.zoomLevel > levelThreshold1){//1k-2k
  23707. change()
  23708. }else if(this.oldZoomLevel > levelThreshold2 && this.zoomLevel <= levelThreshold2){//4k-2k/1k
  23709. change()
  23710. o(this.currentPano, t)
  23711. }else if(this.oldZoomLevel > levelThreshold1 && this.zoomLevel <= levelThreshold1){//2k-1k
  23712. change()
  23713. }
  23714. this.oldZoomLevel = this.zoomLevel
  23715. }
  23716. }
  23717. }
  23718. }
  23719. n.prototype.checkHasNeighbor = function(pano){//add
  23720. for(var i in pano.neighbourPanos ){
  23721. if(i == pano.id)continue;
  23722. if(pano.neighbourPanos[i]){
  23723. return true;
  23724. }
  23725. }
  23726. }
  23727. ,
  23728. t.exports = n
  23729. }
  23730. ).call(this, "/js/player.js")
  23731. }
  23732. , {
  23733. "./constants": 8,
  23734. "./enum/AlignmentType": 17,
  23735. "./enum/BlackoutStyle": 18,
  23736. "./enum/ControlEvents": 21,
  23737. "./enum/Keys": 30,
  23738. "./enum/ModelManagerEvents": 33,
  23739. "./enum/PanoSizeClass": 36,
  23740. "./enum/PanoramaEvents": 37,
  23741. "./enum/PathDiscardMode": 38,
  23742. "./enum/PathDisplayMode": 39,
  23743. "./enum/PlayerEvents": 40,
  23744. "./enum/TagStates": 44,
  23745. "./enum/Vectors": 50,
  23746. "./enum/Viewmode": 51,
  23747. "./enum/WarpStyle": 52,
  23748. "./enum/ZoomEvents": 53,
  23749. "./exception/BasicException": 55,
  23750. "./model/ModelManager": 140,
  23751. "./objects/NSpider": 147,
  23752. "./objects/Panorama": 148,
  23753. "./objects/Reticule": 149,
  23754. "./objects/ShowPath": 151,
  23755. "./objects/Snapshot": 153,
  23756. "./objects/View": 154,
  23757. "./settings": 166,
  23758. "./shaders": 167,
  23759. "./tile/TileDownloader": 171,
  23760. "./tile/TilePrioritizer": 172,
  23761. "./util/ZoomStats": 179,
  23762. "./util/browser": 182,
  23763. "./util/camera": 183,
  23764. "./util/cameraLight": 184,
  23765. "./util/common": 185,
  23766. "./util/easing": 186,
  23767. "./util/history": 187,
  23768. "./util/lerp": 188,
  23769. "./util/logger": 189,
  23770. "./util/math": 190,
  23771. "./util/transitions": 195,
  23772. "hot":"hot",
  23773. "scaleImg":"scaleImg",
  23774. events: 202,
  23775. three: 217
  23776. }],
  23777. "scaleImg":[function(t, e){// xzw
  23778. var OUTPUT = e;
  23779. (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")}
  23780. function n(t){if(t){var e,a=G.getImageData(0,0,s,f),i=a.data;for(e=0;at>e;e+=4)
  23781. 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}
  23782. return G.getImageData(0,0,s,f)}
  23783. 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}
  23784. a||(a=t.input,i=t.output,r=t.inputRemovable,t.scale&&(t=t.scale));var u,d;if(a.src)
  23785. if(u=document.createElement("canvas"),null!=a.naturalWidth)
  23786. 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}
  23787. else
  23788. 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)
  23789. 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)
  23790. for(h(),J=n(),K=J.data,x=0;f>x;x++)
  23791. 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)
  23792. 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)
  23793. W=new Float32Array(at);else
  23794. for(W=[],et=0;at>et;++et)
  23795. W[et]=0;for(b=0;w>b;b++)
  23796. 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)
  23797. 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;}
  23798. delete p,h(),J=n(W)}
  23799. 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}
  23800. if("png-src"===i||"jpeg-src"===i)
  23801. return B.toDataURL("image/"+i.split("-")[0],0.85)}
  23802. return B}
  23803. var e=this;"undefined"!=typeof exports?("undefined"!=typeof module&&module.exports&&(exports=module.exports=t),exports.scale=t):c=t}).call(this);
  23804. OUTPUT.exports = c;
  23805. }, {}
  23806. ],
  23807. 156: [function(e, t, i) {
  23808. (function(i) {
  23809. "use strict";
  23810. function n(e, t) {
  23811. this.model = e,
  23812. this.panos = e.panos,
  23813. this.player = t,
  23814. this.imagePanos = this.listImagePanos(),
  23815. this.retryMinimumTime = 1e4
  23816. }
  23817. var r = (e("three"),
  23818. e("./enum/Viewmode"))
  23819. , o = (e("./settings"),
  23820. e("./objects/Panorama"))
  23821. , a = e("./util/logger")
  23822. , s = new a(i);
  23823. n.prototype.start = function() {
  23824. this.loadNextPano(function(e) {
  23825. e ? this.start() : (s.debug("No suitable pano loaded, waiting a little while before looking again"),
  23826. setTimeout(function() {
  23827. this.start()
  23828. }
  23829. .bind(this), 1e3))
  23830. }
  23831. .bind(this))
  23832. }
  23833. ,
  23834. n.prototype.validLoadTarget = function(e) {
  23835. return e && !e.isLoaded("high") && Date.now() - e.failedLoadingAt > this.retryMinimumTime
  23836. }
  23837. ,
  23838. n.prototype.listImagePanos = function() {
  23839. var e = []
  23840. , t = this;
  23841. return this.model.images.forEach(function(i) {
  23842. if (i.metadata && i.metadata.scan_id) {
  23843. var n = t.model.panos.get(i.metadata.scan_id);
  23844. n && !n.isLoaded("high") && e.push(n)
  23845. }
  23846. }),
  23847. e
  23848. }
  23849. ,
  23850. n.prototype.nextNotLoadedImage = function() {
  23851. for (; this.imagePanos.length > 0; ) {
  23852. var e = this.imagePanos[0];
  23853. if (!e.isLoaded("high"))
  23854. return e;
  23855. this.imagePanos.shift()
  23856. }
  23857. return null
  23858. }
  23859. ,
  23860. n.prototype.loadNextPano = function(e) {
  23861. var t, i, n = this.model.waitQueue.filter(function(e) {
  23862. return e.object instanceof o
  23863. });
  23864. n.length > 0 ? (t = n[0].object,
  23865. s.debug("Overrode pano selection: Flying to an unloaded pano " + t.id)) : this.validLoadTarget(this.player.currentPano) ? (t = this.player.currentPano,
  23866. s.debug("Overrode pano selection: Currently at an unloaded pano " + t.id)) : this.validLoadTarget(this.player.closestPano) ? (t = this.player.closestPano,
  23867. s.debug("Overrode pano selection: Hovering over an unloaded pano " + t.id)) : this.validLoadTarget(this.nextNotLoadedImage()) ? (i = "high",
  23868. t = this.imagePanos[0],
  23869. 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())]),
  23870. t && s.debug("Normal pano selection: neighbor " + t.id)),
  23871. t ? (i = i || t.isLoaded("low") ? "high" : "low",
  23872. s.debug("Preloading " + i + "-res pano " + t.id),
  23873. t.loadCube(i).done(e).fail(function() {
  23874. s.warn("Failed preloading pano", t.id, ", marking it as failed and forgetting it for a while"),
  23875. e()
  23876. })) : e && e(null)
  23877. }
  23878. ,
  23879. t.exports = n
  23880. }
  23881. ).call(this, "/js/preloaders.js")
  23882. }
  23883. , {
  23884. "./enum/Viewmode": 51,
  23885. "./objects/Panorama": 148,
  23886. "./settings": 166,
  23887. "./util/logger": 189,
  23888. three: 217
  23889. }],
  23890. 157: [function(e, t, i) {
  23891. (function(i) {
  23892. "use strict";
  23893. function n(e, t, i, n, r) {
  23894. this.qualityManager = e,
  23895. this.scene = t,
  23896. this.camera = i,
  23897. this.container = r,
  23898. this.controls = n,
  23899. this.controls.enabled = !0,
  23900. this.controls.locked = !0,
  23901. this.quickstartCamera = n.camera,
  23902. this.quickstartCamera.fov = h.clampVFOV(a.insideFOV, a.insideFOVMax, $("#player").width(), $("#player").height()),
  23903. this.skybox = null
  23904. }
  23905. var r = e("three")
  23906. , o = e("../util/logger")
  23907. , a = e("../constants")
  23908. , s = (e("../util/transitions"),
  23909. e("../util/lerp"),
  23910. e("../util/easing"),
  23911. e("../enum/Vectors"))
  23912. , l = e("../enum/PanoSizeClass")
  23913. , c = (e("../materials/ModelTextureMaterial"),
  23914. e("../materials/CubemapMaterial"))
  23915. , h = (e("../cameras/PanoramaCamera"),
  23916. e("../controls/PanoramaControls"),
  23917. e("../tile/TileUtils"),
  23918. e("../util/camera"),
  23919. e("../util/cameraLight"))
  23920. , u = (e("../util/browser"),
  23921. e("../settings"),
  23922. e("../gui/helpManager"),
  23923. new o(i));
  23924. n.prototype.load = function(e) {
  23925. e.pano.shouldRedrawOnBaseLoaded = !0;
  23926. var t, i, n = this, r = s.FORWARD.clone().applyQuaternion(e.quaternion), o = r.clone().negate();
  23927. this.controls.lookAt(r.add(this.quickstartCamera.position));
  23928. var a = this.qualityManager.getPanoSize(l.BASE)
  23929. , c = this.qualityManager.getPanoSize(l.STANDARD);
  23930. if (e.pano.tiled) {
  23931. u.warn("Loading startPano, TILED", e.pano.id);
  23932. var d = h.getHFOVForCamera(this.quickstartCamera, $("#player").width(), $("#player").height())
  23933. , p = this.quickstartCamera.fov;
  23934. u.warn("Quickstart loading tiles in frustum: [horizontal FOV: " + d + ", vertical FOV: " + p + "]"),
  23935. t = e.pano.loadTiledPano(c, r, {
  23936. hFov: d,
  23937. vFov: p
  23938. }, !1, !1, !0),
  23939. i = e.pano.loadTiledPano(a, o, null, !1, !1, !0)
  23940. } else
  23941. u.warn("Loading startPano", e.pano.id),
  23942. t = e.pano.loadCube("high");
  23943. return $.when(t).then(function() {
  23944. n.init(e.pano, e.quaternion),
  23945. e.pano.tiled ? i.done(function() {
  23946. e.pano.lockUntilRenderingComplete = !1,
  23947. this.controls.locked = !1
  23948. }
  23949. .bind(this)) : this.controls.locked = !1
  23950. }
  23951. .bind(this))
  23952. }
  23953. ,
  23954. n.prototype.init = function(e, t) {
  23955. u.info("Quickstart done loading, adding scene objects"),
  23956. e.lockUntilRenderingComplete = !0,
  23957. this.skybox = new r.Mesh(new r.CubeGeometry(1,1,1),new c({
  23958. side: r.BackSide
  23959. })),
  23960. this.skybox.material.uniforms.map.value = e.getSkyboxTexture(),
  23961. this.skybox.quaternion.copy(e.quaternion),
  23962. this.scene.add(this.skybox),
  23963. $(this.container).show()
  23964. }
  23965. ,
  23966. n.prototype.update = function(e) {
  23967. this.controls.update(e),
  23968. this.camera.copy(this.quickstartCamera)
  23969. }
  23970. ,
  23971. n.prototype.setSize = function(e, t) {
  23972. this.quickstartCamera.updateAspect(e / t)
  23973. }
  23974. ,
  23975. n.prototype.destroy = function() {
  23976. this.scene.remove(this.skybox)
  23977. }
  23978. ,
  23979. t.exports = n
  23980. }
  23981. ).call(this, "/js/scene/QuickstartManager.js")
  23982. }
  23983. , {
  23984. "../cameras/PanoramaCamera": 7,
  23985. "../constants": 8,
  23986. "../controls/PanoramaControls": 13,
  23987. "../enum/PanoSizeClass": 36,
  23988. "../enum/Vectors": 50,
  23989. "../gui/helpManager": 68,
  23990. "../materials/CubemapMaterial": 117,
  23991. "../materials/ModelTextureMaterial": 118,
  23992. "../settings": 166,
  23993. "../tile/TileUtils": 174,
  23994. "../util/browser": 182,
  23995. "../util/camera": 183,
  23996. "../util/cameraLight": 184,
  23997. "../util/easing": 186,
  23998. "../util/lerp": 188,
  23999. "../util/logger": 189,
  24000. "../util/transitions": 195,
  24001. three: 217
  24002. }],
  24003. 158: [function(e, t, i) {
  24004. "use strict";
  24005. function n(e, t, i) {
  24006. this.scene = e,
  24007. this.camera = t,
  24008. this.renderer = null,
  24009. this.effects = i,
  24010. this.animateCallback = null,
  24011. this.composer = null,
  24012. this.qualityManager = null,
  24013. e.renderWidth = 0,
  24014. e.renderHeight = 0,
  24015. this.updateClock = new r.Clock,
  24016. this.components = [],
  24017. this.updateListeners = [],
  24018. this.resizeListeners = [],
  24019. this.forceUpdateSize = !1,
  24020. this.started = !1,
  24021. this.textures = {},
  24022. this.suspendedObjects = []
  24023. }
  24024. var r = e("three")
  24025. , o = e("../shaders")
  24026. , a = e("../enum/SceneRendererEvents")
  24027. , s = e("../enum/GLTextureType")
  24028. , l = e("../enum/GLCubeFaces")
  24029. , c = e("../exception/BasicException")
  24030. , h = e("../exception/RendererCreationException")
  24031. /**********************************************************************fyz改 from徐世廷**********************************************************************/
  24032. , m = e("../util/browser")
  24033. /**************************************************************************************************************************************************/
  24034. , u = e("../settings")
  24035. , d = e("events").EventEmitter;
  24036. window.requestAnimationFrame = window.requestAnimationFrame || window.webkitRequestAnimationFrame,
  24037. n.prototype = Object.create(d.prototype),
  24038. n.prototype.addComponent = function(e) {
  24039. this.components.push(e),
  24040. e.update && this.updateListeners.push(e),
  24041. e.setSize && (this.resizeListeners.push(e),
  24042. this.forceUpdateSize = !0)
  24043. }
  24044. ,
  24045. n.prototype.removeComponent = function(e) {
  24046. var t = function(t) {
  24047. return t !== e
  24048. };
  24049. this.components = this.components.filter(t),
  24050. this.updateListeners = this.updateListeners.filter(t),
  24051. this.resizeListeners = this.resizeListeners.filter(t)
  24052. }
  24053. ,
  24054. n.prototype.start = function(e) {
  24055. if (this.started)
  24056. throw new c("Can't start SceneRenderer, already started");
  24057. this.createContext(e),
  24058. /***************************************************VR fyz改 from徐世廷**********************************************************************/
  24059. m.isMobile() && this.boluoVrInit(),
  24060. /*******************************************************************************************************************************/
  24061. this.initComposer(),
  24062. this.started = !0,
  24063. (p = p.bind(this))()
  24064. }
  24065. ,
  24066. n.prototype.createContext = function(e) {
  24067. var transparent = !!(settings.transparentBg || settings.bgImg)
  24068. try {
  24069. this.renderer = new r.WebGLRenderer({antialias: !m.isMobile(), alpha:transparent}),
  24070. this.renderer.autoClear = !0,
  24071. this.renderer.setPixelRatio(window.devicePixelRatio ? window.devicePixelRatio : 1),
  24072. this.renderer.setSize($("#player").width(), $("#player").height(), false), //改
  24073. transparent && this.renderer.setClearColor( 0x000000, 0 ); //透明
  24074. this.emit(a.ContextCreated)
  24075. } catch (e) {
  24076. throw new h("Unable to create a WebGL rendering context")
  24077. }
  24078. u.profiling.enabled && this.overrideTextures(),
  24079. e.appendChild(this.renderer.domElement)
  24080. /* window.stats = new Stats();
  24081. e.appendChild( stats.dom ); */
  24082. }
  24083. ,
  24084. n.prototype.overrideTextures = function() {
  24085. var e = this.renderer.context
  24086. , t = 0
  24087. , i = e.createTexture;
  24088. e.createTexture = function() {
  24089. var n = i.call(e);
  24090. return n.id = t++,
  24091. this.textures[n.id] = n,
  24092. n
  24093. }
  24094. .bind(this);
  24095. var n = e.texImage2D;
  24096. e.texImage2D = function(t, i, r, o, a, l, c, h, u) {
  24097. var d, p = this.getTextureTypeFromTarget(e, t);
  24098. d = p === s.TextureCube ? e.getParameter(e.TEXTURE_BINDING_CUBE_MAP) : e.getParameter(e.TEXTURE_BINDING_2D),
  24099. void 0 !== c ? n.call(e, t, i, r, o, a, l, c, h, u) : (c = o,
  24100. h = a,
  24101. u = l,
  24102. o = u.naturalWidth,
  24103. a = u.naturalHeight,
  24104. n.call(e, t, i, r, c, h, u));
  24105. var f = this.textures[d.id];
  24106. f.width = p === s.TextureCube ? 6 * o : o,
  24107. f.height = a
  24108. }
  24109. .bind(this);
  24110. var r = e.deleteTexture;
  24111. e.deleteTexture = function(t) {
  24112. delete this.textures[t.id],
  24113. r.call(e, t)
  24114. }
  24115. .bind(this)
  24116. }
  24117. ,
  24118. n.prototype.updateTextureMemory = function() {
  24119. var e = null;
  24120. return function() {
  24121. var t = 0;
  24122. for (var i in this.textures) {
  24123. var n = this.textures[i];
  24124. n.width && n.height && (t += n.width * n.height * 4)
  24125. }
  24126. t !== e && this.emit(a.MemoryUsageUpdated, t),
  24127. e = t
  24128. }
  24129. }(),
  24130. n.prototype.getTextureTypeFromTarget = function(e, t) {
  24131. switch (t) {
  24132. case e.TEXTURE_CUBE_MAP_POSITIVE_X:
  24133. case e.TEXTURE_CUBE_MAP_NEGATIVE_X:
  24134. case e.TEXTURE_CUBE_MAP_POSITIVE_Y:
  24135. case e.TEXTURE_CUBE_MAP_NEGATIVE_Y:
  24136. case e.TEXTURE_CUBE_MAP_POSITIVE_Z:
  24137. case e.TEXTURE_CUBE_MAP_NEGATIVE_Z:
  24138. return s.TextureCube;
  24139. case e.TEXTURE_2D:
  24140. return s.Texture2D;
  24141. default:
  24142. return null
  24143. }
  24144. }
  24145. ,
  24146. n.prototype.initComposer = function() {
  24147. this.composer = new r.EffectComposer(this.renderer),
  24148. this.composer.addPass(new r.RenderPass(this.scene,this.camera)),
  24149. //this.composer.addPass(this.effects.hblurPass),
  24150. //this.composer.addPass(this.effects.vblurPass)
  24151. this.composer.addPass(this.effects.transitionMaskPass)//add
  24152. }
  24153. ,
  24154. n.prototype.setSize = function(e, t, devicePixelRatio) {
  24155. this.renderWidth = e,
  24156. this.renderHeight = t,
  24157. this.effects.aspect = e / t,
  24158. /* this.renderer.setSize(e, t), -----MP */
  24159. this.renderer.setSize(e, t, false, devicePixelRatio), //改 为了防止给canvas设置宽高
  24160. this.composer.setSize(e, t);
  24161. for (var i = 0; i < this.resizeListeners.length; i++)
  24162. this.resizeListeners[i].setSize(e, t)
  24163. }
  24164. ,
  24165. n.prototype.render = function() {
  24166. //this.effects.currentBlur > 0 ? this.composer.render() : this.renderer.render(this.scene, this.camera)
  24167. this.effects.transitionMaskPass.enabled ? this.composer.render() : this.renderer.render(this.scene, this.camera)
  24168. }
  24169. /******************************************************************************************************徐世廷**********************************************************************/
  24170. var vrPermission = {};
  24171. var vrPermissionCallBack = function(info1,info2){
  24172. if(info1 == "reset"){
  24173. vrPermission = {};
  24174. }else{
  24175. vrPermission[info1] = info2
  24176. if(Object.keys(vrPermission).length == 2 && (vrPermission.deviceMotion != "granted" || vrPermission.deviceOrientation != "granted")){
  24177. alert("运动和方向访问失败。这会导致画面视角一直固定。您需要完全关闭此应用,然后再次打开,并允许访问运动与方向。" )
  24178. }
  24179. }
  24180. }
  24181. n.prototype.boluoVrInit = function() {
  24182. console.log("boluoVrInit")
  24183. this.isHuawei5X = m.detectHUAWEI5X(),
  24184. this.oldRenderer = this.renderer,
  24185. this.newRenderer = new this.vrRenderer(this.renderer,this,this.camera);
  24186. window.panoCamera = this.camera;
  24187. var a = this;
  24188. window._vrEnabled = !1,
  24189. Object.defineProperty(window, "vrEnabled", {
  24190. get: function() {
  24191. return window._vrEnabled
  24192. },
  24193. set: function(b) {
  24194. b = !!b,
  24195. b ? (a.renderer = a.newRenderer,
  24196. window.vrMarkers.forEach(function(a) {
  24197. a.visible = !0
  24198. })) : (a.renderer = a.oldRenderer,
  24199. window.vrMarkers.forEach(function(a) {
  24200. a.visible = !1
  24201. })),
  24202. a.cursor.visible = b,
  24203. a.setSize(window.innerWidth, window.innerHeight),
  24204. window._vrEnabled = b
  24205. if(b){
  24206. setTimeout(function(){
  24207. console.log("orientEnable"+window.orientEnable)
  24208. if(window.vrEnabled && !window.orientEnable){//很可能没能触发陀螺仪事件
  24209. if(m.detectIOS()/* && m.detectSafari() */){
  24210. var b = m.iosVersion();//{major: 10, minor: 3, patch: 1}
  24211. console.log("开始获取权限 major"+b.major)
  24212. if(b.major == 12 && b.minor>=2){
  24213. if(browser.detectSafari()) alert("浏览器未能检测到转动。为完整体验VR效果,请打开 “设置” > “Safari” > “隐私和安全” 下的 “运动和方向访问” 开关,然后刷新此页面。")
  24214. else{//app??
  24215. alert("浏览器未能检测到转动。请在手机或浏览器设置中开启了运动和方向访问等设置,然后刷新此页面。")
  24216. }
  24217. }else if(b.major >= 13){
  24218. if(!window.location.href.includes("https://")){
  24219. console.log("需要https");
  24220. alert("当前网页下,高于ios12的浏览器版本可能不支持陀螺仪开启。")
  24221. return;
  24222. }
  24223. var hasFailed = window.vrPermission && (window.vrPermission.deviceMotion != "granted" || window.vrPermission.deviceOrientation != "granted")
  24224. setTimeout(()=>{//如果使用了alert会阻断这个事件,报以下错requusting device orientation or motion access requires a user gesture
  24225. if(!window.vrEnabled || window.orientEnable)return;
  24226. vrPermissionCallBack("reset")
  24227. console.log(window.DeviceMotionEvent)
  24228. if ( window.DeviceMotionEvent && window.DeviceMotionEvent.requestPermission && typeof window.DeviceMotionEvent.requestPermission === 'function') {
  24229. console.log("开始获取权限1")
  24230. ///注意:需要https 本地服务器permissionState会得到denied
  24231. window.DeviceMotionEvent.requestPermission().then(permissionState => {
  24232. console.log("permissionState1: "+permissionState)
  24233. vrPermissionCallBack("deviceMotion", permissionState)
  24234. }).catch(function(e){
  24235. vrPermissionCallBack("deviceMotion", false)
  24236. console.log(e)
  24237. })
  24238. }else{
  24239. console.log("window.DeviceMotionEvent undefined")
  24240. vrPermissionCallBack("deviceMotion", false)
  24241. }
  24242. if ( window.DeviceOrientationEvent && window.DeviceOrientationEvent.requestPermission && typeof window.DeviceOrientationEvent.requestPermission === 'function') {
  24243. console.log("开始获取权限2")
  24244. window.DeviceOrientationEvent.requestPermission().then(permissionState => {
  24245. console.log("permissionState2: "+permissionState)
  24246. vrPermissionCallBack("deviceOrientation", permissionState)
  24247. }).catch(function(e){
  24248. vrPermissionCallBack("deviceOrientation", false)
  24249. console.log(e)
  24250. })
  24251. }else{
  24252. console.log("window.DeviceOrientationEvent undefined")
  24253. vrPermissionCallBack("deviceOrientation", false)
  24254. }
  24255. },hasFailed ? 0 : 150)
  24256. /* /* setTimeout(function(){
  24257. if(settings.vrEnabled && !window.orientEnable){
  24258. $alert("若画面视角一直固定,您需要完全关闭Safari浏览器,然后再次打开以开启运动和方向访问。")
  24259. }
  24260. },4000) */
  24261. }else console.log("陀螺仪未能启用 ios "+b.major+"."+b.minor)
  24262. }else{
  24263. //$alert("浏览器未能检测到转动", "请在手机或浏览器设置中开启了运动和方向访问等设置,然后刷新此页面。")
  24264. }
  24265. }else{
  24266. //已经触发了
  24267. }
  24268. },200);
  24269. }
  24270. }
  24271. }),
  24272. this.createCursor(.5, !1, 1, 16777215, 0);
  24273. var b = {
  24274. setSize: function(b, c) {
  24275. a.camera.aspect = b / c
  24276. }
  24277. };
  24278. this.resizeListeners.push(b),
  24279. this.vrLoadingInit()
  24280. }
  24281. ,
  24282. n.prototype.vrLoadingInit = function() {
  24283. var a = function(camera) {
  24284. var a = this
  24285. , b = new r.RingGeometry(1.3,1.5,32,32,0,1.2 * Math.PI)
  24286. , c = new r.MeshBasicMaterial({
  24287. color: 4967932,
  24288. side: r.DoubleSide
  24289. })
  24290. , d = new r.Mesh(b,c);
  24291. this.mesh = d,
  24292. d.position.z = -2,
  24293. d.scale.set(.08, .08, .08),
  24294. d.visible = !1,
  24295. camera.add(d),
  24296. //window.player.camera.add(d),
  24297. a.enabled = !1,
  24298. this.update = function(b) {
  24299. 1 == a.enabled && (d.rotation.z += 15 * b)
  24300. }
  24301. }
  24302. , a = new a(this.camera);
  24303. window.Loading = a,
  24304. this.updateListeners.push(a)
  24305. }
  24306. ,
  24307. n.prototype.createCursor = function(a, b, c, d, e) {
  24308. var g, h = new r.SpriteMaterial({
  24309. opacity: c,
  24310. color: d,
  24311. transparent: b,
  24312. map: this.boluoGetTexture("static/images/cursor.png"),
  24313. needsUpdate: !0,
  24314. side: r.DoubleSide
  24315. });
  24316. h.map.offset = new r.Vector2(1 / 17 * e,0),
  24317. h.map.repeat = new r.Vector2(1 / 17,1),
  24318. h.depthTest = !1,
  24319. h.blending = r.AdditiveBlending,
  24320. g = new r.Sprite(h),
  24321. // g.scale.set(a, a, a),
  24322. g.scale.set(.3,.3,.3)
  24323. g.position.z = -2,
  24324. g.visible = !1,
  24325. g.name = "cursor",
  24326. this.camera.add(g),
  24327. this.scene.add(this.camera),
  24328. this.cursor = g;
  24329. var i = new this.CursorAnimation(this.scene,g,this.camera);
  24330. this.cursor.triggerTargetEvent = i.triggerTargetEvent,
  24331. this.updateListeners.push(i)
  24332. }
  24333. ,
  24334. window.orientEnable = 0; //是否能触发deviceorientation
  24335. n.prototype.CursorAnimation = function(a, b, c) {
  24336. function d() {
  24337. g.orient = r.Math.degToRad(window.orientation || 0)
  24338. }
  24339. function e(a) {
  24340. if(!window.vrEnabled && window.orientEnable) return;
  24341. window.orientEnable || (window.orientEnable = 1);
  24342. var b = r.Math.degToRad(a.alpha)
  24343. , c = r.Math.degToRad(a.beta)
  24344. , d = r.Math.degToRad(a.gamma);
  24345. if (this.isHuawei5X ? (-1e3 === g.alpha && (g.alpha = b),
  24346. -1e3 === g.beta && (g.beta = c),
  24347. -1e3 === g.gamma && (g.gamma = d),
  24348. Math.abs(b - g.alpha) > .06 && (g.alpha = b),
  24349. Math.abs(c - g.beta) > .006 && (g.beta = c),
  24350. Math.abs(d - g.gamma) > .006 && (g.gamma = d)) : (g.alpha = b,
  24351. g.beta = c,
  24352. g.gamma = d),
  24353. n.vrDebug) {
  24354. $("#info-device-orientation").css("display", "block");
  24355. var e = "";
  24356. e += "alpha=(" + g.alpha + ")<BR/>",
  24357. e += "beta=(" + g.beta + ")<BR/>",
  24358. e += "gamma=" + g.gamma + "<BR/>",
  24359. document.getElementById("info-device-orientation").innerHTML = e
  24360. }
  24361. }
  24362. this.cursor = b,
  24363. this.raycaster = new r.Raycaster,
  24364. this.targetEventObj = {},
  24365. this.type = 1,
  24366. this.tweenFlag = !0;
  24367. var g = this;
  24368. this.target = c,
  24369. console.log(c.uuid),
  24370. this.euler = new r.Euler,
  24371. this.q0 = new r.Quaternion,
  24372. this.q1 = new r.Quaternion(-Math.sqrt(.5),0,0,Math.sqrt(.5)),
  24373. this.zee = new r.Vector3(0,0,1),
  24374. this.alpha = -1e3,
  24375. this.beta = -1e3,
  24376. this.gamma = -1e3,
  24377. this.orient = r.Math.degToRad(window.orientation || 0),
  24378. window.addEventListener("orientationchange", d),
  24379. window.addEventListener("deviceorientation", e),
  24380. this.setObjectQuaternion = function(a, b, d, e, f) {
  24381. g.euler.set(d, b, -e, "YXZ"),
  24382. a.setFromEuler(g.euler),
  24383. a.multiply(g.q1),
  24384. a.multiply(g.q0.setFromAxisAngle(g.zee, -f)),
  24385. c.updateMatrixWorld()
  24386. }
  24387. ,
  24388. parent !== window && window.addEventListener("message", function(a) {
  24389. var b = JSON.parse(a.data)
  24390. , c = -1 !== window.navigator.userAgent.indexOf("KIW-TL00H");
  24391. b && b.alpha && b.beta && b.gamma && function(a) {
  24392. var c = r.Math.degToRad(b.alpha)
  24393. , d = r.Math.degToRad(b.beta)
  24394. , e = r.Math.degToRad(b.gamma);
  24395. a ? (-1e3 === g.alpha && (g.alpha = c),
  24396. -1e3 === g.beta && (g.beta = d),
  24397. -1e3 === g.gamma && (g.gamma = e),
  24398. Math.abs(c - g.alpha) > .06 && (g.alpha = c),
  24399. Math.abs(d - g.beta) > .006 && (g.beta = d),
  24400. Math.abs(e - g.gamma) > .006 && (g.gamma = e)) : (g.alpha = c,
  24401. g.beta = d,
  24402. g.gamma = e)
  24403. }(c)
  24404. }),
  24405. this.update = function(a) {
  24406. TWEEN.update();
  24407. if(window.ifTest && window.vrEnabled) this.triggerTargetEvent() //测试时不根据陀螺仪来转向
  24408. else window.vrEnabled && (this.setObjectQuaternion(this.target.quaternion, this.alpha, this.beta, this.gamma, this.orient ),
  24409. this.triggerTargetEvent())
  24410. }
  24411. ,
  24412. this.triggerTargetEvent = function() {
  24413. var a = this.choseObj()
  24414. , b = a ? a.object : void 0;
  24415. this.targetEventObj.currentObj = b,
  24416. b !== this.targetEventObj.lastObj && (b && this.autoCursorPosition(a),
  24417. 1 === this.type ? (this.cursorAnimate && this.cursorAnimate.stop(),
  24418. b && b.enabled && this.startAnimate(function() {
  24419. this.clickCallback(b)
  24420. }
  24421. .bind(this))) : this.type,
  24422. this.targetEventObj.lastObj = b)
  24423. }
  24424. ,
  24425. this.choseObj = function() {
  24426. this.raycaster.setFromCamera({
  24427. x: 0,
  24428. y: 0
  24429. }, c);
  24430. var a = (this.raycaster.ray,
  24431. window.vrMarkers)
  24432. , b = this.raycaster.intersectObjects(a);
  24433. if (b.length > 0)
  24434. return b[0]
  24435. }
  24436. ,
  24437. this.clickCallback = function(a) {
  24438. this.runTHREEAction(a, "onclick")
  24439. }
  24440. ,
  24441. this.runTHREEAction = function(a, b) {
  24442. switch (b) {
  24443. case "onclick":
  24444. a._listeners && a._listeners.click && a._listeners.click.forEach(function(a) {
  24445. a()
  24446. });
  24447. break;
  24448. case "onhover":
  24449. a._listeners && a._listeners.hover && a._listeners.hover.forEach(function(a) {
  24450. a()
  24451. });
  24452. break;
  24453. case "onout":
  24454. a._listeners && a._listeners.out && a._listeners.out.forEach(function(a) {
  24455. a()
  24456. })
  24457. }
  24458. }
  24459. ,
  24460. this.startAnimate = function(a) {
  24461. this.tweenFlag && this.initAnimation(a)
  24462. }
  24463. ,
  24464. this.initAnimation = function(a) {
  24465. var b = this
  24466. , c = this.cursor.material.map.offset
  24467. , d = function(a) {
  24468. return Math.floor(17 * a) / 17
  24469. };
  24470. b.tweenFlag = !1,
  24471. this.cursorAnimate = new TWEEN.Tween(c).to({
  24472. x: 1
  24473. }, 1e3).onStart(function() {
  24474. b.tweenFlag = !1
  24475. }).onStop(function() {
  24476. b.tweenFlag = !0,
  24477. this.x = 0,
  24478. c.x = 0
  24479. }).onUpdate(function() {}).onComplete(function() {
  24480. a(),
  24481. c.x = 0,
  24482. setTimeout(function() {
  24483. b.tweenFlag = !0
  24484. }, 1500)
  24485. }),
  24486. this.cursorAnimate.easing(d),
  24487. this.cursorAnimate.start()
  24488. }
  24489. ,
  24490. this.autoCursorPosition = function(a) {
  24491. // var b = Math.abs(a.distance - 10);
  24492. // this.cursor.position.z = -b,
  24493. // b /= 10;
  24494. // alert(b);
  24495. // this.cursor.scale.set(b, b, b)
  24496. this.cursor.scale.set(.3,.3,.3)
  24497. }
  24498. }
  24499. ,
  24500. n.prototype.vrRenderer = function(a, b, c) {
  24501. var d = new b.vrCamera(c);
  24502. d.bananaAspect = .8,
  24503. this.width,
  24504. this.height;
  24505. var b = this;
  24506. this.setSize = function(c, d) {
  24507. a.setSize.call(this, c, d),
  24508. b.width = c,
  24509. b.height = d
  24510. }
  24511. ,
  24512. this.render = function(b, c, e, f) {
  24513. window.cameraQua = c.quaternion.clone();
  24514. var g, h;
  24515. if (c.__RESS__SKIP__STEREO__)
  24516. return a.render(b, c, e, f);
  24517. if ("PerspectiveCamera" === c.type)
  24518. g = d.cameraL,
  24519. h = d.cameraR,
  24520. b.updateMatrixWorld(),
  24521. null === c.parent && c.updateMatrixWorld(),
  24522. d.vrCameraUpdate(c);
  24523. else {
  24524. if ("OrthographicCamera" !== c.type)
  24525. return DEBUG && console.error("Unsupported renderer: ", c.type);
  24526. g = h = c
  24527. }
  24528. a.setScissorTest(!0),
  24529. a.setScissor(0, 0, this.width / 2, this.height),
  24530. a.setViewport(0, 0, this.width / 2, this.height),
  24531. a.render.call(this, b, g, e, f),
  24532. a.setScissor(this.width / 2, 0, this.width / 2, this.height),
  24533. a.setViewport(this.width / 2, 0, this.width / 2, this.height),
  24534. a.render.call(this, b, h, e, f),
  24535. a.setScissorTest(!1)
  24536. }
  24537. ,
  24538. this.__proto__ = {
  24539. __proto__: a
  24540. }
  24541. }
  24542. ,
  24543. n.prototype.vrCamera = function(a) {
  24544. this.type = "StereoCamera",
  24545. this._aspect = 1,
  24546. this._overlap = .064,
  24547. this.cameraL = new r.PerspectiveCamera,
  24548. this.cameraL.layers.enable(1),
  24549. this.cameraL.near = 0.01,//xzw add
  24550. this.cameraL.matrixAutoUpdate = !1,
  24551. this.cameraR = new r.PerspectiveCamera,
  24552. this.cameraR.layers.enable(2),
  24553. this.cameraR.near = 0.01,//xzw add
  24554. this.cameraR.matrixAutoUpdate = !1,
  24555. this.eyeRight = new r.Matrix4,
  24556. this.eyeLeft = new r.Matrix4,
  24557. this.vrCameraNeedsUpdate = !0,
  24558. window.vrCameraL = this.cameraL; // fyz 记录vr相机
  24559. Object.defineProperty(this, "bananaAspect", {
  24560. get: function() {
  24561. return this._aspect
  24562. },
  24563. set: function(a) {
  24564. this._aspect !== a && (this.vrCameraNeedsUpdate = !0),
  24565. this._aspect = a
  24566. }
  24567. }),
  24568. Object.defineProperty(this, "overlap", {
  24569. get: function() {
  24570. return this._overlap
  24571. },
  24572. set: function(a) {
  24573. this._overlap !== a && (this.vrCameraNeedsUpdate = !0),
  24574. this._overlap = a
  24575. }
  24576. }),
  24577. this.vrCameraUpdate = function(a) {
  24578. this.vrCameraNeedsUpdate = true;
  24579. if (this.vrCameraNeedsUpdate = this.vrCameraNeedsUpdate || this.bananaFov !== a.fov || this.bananaReal_aspect !== a.aspect * this.bananaAspect || this.bananaNear !== a.near || this.bananaFar !== a.far,
  24580. this.vrCameraNeedsUpdate) {
  24581. this.vrCameraNeedsUpdate = !1,
  24582. //console.debug("vrCameraUpdate"),
  24583. this.bananaFocus = a.focus,
  24584. this.bananaFov = a.fov,
  24585. this.bananaReal_aspect = a.aspect * this.bananaAspect,
  24586. this.bananaNear = a.near,
  24587. this.bananaFar = a.far,
  24588. //console.debug(a.aspect),
  24589. this.bananaFocus = 10;
  24590. 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);
  24591. this.eyeLeft.elements[12] = -e,
  24592. this.eyeRight.elements[12] = e,
  24593. b = -g * this.bananaReal_aspect + f,
  24594. c = g * this.bananaReal_aspect + f,
  24595. d.elements[0] = 2 * this.bananaNear / (c - b),
  24596. d.elements[8] = (c + b) / (c - b),
  24597. this.cameraL.projectionMatrix.copy(d),
  24598. b = -g * this.bananaReal_aspect - f,
  24599. c = g * this.bananaReal_aspect - f,
  24600. d.elements[0] = 2 * this.bananaNear / (c - b),
  24601. d.elements[8] = (c + b) / (c - b),
  24602. this.cameraR.projectionMatrix.copy(d)
  24603. }
  24604. this.cameraL.matrixWorld.copy(a.matrixWorld).multiply(this.eyeLeft),
  24605. this.cameraR.matrixWorld.copy(a.matrixWorld).multiply(this.eyeRight)
  24606. }
  24607. }
  24608. ,
  24609. n.prototype.boluoGetTexture = function(a) {
  24610. var b = new r.TextureLoader;
  24611. return b.crossOrigin = "anonymous",
  24612. b.load(a)
  24613. }
  24614. ,
  24615. /***********************************************************************************************************************************************************************************/
  24616. n.prototype.updateScreenSize = function() {//xzw 改 为了截屏 要改canvas大小 以及缩放时不模糊
  24617. var W,H;//当截屏时有setTimeout 期间不能恢复大小,所以要用W,H记录正常大小
  24618. return function(o){
  24619. var render = false;
  24620. var ratio;
  24621. var w, h; //记录应当render的大小
  24622. if(o && !o.resize && o.width!= void 0 && o.height!= void 0){
  24623. w = o.width, h = o.height, render = true, ratio=1;
  24624. }else{
  24625. w = $('#player').width();
  24626. h = $('#player').height();
  24627. o && o.resize && (W = this.renderWidth, H = this.renderHeight);
  24628. (w !== W || h !== H || this.forceUpdateSize) &&
  24629. (W = w, H = h, render = true, ratio = window.devicePixelRatio);
  24630. }
  24631. if(render){
  24632. this.setSize(w, h, ratio);
  24633. this.forceUpdateSize = !1
  24634. }
  24635. }
  24636. }()
  24637. ,
  24638. n.prototype.updateComponents = function() {
  24639. for (var e = Math.min(1, this.updateClock.getDelta()), t = 0; t < this.updateListeners.length; t++)
  24640. this.updateListeners[t].update(e)
  24641. }
  24642. ,
  24643. n.prototype.suspend = function() {
  24644. this.started = !1,
  24645. this.suspendedObjects = this.scene.children.map(function(e) {
  24646. return this.scene.remove(e),
  24647. e
  24648. }
  24649. .bind(this)),
  24650. this.render()
  24651. }
  24652. ,
  24653. n.prototype.resume = function() {
  24654. this.suspendedObjects.forEach(function(e) {
  24655. this.scene.add(e)
  24656. }
  24657. .bind(this)),
  24658. this.suspendedObjects = [],
  24659. this.started = !0,
  24660. p()
  24661. }
  24662. ;
  24663. var p = function() {
  24664. this.started && (window.requestAnimationFrame(p),
  24665. this.updateScreenSize(), // fyz resize
  24666. this.updateComponents(),
  24667. this.updateTextureMemory(),
  24668. this.render(),
  24669. window.stats && (window.fps = stats.update()),
  24670. this.emit(a.AfterRender))
  24671. };
  24672. n.prototype.getImageData = function() {
  24673. var e = document.createElement("canvas")
  24674. , t = e.getContext("2d");
  24675. return function(i, n, r) {
  24676. return e.width === n && e.height === r || (e.width = n,
  24677. e.height = r),
  24678. t.drawImage(i, 0, 0, n, r),
  24679. t.getImageData(0, 0, n, r)
  24680. }
  24681. }(),
  24682. n.prototype.initSizedTexture2D = function(e, t, i) {
  24683. var n = this.renderer
  24684. , o = n.context
  24685. , a = n.state
  24686. , s = new r.Texture(null);
  24687. s.flipY = !1,
  24688. i !== !0 && (i = !1),
  24689. s.generateMipmaps = i;
  24690. var l = n.paramThreeToGL(s.format)
  24691. , c = n.paramThreeToGL(s.type)
  24692. , h = n.properties.get(s)
  24693. , u = o.createTexture();
  24694. a.bindTexture(o.TEXTURE_2D, u),
  24695. o.pixelStorei(o.UNPACK_FLIP_Y_WEBGL, s.flipY),
  24696. o.texImage2D(o.TEXTURE_2D, 0, l, e, e, 0, l, c, null),
  24697. s.wrapS = t,
  24698. s.wrapT = t;
  24699. var d = n.paramThreeToGL(t);
  24700. return o.texParameteri(o.TEXTURE_2D, o.TEXTURE_WRAP_S, d),
  24701. o.texParameteri(o.TEXTURE_2D, o.TEXTURE_WRAP_T, d),
  24702. i ? (s.magFilter = r.LinearFilter,
  24703. s.minFilter = r.LinearMipMapLinearFilter,
  24704. o.texParameteri(o.TEXTURE_2D, o.TEXTURE_MAG_FILTER, o.LINEAR),
  24705. o.texParameteri(o.TEXTURE_2D, o.TEXTURE_MIN_FILTER, o.LINEAR_MIPMAP_NEAREST),
  24706. o.generateMipmap(o.TEXTURE_2D)) : (s.magFilter = r.LinearFilter,
  24707. s.minFilter = r.LinearFilter,
  24708. o.texParameteri(o.TEXTURE_2D, o.TEXTURE_MAG_FILTER, o.LINEAR),
  24709. o.texParameteri(o.TEXTURE_2D, o.TEXTURE_MIN_FILTER, o.LINEAR)),
  24710. a.bindTexture(o.TEXTURE_2D, null),
  24711. h.__webglTexture = u,
  24712. s
  24713. }
  24714. ,
  24715. n.prototype.initSizedCubeMap = function(e, t) {
  24716. var i = this.renderer
  24717. , n = i.context
  24718. , o = i.state
  24719. , a = new r.CubeTexture([null, null, null, null, null, null]);
  24720. a.flipY = !1,
  24721. a.generateMipmaps = t;
  24722. var s = i.paramThreeToGL(a.format)
  24723. , l = i.paramThreeToGL(a.type)
  24724. , c = i.properties.get(a)
  24725. , h = n.createTexture();
  24726. o.bindTexture(n.TEXTURE_CUBE_MAP, h),
  24727. n.pixelStorei(n.UNPACK_FLIP_Y_WEBGL, a.flipY);
  24728. for (var u = 0; u < 6; u++)
  24729. n.texImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X + u, 0, s, e, e, 0, s, l, null);
  24730. return t ? (a.magFilter = r.LinearFilter,
  24731. a.minFilter = r.LinearMipMapLinearFilter,
  24732. n.texParameteri(n.TEXTURE_CUBE_MAP, n.TEXTURE_MAG_FILTER, n.LINEAR),
  24733. n.texParameteri(n.TEXTURE_CUBE_MAP, n.TEXTURE_MIN_FILTER, n.LINEAR_MIPMAP_LINEAR),
  24734. n.texParameteri(n.TEXTURE_CUBE_MAP, n.GENERATE_MIPMAP, n.TRUE),
  24735. n.generateMipmap(n.TEXTURE_CUBE_MAP)) : (a.magFilter = r.LinearFilter,
  24736. a.minFilter = r.LinearFilter,
  24737. n.texParameteri(n.TEXTURE_CUBE_MAP, n.TEXTURE_MAG_FILTER, n.LINEAR),
  24738. n.texParameteri(n.TEXTURE_CUBE_MAP, n.TEXTURE_MIN_FILTER, n.LINEAR)),
  24739. o.bindTexture(n.TEXTURE_CUBE_MAP, null),
  24740. c.__image__webglTextureCube = h,
  24741. a
  24742. }
  24743. ,
  24744. n.prototype.deallocateCubeTexture = function(e) {
  24745. var t = this.renderer
  24746. , i = t.context
  24747. , n = t.properties.get(e);
  24748. i.deleteTexture(n.__image__webglTextureCube)
  24749. }
  24750. ,
  24751. n.prototype.uploadTexture2D = function(e, t, i, n, r, o) {
  24752. var a = this.renderer
  24753. , s = a.context
  24754. , l = a.state
  24755. , c = a.properties.get(t);
  24756. l.bindTexture(s.TEXTURE_2D, c.__webglTexture),
  24757. s.pixelStorei(s.UNPACK_FLIP_Y_WEBGL, t.flipY),
  24758. s.pixelStorei(s.UNPACK_PREMULTIPLY_ALPHA_WEBGL, t.premultiplyAlpha),
  24759. s.pixelStorei(s.UNPACK_ALIGNMENT, t.unpackAlignment),
  24760. s.texParameteri(s.TEXTURE_2D, s.TEXTURE_WRAP_S, a.paramThreeToGL(t.wrapS)),
  24761. s.texParameteri(s.TEXTURE_2D, s.TEXTURE_WRAP_T, a.paramThreeToGL(t.wrapT)),
  24762. s.texParameteri(s.TEXTURE_2D, s.TEXTURE_MAG_FILTER, a.paramThreeToGL(t.magFilter)),
  24763. s.texParameteri(s.TEXTURE_2D, s.TEXTURE_MIN_FILTER, a.paramThreeToGL(t.minFilter)),
  24764. s.texSubImage2D(s.TEXTURE_2D, 0, i, n, s.RGBA, s.UNSIGNED_BYTE, e),
  24765. t.generateMipmaps && s.generateMipmap(s.TEXTURE_2D),
  24766. l.bindTexture(s.TEXTURE_2D, null)
  24767. }
  24768. ,
  24769. n.prototype.uploadTexture3D = function(e, t, i, n, r, o, a) {
  24770. var s = this.renderer
  24771. , l = s.context
  24772. , c = s.state
  24773. , h = s.properties.get(t);
  24774. c.bindTexture(l.TEXTURE_CUBE_MAP, h.__image__webglTextureCube),
  24775. l.pixelStorei(l.UNPACK_FLIP_Y_WEBGL, t.flipY),
  24776. l.texSubImage2D(r, 0, i, n, l.RGBA, l.UNSIGNED_BYTE, e),
  24777. t.generateMipmaps && l.generateMipmap(l.TEXTURE_CUBE_MAP),
  24778. c.bindTexture(l.TEXTURE_CUBE_MAP, null)
  24779. }
  24780. ,
  24781. n.prototype.rebuildMipMaps2D = function(e) {
  24782. var t = this.renderer
  24783. , i = t.context
  24784. , n = t.state;
  24785. t.properties.get(e);
  24786. i.generateMipmap(i.TEXTURE_2D),
  24787. n.bindTexture(i.TEXTURE_2D, null)
  24788. }
  24789. ,
  24790. n.prototype.rebuildMipMaps3D = function(e) {
  24791. var t = this.renderer
  24792. , i = t.context
  24793. , n = t.state
  24794. , r = t.properties.get(e);
  24795. n.bindTexture(i.TEXTURE_CUBE_MAP, r.__image__webglTextureCube),
  24796. i.generateMipmap(i.TEXTURE_CUBE_MAP),
  24797. n.bindTexture(i.TEXTURE_CUBE_MAP, null)
  24798. }
  24799. ,
  24800. n.prototype.renderToCubeMap = function() {
  24801. var e = !1
  24802. , t = null
  24803. , i = null
  24804. , n = null
  24805. , a = null
  24806. , s = null
  24807. , l = 1;
  24808. return function(c, h, u, d, p, f, g, m, v, A, y, C, I, E, b, w) {
  24809. var _ = this.renderer;
  24810. _.context;
  24811. e || (i = new r.OrthographicCamera(l / -2,l / 2,l / 2,l / -2,-200,200),
  24812. i.position.z = 150,
  24813. t = new r.Scene,
  24814. t.add(i),
  24815. n = new r.ShaderMaterial({
  24816. uniforms: {
  24817. tDiffuse: {
  24818. type: "t",
  24819. value: null
  24820. },
  24821. alpha: {
  24822. type: "f",
  24823. value: 1
  24824. }
  24825. },
  24826. vertexShader: o.basicTextured.vertexShader,
  24827. fragmentShader: o.basicTextured.fragmentShader,
  24828. depthWrite: !1,
  24829. depthTest: !1,
  24830. side: r.DoubleSide
  24831. }),
  24832. a = new r.PlaneBufferGeometry(l,l),
  24833. s = new r.Mesh(a,n),
  24834. s.position.z = 0,
  24835. t.add(s),
  24836. e = !0);
  24837. var T = a.getAttribute("uv");
  24838. T.setDynamic(!0),
  24839. T.needsUpdate = !0;
  24840. var x = T.array
  24841. , S = p / u
  24842. , M = f / d
  24843. , R = g / u
  24844. , P = m / d;
  24845. x[0] = S,
  24846. x[1] = M + P,
  24847. x[2] = S + R,
  24848. x[3] = M + P,
  24849. x[4] = S,
  24850. x[5] = M,
  24851. x[6] = S + R,
  24852. x[7] = M;
  24853. var O = a.getAttribute("position");
  24854. O.setDynamic(!0),
  24855. O.needsUpdate = !0;
  24856. var L = O.array
  24857. , D = v / h.width - l / 2
  24858. , N = A / h.height - l / 2
  24859. , B = y / h.width
  24860. , F = C / h.height;
  24861. L[0] = D,
  24862. L[1] = N + F,
  24863. L[3] = D + B,
  24864. L[4] = N + F,
  24865. L[6] = D,
  24866. L[7] = N,
  24867. L[9] = D + B,
  24868. L[10] = N;
  24869. this.renderer.properties.get(c);
  24870. n.uniforms.tDiffuse.value = c,
  24871. n.blending = E || r.NoBlending,
  24872. n.transparent = !!b,
  24873. void 0 !== w && null !== w || (w = 1),
  24874. n.uniforms.alpha.value = w,
  24875. n.needUpdate = !0,
  24876. h.activeCubeFace = I,
  24877. h.viewport.set(0, 0, h.width, h.height);
  24878. var V = this.renderer.autoClear;
  24879. this.renderer.autoClear = !1,
  24880. this.renderer.render(t, i, h, !1),
  24881. this.renderer.autoClear = V
  24882. }
  24883. }(),
  24884. n.prototype.copyCubeMap = function() {
  24885. var e = !1
  24886. , t = null
  24887. , i = null
  24888. , a = null
  24889. , s = null
  24890. , l = null
  24891. , c = new r.Euler;
  24892. new r.Vector3;
  24893. return function(h, u, d, p, f, g, m, v, A) {
  24894. if(f > this.qualityManager.maxRenderTargetSize) return; //add
  24895. this.renderer;
  24896. if (!e) {
  24897. var y = 2;
  24898. i = new r.OrthographicCamera(y / -2,y / 2,y / 2,y / -2,0,200),
  24899. i.position.set(0, 0, 0),
  24900. t = new r.Scene,
  24901. t.add(i),
  24902. a = new r.ShaderMaterial({
  24903. uniforms: {
  24904. tDiffuse: {
  24905. type: "t",
  24906. value: null
  24907. },
  24908. alpha: {
  24909. type: "f",
  24910. value: 1
  24911. }
  24912. },
  24913. vertexShader: o.copyCubeMap.vertexShader,
  24914. fragmentShader: o.copyCubeMap.fragmentShader,
  24915. depthWrite: !1,
  24916. depthTest: !1,
  24917. side: r.DoubleSide
  24918. }),
  24919. s = new r.BoxGeometry(y,y,y),
  24920. l = new r.Mesh(s,a),
  24921. t.add(l),
  24922. e = !0
  24923. }
  24924. for (var C = 0; C < 6; C++)
  24925. n.getCubeOrientationForCubeFace(C, c),
  24926. l.rotation.copy(c),
  24927. l.matrixWorldNeedsUpdate = !0,
  24928. l.updateMatrixWorld(),
  24929. a.uniforms.tDiffuse.value = h,
  24930. a.blending = m || r.NoBlending,
  24931. a.transparent = !!v,
  24932. void 0 !== A && null !== A || (A = 1),
  24933. a.uniforms.alpha.value = A,
  24934. a.needUpdate = !0,
  24935. u.activeCubeFace = C,
  24936. u.viewport.set(0, 0, f, g),
  24937. this.renderer.render(t, i, u, !1)
  24938. }
  24939. }(),
  24940. n.getLookAtForCubeFace = function(e, t) {
  24941. switch (e) {
  24942. case l.GL_TEXTURE_CUBE_MAP_POSITIVE_X:
  24943. t.set(1, 0, 0);
  24944. break;
  24945. case l.GL_TEXTURE_CUBE_MAP_NEGATIVE_X:
  24946. t.set(-1, 0, 0);
  24947. break;
  24948. case l.GL_TEXTURE_CUBE_MAP_POSITIVE_Y:
  24949. t.set(0, 1, 0);
  24950. break;
  24951. case l.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y:
  24952. t.set(0, -1, 0);
  24953. break;
  24954. case l.GL_TEXTURE_CUBE_MAP_POSITIVE_Z:
  24955. t.set(0, 0, 1);
  24956. break;
  24957. case l.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z:
  24958. t.set(0, 0, -1)
  24959. }
  24960. }
  24961. ,
  24962. n.getCubeOrientationForCubeFace = function(e, t) {
  24963. switch (e) {
  24964. case l.GL_TEXTURE_CUBE_MAP_POSITIVE_X:
  24965. t.set(0, -Math.PI / 2, 0);
  24966. break;
  24967. case l.GL_TEXTURE_CUBE_MAP_NEGATIVE_X:
  24968. t.set(0, Math.PI / 2, 0);
  24969. break;
  24970. case l.GL_TEXTURE_CUBE_MAP_POSITIVE_Y:
  24971. t.set(Math.PI / 2, Math.PI, 0);
  24972. break;
  24973. case l.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y:
  24974. t.set(-Math.PI / 2, Math.PI, 0);
  24975. break;
  24976. case l.GL_TEXTURE_CUBE_MAP_POSITIVE_Z:
  24977. t.set(0, -Math.PI, 0);
  24978. break;
  24979. case l.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z:
  24980. t.set(0, 0, 0)
  24981. }
  24982. }
  24983. ,
  24984. t.exports = n
  24985. }
  24986. , {
  24987. "../enum/GLCubeFaces": 25,
  24988. "../enum/GLTextureType": 26,
  24989. "../enum/SceneRendererEvents": 43,
  24990. "../exception/BasicException": 55,
  24991. "../exception/RendererCreationException": 57,
  24992. "../settings": 166,
  24993. "../shaders": 167,
  24994. /********************************************************************fyz改 from徐世廷**********************************************************************/
  24995. "../util/browser": 182,
  24996. /************************************************************************************************************************************************/
  24997. events: 202,
  24998. three: 217
  24999. }],
  25000. 159: [function(e, t, i) {
  25001. "use strict";
  25002. function n(e) {
  25003. this.messenger = new a(e),
  25004. this.clientKey = null
  25005. }
  25006. var r = e("../util/ajax")
  25007. , o = e("./PostMessageType")
  25008. , a = e("./postmessage")
  25009. , s = e("./VersionInfo")
  25010. , l = e("events").EventEmitter
  25011. , c = window.location.origin + "/api/v1/user/";
  25012. n.prototype = Object.create(l.prototype),
  25013. n.prototype.bindEvents = function() {
  25014. this.messenger.on(o.ACTION, this.onMessageReceived.bind(this))
  25015. }
  25016. ,
  25017. n.prototype.waitForConnection = function() {
  25018. var e = new Promise(function(e, t) {
  25019. this.messenger.on(o.CONNECT, function(i) {
  25020. this.onConnectionReceived(i).then(e.bind(this, i.sdkVersion), t.bind())
  25021. }
  25022. .bind(this))
  25023. }
  25024. .bind(this));
  25025. return e
  25026. }
  25027. ,
  25028. n.prototype.onConnectionReceived = function(e) {
  25029. return this.messenger.setTarget(e.source, e.origin),
  25030. this.verifyConnection(e).then(function(t, i) {
  25031. this.messenger.send({
  25032. type: o.ACCEPT,
  25033. toId: e.fromId,
  25034. warning: i
  25035. }),
  25036. this.clientKey = t,
  25037. this.messenger.removeAllListeners(o.CONNECT),
  25038. this.bindEvents()
  25039. }
  25040. .bind(this), function(t) {
  25041. this.messenger.send({
  25042. type: o.REJECT,
  25043. toId: e.fromId,
  25044. reason: t
  25045. }),
  25046. this.messenger.setTarget()
  25047. }
  25048. .bind(this))
  25049. }
  25050. ,
  25051. n.prototype.verifyConnection = function(e) {
  25052. return new Promise(function(t, i) {
  25053. var n;
  25054. if (s.isDeprecated(e.sdkVersion))
  25055. n = "这个版本正在被弃用";
  25056. else if (!s.isSupported(e.sdkVersion))
  25057. return i("不支持此版本的SDK");
  25058. var o = {
  25059. cache: !1,
  25060. headers: {
  25061. "X-port-Application-Key": e.applicationKey,
  25062. "X-port-Referrer": e.origin
  25063. }
  25064. };
  25065. r.get(c, o).done(t.bind(this, e.applicationKey, n)).fail(i.bind(this, "key/referrer mismatch"))
  25066. }
  25067. )
  25068. }
  25069. ,
  25070. n.prototype.onMessageReceived = function(e) {
  25071. if (this.validateClientApplicationKey(e.applicationKey)) {
  25072. var t = this;
  25073. e.onDone = function(i) {
  25074. i.toId = e.fromId,
  25075. i.uid = e.uid,
  25076. i.type = o.RESPONSE,
  25077. t.messenger.send(i)
  25078. }
  25079. ,
  25080. this.emit(o.ACTION, e)
  25081. }
  25082. }
  25083. ,
  25084. n.prototype.validateClientApplicationKey = function(e) {
  25085. return this.clientKey === e
  25086. }
  25087. ,
  25088. n.prototype.sendEvent = function(e, t) {
  25089. this.messenger.send({
  25090. type: o.EVENT,
  25091. eventType: e,
  25092. eventData: t
  25093. })
  25094. }
  25095. ,
  25096. t.exports = n
  25097. }
  25098. , {
  25099. "../util/ajax": 181,
  25100. "./PostMessageType": 160,
  25101. "./VersionInfo": 163,
  25102. "./postmessage": 165,
  25103. events: 202
  25104. }],
  25105. 160: [function(e, t, i) {
  25106. "use strict";
  25107. t.exports = Object.freeze({
  25108. CONNECT: "postmessage.connect",
  25109. ACCEPT: "postmessage.accept",
  25110. REJECT: "postmessage.reject",
  25111. ACTION: "postmessage.action",
  25112. RESPONSE: "postmessage.response",
  25113. EVENT: "postmessage.event"
  25114. })
  25115. }
  25116. , {}],
  25117. 161: [function(e, t, i) {
  25118. "use strict";
  25119. t.exports = Object.freeze({
  25120. MOVE: "sdk.move",
  25121. ENTER_PANO: "sdk.enterpano",
  25122. MODEL_LOADED: "sdk.modelloaded"
  25123. })
  25124. }
  25125. , {}],
  25126. 162: [function(e, t, i) {
  25127. "use strict";
  25128. t.exports = Object.freeze({
  25129. FLY: "transition.fly",
  25130. FADEOUT: "transition.fade",
  25131. INSTANT: "transition.instant"
  25132. })
  25133. }
  25134. , {}],
  25135. 163: [function(e, t, i) {
  25136. "use strict";
  25137. t.exports = {
  25138. current: "1.0",
  25139. supported: ["1.0"],
  25140. deprecated: [],
  25141. isSupported: function(e) {
  25142. return this.supported.indexOf(e) !== -1
  25143. },
  25144. isDeprecated: function(e) {
  25145. return this.deprecated.indexOf(e) !== -1
  25146. },
  25147. isValid: function(e) {
  25148. return this.isSupported(e) || this.isDeprecated(e)
  25149. }
  25150. }
  25151. }
  25152. , {}],
  25153. 164: [function(e, t, i) {
  25154. (function(i) {
  25155. "use strict";
  25156. function n(e, t, i) {
  25157. e && (e = e.toLowerCase().trim());
  25158. var n = new I.UP.clone
  25159. , r = Math.PI / 3
  25160. , o = Math.PI / 2;
  25161. switch (e) {
  25162. case "left":
  25163. i.copy(t),
  25164. i.applyAxisAngle(n, o);
  25165. break;
  25166. case "right":
  25167. i.copy(t),
  25168. i.applyAxisAngle(n, -o);
  25169. break;
  25170. case "forwardleft":
  25171. i.copy(t),
  25172. i.applyAxisAngle(n, r);
  25173. break;
  25174. case "forwardright":
  25175. i.copy(t),
  25176. i.applyAxisAngle(n, -r);
  25177. break;
  25178. case "forward":
  25179. default:
  25180. i.copy(t)
  25181. }
  25182. return i
  25183. }
  25184. function r(e, t) {
  25185. if (e) {
  25186. var i = {
  25187. pano: e,
  25188. lookAtPoint: null,
  25189. duration: null,
  25190. maxDistanceOverride: null,
  25191. skipWarpingCheck: !1
  25192. };
  25193. this.player.flyToPano(i, function() {
  25194. t && t({
  25195. success: !0,
  25196. message: "Transition complete."
  25197. })
  25198. })
  25199. } else
  25200. R.warn("Showcase -> clickPanoObject: Unable to find pano."),
  25201. t && t({
  25202. success: !1,
  25203. error: "Unable to find pano."
  25204. })
  25205. }
  25206. function o(e, t) {
  25207. var i = this.findRankedPano(e, t);
  25208. return i >= 0 ? this.handleToObject[i] : (R.warn("Showcase -> findRankedPanoObject: Unable to find nearby pano."),
  25209. null)
  25210. }
  25211. function a(e, t) {
  25212. var i = this.findRankedtag(e, t);
  25213. return i >= 0 ? this.handleToObject[i] : (R.warn("Showcase -> findRankedtagObject: Unable to find nearby tag."),
  25214. null)
  25215. }
  25216. function s(e, t) {
  25217. t.copy(I.FORWARD),
  25218. e.getDirection(t)
  25219. }
  25220. function l(e) {
  25221. function t(e) {
  25222. var t = (new c.Euler).setFromQuaternion(e.quaternion, "YXZ");
  25223. return {
  25224. x: c.Math.radToDeg(t._x),
  25225. y: c.Math.radToDeg(t._y),
  25226. z: c.Math.radToDeg(t._z)
  25227. }
  25228. }
  25229. var i = function(e) {
  25230. return e.alignmentType !== m.ALIGNED ? null : {
  25231. x: e.position.x,
  25232. y: e.position.y,
  25233. z: e.position.z
  25234. }
  25235. };
  25236. return {
  25237. panos: e.panos.list.map(function(n) {
  25238. var r = y.getCubemapUrls(e.urls, n.id, "high")[C.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z];
  25239. return {
  25240. uuid: n.id,
  25241. aligned: n.alignmentType === m.ALIGNED,
  25242. neighbourUUIDs: n.neighbourUUIDs.slice(),
  25243. position: i(n),
  25244. rotation: t(n),
  25245. thumbnail: r
  25246. }
  25247. })
  25248. }
  25249. }
  25250. var c = e("three")
  25251. , h = e("./ApiHost")
  25252. , u = e("../util/logger")
  25253. , d = e("../util/common")
  25254. , p = e("../util/math")
  25255. , f = e("../enum/ModelManagerEvents")
  25256. , g = e("./PostMessageType")
  25257. , m = e("../enum/AlignmentType")
  25258. , v = e("../enum/Direction")
  25259. , A = e("./TransitionStyles")
  25260. , y = e("../util/panorama")
  25261. , C = e("../enum/GLCubeFaces")
  25262. , I = e("../enum/Vectors")
  25263. , E = e("../enum/Viewmode")
  25264. , b = e("../enum/WarpStyle")
  25265. , w = (e("../enum/Keys"),
  25266. e("../enum/PlayerEvents"))
  25267. , _ = e("../sdk/SdkEvents")
  25268. , I = e("../enum/Vectors")
  25269. , T = e("../enum/ControlEvents")
  25270. , x = e("../enum/RenderLayers")
  25271. , S = (e("../constants"),
  25272. e("../settings"))
  25273. , M = e("../lib/jpeg_encoder")
  25274. , R = new u(i)
  25275. , P = function() {
  25276. var e = function e() {
  25277. e.playerDirection.copy(e.player.mode === E.FLOORPLAN ? I.UP : I.FORWARD),
  25278. e.player.getDirection(e.playerDirection),
  25279. e.projectVectors();
  25280. var t = e.playerDirection.angleTo(e.lastFacingDirection);
  25281. if (e.angleTravelled += Math.abs(t),
  25282. e.angleTravelled >= Math.abs(e.angle)) {
  25283. if (e.active = !1,
  25284. e.onDone) {
  25285. var i = e.onDone;
  25286. i()
  25287. }
  25288. } else
  25289. e.lastFacingDirection.copy(e.playerDirection),
  25290. window.setTimeout(e, 4)
  25291. };
  25292. return e.active = !1,
  25293. e.angle = 0,
  25294. e.angleTravelled = 0,
  25295. e.playerDirection = new c.Vector3,
  25296. e.lastFacingDirection = new c.Vector3,
  25297. e.onDone = null,
  25298. e.player = null,
  25299. e.start = function(t, i, n, r) {
  25300. e.active = !0,
  25301. t && i && (i = 0),
  25302. e.angle = t || i,
  25303. e.xAngle = t,
  25304. e.yAngle = i,
  25305. e.angleTravelled = 0,
  25306. e.playerDirection.copy(n.mode === E.FLOORPLAN ? I.UP : I.FORWARD),
  25307. n.getDirection(e.playerDirection),
  25308. e.lastFacingDirection.copy(e.playerDirection),
  25309. e.projectVectors(),
  25310. e.onDone = r,
  25311. e.player = n,
  25312. e()
  25313. }
  25314. ,
  25315. e.projectVectors = function() {
  25316. e.xAngle && (e.playerDirection.projectOnPlane(I.UP),
  25317. e.lastFacingDirection.projectOnPlane(I.UP))
  25318. }
  25319. ,
  25320. e
  25321. }()
  25322. , O = function() {
  25323. var e = new c.Vector3;
  25324. return function(t) {
  25325. t ? (e.copy(t.position),
  25326. e.add(t.discPosition),
  25327. p.projectPositionToCanvas(e, this.player.camera, e),
  25328. this.click(e.x, e.y)) : R.warn("Showcase -> clicktagObject: Unable to find tag.")
  25329. }
  25330. }()
  25331. , L = function() {
  25332. return this.player.mode === E.PANORAMA ? S.insideLookLimitUp : this.player.mode === E.DOLLHOUSE ? 90 - c.Math.radToDeg(S.dollhouseDefault.minPolarAngle) : null
  25333. }
  25334. , D = function() {
  25335. return this.player.mode === E.PANORAMA ? S.insideLookLimitDown : this.player.mode === E.DOLLHOUSE ? 90 - c.Math.radToDeg(S.dollhouseDefault.maxPolarAngle) : null
  25336. }
  25337. , N = function(e) {
  25338. var t = new c.Vector3;
  25339. return function(e) {
  25340. var i = this.player.getDirection();
  25341. t.copy(i);
  25342. var n = t.y;
  25343. t.y = 0,
  25344. t.normalize();
  25345. var r = c.Math.radToDeg(t.angleTo(i)) * (n < 0 ? -1 : 1);
  25346. if (this.player.mode !== E.DOLLHOUSE && this.player.mode !== E.PANORAMA)
  25347. return 0 !== e && R.warn("Cannot rotate in y direction when in " + this.player.mode + " mode"),
  25348. 0;
  25349. this.player.mode === E.DOLLHOUSE && (r = -r);
  25350. var o = L.call(this) - .1
  25351. , a = D.call(this) + .1
  25352. , s = r + e;
  25353. s > o ? s = o : s < a && (s = a);
  25354. var l = s - r;
  25355. return e > 0 && l < .01 && (l = 0),
  25356. e < 0 && l > -.01 && (l = 0),
  25357. l
  25358. }
  25359. }()
  25360. , B = function() {
  25361. var e = new c.Euler;
  25362. return function(t) {
  25363. return e.setFromQuaternion(t.quaternion, "YXZ"),
  25364. {
  25365. position: {
  25366. x: t.position.x,
  25367. y: t.position.y,
  25368. z: t.position.z
  25369. },
  25370. rotation: {
  25371. x: c.Math.radToDeg(e.x),
  25372. y: c.Math.radToDeg(e.y),
  25373. z: 0
  25374. },
  25375. pano: t.currentPano ? t.currentPano.id : null,
  25376. mode: t.mode
  25377. }
  25378. }
  25379. }()
  25380. , F = null;
  25381. t.exports = {
  25382. init: function(e, t, i, n, r) {
  25383. V.init(e, t, i, r),
  25384. F = new Promise(function(e, t) {
  25385. i.on(w.Ready, function() {
  25386. e()
  25387. })
  25388. }
  25389. .bind(this));
  25390. var o = new h(window)
  25391. , a = o.waitForConnection();
  25392. a.then(function(e) {
  25393. o.on(g.ACTION, V.onMessageReceive.bind(V))
  25394. });
  25395. var s = function() {
  25396. var e = Date.now();
  25397. return function() {
  25398. if (!(Date.now() - e < 100)) {
  25399. var t = B(i);
  25400. o.sendEvent(_.MOVE, {
  25401. state: t
  25402. }),
  25403. e = Date.now()
  25404. }
  25405. }
  25406. }();
  25407. i.on(w.Move, s),
  25408. i.on(w.ViewChanged, s),
  25409. n.on(f.ActiveModelChanged, function(e) {
  25410. function t(e) {
  25411. var t, i = e.newPano.id;
  25412. e.oldPano && (t = e.oldPano.id),
  25413. i !== t && o.sendEvent(_.ENTER_PANO, {
  25414. oldPano: t,
  25415. newPano: i
  25416. })
  25417. }
  25418. var i = e.model
  25419. , n = e.oldModel;
  25420. V.model = i,
  25421. a.then(function() {
  25422. o.sendEvent(_.MODEL_LOADED, {
  25423. metadata: l(i)
  25424. })
  25425. }),
  25426. n && n.panos.forEach(function(e) {
  25427. e.removeEventListener("enter", t)
  25428. }),
  25429. i.panos.forEach(function(e) {
  25430. e.on("enter", t)
  25431. })
  25432. })
  25433. }
  25434. };
  25435. var V = {
  25436. director: null,
  25437. player: null,
  25438. controls: null,
  25439. sceneRenderer: null,
  25440. model: null,
  25441. init: function(e, t, i, n) {
  25442. this.director = e,
  25443. this.player = i,
  25444. this.controls = t,
  25445. this.sceneRenderer = n
  25446. },
  25447. handleToObject: {},
  25448. objectToHandle: {},
  25449. handleCount: 0,
  25450. onMessageReceive: function(e) {
  25451. if (e) {
  25452. var t = e.targetFunction
  25453. , i = e.params
  25454. , n = e.onDone;
  25455. t && this[t] && this[t](i, n)
  25456. }
  25457. },
  25458. waitForInit: function(e, t) {
  25459. F.then(t.bind({
  25460. success: !0,
  25461. message: "Init complete."
  25462. }))
  25463. },
  25464. moveToPano: function(e, t) {
  25465. var i = new c.Euler(0,0,0,"YXZ")
  25466. , n = new c.Quaternion;
  25467. return function(e, t) {
  25468. var r = e.pano
  25469. , o = e.rotation
  25470. , a = e.transition;
  25471. if (!this.model)
  25472. return t({
  25473. success: !1,
  25474. error: "The model has not been loaded yet"
  25475. });
  25476. var s = this.model.panos.get(r);
  25477. if (!s)
  25478. return t({
  25479. success: !1,
  25480. error: r + " does not exist in this model"
  25481. });
  25482. if (!o)
  25483. return t({
  25484. sucess: !1,
  25485. erorr: o + " is not a valid rotation"
  25486. });
  25487. i.set(c.Math.degToRad(o.x || 0), c.Math.degToRad(o.y || 0), c.Math.degToRad(o.z || 0), "YXZ"),
  25488. console.log(o.z);
  25489. var l = {
  25490. success: !0,
  25491. message: r
  25492. };
  25493. if (a === A.FADEOUT)
  25494. n.setFromEuler(i),
  25495. this.player.warpToPano(s, n, null, null, b.BLACK, null, null, t.bind(this, l));
  25496. else {
  25497. var h, u;
  25498. a === A.INSTANT && (h = 0,
  25499. u = 0);
  25500. var d = I.FORWARD.clone().applyEuler(i).add(s.position);
  25501. this.player.flyToPano({
  25502. pano: s,
  25503. lookAtPoint: d,
  25504. duration: h,
  25505. aimDuration: u
  25506. }, t.bind(this, l))
  25507. }
  25508. }
  25509. }(),
  25510. moveInDirection: function(e, t) {
  25511. var i = e.direction;
  25512. return "undefined" == typeof v[i] ? (R.warn("Showcase -> moveInDirection: Cannot move in invalid direction."),
  25513. void (t && t({
  25514. success: !1,
  25515. error: "Invalid direction."
  25516. }))) : void this.player.flyLocalDirection(I[i].clone()).then(function(e) {
  25517. t(e ? {
  25518. success: !0,
  25519. message: "moved " + i
  25520. } : {
  25521. success: !1,
  25522. error: "Cannot move in direction: " + i
  25523. })
  25524. })
  25525. },
  25526. getPose: function(e, t) {
  25527. this.player.camera.position,
  25528. (new c.Euler).setFromQuaternion(this.player.camera.quaternion, "YXZ");
  25529. return t({
  25530. success: !0,
  25531. message: B(this.player)
  25532. })
  25533. },
  25534. takeScreenShot: function() {
  25535. var e = new c.PerspectiveCamera
  25536. , t = new c.WebGLRenderTarget;
  25537. return function(i, n) {
  25538. if (!i.resolution)
  25539. return n({
  25540. success: !1,
  25541. error: "An invalid resolution was specified"
  25542. });
  25543. if (i.resolution.width === -1 || i.resolution.height === -1) {
  25544. var r = this.sceneRenderer.renderer.getSize();
  25545. i.resolution.width = r.width,
  25546. i.resolution.height = r.height
  25547. }
  25548. e.layers.set(x.DEFAULT),
  25549. i.visibleObjects && (i.visibleObjects.showtags && e.layers.enable(x.TAG),
  25550. i.visibleObjects.showPucks && e.layers.enable(x.PANOMARKERS),
  25551. i.visibleObjects.showReticule && e.layers.enable(x.RETICULE));
  25552. var o = i.resolution.width
  25553. , a = i.resolution.height
  25554. , s = o / a;
  25555. e.position.copy(this.sceneRenderer.camera.position),
  25556. e.quaternion.copy(this.sceneRenderer.camera.quaternion),
  25557. e.projectionMatrix.copy(this.player.camera.projectionMatrix),
  25558. e.projectionMatrix.elements[0] = this.player.camera.projectionMatrix.elements[5] / s,
  25559. t.setSize(o, a),
  25560. this.sceneRenderer.renderer.render(this.sceneRenderer.scene, e, t);
  25561. var l = new Uint8Array(o * a * 4);
  25562. this.sceneRenderer.renderer.readRenderTargetPixels(t, 0, 0, o, a, l);
  25563. var c = M.encode({
  25564. data: l,
  25565. width: o,
  25566. height: a,
  25567. heading: 180,
  25568. pitch: 0
  25569. }, {
  25570. quality: 75,
  25571. flipY: !0
  25572. })
  25573. , h = "data:image/jpg;base64," + d.uint8ToBase64(c.data);
  25574. n({
  25575. success: !0,
  25576. message: h
  25577. })
  25578. }
  25579. }(),
  25580. findRankedPano: function(e, t) {
  25581. var i = new c.Vector3
  25582. , r = new c.Vector3;
  25583. return function(e, t) {
  25584. s(this.player, r),
  25585. n(t, r, i);
  25586. var o = this.player.rankedPanoInDirection(e, i);
  25587. if (o) {
  25588. var a = this.objectToHandle[o.id];
  25589. return a || (this.objectToHandle[o.id] = a = this.handleCount++,
  25590. this.handleToObject[a] = o),
  25591. a
  25592. }
  25593. return R.warn("Showcase -> findRankedPano: Unable to find nearby pano."),
  25594. -1
  25595. }
  25596. }(),
  25597. findRankedtag: function(e, t) {
  25598. var i = new c.Vector3
  25599. , r = new c.Vector3;
  25600. return function(e, t) {
  25601. s(this.player, r),
  25602. n(t, r, i);
  25603. var o = this.player.rankedtagInDirection(e, i);
  25604. if (o) {
  25605. var a = this.objectToHandle[o.sid];
  25606. return a || (this.objectToHandle[o.sid] = a = this.handleCount++,
  25607. this.handleToObject[a] = o),
  25608. a
  25609. }
  25610. return R.warn("Showcase -> findRankedtag: Unable to find nearby tag."),
  25611. -1
  25612. }
  25613. }(),
  25614. clickNearesttag: function(e) {
  25615. this.clickRankedtag(0, e)
  25616. },
  25617. clickRankedtag: function(e, t) {
  25618. var i = a.call(this, e, t);
  25619. i && O.call(this, i)
  25620. },
  25621. clickNearestPano: function(e, t) {
  25622. this.clickRankedPano(0, e, t)
  25623. },
  25624. clickRankedPano: function(e, t, i) {
  25625. var n = o.call(this, e, t);
  25626. n ? r.call(this, n, i) : i(null)
  25627. },
  25628. clickPano: function(e, t) {
  25629. var i = this.handleTable[e];
  25630. i ? r.call(this, i, t) : t(null)
  25631. },
  25632. rotateDirection: function() {
  25633. return function(e, t) {
  25634. var i = e.direction
  25635. , n = e.angle;
  25636. if (!P.active) {
  25637. var r = 0
  25638. , o = 0
  25639. , a = 0
  25640. , s = 0;
  25641. if (!n || isNaN(n))
  25642. return R.warn("Showcase -> rotateDirection: Invalid rotation angle."),
  25643. void (t && t({
  25644. success: !1,
  25645. error: "Invalid rotation angle."
  25646. }));
  25647. if (this.player.mode === E.TRANSITIONING)
  25648. return R.warn("Automation -> rotateDirection: Cannot rotate while transitioning"),
  25649. void (t && t({
  25650. success: !1,
  25651. error: "Cannot rotate while transitioning"
  25652. }));
  25653. if (i === v.RIGHT || i === v.LEFT)
  25654. i === v.RIGHT && (n = -n),
  25655. r = n > 0 ? -1 : 1,
  25656. a = n;
  25657. else {
  25658. if (i !== v.UP && i !== v.DOWN)
  25659. return R.warn("Showcase -> rotateDirection: Invalid direction for rotation: " + i),
  25660. void (t && t({
  25661. success: !1,
  25662. error: "Invalid direction for rotation."
  25663. }));
  25664. if (this.player.mode === E.FLOORPLAN)
  25665. return R.warn("Showcase -> rotateDirection: Cannot rotate " + i + " in floorplan mode"),
  25666. void (t && t({
  25667. success: !1,
  25668. error: "Cannot rotate " + i + " in floorplan mode"
  25669. }));
  25670. if (i === v.DOWN && (n = -n),
  25671. n = N.call(this, n),
  25672. 0 === n)
  25673. return R.warn("Showcase -> rotateDirection: Already at maximum rotation in direction: " + i),
  25674. void (t && t({
  25675. success: !1,
  25676. error: "Already at maximum rotation in direction: " + i
  25677. }));
  25678. o = n > 0 ? 1 : -1,
  25679. s = n
  25680. }
  25681. var l = n;
  25682. n = c.Math.degToRad(n),
  25683. a = c.Math.degToRad(a),
  25684. s = c.Math.degToRad(s);
  25685. var h = this.controls.activeControl
  25686. , u = function() {
  25687. h.stopRotating(!0),
  25688. t && t({
  25689. success: !0,
  25690. message: "Rotated " + l.toFixed(2) + "° in direction: " + e.direction
  25691. })
  25692. };
  25693. h.startRotating(r, o),
  25694. P.start(a, s, this.player, u)
  25695. }
  25696. }
  25697. }(),
  25698. rotate: function() {
  25699. var e = new c.Vector3
  25700. , t = new c.Vector3;
  25701. return function(i, n) {
  25702. var r = i.xAngle
  25703. , o = i.yAngle;
  25704. if (!P.active) {
  25705. if (r = r || 0,
  25706. o = o || 0,
  25707. isNaN(r) || isNaN(o))
  25708. return R.warn("Showcase -> rotate: Invalid rotation angle."),
  25709. void (n && n({
  25710. success: !1,
  25711. error: "Invalid rotation angle."
  25712. }));
  25713. if (this.player.mode === E.TRANSITIONING)
  25714. return R.warn("Automation -> rotate: Cannot rotate while transitioning"),
  25715. void (n && n({
  25716. success: !1,
  25717. error: "Cannot rotate while transitioning"
  25718. }));
  25719. Math.abs(r) < .01 && (r = 0),
  25720. Math.abs(o) < .01 && (o = 0);
  25721. var a = o;
  25722. o = N.call(this, o),
  25723. r = -r;
  25724. var s = a > 0 ? "UP" : "DOWN";
  25725. if (!r && a && !o)
  25726. return R.warn("Showcase -> rotate: Already at maximum rotation in direction: " + s),
  25727. void (n && n({
  25728. success: !1,
  25729. error: "Already at maximum rotation in direction: " + s
  25730. }));
  25731. a > o && R.warn("Showcase -> rotate: Reached maximum rotation in direction: " + s);
  25732. var l = o;
  25733. o = c.Math.degToRad(o),
  25734. r = c.Math.degToRad(r),
  25735. e.copy(this.player.mode === E.FLOORPLAN ? I.UP : I.FORWARD),
  25736. this.player.getDirection(e),
  25737. t.copy(e).applyAxisAngle(I.UP, r),
  25738. t.applyAxisAngle(I.RIGHT, o);
  25739. var h = (e.angleTo(t),
  25740. r > 0 ? -1 : r < 0 ? 1 : 0)
  25741. , u = o > 0 ? 1 : o < 0 ? -1 : 0;
  25742. Math.abs(r) > Math.abs(o) ? u *= Math.abs(o / r) : Math.abs(o) > Math.abs(r) && (h *= Math.abs(r / o));
  25743. var d = this.controls.activeControl
  25744. , p = function() {
  25745. d.stopRotating(!0),
  25746. n && n({
  25747. success: !0,
  25748. message: "Rotated " + i.xAngle.toFixed(2) + "° horizontally, " + l.toFixed(2) + "° vertically"
  25749. })
  25750. };
  25751. d.startRotating(h, u),
  25752. P.start(r, o, this.player, p)
  25753. }
  25754. }
  25755. }(),
  25756. panCamera: function(e, t) {
  25757. function i(e) {
  25758. switch (r.removeAllListeners(T.AutoPanComplete),
  25759. r.removeAllListeners(T.AutoPanInterrupt),
  25760. r.removeAllListeners(T.AutoPanClamped),
  25761. e) {
  25762. case T.AutoPanInterrupt:
  25763. t({
  25764. success: !0,
  25765. message: "Camera panning interrupted."
  25766. });
  25767. break;
  25768. case T.AutoPanClamped:
  25769. if (r.autoPanPosition.x !== n.x || r.autoPanPosition.z !== n.z) {
  25770. if (Math.abs(this.player.position.x - r.autoPanPosition.x) < .01 && Math.abs(this.player.position.z - r.autoPanPosition.z) < .01)
  25771. return void t({
  25772. success: !1,
  25773. error: "Already at edge of current model bounds."
  25774. });
  25775. var i = "The view point is outside the bounds for the current model. ";
  25776. i += "The view point was clamped to " + o(r.target.x, r.target.z),
  25777. console.warn(i)
  25778. }
  25779. case T.AutoPanComplete:
  25780. t({
  25781. success: !0,
  25782. message: "Panned camera to position " + o(r.autoPanPosition.x, r.autoPanPosition.z)
  25783. })
  25784. }
  25785. }
  25786. if (this.player.mode !== E.DOLLHOUSE && this.player.mode !== E.FLOORPLAN)
  25787. return t({
  25788. success: !1,
  25789. error: "Camera panning is not available in the current mode: " + this.player.mode
  25790. });
  25791. var n = e.position
  25792. , r = this.player.control;
  25793. r.setAutoPanPosition(n.x, n.z),
  25794. r.autoPan = !0;
  25795. var o = function(e, t) {
  25796. return "(" + e.toFixed(2) + ", " + t.toFixed(2) + ")"
  25797. };
  25798. r.on(T.AutoPanComplete, i.bind(this, T.AutoPanComplete)),
  25799. r.on(T.AutoPanInterrupt, i.bind(this, T.AutoPanInterrupt)),
  25800. r.on(T.AutoPanClamped, i.bind(this, T.AutoPanClamped))
  25801. },
  25802. click: function(e, t) {
  25803. var i = e.x
  25804. , n = e.y
  25805. , r = e.percentage;
  25806. r === !0 && (i = i / 100 * $("#player").width(),
  25807. n = n / 100 * $("#player").height()),
  25808. this.player.handleInputStart(i, n),
  25809. this.player.updateIntersect(),
  25810. this.player.handleInputEnd(i, n)
  25811. },
  25812. mouseOver: function(e, t) {
  25813. var i = e.x
  25814. , n = e.y
  25815. , r = e.percentage;
  25816. r === !0 && (i = i / 100 * $("#player").width(),
  25817. n = n / 100 * $("#player").height()),
  25818. this.player.handleInputMove(i, n),
  25819. this.player.updateIntersect()
  25820. },
  25821. moveToMode: function(e, t) {
  25822. function i(e) {
  25823. t(e ? {
  25824. success: !1,
  25825. error: "Failed to load new mode: " + e
  25826. } : {
  25827. success: !0,
  25828. message: "Moved to new mode: " + n
  25829. })
  25830. }
  25831. var n = e.mode;
  25832. n === E.PANORAMA || n === E.DOLLHOUSE || n === E.FLOORPLAN ? this.director.changeMode(n).then(function() {
  25833. i()
  25834. }, function(e) {
  25835. i(e)
  25836. }) : t({
  25837. success: !1,
  25838. error: "Invalid mode selection"
  25839. })
  25840. }
  25841. }
  25842. }
  25843. ).call(this, "/js/sdk/automation.js")
  25844. }
  25845. , {
  25846. "../constants": 8,
  25847. "../enum/AlignmentType": 17,
  25848. "../enum/ControlEvents": 21,
  25849. "../enum/Direction": 22,
  25850. "../enum/GLCubeFaces": 25,
  25851. "../enum/Keys": 30,
  25852. "../enum/ModelManagerEvents": 33,
  25853. "../enum/PlayerEvents": 40,
  25854. "../enum/RenderLayers": 41,
  25855. "../enum/Vectors": 50,
  25856. "../enum/Viewmode": 51,
  25857. "../enum/WarpStyle": 52,
  25858. "../lib/jpeg_encoder": 94,
  25859. "../sdk/SdkEvents": 161,
  25860. "../settings": 166,
  25861. "../util/common": 185,
  25862. "../util/logger": 189,
  25863. "../util/math": 190,
  25864. "../util/panorama": 191,
  25865. "./ApiHost": 159,
  25866. "./PostMessageType": 160,
  25867. "./TransitionStyles": 162,
  25868. three: 217
  25869. }],
  25870. 165: [function(e, t, i) {
  25871. "use strict";
  25872. function n(e) {
  25873. this.sourceWindow = e,
  25874. this.targetWindow = null,
  25875. this.targetOrigin = null,
  25876. this.id = Math.floor(1e5 * Math.random()),
  25877. this.bindEvents()
  25878. }
  25879. var r = e("./PostMessageType")
  25880. , o = e("events").EventEmitter;
  25881. n.prototype = Object.create(o.prototype),
  25882. n.prototype.bindEvents = function() {
  25883. this.sourceWindow.addEventListener("message", this.onPostmessageReceived.bind(this))
  25884. }
  25885. ,
  25886. n.prototype.setTarget = function(e, t) {
  25887. this.targetWindow = e,
  25888. this.targetOrigin = t
  25889. }
  25890. ,
  25891. n.prototype.onPostmessageReceived = function(e) {
  25892. var t = e.origin || e.originalEvent.origin
  25893. , i = e.source;
  25894. switch (e.data.type) {
  25895. case r.CONNECT:
  25896. break;
  25897. case r.RESPONSE:
  25898. if (this.id !== e.data.toId)
  25899. return;
  25900. default:
  25901. if (!this.validateMessageOrigin(t))
  25902. return
  25903. }
  25904. var n = e.data;
  25905. n.source = i,
  25906. n.origin = t,
  25907. n.timestamp = Date.now(),
  25908. this.emit(e.data.type, n)
  25909. }
  25910. ,
  25911. n.prototype.validateMessageOrigin = function(e) {
  25912. return "*" === this.targetOrigin || e === this.targetOrigin
  25913. }
  25914. ,
  25915. n.prototype.send = function(e) {
  25916. this.targetWindow && this.targetOrigin && (e.fromId = this.id,
  25917. this.targetWindow.postMessage(e, this.targetOrigin))
  25918. }
  25919. ,
  25920. t.exports = n
  25921. }
  25922. , {
  25923. "./PostMessageType": 160,
  25924. events: 202
  25925. }],
  25926. 166: [function(e, t, i) {
  25927. "use strict";
  25928. var n = e("three")
  25929. , r = e("./util/browser")
  25930. , o = e("./enum/Viewmode")
  25931. , a = e("./enum/VROption")
  25932. , s = e("./enum/Colors")
  25933. , l = e("./enum/WarpStyle")
  25934. , c = e("./util/easing")
  25935. , h = e("./util/common")
  25936. , u = e("./util/showcase")
  25937. , d = e("./constants")
  25938. , p = {
  25939. debug: !1,
  25940. version: "2.25.6-0-gd87e5b1",
  25941. languageTag: r.valueFromHash("lang", null),
  25942. pageTitle: "四维虚拟漫游",
  25943. authorizationHeader: u.getAuthorizationHeader(),
  25944. autoplay: r.valueFromHash("play", !1) || !r.inIframe(),
  25945. logLevel: r.valueFromHash("log", 2),
  25946. skyboxRadius: 2500,
  25947. modelBoundsPadding: 5,
  25948. showNeighbors: !1,
  25949. brand: r.valueFromHash("brand", !0),
  25950. showHighlights: r.valueFromHash("hhl", !0) && r.valueFromHash("hr", 1),
  25951. startHighlights: r.valueFromHash("hl", -1),
  25952. specialEdition: r.valueFromHash("bn", 0),
  25953. useWheel: r.valueFromHash("wh", !0),
  25954. crossOrigin: "anonymous",
  25955. fancierTransition: !1,
  25956. wireframe: !1,
  25957. skyboxWireframe: !1,
  25958. modelAlpha: 1,
  25959. highlightPanoSelection: !1,
  25960. showSweeps: !0,
  25961. showSkyboxes: !1,
  25962. showMesh: !0,
  25963. showFloors: !1,
  25964. showFloorDuration: 300,
  25965. showFloorDelay: 300,
  25966. hideFloorDuration: 300,
  25967. hideFloorDelay: 0,
  25968. reticuleOpacityTransitionTime: 250,
  25969. reticuleColor: window.DATA.mouseMarkerColor || s.newBlue, // 方奕卓 配置鼠标标志颜色
  25970. markerOpacityTransitionTime: 500,
  25971. guiAnimationSpeed: 250,
  25972. highlightAnimationDuration: 500,
  25973. modelComponentLoadSpinnerDelay: 150,
  25974. captureErrors: !1,
  25975. maxMobileTextures: 6,
  25976. minimalMemoryMode: r.valueFromHash("m3", r.isMobile()),
  25977. startupFlyinDelay: 3e3,
  25978. dollhouseDefault: {
  25979. minDistance: 15,
  25980. maxDistance: 50,
  25981. minPolarAngle: n.Math.degToRad(10),
  25982. maxPolarAngle: n.Math.degToRad(90)
  25983. },
  25984. hideReticuleTimeout: 1e3,
  25985. analytics: {
  25986. inactivityThreshold: 30,
  25987. sessionTrackingRate: .15,
  25988. maxTrackedErrors: 20,
  25989. sessionDurationPingFrequency: 10,
  25990. sessionDurationTimeout: 15
  25991. },
  25992. flydown: {
  25993. movementEasing: "easeInOutQuad",
  25994. movementDelay: .001,
  25995. rotationEasing: "easeInOutQuad",
  25996. rotationDelay: .5,
  25997. modelTextureDelay: .75,
  25998. skyboxDelay: .75
  25999. },
  26000. transition: {
  26001. flySpeed: .001,
  26002. flyTime: 750,
  26003. flytimeMaxDistanceThreshold: 5,
  26004. flytimeDistanceMultiplier: 150,
  26005. aimTime: 1500,
  26006. aimSlowFactor: 1.5,
  26007. blur: 0.8,
  26008. movementEasing: "easeInOutQuad",
  26009. blendEasing: "easeInOutQuad",
  26010. fastForwardFactor: 4,//r.valueFromHash("mfis", 3) //快速停止导览的速度,原先是3
  26011. },
  26012. show360Views: {
  26013. enabled: !0,
  26014. transitionTime: 1e3
  26015. },
  26016. quickstart: {
  26017. enabled: true,
  26018. animation: 1400,
  26019. showTextDelay: 500,
  26020. fadeOutDelay: 3e3,
  26021. fovChange: 10
  26022. },
  26023. appConfig: {
  26024. webvr_version: null,
  26025. segment_key: null,
  26026. embedly_key: null,
  26027. branch_key: null,
  26028. keen_write_key: null,
  26029. keen_project_id: null
  26030. },
  26031. vr: {
  26032. enabled: !0,
  26033. allowWebVR: !1,
  26034. option: r.valueFromHash("vr", a.CONTEXTUAL)
  26035. },
  26036. share: {
  26037. enabled: !r.valueFromHash("mls", 0) && r.valueFromHash("brand", !0)
  26038. },
  26039. input: {
  26040. longTapThreshold: 200,
  26041. moveToleranceNDC: .01,
  26042. touchMoveThreshold: 25
  26043. },
  26044. help: {
  26045. modalStayDuration: 600
  26046. },
  26047. immersive: {
  26048. timeToShowAgain: 1250,
  26049. uiStayDuration: 600
  26050. },
  26051. tourInteraction: {
  26052. disabled: "0" === r.valueFromHash("tourcta", null),
  26053. showPauseButton: 1e3,
  26054. showModal: 1500,
  26055. allowNextClick: 200,
  26056. largeModal: "1" === r.valueFromHash("tourcta", null),
  26057. smallModal: "2" === r.valueFromHash("tourcta", null)
  26058. },
  26059. labels: {
  26060. enabled: !1,
  26061. hideUntilStart: !0,
  26062. fadeInDuration: 250,
  26063. fadeInDelay: 250,
  26064. fadeOutDuration: 250,
  26065. fadeOutDelay: 0,
  26066. zoomHideThreshhold: {
  26067. mobile: r.isSmallScreen() ? .45 : .6,
  26068. desktop: 2
  26069. },
  26070. zoomTruncateThreshhold: {
  26071. mobile: r.isSmallScreen() ? .35 : .45,
  26072. desktop: .85
  26073. },
  26074. minLengthForTruncate: 16,
  26075. truncateLength: 12,
  26076. truncateSuffix: "..."
  26077. },
  26078. tags: {
  26079. enabled: r.valueFromHash("mt", 1),
  26080. startup: {
  26081. hideUntilStart: !0,
  26082. fadeInDuration: 500,
  26083. fadeInDelay: 100
  26084. },
  26085. visibility: {
  26086. anyDistance: !0,
  26087. visibleDistance: 8,
  26088. cameraClearance: .1,
  26089. alphaTestLevel: .05,
  26090. hideViaFloor: !0,
  26091. hideOffScreenDisc: !1,
  26092. hideOffScreenObject: !1
  26093. },
  26094. disc: {
  26095. opacity: 1,
  26096. disabledOpacity: .5,
  26097. scale: {
  26098. nearBound: 1.5,
  26099. farBound: 4.8,
  26100. linkFarBound: !1,
  26101. linkPercent: 40,
  26102. maxSize: 80,
  26103. minSize: 40,
  26104. baseViewportSize: 800,
  26105. responsiveness: 100
  26106. }
  26107. },
  26108. pole: {
  26109. enabled: !0,
  26110. height: .5,
  26111. width: 2,
  26112. opacity: .5,
  26113. color: "white"
  26114. },
  26115. navigate: {
  26116. nearestPano: !0,
  26117. lineOfSight: !0,
  26118. reactivate: !0,
  26119. aimAt: "disc",
  26120. tiltTolerance: 25,
  26121. rotateSpeedFactor: .6
  26122. }
  26123. },
  26124. path: {
  26125. color: window.DATA.floorMarkerColor || s.newBlue, // 方奕卓 配置导览标志颜色
  26126. colorUp: s._desat(s.newBlue, .5),
  26127. colorDown: s._darken(s.newBlue, .35),
  26128. opacity: .5,
  26129. style: "ribbon",
  26130. height: .025,
  26131. ribbonWidth: .24,
  26132. outsideHeight: .5,
  26133. waypointRadius: .5,
  26134. waypointIndoorRadius: .24,
  26135. waypointPulse: 1e3,
  26136. typ: l.BLACK,
  26137. meshFree: r.valueFromHash("mf", 1),
  26138. mapGuides: r.valueFromHash("guides", !0),
  26139. fadeInTime: 400,
  26140. fadeOutTime: 300
  26141. },
  26142. warp: {
  26143. nearPanoDist: .1,
  26144. matchCam: !1,
  26145. blur: .33,
  26146. fastTime: 1500,
  26147. teleportTime: 1500,//瞬间过渡的时间
  26148. flytimeDistanceMultiplier:150,//add
  26149. flyTime:750,//add
  26150. outsideTime: 2e3,
  26151. lookAheadMax: .3,
  26152. lookAheadDist: 2.5,
  26153. softPushDist: .37,
  26154. softPushEnd: .3,
  26155. softBendAngle: 8,
  26156. softBendTilt: 4,
  26157. softBendEnd: .3,
  26158. doBurns: true, //r.valueFromHash("kb", !0),
  26159. burnsAngle: 8, //导览在每个点停留时的旋转角度
  26160. minBurnsAngle: 35,
  26161. minDownAngle: -35,
  26162. maxTurnPerSec: 280,
  26163. maxAimPerSec: 35,
  26164. minRotation: 12,
  26165. maxAimRotation: 33.2,
  26166. turnFriction: .2,
  26167. flySpeed: .01,
  26168. minWarpTime: 1200,
  26169. warpInterruptionRedirectTime: 500,
  26170. tourStepDelay: r.valueFromHash("st", 0),
  26171. walkDelay: 0,
  26172. walkMaxDist: 50,
  26173. walkMinDist: .8,
  26174. walkSlideShowThreshhold: 3000,
  26175. walkExtraPanosDistance: .4,
  26176. timePerMeter: 1200,
  26177. motionLeadTime: 5000,
  26178. movementEasing: "easeInOutQuad",
  26179. blendEasing: "easeInOutQuad",
  26180. showBunny: !1,
  26181. loop: r.valueFromHash("lp", !1),
  26182. auto: r.valueFromHash("ts", -1),
  26183. eOrder: 'YXZ', //"YXZ",
  26184. stepFactor: .25,
  26185. brakeStrength: 2,
  26186. minBrakeAngle: .1,
  26187. maxBrakeAngle: 1.8,
  26188. climbEffort: 4
  26189. },
  26190. rotationFriction: .05,
  26191. rotationAccelerationInside: 4.5,
  26192. rotationAccelerationOutside: .15,
  26193. rotationAfterMoveMultiplier: 40,
  26194. rotationAfterMoveHistoryCount: 5,
  26195. panFriction: .09,
  26196. panAccelerationOutside: 60,
  26197. onload: r.valueFromHash("onload", o.PANORAMA),
  26198. zoomNearLimit: .1,
  26199. zoomFarLimit: 50,
  26200. navigation: {
  26201. panoScores: !1,
  26202. mouseDirection: !0,
  26203. filterStrictness: .75,
  26204. angleFactor: -30,
  26205. directionFactor: 10,
  26206. distanceFactor: -1,
  26207. optionalityFactor: 3
  26208. },
  26209. sdkInit: !1,
  26210. secretPanelWord: [38, 38, 40, 40, 37, 39, 37, 39, 66, 65],
  26211. console: r.valueFromHash("console", !1),
  26212. noMeshFloorPositionOffset: new n.Vector3(0,-1.2,0),
  26213. panoramaNeighbourMaxDistance: 5,
  26214. panoFloorClickRadius: .35,
  26215. showScreenshotLocations: !1,
  26216. showAxis: !1,
  26217. showNeighbourRaycasts: !1,
  26218. colorMarkerOnLoad: !1,
  26219. colorMarkerByFloor: !1,
  26220. tiling: {
  26221. panoPreRenderRepeatDelay: 2500,
  26222. panoPreRenderDelay: 500,
  26223. preRenderTourPanos: r.valueFromHash("tileprerender", 0),
  26224. tilingFlagNames: ["usetiles", "tiles"],
  26225. maxNavPanoQuality: r.valueFromHash("maxtileq", null),
  26226. maxZoomPanoQuality: r.valueFromHash("maxztileq", null),
  26227. overlayStyle: r.valueFromHash("tileoverlay", 0),
  26228. uploadIntervalDelay: r.valueFromHash("tileupdelay", 10),
  26229. initialIntervalDelay: r.valueFromHash("itiledelay", 0),
  26230. maxNonBaseUploadsPerFrame: r.valueFromHash("maxnbtpf", 1),
  26231. maxBaseUploadsPerFrame: r.valueFromHash("maxbtpf", 6),
  26232. customCompression: r.valueFromHash("tilecustcomp", 0),
  26233. // mobileHighQualityOverride: !1,
  26234. mobileHighQualityOverride: 1,
  26235. allowUltraHighResolution: true
  26236. },
  26237. zoom: {
  26238. enabled: true,
  26239. forceOff: r.valueFromHash("nozoom", 0),
  26240. overridemax: r.valueFromHash("maxzoom", null),
  26241. overridemin: r.valueFromHash("minzoom", null),
  26242. max: d.highQualityMaxZoom,
  26243. min: 1,
  26244. transitionStyle: r.valueFromHash("zoomtrans", 1),
  26245. activationThreshold: 1.1,
  26246. restoreTime: 500
  26247. },
  26248. profiling: {
  26249. enabled: r.valueFromHash("mem", !1)
  26250. }
  26251. };
  26252. p = h.deepExtend(p, d, {
  26253. insideFOV: r.valueFromHash("fov", d.insideFOV),
  26254. insideFOVMax: r.valueFromHash("fovmax", d.insideFOVMax),
  26255. panorama: {
  26256. transitionTime: 1e3,
  26257. modelAlpha: 0,
  26258. modelAlphaDelay: p.flydown.modelTextureDelay,
  26259. modelAlphaLength: 1,
  26260. skyboxOpacity: 1,
  26261. skyboxOpacityDelay: p.flydown.skyboxDelay,
  26262. skyboxOpacityLength: .9,
  26263. fovLength: 1,
  26264. fovDelay: 0,
  26265. cameraMatrixDuration: .8,
  26266. cameraMatrixDelay: 0,
  26267. cameraMatrixEase: c.easeInCubic,
  26268. reticuleOpacity: 1,
  26269. markerOpacity: .3,
  26270. markerOpacityOnHover: 1
  26271. },
  26272. dollhouse: {
  26273. transitionTime: 1e3,
  26274. modelAlpha: 1,
  26275. modelAlphaDelay: 0,
  26276. modelAlphaLength: 1 - p.flydown.modelTextureDelay,
  26277. skyboxOpacity: 0,
  26278. skyboxOpacityDelay: 0,
  26279. skyboxOpacityLength: 1 - p.flydown.skyboxDelay,
  26280. fovLength: 1,
  26281. fovDelay: 0,
  26282. cameraMatrixDuration: .8,
  26283. cameraMatrixDelay: .3,
  26284. cameraMatrixEase: c.easeInCubic,
  26285. reticuleOpacity: 1,
  26286. markerOpacity: 0,
  26287. markerOpacityOnHover: 0
  26288. },
  26289. floorplan: {
  26290. transitionTime: 1e3,
  26291. modelAlpha: 1,
  26292. modelAlphaDelay: 0,
  26293. modelAlphaLength: 1 - p.flydown.modelTextureDelay,
  26294. skyboxOpacity: 0,
  26295. skyboxOpacityDelay: 0,
  26296. skyboxOpacityLength: 1 - p.flydown.skyboxDelay,
  26297. fovLength: 1,
  26298. fovDelay: 0,
  26299. cameraMatrixDuration: .5,
  26300. cameraMatrixDelay: 0,
  26301. cameraMatrixEase: c.easeOutCubic,
  26302. reticuleOpacity: 1,
  26303. markerOpacity: 0,
  26304. markerOpacityOnHover: 0,
  26305. cameraHeight: 50
  26306. },
  26307. transitioning: {
  26308. reticuleOpacity: 0,
  26309. markerOpacity: .3,
  26310. markerOpacityOnHover: 1
  26311. },
  26312. "floorplan-dollhouse": {
  26313. rotationDelay: 0,
  26314. rotationDuration: 1
  26315. },
  26316. "floorplan-panorama": {
  26317. rotationDelay: .5,
  26318. rotationDuration: 1
  26319. },
  26320. "dollhouse-panorama": {
  26321. rotationDelay: .5,
  26322. rotationDuration: 1
  26323. },
  26324. "dollhouse-floorplan": {
  26325. rotationDelay: 0,
  26326. rotationDuration: 1,
  26327. cameraMatrixDuration: 1.05,
  26328. cameraMatrixDelay: .5
  26329. },
  26330. "panorama-dollhouse": {
  26331. rotationDelay: 0,
  26332. rotationDuration: .5
  26333. },
  26334. "panorama-floorplan": {
  26335. transitionTime: 1500,
  26336. rotationDelay: 0,
  26337. rotationDuration: .5
  26338. }
  26339. }),
  26340. p.path.meshFree && (p.path.typ = l.WALK),
  26341. p.zoom.max = p.zoom.overridemax || p.zoom.max,
  26342. p.zoom.min = p.zoom.overridemin || p.zoom.min,
  26343. window._settings = t.exports = p
  26344. }
  26345. , {
  26346. "./constants": 8,
  26347. "./enum/Colors": 19,
  26348. "./enum/VROption": 47,
  26349. "./enum/Viewmode": 51,
  26350. "./enum/WarpStyle": 52,
  26351. "./util/browser": 182,
  26352. "./util/common": 185,
  26353. "./util/easing": 186,
  26354. "./util/showcase": 193,
  26355. three: 217
  26356. }],
  26357. 167: [function(e, t, i) {
  26358. "use strict";
  26359. var n = e("three")
  26360. , r = e("./settings")
  26361. , 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"
  26362. , a = "precision highp float;\nprecision highp int;\n\nuniform mat4 viewMatrix;\nuniform vec3 cameraPosition;\n";
  26363. t.exports = {
  26364. basicTextured: {
  26365. uniforms: {
  26366. tDiffuse: {
  26367. type: "t",
  26368. value: null
  26369. },
  26370. alpha: {
  26371. type: "f",
  26372. value: 1
  26373. }
  26374. },
  26375. vertexShader: "varying vec2 vUv;\nvoid main() {\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n}",
  26376. 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}"
  26377. },
  26378. copyCubeMap: {
  26379. uniforms: {
  26380. tDiffuse: {
  26381. type: "t",
  26382. value: null
  26383. },
  26384. alpha: {
  26385. type: "f",
  26386. value: 1
  26387. }
  26388. },
  26389. 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}",
  26390. 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}"
  26391. },
  26392. cube: {
  26393. uniforms: {
  26394. map: {
  26395. type: "t",
  26396. value: null
  26397. },
  26398. opacity: {
  26399. type: "f",
  26400. value: 1
  26401. }
  26402. },
  26403. vertexShader: o + "varying vec3 vWorldPosition;\n\nvoid main() {\n vWorldPosition = position;\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}\n",
  26404. 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"
  26405. },
  26406. model: {
  26407. uniforms: {
  26408. map: {
  26409. type: "t",
  26410. value: null
  26411. },
  26412. modelAlpha: {
  26413. type: "f",
  26414. value: r.modelAlpha
  26415. },
  26416. opacity: {
  26417. type: "f",
  26418. value: 1
  26419. },
  26420. progress: {
  26421. type: "f",
  26422. value: 0
  26423. },
  26424. blackout: {
  26425. type: "i",
  26426. value: 0
  26427. },
  26428. pano0Map: {
  26429. type: "t",
  26430. value: null
  26431. },
  26432. pano0Position: {
  26433. type: "v3",
  26434. value: new n.Vector3
  26435. },
  26436. pano0Matrix: {
  26437. type: "m4",
  26438. value: new n.Matrix4
  26439. },
  26440. pano1Map: {
  26441. type: "t",
  26442. value: null
  26443. },
  26444. pano1Position: {
  26445. type: "v3",
  26446. value: new n.Vector3
  26447. },
  26448. pano1Matrix: {
  26449. type: "m4",
  26450. value: new n.Matrix4
  26451. }
  26452. },
  26453. vertexShader: o + `uniform vec3 pano0Position;
  26454. uniform mat4 pano0Matrix;\n\nuniform vec3 pano1Position;\n
  26455. uniform mat4 pano1Matrix;\n\nvarying vec2 vUv;\n
  26456. varying vec3 vWorldPosition0;
  26457. varying vec3 vWorldPosition1;
  26458. uniform int blackout;
  26459. void main() {
  26460. vUv = uv;
  26461. vec4 worldPosition = modelMatrix * vec4(position, 1.0);
  26462. vec3 positionLocalToPanoCenter0 = worldPosition.xyz - pano0Position;
  26463. vWorldPosition0 = (vec4(positionLocalToPanoCenter0, 1.0) * pano0Matrix).xyz;
  26464. vWorldPosition0.x *= -1.0;
  26465. vec3 positionLocalToPanoCenter1 = worldPosition.xyz - pano1Position;
  26466. vWorldPosition1 = (vec4(positionLocalToPanoCenter1, 1.0) * pano1Matrix).xyz;
  26467. vWorldPosition1.x *= -1.0;
  26468. gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );
  26469. }`,
  26470. fragmentShader: a + `uniform sampler2D map;\nuniform float modelAlpha;\nuniform float opacity;\n
  26471. 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
  26472. void main() {
  26473. const vec4 BLACK = vec4(0.0, 0.0, 0.0, 1.0);
  26474. const vec4 GREY = vec4(0.5, 0.5, 0.5, 1.0);
  26475. vec4 colorFromPanos;
  26476. if (blackout == 5){
  26477. colorFromPanos = textureCube( pano1Map, vWorldPosition1.xyz) ;
  26478. }else{
  26479. vec4 colorFromPano0 = textureCube( pano0Map, vWorldPosition0.xyz);
  26480. vec4 colorFromPano1 = textureCube( pano1Map, vWorldPosition1.xyz);
  26481. if (blackout == 0) {colorFromPanos = mix(colorFromPano0, colorFromPano1, progress);}
  26482. else if (blackout == 1) {
  26483. colorFromPanos = mix(colorFromPano0, BLACK, min(1.0, progress*2.0));
  26484. colorFromPanos = mix(colorFromPanos, colorFromPano1, max(0.0, progress * 2.0 - 1.0));
  26485. }
  26486. else if (blackout == 2) {colorFromPanos = mix(colorFromPano0, BLACK, progress);}
  26487. else if (blackout == 3) {colorFromPanos = mix(BLACK, colorFromPano1, max(0.0, progress * 2.0 - 1.0));}
  26488. }
  26489. vec4 colorFromTexture = texture2D( map, vUv );
  26490. colorFromPanos = mix(colorFromPanos, colorFromTexture, modelAlpha);
  26491. float whiteness = 1.0 - smoothstep(0.1, 0.2, opacity);
  26492. colorFromPanos = mix(colorFromPanos, GREY, whiteness);
  26493. gl_FragColor = vec4(colorFromPanos.rgb, opacity);
  26494. }`
  26495. },
  26496. hot:{
  26497. uniforms:{
  26498. color:{
  26499. type: "c",
  26500. value: new n.Color( 0xff2200 )
  26501. },
  26502. opac:{
  26503. type: "f",
  26504. value: 0
  26505. },
  26506. texture1:{
  26507. type: "t",
  26508. value: null
  26509. },
  26510. texture2:{
  26511. type: "t",
  26512. value: null
  26513. }
  26514. },
  26515. vertexShader:"varying vec2 vUv;\n\nvoid main() {\n\n vUv = uv ;\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\n}\n",
  26516. 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"
  26517. },
  26518. modelOutside: {
  26519. uniforms: {
  26520. map: {
  26521. type: "t",
  26522. value: null
  26523. },
  26524. opacity: {
  26525. type: "f",
  26526. value: 1
  26527. }
  26528. },
  26529. vertexShader: o + "varying vec2 vUv;\n\nvoid main() {\n\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\n}\n",
  26530. 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"
  26531. },
  26532. ribbon: {
  26533. uniforms: {
  26534. map: {
  26535. type: "t",
  26536. value: null
  26537. },
  26538. opacity: {
  26539. type: "f",
  26540. value: 1
  26541. },
  26542. color: {
  26543. type: "c",
  26544. value: new n.Color(r.path.color)
  26545. }
  26546. },
  26547. 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",
  26548. 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"
  26549. },
  26550. waypoint: {
  26551. uniforms: {
  26552. map: {
  26553. type: "t",
  26554. value: null
  26555. },
  26556. opacity: {
  26557. type: "f",
  26558. value: 1
  26559. },
  26560. pulse: {
  26561. type: "f",
  26562. value: 1
  26563. },
  26564. nearFade: {
  26565. type: "v2",
  26566. value: new n.Vector2(2 * r.insideNear,2 * r.path.waypointIndoorRadius)
  26567. },
  26568. color: {
  26569. type: "c",
  26570. value: new n.Color(r.reticuleColor)
  26571. }
  26572. },
  26573. 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",
  26574. 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"
  26575. },
  26576. modelDebug: {
  26577. uniforms: {
  26578. map: {
  26579. type: "t",
  26580. value: null
  26581. },
  26582. modelAlpha: {
  26583. type: "f",
  26584. value: r.modelAlpha
  26585. },
  26586. depthmapRatio: {
  26587. type: "f",
  26588. value: 0
  26589. },
  26590. opacity: {
  26591. type: "f",
  26592. value: 1
  26593. },
  26594. progress: {
  26595. type: "f",
  26596. value: 0
  26597. },
  26598. considerOcclusion: {
  26599. type: "i",
  26600. value: r.fancierTransition
  26601. },
  26602. highlightPanoSelection: {
  26603. type: "i",
  26604. value: 0
  26605. },
  26606. useThirdPano: {
  26607. type: "i",
  26608. value: r.useThirdPano
  26609. },
  26610. pano0Map: {
  26611. type: "t",
  26612. value: null
  26613. },
  26614. pano0Depth: {
  26615. type: "t",
  26616. value: null
  26617. },
  26618. pano0Position: {
  26619. type: "v3",
  26620. value: new n.Vector3
  26621. },
  26622. pano0Matrix: {
  26623. type: "m4",
  26624. value: new n.Matrix4
  26625. },
  26626. pano0Weight: {
  26627. type: "f",
  26628. value: r.transition.pano0Weight
  26629. },
  26630. pano1Map: {
  26631. type: "t",
  26632. value: null
  26633. },
  26634. pano1Depth: {
  26635. type: "t",
  26636. value: null
  26637. },
  26638. pano1Position: {
  26639. type: "v3",
  26640. value: new n.Vector3
  26641. },
  26642. pano1Matrix: {
  26643. type: "m4",
  26644. value: new n.Matrix4
  26645. },
  26646. pano1Weight: {
  26647. type: "f",
  26648. value: r.transition.pano1Weight
  26649. },
  26650. pano2Map: {
  26651. type: "t",
  26652. value: null
  26653. },
  26654. pano2Depth: {
  26655. type: "t",
  26656. value: null
  26657. },
  26658. pano2Position: {
  26659. type: "v3",
  26660. value: new n.Vector3
  26661. },
  26662. pano2Matrix: {
  26663. type: "m4",
  26664. value: new n.Matrix4
  26665. },
  26666. pano2Weight: {
  26667. type: "f",
  26668. value: r.transition.pano2Weight
  26669. }
  26670. },
  26671. 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",
  26672. 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"
  26673. },
  26674. customDepth: {
  26675. uniforms: {
  26676. panoPosition: {
  26677. type: "v3",
  26678. value: new n.Vector3
  26679. }
  26680. },
  26681. 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",
  26682. 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"
  26683. },
  26684. skysphere: {
  26685. uniforms: {
  26686. radius: {
  26687. type: "f",
  26688. value: 0
  26689. }
  26690. },
  26691. 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",
  26692. 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"
  26693. },
  26694. tagDisc: {
  26695. uniforms: {
  26696. opacity: {
  26697. type: "f",
  26698. value: 0
  26699. },
  26700. color: {
  26701. type: "c",
  26702. value: new n.Color
  26703. },
  26704. bg: {
  26705. type: "t",
  26706. value: null
  26707. },
  26708. mask: {
  26709. type: "t",
  26710. value: null
  26711. }
  26712. },
  26713. vertexShader: o + "varying vec2 vUv;\nvoid main() {\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n}",
  26714. 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"
  26715. }
  26716. }
  26717. }
  26718. , {
  26719. "./settings": 166,
  26720. three: 217
  26721. }],
  26722. 168: [function(e, t, i) {
  26723. (function(i) {
  26724. "use strict";
  26725. var n = e("three")
  26726. , r = (e("url"),
  26727. e("./util/ajax"))
  26728. , o = e("./settings")
  26729. , a = e("./util/logger")
  26730. , s = e("./util/math")
  26731. , l = e("./util/showcase")
  26732. , c = e("./objects/Panorama")
  26733. , h = new a(i)
  26734. , u = e("./model/Model")
  26735. , d = e("./shaders")
  26736. , p = e("./util/transitions")
  26737. , f = e("./objects/Chunk")
  26738. , g = e("./objects/Reticule")
  26739. , m = e("./objects/Skybox")
  26740. , v = e("./objects/Floor")
  26741. , A = e("./cameras/DollhouseCamera")
  26742. , y = e("./cameras/FloorplanCamera")
  26743. , C = e("./cameras/PanoramaCamera")
  26744. , I = e("./controls/DollhouseControls")
  26745. , E = e("./controls/FloorplanControls")
  26746. , b = e("./controls/PanoramaControls");
  26747. n.ImageUtils.crossOrigin = o.crossOrigin,
  26748. t.exports = {
  26749. shaders: d,
  26750. transitions: p,
  26751. Model: u,
  26752. Chunk: f,
  26753. Floor: v,
  26754. Skybox: m,
  26755. Reticule: g,
  26756. Panorama: c,
  26757. DollhouseCamera: A,
  26758. FloorplanCamera: y,
  26759. PanoramaCamera: C,
  26760. DollhouseControls: I,
  26761. FloorplanControls: E,
  26762. PanoramaControls: b,
  26763. getModel: function(e) {
  26764. if (!e.url)
  26765. throw 'getModel(): missing parameter "url"';
  26766. e.autoload = void 0 === e.autoload || e.autoload;
  26767. var t = l.parseSidUrl(e.url);
  26768. e.urlBase = t.urlBase,
  26769. e.urlModel = t.urlModel,
  26770. e.urlFiles = t.urlFiles;
  26771. var i = this._getPlatformError();
  26772. return i ? $.Deferred().reject(i).promise() : (this.options = e,
  26773. this._loadModel().then(this._buildModel.bind(this)))
  26774. },
  26775. _getPlatformError: function() {
  26776. 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"
  26777. },
  26778. _loadModel: function() {
  26779. return r.get(this.options.urlModel, {
  26780. responseType: "json",
  26781. prefetchFrom: "model",
  26782. auth: l.getAuthorizationHeader()
  26783. }).then(null, function() {
  26784. return h.warn("Model loading failed at initial metadata load"),
  26785. "loading-failed"
  26786. })
  26787. },
  26788. _buildModel: function(e) {
  26789. e = l.normalizeModeldata(e, s);
  26790. var t = new u(this.options,e);
  26791. return this.options.autoload ? t.load(!0) : $.when(t)
  26792. }
  26793. }
  26794. }
  26795. ).call(this, "/js/showcase.js")
  26796. }
  26797. , {
  26798. "./cameras/DollhouseCamera": 5,
  26799. "./cameras/FloorplanCamera": 6,
  26800. "./cameras/PanoramaCamera": 7,
  26801. "./controls/DollhouseControls": 10,
  26802. "./controls/FloorplanControls": 11,
  26803. "./controls/PanoramaControls": 13,
  26804. "./model/Model": 139,
  26805. "./objects/Chunk": 144,
  26806. "./objects/Floor": 146,
  26807. "./objects/Panorama": 148,
  26808. "./objects/Reticule": 149,
  26809. "./objects/Skybox": 152,
  26810. "./settings": 166,
  26811. "./shaders": 167,
  26812. "./util/ajax": 181,
  26813. "./util/logger": 189,
  26814. "./util/math": 190,
  26815. "./util/showcase": 193,
  26816. "./util/transitions": 195,
  26817. three: 217,
  26818. url: 208
  26819. }],
  26820. 169: [function(e, t, i) {
  26821. "use strict";
  26822. function n() {
  26823. var e = {
  26824. renderTarget: null,
  26825. inUse: !1,
  26826. size: -1,
  26827. pano: null
  26828. };
  26829. return e
  26830. }
  26831. function r(e) {
  26832. M.push(e)
  26833. }
  26834. function o(e) {
  26835. var t = n();
  26836. return t.inUse = !0,
  26837. t.size = e,
  26838. r(t),
  26839. t
  26840. }
  26841. function a(e) {
  26842. for (var t = 0; t < M.length; t++) {
  26843. var i = M[t];
  26844. if (!i.inUse && i.size === e)
  26845. return i.inUse = !0,
  26846. i
  26847. }
  26848. return null
  26849. }
  26850. function s(e) {
  26851. for (var t = 0; t < M.length; t++) {
  26852. var i = M[t];
  26853. if (i.renderTarget === e)
  26854. return i.inUse = !1,
  26855. !0
  26856. }
  26857. return !1
  26858. }
  26859. function l() {
  26860. this.tileDirectory = {},
  26861. this.activeRenderTargetDescriptors = {},
  26862. this.activePanos = [],
  26863. this.panoLODDescriptors = {},
  26864. this.panoDescriptors = {},
  26865. this.tileTrees = {},
  26866. this.sceneRenderer = null,
  26867. this.tileDownloader = null,
  26868. this.forceQueue = [],
  26869. this.uploadQueues = {},
  26870. this.uploadInterval = null,
  26871. this.uploadIntervalCancelled = !1,
  26872. this.usingTileOverlay = !1,
  26873. this.overlayTilesLoaded = !1,
  26874. this.overlayTileBase = null,
  26875. this.overlayTilesBasic = {},
  26876. this.overlayTilesEnhanced = {},
  26877. this.zoomRenderTarget = null,
  26878. this.zoomPano = null,
  26879. this.zoomingActive = !1,
  26880. this.zoomPanoId = null,
  26881. this.zoomPanoRenderingDisabled = !1,
  26882. this.direction = new h.Vector3,
  26883. this.initTime = -1,
  26884. this.maxBaseUploadsPerFrame = x,
  26885. this.maxNonBaseUploadsPerFrame = T
  26886. }
  26887. function c() {
  26888. this.uploadIntervalCancelled || (this.overlayTilesLoaded || !this.usingTileOverlay ? (b = !0,
  26889. this.updateUploadQueue(this.maxNonBaseUploadsPerFrame, this.maxBaseUploadsPerFrame),
  26890. this.peekNextFromUploadQueue() ? this.refreshUploadInterval(w) : this.uploadInterval = null) : this.refreshUploadInterval(this.uploadIntervalDelay))
  26891. }
  26892. var h = e("three")
  26893. , u = e("../exception/BasicException")
  26894. , d = e("../settings")
  26895. , p = e("../enum/PanoSizeClass")
  26896. , f = (e("../objects/Panorama"),
  26897. e("../enum/PanoRendererEvents"))
  26898. , g = e("../enum/SceneRendererEvents")
  26899. , m = e("../enum/TileDownloaderEvents")
  26900. , v = e("../enum/Vectors")
  26901. , A = (e("../enum/GLCubeFaces"),
  26902. e("../objects/Panorama"),
  26903. e("./TileTree"))
  26904. , y = (e("./TileDownloader"),
  26905. e("./TilePrioritizer"))
  26906. , C = e("./TileUtils")
  26907. , p = e("../enum/PanoSizeClass")
  26908. , I = (e("../util/browser"),
  26909. e("../util/panorama"))
  26910. , E = e("events").EventEmitter
  26911. , b = !1
  26912. , w = d.tiling.uploadIntervalDelay
  26913. , _ = d.tiling.initialIntervalDelay
  26914. , T = d.tiling.maxNonBaseUploadsPerFrame
  26915. , x = d.tiling.maxBaseUploadsPerFrame
  26916. , S = {
  26917. Base: 0,
  26918. Remaining: 1
  26919. }
  26920. , M = [];
  26921. l.prototype = Object.create(E.prototype),
  26922. l.prototype.init = function(e, t, i) {
  26923. this.sceneRenderer = e,
  26924. this.tileDownloader = t,
  26925. this.qualityManager = i,
  26926. this.bindEvents(),
  26927. this.sceneRenderer.on(g.ContextCreated, this.loadOverlayTiles.bind(this)),
  26928. this.initTime = performance.now()
  26929. }
  26930. ,
  26931. l.prototype.getActivePanoTextures = function(e) {
  26932. e = e || [];
  26933. for (var t = 0; t < M.length; t++) {
  26934. var i = M[t];
  26935. i.renderTarget && i.renderTarget.texture && e.push(i.renderTarget.texture)
  26936. }
  26937. }
  26938. ,
  26939. l.prototype.hasQueuedTiles = function() {
  26940. var e = this.peekNextFromUploadQueue();
  26941. return null !== e && void 0 !== e
  26942. }
  26943. ,
  26944. l.prototype.getActiveRenderTargetDescriptor = function(e) {
  26945. return this.activeRenderTargetDescriptors[e]
  26946. }
  26947. ,
  26948. l.prototype.setActiveRenderTargetDescriptor = function(e, t) {
  26949. this.activeRenderTargetDescriptors[e] = t
  26950. }
  26951. ,
  26952. l.prototype.loadOverlayTiles = function() {
  26953. if (0 !== d.tiling.overlayStyle) {
  26954. var e = 0
  26955. , t = function(t, n, r) {
  26956. t = n ? t[n] = this.sceneRenderer.initSizedTexture2D(C.TILE_SIZE, h.ClampToEdgeWrapping) : this.overlayTileBase = this.sceneRenderer.initSizedTexture2D(C.TILE_SIZE, h.ClampToEdgeWrapping),
  26957. this.sceneRenderer.uploadTexture2D(r, t, 0, 0, C.TILE_SIZE, C.TILE_SIZE),
  26958. e++,
  26959. e === i.length && (this.overlayTilesLoaded = !0)
  26960. }
  26961. .bind(this)
  26962. , 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)]];
  26963. i.forEach(function(e) {
  26964. this.tileDownloader.loadImage(e[0], 0, e[1])
  26965. }
  26966. .bind(this)),
  26967. this.usingTileOverlay = !0
  26968. } else
  26969. this.usingTileOverlay = !1
  26970. }
  26971. ,
  26972. l.prototype.bindEvents = function() {
  26973. this.tileDownloader.on(m.TileDownloadSuccess, this.onTileDownloaded.bind(this))
  26974. }
  26975. ,
  26976. l.prototype.setupZoomRenderTarget = function() {
  26977. var targets = {};
  26978. return function(){
  26979. if(this.qualityManager.maxRenderTargetSize == '2k' && this.qualityManager.getMaxNavPanoSize()=='2k')return; //不使用zoomTarget 直接用pano的tiledPanoRenderTarget,防崩溃
  26980. if (this.qualityManager.getMaxZoomPanoSize() >= this.qualityManager.getMaxNavPanoSize()) {
  26981. if (this.zoomRenderTarget && this.zoomRenderTarget.width === this.qualityManager.getMaxZoomPanoSize())
  26982. return;
  26983. var e = this.zoomRenderTarget;
  26984. var size = this.qualityManager.getMaxZoomPanoSize()
  26985. if(size > this.qualityManager.maxRenderTargetSize){
  26986. return
  26987. }
  26988. if(targets[size]){
  26989. this.zoomRenderTarget = targets[size]
  26990. }else{
  26991. this.zoomRenderTarget = this.initTiledPano(size, false )//放大后不使用抗锯齿,否则消耗更多内存
  26992. targets[size] = this.zoomRenderTarget
  26993. }
  26994. if(e) {//将旧的zoomRenderTarget渲染到新zoomRenderTarget上
  26995. var t = e.width
  26996. , i = this.zoomRenderTarget.width;
  26997. this.sceneRenderer.copyCubeMap(e.texture, this.zoomRenderTarget, t, t, i, i),
  26998. e.texture.dispose(),
  26999. e.texture.loaded = !1,
  27000. e.texture.version = 0,
  27001. this.sceneRenderer.deallocateCubeTexture(e.texture),
  27002. e.texture = null
  27003. }
  27004. this.zoomPanoRenderingDisabled = !1
  27005. } else
  27006. this.zoomPanoRenderingDisabled = !0
  27007. }
  27008. }()
  27009. ,
  27010. l.prototype.enableHighQuality = function(e) {
  27011. //xzw add 如果最多只要2k图的话enableUltraHighQualityMode替换成这个
  27012. if (!this.qualityManager.highQualityModeStarted) {
  27013. this.setupZoomRenderTarget()
  27014. e()
  27015. this.qualityManager.highQualityModeStarted = true
  27016. }
  27017. }
  27018. l.prototype.enableUltraHighQualityMode = function(e) {
  27019. if (!this.qualityManager.ultraHighQualityModeEnabled()) {
  27020. var t = this.qualityManager.getPanoSize(p.ULTRAHIGH);
  27021. this.tileDownloader.testDownload(t, C.TILE_SIZE, function(t) {
  27022. t && (this.qualityManager.enableUltraHighQualityMode(),
  27023. this.setupZoomRenderTarget(),
  27024. e())
  27025. }
  27026. .bind(this))
  27027. }
  27028. }
  27029. ,
  27030. l.prototype.activateTiledPano = function(e, t, i) {
  27031. i && this.clearAllQueuedUploads();
  27032. for (var n = 0; n < C.FACES_PER_PANO; n++)
  27033. this.initTileTree(e.id, n, this.qualityManager.getMaxPossiblePanoSize());
  27034. this.linkAllTilesAndNodes(e);
  27035. var r = this.getActiveRenderTargetDescriptor(e.id)
  27036. , l = t;
  27037. if (l > this.qualityManager.getMaxNavPanoSize() && (l = this.qualityManager.getMaxNavPanoSize()),
  27038. !r || l !== r.size) {
  27039. if (r && s(r.renderTarget),
  27040. r = a(l),
  27041. !r) {
  27042. var c = this.initTiledPano(l, !browser.isMobile()/* !1 */);
  27043. r = o(c.width),
  27044. r.renderTarget = c
  27045. }
  27046. r.pano = e,
  27047. this.resetPanoDescriptor(e.id),
  27048. this.resetPanoLODDescriptors(e.id),
  27049. this.resetRenderStatus(e.id, !0, !0)
  27050. }
  27051. this.setActiveRenderTargetDescriptor(e.id, r);
  27052. var h = i ? 0 : 1;
  27053. return this.updateActivePanos(e, h),
  27054. r.renderTarget
  27055. }
  27056. ,
  27057. l.prototype.deactivateTiledPano = function(e) {
  27058. var t = this.getActiveRenderTargetDescriptor(e.id);
  27059. this.isRenderTargetDescriptorValid(t) && s(t.renderTarget),
  27060. this.setActiveRenderTargetDescriptor(e.id, null);
  27061. var i = this.getUploadQueueForPano(e.id);
  27062. this.clearUploadQueue(i),
  27063. this.updateActivePanos()
  27064. }
  27065. ,
  27066. l.prototype.updateActivePanos = function() {
  27067. var e = [];
  27068. return function(t, i) {
  27069. e.length = 0;
  27070. for (var n = 0; n < this.activePanos.length; n++) {
  27071. t && e.length === i && e.push(t);
  27072. var r = this.activePanos[n]
  27073. , o = this.getActiveRenderTargetDescriptor(r.id);
  27074. t && r.id === t.id || !this.isRenderTargetDescriptorValid(o) || e.push(r)
  27075. }
  27076. t && i >= e.length && e.push(t),
  27077. this.activePanos.length = 0,
  27078. this.activePanos.push.apply(this.activePanos, e)
  27079. }
  27080. }(),
  27081. l.prototype.getActivePanoCount = function() {
  27082. return this.activePanos.length
  27083. }
  27084. ,
  27085. l.prototype.resetRenderStatus = function(e, t, i, n) {
  27086. var r = null;
  27087. n && (r = A.getLevelCountForSize(C.TILE_SIZE, n) + 1);
  27088. for (var o = function(e, n, r, o) {
  27089. i && (n.tile.zoomUploaded = !1),
  27090. t && (n.tile.uploaded = !1)
  27091. }, a = 0; a < C.FACES_PER_PANO; a++) {
  27092. var s = this.getTileTree(e, a);
  27093. s.breadthFirst({
  27094. callback: o.bind(this, a),
  27095. minLevel: r
  27096. })
  27097. }
  27098. }
  27099. ,
  27100. l.prototype.copyBaseRenderStatusToZoomed = function(e) {
  27101. for (var t = A.getLevelCountForSize(C.TILE_SIZE, this.qualityManager.getMaxNavPanoSize()), i = function(e, t, i, n) {
  27102. t.tile.zoomUploaded = t.tile.uploaded,
  27103. t.zoomCovered = t.covered
  27104. }, n = 0; n < C.FACES_PER_PANO; n++) {
  27105. var r = this.getTileTree(e, n);
  27106. r.breadthFirst({
  27107. callback: i.bind(this, n),
  27108. maxLevel: t
  27109. })
  27110. }
  27111. }
  27112. ,
  27113. l.prototype.renderPanoTiles = function() {
  27114. var e = [];
  27115. return function(t, i, n, r) {
  27116. this.zoomRenderTarget && this.zoomRenderTarget.width === this.qualityManager.getMaxZoomPanoSize() || this.zoomPanoRenderingDisabled || this.setupZoomRenderTarget(),
  27117. i = i || this.direction || v.FORWARD;
  27118. var o = this.getActiveRenderTargetDescriptor(t);
  27119. if (!this.isRenderTargetDescriptorValid(o))
  27120. throw new u("PanoRenderer.renderPanoTiles() -> Cannot render to a pano that is not activated.");
  27121. for (var a = 0; a < C.FACES_PER_PANO; a++) {
  27122. var s = this.getTileTree(t, a);
  27123. e.length = 0,
  27124. s.breadthFirst({
  27125. saveVisited: e
  27126. });
  27127. for (var l = 0; l < e.length; l++) {
  27128. var c = e[l];
  27129. this.queueTileUpload(c.tile, !1, r || 0 === l && n)
  27130. }
  27131. }
  27132. this.updateDirection(i)
  27133. }
  27134. }(),
  27135. l.prototype.isRenderTargetDescriptorValid = function(e) {
  27136. return e && e.renderTarget
  27137. }
  27138. ,
  27139. l.prototype.isPanoActive = function(e) {
  27140. var t = this.getActiveRenderTargetDescriptor(e);
  27141. return this.isRenderTargetDescriptorValid(t)
  27142. }
  27143. ,
  27144. l.prototype.isPanoZoomed = function(e) {
  27145. return this.zoomingActive && this.zoomPanoId === e
  27146. }
  27147. ,
  27148. l.prototype.initTileTree = function(e, t, i) {
  27149. var n = this.tileTrees[e];
  27150. n || (n = [],
  27151. this.tileTrees[e] = n);
  27152. var r = n[t];
  27153. if (!r) {
  27154. var o = A.getLevelCountForSize(C.TILE_SIZE, i);
  27155. r = new A(C.TILE_SIZE,o),
  27156. n[t] = r
  27157. }
  27158. }
  27159. ,
  27160. l.prototype.getTileTree = function(e, t) {
  27161. var i = this.tileTrees[e];
  27162. if (!i)
  27163. throw new u("PanoRenderer.getTileTree() -> Tree array not yet initialized!");
  27164. var n = i[t];
  27165. if (!n)
  27166. throw new u("PanoRenderer.getTileTree() -> Tree not yet initialized!");
  27167. return n
  27168. }
  27169. ,
  27170. l.prototype.initTiledPano = function(e, antialias) {
  27171. var i = this.sceneRenderer.renderer
  27172. , n = (i.context,
  27173. new h.WebGLRenderTargetCube(e,e,{
  27174. stencilBuffer: !1
  27175. }))
  27176. , r = new h.CubeTexture([]);
  27177. n.texture = r,
  27178. r.image = [null, null, null, null, null, null],
  27179. r.flipY = !0,
  27180. antialias ? (r.generateMipmaps = !0,
  27181. r.magFilter = h.LinearFilter,
  27182. r.minFilter = h.LinearMipMapLinearFilter) : (r.generateMipmaps = !1,
  27183. r.magFilter = h.LinearFilter,
  27184. r.minFilter = h.LinearFilter),
  27185. r.format = h.RGBAFormat,
  27186. i.setRenderTarget(n),
  27187. i.setRenderTarget(null);
  27188. var o = i.properties.get(r);
  27189. return o.__image__webglTextureCube = o.__webglTexture,
  27190. n
  27191. }
  27192. ,
  27193. l.prototype.getUploadQueueForPano = function(e) {
  27194. var t = this.uploadQueues[e];
  27195. return t || (t = [],
  27196. this.uploadQueues[e] = t),
  27197. t
  27198. }
  27199. ,
  27200. l.prototype.isTileUploaded = function(e) {
  27201. return this.isPanoZoomed(e.panoId) ? e.zoomUploaded : e.uploaded
  27202. }
  27203. ,
  27204. l.prototype.setUploaded = function(e, t) {
  27205. this.isPanoZoomed(e.panoId) ? e.zoomUploaded = t : e.uploaded = t
  27206. }
  27207. ,
  27208. l.prototype.queueTileUpload = function(e, t, i) {
  27209. var n = this.getActiveRenderTargetDescriptor(e.panoId);
  27210. if (this.isRenderTargetDescriptorValid(n) && e.downloaded && !this.isTileUploaded(e) && (!e.uploadQueued || i) && (!(e.panoSize > this.qualityManager.getMaxNavPanoSize()) || this.zoomingActive)) {
  27211. var r = this.getUploadQueueForPano(e.panoId);
  27212. 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),
  27213. e.uploadQueued = !0,
  27214. this.uploadInterval || this.uploadIntervalCancelled || this.refreshUploadInterval(0))
  27215. }
  27216. }
  27217. ,
  27218. l.prototype.shoulPushToFrontOfQueue = function(e) {
  27219. return 0 === A.getLevelCountForSize(C.TILE_SIZE, e.panoSize)
  27220. }
  27221. ,
  27222. l.prototype.getTopUploadQueue = function() {
  27223. for (var e = null, t = null, i = S.Base; i <= S.Remaining; i++)
  27224. for (var n = 0; n < this.activePanos.length; n++)
  27225. if (e = this.activePanos[n],
  27226. t = this.getUploadQueueForPano(e.id),
  27227. t.length > 0)
  27228. switch (i) {
  27229. case S.Base:
  27230. if (0 === t[0].level)
  27231. return t;
  27232. break;
  27233. case S.Remaining:
  27234. return t
  27235. }
  27236. return null
  27237. }
  27238. ,
  27239. l.prototype.getNextFromUploadQueue = function() {
  27240. var e = function(e) {
  27241. var t = e.shift();
  27242. return t.uploadQueued = !1,
  27243. t
  27244. };
  27245. return function() {
  27246. if (this.forceQueue.length > 0)
  27247. return e(this.forceQueue);
  27248. var t = this.getTopUploadQueue();
  27249. return t && t.length > 0 ? e(t) : null
  27250. }
  27251. }(),
  27252. l.prototype.peekNextFromUploadQueue = function() {
  27253. if (this.forceQueue.length > 0)
  27254. return this.forceQueue[0];
  27255. var e = this.getTopUploadQueue();
  27256. return e && e.length > 0 ? e[0] : null
  27257. }
  27258. ,
  27259. l.prototype.clearAllQueuedUploads = function() {
  27260. this.clearAllUploadQueues(null, 0)
  27261. }
  27262. ,
  27263. l.prototype.clearAllQueuedUploadsForPano = function(e) {
  27264. this.clearAllUploadQueues(e, 0)
  27265. }
  27266. ,
  27267. l.prototype.clearAllUploadQueues = function(e, t) {
  27268. if (e)
  27269. this.clearUploadQueue(this.getUploadQueueForPano(e), t),
  27270. this.clearUploadQueue(this.forceQueue, t, e);
  27271. else {
  27272. for (var i = 0; i < this.activePanos.length; i++) {
  27273. var n = this.activePanos[i];
  27274. this.clearUploadQueue(this.getUploadQueueForPano(n.id), t)
  27275. }
  27276. this.clearUploadQueue(this.forceQueue, t)
  27277. }
  27278. }
  27279. ,
  27280. l.prototype.clearUploadQueue = function(e, t, i) {
  27281. void 0 !== t && null !== t || (t = 0);
  27282. for (var n = 0; n < e.length; ) {
  27283. var r = e[n];
  27284. (!i || i && i === r.tile.panoId) && r.level >= t ? (r.uploadQueued = !1,
  27285. e.splice(n, 1)) : n++
  27286. }
  27287. }
  27288. ,
  27289. l.prototype.refreshUploadInterval = function() {
  27290. var e = null;
  27291. return function(t) {
  27292. this.uploadIntervalCancelled || (e || (e = c.bind(this)),
  27293. null !== t && void 0 !== t || (t = w),
  27294. b || (t = _),
  27295. this.uploadInterval = window.setTimeout(e, t),
  27296. this.uploadIntervalDelay = t)
  27297. }
  27298. }(),
  27299. l.prototype.update = function() {
  27300. var e = performance.now()
  27301. , t = 0;
  27302. return function() {
  27303. this.uploadIntervalCancelled = !0,
  27304. window.clearTimeout(this.uploadInterval),
  27305. this.uploadInterval = null;
  27306. var i = performance.now() - e;
  27307. !(i > w || 0 === t) || !this.overlayTilesLoaded && this.usingTileOverlay || (this.updateUploadQueue(this.maxNonBaseUploadsPerFrame, this.maxBaseUploadsPerFrame),
  27308. e = performance.now()),
  27309. t++
  27310. }
  27311. }(),
  27312. l.prototype.updateUploadQueue = function(e, t) {
  27313. e || (e = 1);
  27314. for (var i = 0, n = 0; ; ) {
  27315. if (n >= t || i >= e)
  27316. break;
  27317. var r = this.getNextFromUploadQueue();
  27318. if (!r)
  27319. break;
  27320. if (0 !== r.level ? i++ : n++,
  27321. !(r.panoSize > this.qualityManager.getMaxNavPanoSize()) || this.zoomingActive) {
  27322. var o = this.getActiveRenderTargetDescriptor(r.panoId);
  27323. this.isRenderTargetDescriptorValid(o) && this.uploadTile(r, r.forceUpload)
  27324. }
  27325. }
  27326. }
  27327. ,
  27328. l.prototype.updateDirection = function(e) {
  27329. if (e = e || this.direction) {
  27330. this.direction = e;
  27331. for (var t = 0; t < this.activePanos.length; t++) {
  27332. var i = this.activePanos[t]
  27333. , n = this.getUploadQueueForPano(i.id);
  27334. y.sortPanoTiles(n, i, this.direction)
  27335. }
  27336. }
  27337. }
  27338. ,
  27339. l.prototype.uploadTile = function() {
  27340. var e = {}
  27341. , t = (new h.Vector4,
  27342. d.tiling.overlayStyle);
  27343. //var failHistory = {};
  27344. return function(i, n) {
  27345. var r = i.panoId
  27346. , o = i.image
  27347. , a = i.tileSize
  27348. , s = i.panoSize
  27349. , l = i.tileIndex
  27350. , c = (i.faceTileIndex,
  27351. i.totalTiles)
  27352. , u = (i.face,
  27353. i.tileX)
  27354. , d = i.tileY
  27355. , p = !0
  27356. , g = !1
  27357. , m = (this.getPanoDescriptor(r),
  27358. this.getPanoLODDescriptor(r, s))
  27359. , v = this.getActiveRenderTargetDescriptor(r)
  27360. , A = v.renderTarget
  27361. , y = v.size;
  27362. if (this.isPanoZoomed(r) && (A = this.zoomRenderTarget,
  27363. y = A.width), //this.qualityManager.getMaxZoomPanoSize()),
  27364. this.isRenderTargetDescriptorValid(v) || (p = !1,
  27365. g = !1),
  27366. n || (this.anyUploaded(i.node) && (p = !1,
  27367. g = !0),
  27368. this.isTileUploaded(i) && (p = !1,
  27369. g = !1)),
  27370. p) {
  27371. /* if(failHistory[''+r+s+l]){
  27372. console.log('uploadTile retry', r, s, l)
  27373. }
  27374. console.log('uploadTile 成功', r, s, l)
  27375. */
  27376. var C = u * a
  27377. , I = d * a
  27378. , E = a / s * y
  27379. , b = C / s * y
  27380. , w = I / s * y;
  27381. if (s > this.qualityManager.maxRenderTargetSize) {
  27382. player.model.getHighImage(o, i.cubeFace, u, d)
  27383. }else{
  27384. e[a] || (e[a] = this.sceneRenderer.initSizedTexture2D(a, h.ClampToEdgeWrapping));
  27385. var _ = e[a]
  27386. this.sceneRenderer.uploadTexture2D(o, _, 0, 0, a, a)
  27387. if ( 1 === t || 2 === t) {
  27388. var T = 1 === t ? this.overlayTilesBasic : this.overlayTilesEnhanced;
  27389. this.sceneRenderer.renderToCubeMap(_, A, a, a, 0, 0, a, a, b, w, E, E, i.cubeFace),
  27390. this.sceneRenderer.renderToCubeMap(T[s], A, a, a, 0, 0, a, a, b, w, E, E, i.cubeFace, h.NormalBlending, !0, .5)
  27391. } else
  27392. this.sceneRenderer.renderToCubeMap(_, A, a, a, 0, 0, a, a, b, w, E, E, i.cubeFace);
  27393. }
  27394. m.uploadCount++,
  27395. this.emit(f.TileRenderSuccess, r, s, l, c),
  27396. m.uploadCount === c && this.emit(f.PanoRenderComplete, r, s, c),
  27397. this.setUploaded(i, !0),
  27398. this.addCoverageForNode(i.node)
  27399. } else{
  27400. this.setUploaded(i, !1);
  27401. //console.log('uploadTile 失败', r, s, l)
  27402. //failHistory[''+r+s+l] = true;
  27403. }
  27404. return i.uploadAttempted || (m.uploadAttempts++,
  27405. this.emit(f.TileUploadAttempted, r, s, l, c)),
  27406. i.uploadAttempted = !0,
  27407. m.uploadAttempts === c && this.emit(f.UploadAttemptedForAllTiles, r, s, c),
  27408. g
  27409. }
  27410. }(),
  27411. l.prototype.linkTileAndNode = function(e, t) {
  27412. t.tile = e,
  27413. e.node = t
  27414. }
  27415. ,
  27416. l.prototype.linkAllTilesAndNodes = function(e) {
  27417. for (var t = function(t, i, n, r, o) {
  27418. var a = this.getTileDirectoryEntry(e.id, i, r, o);
  27419. this.linkTileAndNode(a, n)
  27420. }, i = 0; i < C.FACES_PER_PANO; i++) {
  27421. var n = this.getTileTree(e.id, i);
  27422. n.breadthFirst({
  27423. callback: t.bind(this, n, i)
  27424. })
  27425. }
  27426. }
  27427. ,
  27428. l.prototype.anyUploaded = function(e) {
  27429. if (!e)
  27430. return !1;
  27431. if (e.tile && this.isTileUploaded(e.tile))
  27432. return !0;
  27433. if (e.children)
  27434. for (var t = 0; t < e.children.length; t++) {
  27435. var i = e.children[t];
  27436. if (this.anyUploaded(i))
  27437. return !0
  27438. }
  27439. return !1
  27440. }
  27441. ,
  27442. l.prototype.setNodeCovered = function(e, t) {
  27443. this.isPanoZoomed(e.tile.panoId) ? e.zoomCovered = t : e.covered = t
  27444. }
  27445. ,
  27446. l.prototype.isNodeCovered = function(e) {
  27447. return !!e && (this.isPanoZoomed(e.tile.panoId) ? e.zoomCovered : e.covered)
  27448. }
  27449. ,
  27450. l.prototype.addCoverageForNode = function(e) {
  27451. if (this.setNodeCovered(e, !0),
  27452. e.parent && e.covered) {
  27453. var t = e.parent;
  27454. this.nodeSubcovered(t) && this.addCoverageForNode(t, !0)
  27455. }
  27456. }
  27457. ,
  27458. l.prototype.calcFullCoverage = function(e) {
  27459. var t = !1;
  27460. if (e.children)
  27461. for (var i = 0; i < e.children.length; i++) {
  27462. var n = e.children[i];
  27463. t = t || this.calcFullCoverage(n)
  27464. }
  27465. e.covered = e.tile.uploaded || t
  27466. }
  27467. ,
  27468. l.prototype.nodeSubcovered = function(e) {
  27469. if (!e.children)
  27470. return !1;
  27471. for (var t = 0; t < e.children.length; t++)
  27472. if (!e.children[t] || !this.isNodeCovered(e.children[t]))
  27473. return !1;
  27474. return !0
  27475. }
  27476. ,
  27477. l.prototype.resetPanoDescriptor = function(e) {
  27478. this.getPanoDescriptor(e)
  27479. }
  27480. ,
  27481. l.prototype.getPanoDescriptor = function(e) {
  27482. var t = this.panoDescriptors[e];
  27483. return t || (t = {},
  27484. this.panoDescriptors[e] = t),
  27485. t
  27486. }
  27487. ,
  27488. l.prototype.resetPanoLODDescriptors = function(e) {
  27489. var t = this.getPanoLODDescriptors(e);
  27490. for (var i in t)
  27491. if (t.hasOwnProperty(i)) {
  27492. var n = t[i];
  27493. n.uploadCount = 0,
  27494. n.uploadAttempts = 0
  27495. }
  27496. }
  27497. ,
  27498. l.prototype.getPanoLODDescriptor = function(e, t) {
  27499. var i = this.getPanoLODDescriptors(e)
  27500. , n = i[t];
  27501. return n || (n = {
  27502. uploadCount: 0,
  27503. uploadAttempts: 0
  27504. },
  27505. i[t] = n),
  27506. n
  27507. }
  27508. ,
  27509. l.prototype.getPanoLODDescriptors = function(e) {
  27510. var t = this.panoLODDescriptors[e];
  27511. return t || (t = {},
  27512. this.panoLODDescriptors[e] = t),
  27513. t
  27514. }
  27515. ,
  27516. l.prototype.onTileDownloaded = function(e) {
  27517. var t = A.getLevelCountForSize(C.TILE_SIZE, e.panoSize)
  27518. , i = this.getTileDirectoryEntry(e.panoId, e.face, t, e.faceTileIndex);
  27519. if (i.downloaded = !0,
  27520. i.image = e.image,
  27521. i.panoSize = e.panoSize,
  27522. i.tileX = e.tileX,
  27523. i.tileY = e.tileY,
  27524. i.totalTiles = e.totalTiles,
  27525. i.tileIndex = e.tileIndex,
  27526. i.faceTileIndex = e.faceTileIndex,
  27527. i.face = e.face,
  27528. i.cubeFace = I.mapFaceToCubemapFace(e.face),
  27529. i.panoId = e.panoId,
  27530. i.tileSize = e.tileSize,
  27531. i.direction = (new h.Vector3).copy(e.direction),
  27532. i.node = null,
  27533. i.level = A.getLevelCountForSize(C.TILE_SIZE, i.panoSize),
  27534. this.isPanoActive(i.panoId)) {
  27535. var n = this.getTileTree(i.panoId, i.face)
  27536. , r = n.getSubNode(i.panoSize, i.tileX, i.tileY);
  27537. this.linkTileAndNode(i, r),
  27538. this.queueTileUpload(i, !0)
  27539. }
  27540. }
  27541. ,
  27542. l.prototype.getTileDirectoryEntry = function(e, t, i, n) {
  27543. var r = this.tileDirectory[e];
  27544. r || (r = {},
  27545. this.tileDirectory[e] = r);
  27546. var o = 16384 * t + 1024 * i + n
  27547. , a = r[o];
  27548. return a || (a = {
  27549. downloaded: !1,
  27550. uploaded: !1,
  27551. zoomUploaded: !1
  27552. },
  27553. r[o] = a),
  27554. a._key = e + ":" + t + ":" + i + ":" + n,
  27555. a._tileKey = o,
  27556. a
  27557. }
  27558. ,
  27559. l.prototype.setZoomingActive = function(e, t, i) {
  27560. this.zoomPanoRenderingDisabled || e === this.zoomingActive && this.zoomPanoId === t.id || (this.zoomingActive = e,
  27561. this.zoomPanoId = t.id,
  27562. this.zoomingActive && (this.zoomPanoId !== t.id || i) && this.updateZoomedPanoFromBase(t))
  27563. }
  27564. ,
  27565. l.prototype.updateZoomedPanoFromBase = function(e) {
  27566. if (!this.zoomPanoRenderingDisabled) {
  27567. var t = this.getActiveRenderTargetDescriptor(e.id);
  27568. if (t && t.renderTarget) {
  27569. var i = Math.min(this.qualityManager.maxRenderTargetSize, this.qualityManager.getMaxZoomPanoSize()), //this.qualityManager.getMaxZoomPanoSize()
  27570. n = t.renderTarget
  27571. , r = t.size;
  27572. this.sceneRenderer.copyCubeMap(n.texture, this.zoomRenderTarget, r, r, i, i),
  27573. this.copyBaseRenderStatusToZoomed(e.id)
  27574. }
  27575. }
  27576. }
  27577. ,
  27578. t.exports = l
  27579. }
  27580. , {
  27581. "../enum/GLCubeFaces": 25,
  27582. "../enum/PanoRendererEvents": 35,
  27583. "../enum/PanoSizeClass": 36,
  27584. "../enum/SceneRendererEvents": 43,
  27585. "../enum/TileDownloaderEvents": 45,
  27586. "../enum/Vectors": 50,
  27587. "../exception/BasicException": 55,
  27588. "../objects/Panorama": 148,
  27589. "../settings": 166,
  27590. "../util/browser": 182,
  27591. "../util/panorama": 191,
  27592. "./TileDownloader": 171,
  27593. "./TilePrioritizer": 172,
  27594. "./TileTree": 173,
  27595. "./TileUtils": 174,
  27596. events: 202,
  27597. three: 217
  27598. }],
  27599. 170: [function(e, t, i) {
  27600. "use strict";
  27601. function n(e, t, i) {
  27602. this.maxNavPanoSize = -1,
  27603. this.maxZoomPanoSize = -1,
  27604. this.devicePixelDensity = e,
  27605. this.deviceScreenSize = t,
  27606. this.clientBandwidth = i,
  27607. this.panoSizeClassMap = {},
  27608. this.useHighResolutionPanos = !0,
  27609. this.useUltraHighResolutionPanos = !1,
  27610. this.modelHasUltraHighPanos = !1
  27611. this.maxRenderTargetSize = a.isMobile() ? 2048 : 4096 //add
  27612. }
  27613. var r = e("../enum/PanoSizeClass")
  27614. , o = e("../settings")
  27615. , a = e("../util/browser")
  27616. , s = e("../constants")
  27617. , l = e("../util/showcase")
  27618. , c = e("../enum/ModelManagerEvents");
  27619. n.prototype.init = function(e) {
  27620. this.buildPanoSizeClassMap(this.devicePixelDensity, this.deviceScreenSize, this.clientBandwidth),
  27621. this.ultraHighSize = this.getPanoSize(r.ULTRAHIGH),
  27622. this.highSize = this.getPanoSize(r.HIGH),
  27623. this.standardSize = this.getPanoSize(r.STANDARD),
  27624. this.baseSize = this.getPanoSize(r.BASE),
  27625. o.tiling.maxZoomPanoQuality && this.ultraHighSize <= o.tiling.maxZoomPanoQuality && (o.tiling.allowUltraHighResolution = !0),
  27626. this.highQualityThreshold = a.valueFromHash("threshold2k", s.windowHeightHighQualityThreshold),
  27627. this.updateMaximums(),
  27628. e.on(c.ActiveModelChanged, this.onModelChanged.bind(this))
  27629. }
  27630. ,
  27631. n.prototype.updateFromModel = function(e) {
  27632. this.updateHighResolutionSettings(e),
  27633. this.updateUltraHighResolutionSettings(e)
  27634. }
  27635. ,
  27636. n.prototype.updateHighResolutionSettings = function(e) {
  27637. //---------------------许钟文---------原始的会判断modeldata里version,以致useHighResolutionPanos为false,所以我直接变为true啦----------------------------------
  27638. l.modelDataPromisesTiles(e.data) ? this.useHighResolutionPanos = !0 : this.useHighResolutionPanos = !1,
  27639. //this.useHighResolutionPanos = !0;
  27640. //----------------------e n d -----------------------------------------------------------------
  27641. this.updateMaximums()
  27642. }
  27643. ,
  27644. n.prototype.updateUltraHighResolutionSettings = function(e) {
  27645. o.tiling.allowUltraHighResolution && this.modelHasUltraHighPanos ? this.useUltraHighResolutionPanos = !0 : this.useUltraHighResolutionPanos = !1,
  27646. this.updateMaximums()
  27647. }
  27648. ,
  27649. n.prototype.enableUltraHighQualityMode = function() {
  27650. this.modelHasUltraHighPanos = !0,
  27651. this.updateUltraHighResolutionSettings(null)
  27652. }
  27653. ,
  27654. n.prototype.ultraHighQualityModeEnabled = function() {
  27655. return this.modelHasUltraHighPanos
  27656. }
  27657. ,
  27658. n.prototype.onModelChanged = function(e) {
  27659. this.updateFromModel(e.model),
  27660. this.updateMaximums()
  27661. }
  27662. ,
  27663. n.prototype.updateMaximums = function() {
  27664. this.maxNavPanoSize = o.tiling.maxNavPanoQuality || this.detectMaxNavPanoSize(),
  27665. this.maxZoomPanoSize = o.tiling.maxZoomPanoQuality || this.detectMaxZoomPanoSize(),
  27666. this.maxZoomPanoSize < this.maxNavPanoSize && (this.maxNavPanoSize = this.maxZoomPanoSize)
  27667. }
  27668. ,
  27669. n.prototype.buildPanoSizeClassMap = function() {
  27670. this.panoSizeClassMap[r.BASE] = 512,
  27671. this.panoSizeClassMap[r.STANDARD] = 1024,
  27672. this.panoSizeClassMap[r.HIGH] = 2048,
  27673. this.panoSizeClassMap[r.ULTRAHIGH] = 4096
  27674. }
  27675. ,
  27676. n.prototype.getPanoSize = function(e) {
  27677. return this.panoSizeClassMap[e]
  27678. }
  27679. ,
  27680. n.prototype.getMaxPossiblePanoSize = function() {
  27681. return this.getPanoSize(r.ULTRAHIGH)
  27682. }
  27683. ,
  27684. n.prototype.getMaxPanoSize = function() {
  27685. return this.maxZoomPanoSize
  27686. }
  27687. ,
  27688. n.prototype.getMaxNavPanoSize = function() {
  27689. return this.maxNavPanoSize
  27690. }
  27691. ,
  27692. n.prototype.getMaxZoomPanoSize = function() {
  27693. return this.maxZoomPanoSize
  27694. }
  27695. ,
  27696. /* n.prototype.detectMaxNavPanoSizeClass = function() {
  27697. if(settings.mobileNavHigh)return r.HIGH //改
  27698. else return this.useHighResolutionPanos ? a.isMobile() ? r.STANDARD : $("#player").height() < this.highQualityThreshold ? r.STANDARD : r.HIGH : r.STANDARD
  27699. } */
  27700. n.prototype.detectDevice = function(){//add
  27701. if(a.isMobile()){
  27702. let area = $("#player").width() * $("#player").height()
  27703. if(area < 768 * 1024){//ipad mini full screen 大场景拍的质量很好默认不需要很高清
  27704. return 'mobile'
  27705. }else{
  27706. return 'bigMobile'
  27707. }
  27708. }else{
  27709. return 'pc'
  27710. }
  27711. }
  27712. n.prototype.detectMaxNavPanoSizeClass = function() { //xzw 改
  27713. switch(this.getNavZoomClass()){
  27714. case '1k':
  27715. return r.STANDARD;
  27716. break;
  27717. case '2k':
  27718. default:
  27719. return r.HIGH;
  27720. case '4k': //虽然这种暂不支持
  27721. return r.ULTRAHIGH;
  27722. }
  27723. }
  27724. ,
  27725. n.prototype.detectMaxNavPanoSize = function() {
  27726. var e = this.detectMaxNavPanoSizeClass();
  27727. return this.getPanoSize(e)
  27728. }
  27729. ,
  27730. n.prototype.getMaxZoomClass = function(){//add
  27731. let type = this.detectDevice()
  27732. let setting = settings.tileClass[type] //见manage.js的settings
  27733. return setting.max
  27734. }
  27735. n.prototype.getNavZoomClass = function(){//add
  27736. let type = this.detectDevice()
  27737. let setting = settings.tileClass[type]
  27738. return setting.nav
  27739. }
  27740. ,
  27741. n.prototype.detectMaxZoomPanoSize = function() {//获取当前zoomRenderTarget应下载的最高级别
  27742. //若是有三个级别,每次只需要加载到当前的zoomLevel;而两级时因为有zoomed来判断是使用基本贴图还是zoomRenderTarget,所以只需要返回最大的即可
  27743. if (this.zoomLevelResolution) {//有三个级别
  27744. if (this.zoomLevelResolution == '4k' && this.useUltraHighResolutionPanos) {
  27745. return this.getPanoSize(r.ULTRAHIGH)
  27746. } else if (this.zoomLevelResolution == '1k' || !this.useHighResolutionPanos) {
  27747. return this.getPanoSize(r.STANDARD)
  27748. } else {
  27749. return this.getPanoSize(r.HIGH)
  27750. }
  27751. } else {
  27752. let tileClass = this.getMaxZoomClass()
  27753. if(tileClass == '1k')return this.getPanoSize(r.STANDARD);
  27754. if(tileClass == '4k' && this.useUltraHighResolutionPanos ){
  27755. return this.getPanoSize(r.ULTRAHIGH);
  27756. }else{//'2k'
  27757. return this.getPanoSize(r.HIGH);
  27758. }
  27759. }
  27760. }
  27761. /* n.prototype.detectMaxZoomPanoSize = function() {
  27762. 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)
  27763. } */
  27764. ,
  27765. t.exports = n
  27766. }
  27767. , {
  27768. "../constants": 8,
  27769. "../enum/ModelManagerEvents": 33,
  27770. "../enum/PanoSizeClass": 36,
  27771. "../settings": 166,
  27772. "../util/browser": 182,
  27773. "../util/showcase": 193
  27774. }],
  27775. 171: [function(e, t, i) {
  27776. (function(i) {
  27777. "use strict";
  27778. function n(e) {
  27779. this.panos = null,
  27780. this.retryMinimumTime = 1e4,
  27781. this.urls = null,
  27782. this.panoLoadCallbacks = {},
  27783. this.downloadDescriptors = {},
  27784. this.priorityQueue = [],
  27785. this.forceQueue = [],
  27786. this.activeDownloads = [],
  27787. this.qualityManager = null,
  27788. this.tilePrioritizer = null,
  27789. this.refreshInterval = null,
  27790. this.processPriorityQueue = !1,
  27791. this.concurrentDownloads = e.concurrentDownloads || 1,
  27792. this.downloadTestResults = {}
  27793. }
  27794. var r = e("three")
  27795. , o = (e("../enum/Viewmode"),
  27796. e("../settings"))
  27797. , a = (e("../objects/Panorama"),
  27798. e("../util/logger"))
  27799. , s = (e("../enum/Vectors"),
  27800. e("../enum/PanoSizeClass"),
  27801. e("../enum/TileDownloaderEvents"))
  27802. , l = e("./TilePrioritizer")
  27803. , c = e("./TileUtils")
  27804. , h = (e("../enum/GLCubeFaces"),
  27805. e("../enum/DownloadStatus"))
  27806. , u = e("../util/panorama")
  27807. , d = e("../util/ajax")
  27808. , p = e("../ab")
  27809. , f = e("events").EventEmitter
  27810. , g = (new a(i),
  27811. Object.freeze({
  27812. Testing: 1,
  27813. Success: 2,
  27814. Fail: 3
  27815. }));
  27816. n.prototype = Object.create(f.prototype),
  27817. n.IDLE_REFRESH_DELAY = 500,
  27818. n.ACTIVE_REFRESH_DELAY = 16,
  27819. n.DOWNLOAD_RETRIES = 4,
  27820. n.prototype.init = function(e) {
  27821. this.qualityManager = e
  27822. }
  27823. ,
  27824. n.prototype.setUrls = function(e) {
  27825. this.urls = e
  27826. }
  27827. ,
  27828. n.prototype.setPanoData = function(e, t, i) {
  27829. this.panos = e,
  27830. this.imagePanos = t,
  27831. this.panoGroupId = i
  27832. }
  27833. ,
  27834. n.prototype.start = function() {
  27835. this.refreshUpdateInterval(0)
  27836. }
  27837. ,
  27838. n.prototype.stop = function() {
  27839. window.cancel(this.refreshInterval)
  27840. }
  27841. ,
  27842. n.prototype.refreshUpdateInterval = function(e) {
  27843. e || (e = 0),
  27844. this.refreshInterval = window.setTimeout(function() {
  27845. var e = this.update();
  27846. e ? this.refreshUpdateInterval(n.ACTIVE_REFRESH_DELAY) : this.refreshUpdateInterval(n.IDLE_REFRESH_DELAY)
  27847. }
  27848. .bind(this), e)
  27849. }
  27850. ,
  27851. n.prototype.update = function() {
  27852. var e = this.forceQueue.length > 0;
  27853. return this.processQueueForDownloading(this.forceQueue),
  27854. this.processPriorityQueue && (this.queuePrioritizedTilesForPanos(this.panos),
  27855. this.priorityQueue.length > 0 && (e = !0),
  27856. this.processQueueForDownloading(this.priorityQueue)),
  27857. e
  27858. }
  27859. ,
  27860. n.prototype.forceQueueTilesForPano = function() {
  27861. var e = []
  27862. , t = [];
  27863. return function(i, n, r, o, a, s) {
  27864. e.length = 0;
  27865. for (var u = this.getTileDownloadDescriptors(i, n), d = 0; d < u.length; d++) {
  27866. var p = u[d];
  27867. p.status !== h.None && p.status !== h.Queued || e.push(p)
  27868. }
  27869. if (r && e.length > 0) {
  27870. l.sortPanoTiles(e, i, r),
  27871. t.length = 0,
  27872. c.matchingTilesInDirection(i, n, r, o, a, t);
  27873. for (var f = 0, g = function(e) {
  27874. return e.face === m.face && e.faceTileIndex === m.faceTileIndex
  27875. }; f < e.length; ) {
  27876. var m = e[f]
  27877. , v = t.findIndex(g);
  27878. v < 0 ? e.splice(f, 1) : f++
  27879. }
  27880. }
  27881. for (var A = 0; A < e.length; A++)
  27882. this.forceQueue.push(e[A]);
  27883. this.setStatusForAllDescriptors(this.forceQueue, h.ForceQueued),
  27884. this.clearFromQueue(this.priorityQueue, h.ForceQueued, !1),
  27885. s && this.processQueueForDownloading(this.forceQueue, !0)
  27886. }
  27887. }(),
  27888. n.prototype.clearForceQueue = function() {
  27889. this.clearQueue(this.forceQueue)
  27890. }
  27891. ,
  27892. n.prototype.queuePrioritizedTilesForPanos = function(e) {
  27893. this.tilePrioritizer && (this.clearQueue(this.priorityQueue),
  27894. this.tilePrioritizer.filterAndPrioritize(this.priorityQueue, e, this),
  27895. this.clearFromQueue(this.priorityQueue, h.None, !0),
  27896. this.setStatusOrRemoveForAllDescriptors(this.priorityQueue, h.Queued))
  27897. }
  27898. ,
  27899. n.prototype.clearQueue = function(e) {
  27900. this.setStatusForAllDescriptors(e, h.None),
  27901. e.length = 0
  27902. }
  27903. ,
  27904. n.prototype.clearFromQueue = function(e, t, i) {
  27905. for (var n = 0; n < e.length; n++) {
  27906. var r = e[n];
  27907. r && (t === r.status && !i || t !== r.status && i) && (e[n] = null)
  27908. }
  27909. }
  27910. ,
  27911. n.prototype.setStatusForAllDescriptors = function(e, t) {
  27912. for (var i = 0; i < e.length; i++) {
  27913. var n = e[i];
  27914. n && (n.status = t)
  27915. }
  27916. }
  27917. ,
  27918. n.prototype.setStatusOrRemoveForAllDescriptors = function(e, t) {
  27919. for (var i = 0; i < e.length; i++) {
  27920. var n = e[i];
  27921. n && (n.status !== t ? n.status = t : e[i] = null)
  27922. }
  27923. }
  27924. ,
  27925. n.prototype.getTileDownloadDescriptors = function(e, t) {
  27926. var i = this.getAllTileDownloadDescriptorsForPano(e)
  27927. , n = i[t];
  27928. return n || (n = this.buildDownloadDescriptorArray(t),
  27929. i[t] = n,
  27930. this.initTileDownloadDescriptors(n, e, t)),
  27931. n
  27932. }
  27933. ,
  27934. n.prototype.getAllTileDownloadDescriptorsForPano = function(e) {
  27935. var t = this.downloadDescriptors[e.id];
  27936. return t || (t = {},
  27937. this.downloadDescriptors[e.id] = t),
  27938. t
  27939. }
  27940. ,
  27941. n.prototype.processQueueForDownloading = function(e, t) {
  27942. if (this.cleanupActiveDownloads(),
  27943. this.activeDownloads.length < this.concurrentDownloads || t)
  27944. for (var i = t ? e.length : this.concurrentDownloads - this.activeDownloads.length, n = 0, r = 0; n < i && e.length > 0; r++) {
  27945. var o = e.shift();
  27946. o && (this.startDownload(o),
  27947. n++)
  27948. }
  27949. }
  27950. ,
  27951. n.prototype.testDownload = function(e, t, i) {
  27952. var n = this.downloadTestResults[e];
  27953. if (n)
  27954. return void (n === g.Success ? i(!0) : n === g.Fail && i(!1));
  27955. this.downloadTestResults[e] = g.Testing;
  27956. var r = this.panos.list[0]
  27957. , o = this.getTileUrl(r.id, e, t, 0)
  27958. , a = function(t) {
  27959. this.downloadTestResults[e] = g.Success,
  27960. i(!0)
  27961. }
  27962. .bind(this)
  27963. , s = function() {
  27964. this.downloadTestResults[e] = g.Fail,
  27965. i(!1)
  27966. }
  27967. .bind(this);
  27968. this.loadImage(o, 0, a, s)
  27969. }
  27970. ,
  27971. n.prototype.startDownload = function(e) {
  27972. e.status = h.Downloading;
  27973. var t = this.getTileUrl(e.pano.id, e.panoSize, e.tileSize, e.tileIndex);
  27974. this.activeDownloads.push(e),
  27975. this.loadImage(t, n.DOWNLOAD_RETRIES, this.downloadComplete.bind(this, e), this.downloadFailed.bind(this, e))
  27976. }
  27977. ,
  27978. n.prototype.downloadFailed = function(e, t) {}
  27979. ,
  27980. n.prototype.downloadComplete = function(e, t) {
  27981. if (e.panoGroupId === this.panoGroupId) {
  27982. var i = this.getPanoLoadCallbacks(e.pano, e.panoSize);
  27983. e.status = h.Downloaded,
  27984. i && i.onProgress && i.onProgress(e.pano, e.panoSize);
  27985. var n = {
  27986. panoId: e.pano.id,
  27987. image: t,
  27988. tileSize: e.tileSize,
  27989. panoSize: e.panoSize,
  27990. tileIndex: e.tileIndex,
  27991. faceTileIndex: e.faceTileIndex,
  27992. totalTiles: e.totalTiles,
  27993. face: e.face,
  27994. tileX: e.tileX,
  27995. tileY: e.tileY,
  27996. direction: e.direction
  27997. };
  27998. e.image = t,
  27999. this.emit(s.TileDownloadSuccess, n),
  28000. this.isPanoDownloaded(e.pano, e.panoSize) && (n = {
  28001. panoId: e.pano.id,
  28002. tileSize: e.tileSize,
  28003. panoSize: e.panoSize
  28004. },
  28005. this.emit(s.PanoDownloadComplete, n),
  28006. i && i.onLoad && i.onLoad(e.pano, e.panoSize))
  28007. }
  28008. }
  28009. ,
  28010. n.prototype.cleanupActiveDownloads = function() {
  28011. var e = [];
  28012. return function() {
  28013. e.length = 0;
  28014. for (var t = 0; t < this.activeDownloads.length; t++) {
  28015. var i = this.activeDownloads[t];
  28016. i.status !== h.Downloaded && i.status !== h.Failed && e.push(i)
  28017. }
  28018. this.activeDownloads.length = 0,
  28019. this.activeDownloads.push.apply(this.activeDownloads, e)
  28020. }
  28021. }(),
  28022. n.prototype.isPanoDownloaded = function(e, t) {
  28023. var i = this.getTileDownloadDescriptors(e, t);
  28024. if (i.length <= 0)
  28025. return !1;
  28026. for (var n = 0; n < i.length; n++) {
  28027. var r = i[n];
  28028. if (r.status !== h.Downloaded)
  28029. return !1
  28030. }
  28031. return !0
  28032. }
  28033. ,
  28034. n.prototype.setPanoLoadCallbacks = function(e, t, i, n, r) {
  28035. var o = e.id + ":" + this.qualityManager.getPanoSize(t);
  28036. this.panoLoadCallbacks[o] = {
  28037. onLoad: i,
  28038. onFail: n,
  28039. onProgress: r
  28040. }
  28041. }
  28042. ,
  28043. n.prototype.getPanoLoadCallbacks = function(e, t) {
  28044. var i = e.id + ":" + t;
  28045. return this.panoLoadCallbacks[i]
  28046. }
  28047. ,
  28048. n.prototype.buildDownloadDescriptorArray = function(e) {
  28049. for (var t = c.getTileCountForSize(e), i = [], n = 0; n < t; n++) {
  28050. var r = this.buildDownloadDescriptor();
  28051. i.push(r)
  28052. }
  28053. return i
  28054. }
  28055. ,
  28056. n.prototype.buildDownloadDescriptor = function() {
  28057. var e = {
  28058. panoGroupId: null,
  28059. pano: null,
  28060. panoSize: -1,
  28061. tileSize: -1,
  28062. tileIndex: -1,
  28063. totalTiles: -1,
  28064. faceTileIndex: -1,
  28065. status: h.None,
  28066. url: null,
  28067. image: null,
  28068. direction: new r.Vector3,
  28069. face: -1,
  28070. cubeFace: -1,
  28071. tileX: -1,
  28072. tileY: -1
  28073. };
  28074. return e
  28075. }
  28076. ,
  28077. n.prototype.initTileDownloadDescriptors = function(e, t, i) {
  28078. for (var n = 0; n < e.length; n++) {
  28079. var r = e[n];
  28080. this.initTileDownloadDescriptor(r, t, i, n)
  28081. }
  28082. }
  28083. ,
  28084. n.prototype.initTileDownloadDescriptor = function(e, t, i, n) {
  28085. var r = i >= c.TILE_SIZE ? c.TILE_SIZE : i;
  28086. e.face = c.getFaceForTile(i, n),
  28087. e.cubeFace = u.mapFaceToCubemapFace(e.face),
  28088. e.panoGroupId = this.panoGroupId,
  28089. e.pano = t,
  28090. e.panoSize = i,
  28091. e.tileSize = r,
  28092. e.tileIndex = n,
  28093. e.totalTiles = c.getTileCountForSize(i),
  28094. e.status = h.None,
  28095. e.image = null,
  28096. c.getTileLocation(e.panoSize, e.tileIndex, e),
  28097. c.getTileVector(e.panoSize, e.tileSize, e.cubeFace, e.tileX, e.tileY, c.LocationOnTile.Center, 0, e.direction)
  28098. }
  28099. ,
  28100. n.prototype.getTileUrl = function() {
  28101. var e = {
  28102. 256: "256",
  28103. 512: "512",
  28104. 1024: "1k",
  28105. 2048: "2k",
  28106. 4096: "4k"
  28107. }
  28108. , t = {
  28109. face: -1,
  28110. faceTileIndex: -1,
  28111. tileX: -1,
  28112. tileY: -1
  28113. };
  28114. return function(i, n, r, a) {
  28115. c.getTileLocation(n, a, t);
  28116. var s = Math.floor(n / r)
  28117. , l = s * s
  28118. , h = Math.floor(a / l)
  28119. , u = "";
  28120. 1 === o.tiling.customCompression && (u = "_" + o.tiling["q" + e[n]]);
  28121. var d = this.urls.get("tiles/" + i + "/" + e[n] + u + "_face" + h + "_" + t.tileX + "_" + t.tileY + ".jpg");
  28122. return d = p.changeIfTileGenerating(d)
  28123. }
  28124. }(),
  28125. n.prototype.loadImage = function(e, t, i, n) {
  28126. d.getImage(e, t).then(function(e) {
  28127. i(e)
  28128. }).fail(n)
  28129. }
  28130. ,
  28131. t.exports = n
  28132. }
  28133. ).call(this, "/js/tile/TileDownloader.js")
  28134. }
  28135. , {
  28136. "../ab": 3,
  28137. "../enum/DownloadStatus": 24,
  28138. "../enum/GLCubeFaces": 25,
  28139. "../enum/PanoSizeClass": 36,
  28140. "../enum/TileDownloaderEvents": 45,
  28141. "../enum/Vectors": 50,
  28142. "../enum/Viewmode": 51,
  28143. "../objects/Panorama": 148,
  28144. "../settings": 166,
  28145. "../util/ajax": 181,
  28146. "../util/logger": 189,
  28147. "../util/panorama": 191,
  28148. "./TilePrioritizer": 172,
  28149. "./TileUtils": 174,
  28150. events: 202,
  28151. three: 217
  28152. }],
  28153. 172: [function(e, t, i) {
  28154. (function(i) {
  28155. "use strict";
  28156. function n(e, t, i, o, a) {
  28157. this.qualityManager = e,
  28158. this.maxNavQuality = this.qualityManager.getMaxNavPanoSize(),
  28159. this.maxZoomQuality = this.qualityManager.getMaxZoomPanoSize(),
  28160. this.baseSize = t,
  28161. this.standardSize = i,
  28162. this.highSize = o,
  28163. this.ultraHighSize = a,
  28164. this.priorityCriteria = new n.PriorityCriteria(null,new r.Vector3(0,0,0),new r.Vector3(0,0,-1),new r.Vector3(0,0,-1))
  28165. }
  28166. var r = e("three")
  28167. , o = (e("../enum/Viewmode"),
  28168. e("../settings"),
  28169. e("../settings"),
  28170. e("../objects/Panorama"))
  28171. , a = e("../util/logger")
  28172. , s = (e("../enum/Vectors"),
  28173. e("../enum/PanoSizeClass"),
  28174. e("../enum/ModelManagerEvents"),
  28175. e("../enum/GLCubeFaces"),
  28176. e("../enum/DownloadStatus"))
  28177. , l = (e("../util/browser"),
  28178. e("./TileUtils"))
  28179. , c = e("../util/math")
  28180. , h = (e("events").EventEmitter,
  28181. new a(i),
  28182. Object.freeze({
  28183. None: 0,
  28184. DirectionalFOV: 1
  28185. }));
  28186. n.PriorityCriteria = function(e, t, i, n, o) {
  28187. this.pano = e,
  28188. this.cameraPosition = (new r.Vector3).copy(t),
  28189. this.cameraDir = (new r.Vector3).copy(i),
  28190. this.panoSpaceDir = (new r.Vector3).copy(n),
  28191. this.upcomingPanos = o,
  28192. this.copy = function(e) {
  28193. this.pano = e.pano,
  28194. this.cameraPosition.copy(e.cameraPosition),
  28195. this.cameraDir.copy(e.cameraDir),
  28196. this.panoSpaceDir.copy(e.panoSpaceDir),
  28197. this.upcomingPanos = o
  28198. }
  28199. ,
  28200. this.zoomingActive = !1
  28201. }
  28202. ,
  28203. n.DIRECTIONAL_FOV = 180,
  28204. n.DIRECTIONAL_FOV_NARROW = 120,
  28205. n.MAX_SCORED_PANOS_TOCONSIDER = 6,
  28206. n.MAX_SCORED_PANOS_TOADD = 2,
  28207. n.MAX_UPCOMING_PANOS_TOADD = 3,
  28208. n.DIRECTION_SCORE_STRICTNESS = .75,
  28209. n.appendQueue = function(e, t) {
  28210. if (e && t)
  28211. for (var i = 0; i < t.length; i++)
  28212. e.push(t[i])
  28213. }
  28214. ,
  28215. n.prototype.updateCriteria = function(e, t, i, n) {
  28216. this.priorityCriteria.pano = e,
  28217. this.priorityCriteria.cameraPosition.copy(t),
  28218. this.priorityCriteria.cameraDir.copy(i),
  28219. this.priorityCriteria.upcomingPanos = n,
  28220. this.maxNavQuality = this.qualityManager.getMaxNavPanoSize(),
  28221. this.maxZoomQuality = this.qualityManager.getMaxZoomPanoSize()
  28222. if(!player.panoRenderer.isPanoZoomed(e.id)){ //xzw add,直到到达该点后才能下载4k,否则不会渲染到zoomRenderTarget上
  28223. this.maxNavQuality = Math.min(2048, this.maxNavQuality)
  28224. this.maxZoomQuality = Math.min(2048, this.maxZoomQuality)
  28225. }
  28226. }
  28227. ,
  28228. n.prototype.filterAndPrioritize = function() {
  28229. var e = []
  28230. , t = []
  28231. , i = [];
  28232. return function(r, o, a) {
  28233. this.populateNeighborPanos(this.priorityCriteria.pano, o, e),
  28234. this.populateScoredPanos(this.priorityCriteria.pano, o, t, this.priorityCriteria.cameraDir, n.MAX_SCORED_PANOS_TOCONSIDER);
  28235. var s = this.baseSize
  28236. , l = this.standardSize
  28237. , c = this.highSize
  28238. , h = this.ultraHighSize;
  28239. this.queueTilesForPano(r, a, this.priorityCriteria.pano, s),
  28240. this.priorityCriteria.upcomingPanos && this.queueTilesForPanos(r, this.priorityCriteria.upcomingPanos, a, s, n.MAX_UPCOMING_PANOS_TOADD),
  28241. this.priorityCriteria.upcomingPanos && this.queueTilesForPanos(r, this.priorityCriteria.upcomingPanos, a, 1024 , n.MAX_UPCOMING_PANOS_TOADD),//更清晰些
  28242. i.length = 0,
  28243. this.canDownloadSize(l) && this.queueTilesInDirectionForPano(i, a, this.priorityCriteria.pano, l, this.priorityCriteria.cameraPosition, this.priorityCriteria.cameraDir, n.DIRECTIONAL_FOV_NARROW),
  28244. n.sortPanoTiles(i, this.priorityCriteria.pano, this.priorityCriteria.cameraDir),
  28245. n.appendQueue(r, i),
  28246. this.queueTilesForPanos(r, t, a, s, n.MAX_SCORED_PANOS_TOADD),
  28247. i.length = 0,
  28248. this.canDownloadSize(c) && this.queueTilesInDirectionForPano(i, a, this.priorityCriteria.pano, c, this.priorityCriteria.cameraPosition, this.priorityCriteria.cameraDir, n.DIRECTIONAL_FOV_NARROW),
  28249. this.canDownloadSize(h) && this.queueTilesInDirectionForPano(i, a, this.priorityCriteria.pano, h, this.priorityCriteria.cameraPosition, this.priorityCriteria.cameraDir, n.DIRECTIONAL_FOV_NARROW),
  28250. n.sortPanoTiles(i, this.priorityCriteria.pano, this.priorityCriteria.cameraDir),
  28251. n.appendQueue(r, i),
  28252. i.length = 0,
  28253. this.canDownloadSize(l) && this.queueTilesInDirectionForPano(i, a, this.priorityCriteria.pano, l, this.priorityCriteria.cameraPosition, this.priorityCriteria.cameraDir, n.DIRECTIONAL_FOV),
  28254. this.canDownloadSize(c) && this.queueTilesInDirectionForPano(i, a, this.priorityCriteria.pano, c, this.priorityCriteria.cameraPosition, this.priorityCriteria.cameraDir, n.DIRECTIONAL_FOV),
  28255. this.canDownloadSize(h) && this.queueTilesInDirectionForPano(i, a, this.priorityCriteria.pano, h, this.priorityCriteria.cameraPosition, this.priorityCriteria.cameraDir, n.DIRECTIONAL_FOV),
  28256. n.sortPanoTiles(i, this.priorityCriteria.pano, this.priorityCriteria.cameraDir),
  28257. n.appendQueue(r, i),
  28258. this.queueTilesForPanos(r, e, a, s)
  28259. }
  28260. }(),
  28261. n.prototype.canDownloadSize = function(e) {
  28262. return this.maxNavQuality >= e || this.maxZoomQuality >= e && this.zoomingActive
  28263. }
  28264. ,
  28265. n.prototype.populateNeighborPanos = function(e, t, i) {
  28266. i = i || [],
  28267. i.length = 0;
  28268. var n = t.getNeighbours(e);
  28269. for (var r in n)
  28270. if (n.hasOwnProperty(r)) {
  28271. var o = t.get(r);
  28272. i.push(o)
  28273. }
  28274. return i
  28275. }
  28276. ,
  28277. n.prototype.populateScoredPanos = function(e, t, i, r, a) {
  28278. i = i || [],
  28279. i.length = 0;
  28280. var s = [o.filters.inPanoDirection(e.position, r, n.DIRECTION_SCORE_STRICTNESS), o.filters.not(e)]
  28281. , l = [o.scoreFunctions.distanceSquared(e), o.scoreFunctions.direction(e.position, r)]
  28282. , c = t.sortByScore(s, l);
  28283. if (c)
  28284. for (var h = 0; h < c.length && h < a; h++) {
  28285. var u = c[h].item;
  28286. i.push(u)
  28287. }
  28288. return i
  28289. }
  28290. ,
  28291. n.prototype.queueTilesForPanos = function(e, t, i, n, r) {
  28292. for (var o = 0, a = 0; a < t.length; a++) {
  28293. var s = t[a]
  28294. , l = this.queueTilesForPano(e, i, s, n);
  28295. if (o += l > 0 ? 1 : 0,
  28296. r && o >= r)
  28297. break
  28298. }
  28299. return o
  28300. }
  28301. ,
  28302. n.prototype.queueTilesForPano = function() {
  28303. var e = {
  28304. filter: h.None
  28305. };
  28306. return function(t, i, n, r) {
  28307. return this.filterAndQueueTileDownloadDescriptors(t, i, n, r, e)
  28308. }
  28309. }(),
  28310. n.prototype.queueTilesForPanosInDirection = function() {
  28311. var e = new r.Vector3;
  28312. return function(t, i, n, r, o, a, s, l) {
  28313. for (var h = 0, u = 0; u < n.length; u++) {
  28314. var d = n[u];
  28315. e.copy(d.position),
  28316. e.sub(o),
  28317. e.normalize();
  28318. var p = Math.max(Math.min(a.dot(e), 1), -1)
  28319. , f = c.getFOVDotThreshold(s);
  28320. if (p >= f) {
  28321. var g = this.queueTilesInDirectionForPano(t, i, d, r, o, a, s);
  28322. if (h += g > 0 ? 1 : 0,
  28323. l && h >= l)
  28324. break
  28325. }
  28326. }
  28327. return h
  28328. }
  28329. }(),
  28330. n.prototype.queueTilesInDirectionForPanos = function(e, t, i, n, r, o, a, s) {
  28331. for (var l = 0, c = 0; c < i.length; c++) {
  28332. var h = i[c]
  28333. , u = this.queueTilesInDirectionForPano(e, t, h, n, o, a);
  28334. if (l += u > 0 ? 1 : 0,
  28335. s && l >= s)
  28336. break
  28337. }
  28338. return l
  28339. }
  28340. ,
  28341. n.prototype.queueTilesInDirectionForPano = function() {
  28342. var e = {
  28343. filter: h.DirectionalFOV,
  28344. direction: new r.Vector3,
  28345. fov: 60
  28346. }
  28347. , t = new r.Vector3;
  28348. return function(i, n, r, o, a, s, c) {
  28349. return t.copy(s),
  28350. l.getRelativeDirection(r.quaternion, t),
  28351. e.direction.copy(t),
  28352. e.fov = c,
  28353. this.filterAndQueueTileDownloadDescriptors(i, n, r, o, e)
  28354. }
  28355. }(),
  28356. n.prototype.filterAndQueueTileDownloadDescriptors = function() {
  28357. var e = [];
  28358. return function(t, i, n, r, o) {
  28359. var a = i.getTileDownloadDescriptors(n, r);
  28360. e.length = 0,
  28361. this.filterTileDownloadDescriptors(n, a, e, o);
  28362. for (var s = 0, l = 0; l < e.length; l++) {
  28363. var c = e[l];
  28364. c && (t.push(c),
  28365. s++)
  28366. }
  28367. return s
  28368. }
  28369. }(),
  28370. n.prototype.filterTileDownloadDescriptors = function() {
  28371. new r.Vector3;
  28372. return function(e, t, i, n) {
  28373. var r, o;
  28374. switch (n.filter) {
  28375. case h.DirectionalFOV:
  28376. for (r = 0; r < t.length; r++)
  28377. o = t[r],
  28378. l.isTileWithinFOV(o.panoSize, o.tileSize, o.face, o.tileX, o.tileY, n.direction, n.fov) && i.push(o);
  28379. break;
  28380. default:
  28381. for (r = 0; r < t.length; r++)
  28382. o = t[r],
  28383. i.push(o)
  28384. }
  28385. for (r = 0; r < i.length; r++)
  28386. o = i[r],
  28387. this.canIncludeDescriptor(o) || (i[r] = null)
  28388. }
  28389. }(),
  28390. n.prototype.canIncludeDescriptor = function(e) {
  28391. return e.status !== s.Downloading && e.status !== s.Downloaded
  28392. }
  28393. ,
  28394. n.prototype.canIncludePano = function(e, t) {
  28395. return !e.isLoaded(t)
  28396. }
  28397. ,
  28398. n.getFOVDotThreshold = function(e) {
  28399. return Math.cos(r.Math.degToRad(e / 2))
  28400. }
  28401. ;
  28402. var u = function() {
  28403. var e = function e(t, i) {
  28404. var n = e._panoSpaceDir
  28405. , r = e._fovThreshold
  28406. , o = e._fovThresholdNarrow
  28407. , a = Math.max(Math.min(n.dot(t.direction), 1), -1)
  28408. , s = Math.max(Math.min(n.dot(i.direction), 1), -1);
  28409. return t._dot = a,
  28410. i._dot = s,
  28411. 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)
  28412. };
  28413. return e._panoSpaceDir = new r.Vector3,
  28414. e._fovThreshold = -1,
  28415. e._fovThresholdNarrow = -1,
  28416. e
  28417. }();
  28418. n.sortPanoTiles = function(e, t, i) {
  28419. u._panoSpaceDir.copy(i),
  28420. l.getRelativeDirection(t.quaternion, u._panoSpaceDir),
  28421. u._fovThresholdNarrow = c.getFOVDotThreshold(n.DIRECTIONAL_FOV_NARROW),
  28422. u._fovThreshold = c.getFOVDotThreshold(n.DIRECTIONAL_FOV),
  28423. e.sort(u)
  28424. }
  28425. ,
  28426. n.insertSortedPanoTile = function(e, t, i, r) {
  28427. u._panoSpaceDir.copy(r),
  28428. l.getRelativeDirection(i.quaternion, u._panoSpaceDir),
  28429. u._fovThresholdNarrow = c.getFOVDotThreshold(n.DIRECTIONAL_FOV_NARROW),
  28430. u._fovThreshold = c.getFOVDotThreshold(n.DIRECTIONAL_FOV);
  28431. for (var o = -1, a = 0; a < e.length; a++) {
  28432. var s = u(t, e[a]);
  28433. if (s <= 0) {
  28434. o = a;
  28435. break
  28436. }
  28437. }
  28438. if (o === -1)
  28439. e[e.length] = t;
  28440. else {
  28441. for (var h = e.length; h > o; h--)
  28442. e[h] = e[h - 1];
  28443. e[o] = t
  28444. }
  28445. }
  28446. ,
  28447. n.prototype.setZoomingActive = function(e) {
  28448. e !== this.zoomingActive && (this.zoomingActive = e)
  28449. }
  28450. ,
  28451. t.exports = n
  28452. }
  28453. ).call(this, "/js/tile/TilePrioritizer.js")
  28454. }
  28455. , {
  28456. "../enum/DownloadStatus": 24,
  28457. "../enum/GLCubeFaces": 25,
  28458. "../enum/ModelManagerEvents": 33,
  28459. "../enum/PanoSizeClass": 36,
  28460. "../enum/Vectors": 50,
  28461. "../enum/Viewmode": 51,
  28462. "../objects/Panorama": 148,
  28463. "../settings": 166,
  28464. "../util/browser": 182,
  28465. "../util/logger": 189,
  28466. "../util/math": 190,
  28467. "./TileUtils": 174,
  28468. events: 202,
  28469. three: 217
  28470. }],
  28471. 173: [function(e, t, i) {
  28472. "use strict";
  28473. function n(e, t) {
  28474. this.levels = t,
  28475. this.tileSize = e,
  28476. this.root = null,
  28477. this.allNodes = [],
  28478. a(this)
  28479. }
  28480. function r(e, t) {
  28481. this.tree = e,
  28482. this.parent = t,
  28483. this.children = [],
  28484. this.id = ++u
  28485. }
  28486. function o(e, t, i, r, a, s, l, h) {
  28487. if (e) {
  28488. l = l || n.TraversalType.PreOrder;
  28489. var u = r * c + i;
  28490. if (l === n.TraversalType.PreOrder && (a && a(e, t, u, i, r),
  28491. s && s.push(e)),
  28492. e.children && 0 !== e.children.length) {
  28493. for (var d = r * c, p = i * c, f = 0; f < c; f++)
  28494. for (var g = 0; g < c; g++)
  28495. o(e.children[g * c + f], t + 1, p + f, d + g, a, s, l, h);
  28496. l === n.TraversalType.PostOrder && (a && a(e, t, u, i, r),
  28497. s && s.push(e))
  28498. }
  28499. }
  28500. }
  28501. function a(e) {
  28502. e.root = s(e, null, 0)
  28503. }
  28504. function s(e, t, i) {
  28505. if (i > e.levels)
  28506. return null;
  28507. var n = new r(e,t);
  28508. e.allNodes.push(n);
  28509. for (var o = 0; o < h; o++)
  28510. n.children[o] = s(e, n, i + 1);
  28511. return n
  28512. }
  28513. function l(e, t, i, n, r) {
  28514. if (!e)
  28515. return null;
  28516. if (0 === i)
  28517. return e;
  28518. if (!e.children || 0 === e.children.length)
  28519. return null;
  28520. var o = Math.pow(c, i)
  28521. , a = o / c
  28522. , s = n % a
  28523. , h = r % a
  28524. , u = Math.floor(r / a)
  28525. , d = Math.floor(n / a)
  28526. , p = u * c + d
  28527. , f = e.children[p];
  28528. return l(f, t + 1, i - 1, s, h)
  28529. }
  28530. var c = (e("three"),
  28531. e("./TileUtils"),
  28532. e("../objects/Panorama"),
  28533. e("../util/panorama"),
  28534. e("events").EventEmitter,
  28535. 2)
  28536. , h = c * c;
  28537. n.TraversalType = Object.freeze({
  28538. PreOrder: 0,
  28539. PostOrder: 1
  28540. });
  28541. var u = 0;
  28542. n.getLevelCountForSize = function(e, t) {
  28543. var i = 0;
  28544. for (t < e && (t = e); ; ) {
  28545. if (t /= c,
  28546. t < e)
  28547. break;
  28548. i++
  28549. }
  28550. return i
  28551. }
  28552. ,
  28553. n.getSizeForLevel = function(e, t) {
  28554. return Math.pow(c, t) * e
  28555. }
  28556. ,
  28557. n.prototype.getSubNode = function(e, t, i) {
  28558. (!t || e < this.tileSize) && (t = 0),
  28559. (!i || e < this.tileSize) && (i = 0),
  28560. e < this.tileSize && (e = this.tileSize);
  28561. var r = n.getLevelCountForSize(this.tileSize, e)
  28562. , o = l(this.root, 0, r, t, i);
  28563. return o
  28564. }
  28565. ,
  28566. n.prototype.breadthFirst = function(e) {
  28567. e = e || {};
  28568. var t = !!e.nullLevelEnd
  28569. , i = e.maxLevel
  28570. , n = e.minLevel
  28571. , r = e.callback
  28572. , o = e.saveVisited
  28573. , a = []
  28574. , s = {}
  28575. , l = 0
  28576. , c = 0;
  28577. for (a.push(this.root),
  28578. a.push(s); a.length > 0 && !(i && l > i); ) {
  28579. var h = a.shift();
  28580. if (h === s)
  28581. (!n || l >= n) && (r && t && r(null),
  28582. o && t && o.push(null)),
  28583. a.length > 0 && a.push(s),
  28584. l++,
  28585. c = 0;
  28586. else {
  28587. if (h.children)
  28588. for (var u = 0; u < h.children.length; u++) {
  28589. var d = h.children[u];
  28590. d && a.push(h.children[u])
  28591. }
  28592. var p = this.getFaceIndexFromNode(h);
  28593. (!n || l >= n) && (r && r(h, l, p),
  28594. o && o.push(h)),
  28595. c++
  28596. }
  28597. }
  28598. }
  28599. ,
  28600. n.prototype.getFaceIndexFromNode = function(e) {
  28601. if (!e)
  28602. return -1;
  28603. for (var t = 1, i = e, n = 0, r = 0; ; ) {
  28604. var o = i.parent;
  28605. if (!o)
  28606. break;
  28607. for (var a = -1, s = 0; s < o.children.length; s++)
  28608. o.children[s] === i && (a = s);
  28609. var l = a % c
  28610. , h = Math.floor(a / c);
  28611. n = l * t + n,
  28612. r = h * t + r,
  28613. t *= c,
  28614. i = o
  28615. }
  28616. return r * t + n
  28617. }
  28618. ,
  28619. n.prototype.depthFirst = function(e, t, i) {
  28620. o(this.root, 0, 0, 0, e, t, i, this.tileSize)
  28621. }
  28622. ,
  28623. t.exports = n
  28624. }
  28625. , {
  28626. "../objects/Panorama": 148,
  28627. "../util/panorama": 191,
  28628. "./TileUtils": 174,
  28629. events: 202,
  28630. three: 217
  28631. }],
  28632. 174: [function(e, t, i) {
  28633. "use strict";
  28634. var n = e("../enum/GLCubeFaces")
  28635. , r = e("../util/MathLight")
  28636. , o = {};
  28637. o.TILE_SIZE = 512,
  28638. o.FACES_PER_PANO = 6,
  28639. o.LocationOnTile = {
  28640. Center: 0,
  28641. UpperLeft: 1,
  28642. UpperRight: 2,
  28643. LowerRight: 3,
  28644. LowerLeft: 4
  28645. },
  28646. o.getTileVector = function() {
  28647. return function(e, t, i, a, s, l, c, h) {
  28648. l = l || o.LocationOnTile.Center;
  28649. var u = e / t
  28650. , d = a / u;
  28651. s = -s + (u - 1);
  28652. var p = s / u
  28653. , f = t / e
  28654. , g = 2 * f
  28655. , m = g / 2
  28656. , v = 2 * d - 1 + m
  28657. , A = 2 * p - 1 + m;
  28658. switch (l) {
  28659. case o.LocationOnTile.UpperLeft:
  28660. v -= m,
  28661. A += m,
  28662. v += c * g;
  28663. break;
  28664. case o.LocationOnTile.UpperRight:
  28665. v += m,
  28666. A += m,
  28667. A -= c * g;
  28668. break;
  28669. case o.LocationOnTile.LowerRight:
  28670. v += m,
  28671. A -= m,
  28672. v -= c * g;
  28673. break;
  28674. case o.LocationOnTile.LowerLeft:
  28675. v -= m,
  28676. A -= m,
  28677. A += c * g;
  28678. break;
  28679. case o.LocationOnTile.Center:
  28680. }
  28681. switch (i) {
  28682. case n.GL_TEXTURE_CUBE_MAP_POSITIVE_X:
  28683. r.setVector(h, -1, A, -v);
  28684. break;
  28685. case n.GL_TEXTURE_CUBE_MAP_NEGATIVE_X:
  28686. r.setVector(h, 1, A, v);
  28687. break;
  28688. case n.GL_TEXTURE_CUBE_MAP_POSITIVE_Y:
  28689. r.setVector(h, -v, 1, -A);
  28690. break;
  28691. case n.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y:
  28692. r.setVector(h, -v, -1, A);
  28693. break;
  28694. case n.GL_TEXTURE_CUBE_MAP_POSITIVE_Z:
  28695. r.setVector(h, -v, A, 1);
  28696. break;
  28697. case n.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z:
  28698. r.setVector(h, v, A, -1)
  28699. }
  28700. r.normalize(h)
  28701. }
  28702. }(),
  28703. o.getFaceForTile = function(e, t) {
  28704. var i = o.TILE_SIZE;
  28705. e < o.TILE_SIZE && (i = e);
  28706. var n = Math.floor(e / i)
  28707. , r = n * n;
  28708. return Math.floor(t / r)
  28709. }
  28710. ,
  28711. o.getTileLocation = function(e, t, i) {
  28712. var n = o.TILE_SIZE;
  28713. e < o.TILE_SIZE && (n = e);
  28714. var r = o.getFaceForTile(e, t)
  28715. , a = Math.floor(e / n)
  28716. , s = a * a
  28717. , l = t - r * s;
  28718. i.tileX = l % a,
  28719. i.tileY = Math.floor(l / a),
  28720. i.face = r,
  28721. i.faceTileIndex = l
  28722. }
  28723. ,
  28724. o.getTileCountForSize = function(e) {
  28725. if (e <= o.TILE_SIZE)
  28726. return o.FACES_PER_PANO;
  28727. var t = Math.floor(e / o.TILE_SIZE)
  28728. , i = t * t
  28729. , n = i * o.FACES_PER_PANO;
  28730. return n
  28731. }
  28732. ,
  28733. o.getRelativeDirection = function() {
  28734. var e = new r.Matrix4
  28735. , t = new r.Quaternion;
  28736. return function(i, n) {
  28737. t.copy(i),
  28738. t.inverse(),
  28739. e.makeRotationFromQuaternion(t),
  28740. e.applyToVector3(n),
  28741. r.normalize(n)
  28742. }
  28743. }(),
  28744. o.matchingTilesInDirection = function() {
  28745. var e = new r.Vector3
  28746. , t = new r.Vector3(0,0,-1)
  28747. , i = new r.Quaternion
  28748. , n = function(e, t) {
  28749. e.push({
  28750. face: t.face,
  28751. faceTileIndex: t.faceTileIndex,
  28752. tileX: t.tileX,
  28753. tileY: t.tileY
  28754. })
  28755. }
  28756. , a = function() {
  28757. var e = {
  28758. face: -1,
  28759. faceTileIndex: -1,
  28760. tileX: -1,
  28761. tileY: -1
  28762. };
  28763. return function(t, i, r) {
  28764. for (var a = o.getTileCountForSize(t), s = 0, l = 0; l < a; l++)
  28765. o.getTileLocation(t, l, e),
  28766. i && !i(e) || (s++,
  28767. r && n(r, e));
  28768. return s
  28769. }
  28770. }();
  28771. return function(n, s, l, c, h, u) {
  28772. var d = s < o.TILE_SIZE ? s : o.TILE_SIZE;
  28773. o.getTileCountForSize(s);
  28774. if (!c && !h)
  28775. return a(s, null, u);
  28776. var p = !!h;
  28777. if (h = h || c,
  28778. h = Math.max(0, Math.min(h, 360)),
  28779. c = Math.max(0, Math.min(c, 360)),
  28780. r.copyVector(l, e),
  28781. o.getRelativeDirection(n.quaternion, e),
  28782. p) {
  28783. i.setFromUnitVectors(e, t);
  28784. var f = function(e) {
  28785. return o.isTileWithinFrustum(s, d, e.face, e.tileX, e.tileY, i, c, h)
  28786. };
  28787. return a(s, f, u)
  28788. }
  28789. var g = function(t) {
  28790. return o.isTileWithinFOV(s, d, t.face, t.tileX, t.tileY, e, c)
  28791. };
  28792. return a(s, g, u)
  28793. }
  28794. }(),
  28795. o.isTileWithinFrustum = function() {
  28796. var e = new r.Vector3
  28797. , t = 1e-5;
  28798. return function(i, n, a, s, l, c, h, u) {
  28799. 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++)
  28800. if (o.getTileVector(i, n, m, s, l, b, 0, e),
  28801. r.applyQuaternionToVector(c, e),
  28802. e.z >= -t)
  28803. I++;
  28804. else {
  28805. var w = -1 / e.z
  28806. , _ = e.x * w
  28807. , T = e.y * w;
  28808. T > d ? v++ : T < p && A++,
  28809. _ > f ? y++ : _ < g && C++,
  28810. E++
  28811. }
  28812. return A !== E && v !== E && y !== E && C !== E
  28813. }
  28814. }(),
  28815. o.isTileWithinFOV = function() {
  28816. var e = new r.Vector3
  28817. , t = new r.Vector3(0,1,0)
  28818. , i = new r.Vector3(1,0,0);
  28819. return function(n, a, s, l, c, h, u) {
  28820. var d = o.mapFaceToCubemapFace(s);
  28821. if (r.cross(h, t, i),
  28822. o.getTileVector(n, a, d, l, c, o.LocationOnTile.Center, 0, e),
  28823. o.isWithinFOV(e, h, u, null))
  28824. return !0;
  28825. for (var p = u / 360, f = Math.floor(1 / p), g = 0, m = 0; m < f; m++) {
  28826. for (var v = o.LocationOnTile.UpperLeft; v <= o.LocationOnTile.LowerLeft; v++)
  28827. if (o.getTileVector(n, a, d, l, c, v, g, e),
  28828. o.isWithinFOV(e, h, u, null))
  28829. return !0;
  28830. g += p
  28831. }
  28832. return !1
  28833. }
  28834. }(),
  28835. o.isWithinFOV = function() {
  28836. var e = new r.Vector3
  28837. , t = new r.Vector3;
  28838. return function(i, n, o, a) {
  28839. if (r.copyVector(i, t),
  28840. a) {
  28841. r.copyVector(a, e),
  28842. r.normalize(e);
  28843. var s = r.dot(e, i);
  28844. e.x *= s,
  28845. e.y *= s,
  28846. e.z *= s,
  28847. r.subVector(t, e)
  28848. }
  28849. var l = o / 2 * r.RADIANS_PER_DEGREE
  28850. , c = Math.cos(l)
  28851. , h = r.dot(t, n);
  28852. return h >= c
  28853. }
  28854. }(),
  28855. o.mapFaceToCubemapFace = function() {
  28856. var e = {
  28857. 0: n.GL_TEXTURE_CUBE_MAP_POSITIVE_Y,
  28858. 1: n.GL_TEXTURE_CUBE_MAP_POSITIVE_Z,
  28859. 2: n.GL_TEXTURE_CUBE_MAP_POSITIVE_X,
  28860. 3: n.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z,
  28861. 4: n.GL_TEXTURE_CUBE_MAP_NEGATIVE_X,
  28862. 5: n.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y
  28863. };
  28864. return function(t) {
  28865. return e[t]
  28866. }
  28867. }(),
  28868. t.exports = o
  28869. }
  28870. , {
  28871. "../enum/GLCubeFaces": 25,
  28872. "../util/MathLight": 176
  28873. }],
  28874. 175: [function(e, t, i) {
  28875. (function(i) {
  28876. "use strict";
  28877. function n() {
  28878. this.list = [],
  28879. this.index = {},
  28880. Object.defineProperty(this, "length", {
  28881. get: function() {
  28882. return this.list.length
  28883. }
  28884. })
  28885. }
  28886. var r = (e("./common"),
  28887. e("./logger"));
  28888. new r(i);
  28889. n.prototype.forEach = function(e) {
  28890. this.list.forEach(e)
  28891. }
  28892. ,
  28893. n.prototype.add = function(e) {
  28894. this.list.push(e),
  28895. this.index[this.getIndex(e)] = e
  28896. }
  28897. ,
  28898. n.prototype.getIndex = function(e) {
  28899. throw new Error("IndexedCollection.getIndex not implemented in subclass.")
  28900. }
  28901. ,
  28902. n.prototype.extend = function(e) {
  28903. for (var t = 0; t < e.length; t++)
  28904. this.add(e[t])
  28905. }
  28906. ,
  28907. n.prototype.get = function(e) {
  28908. return this.index[e]
  28909. }
  28910. ,
  28911. n.prototype.first = function() {
  28912. return this.list[0]
  28913. }
  28914. ,
  28915. n.prototype.last = function() {
  28916. return this.list[this.list.length - 1]
  28917. }
  28918. ,
  28919. n.prototype.reIndex = function() {
  28920. this.index = {};
  28921. var e = this;
  28922. this.forEach(function(t) {
  28923. e.index[e.getIndex(t)] = t
  28924. })
  28925. }
  28926. ,
  28927. n.prototype.filter = function(e) {
  28928. var t = this.list.filter(e);
  28929. return this.reIndex(),
  28930. t
  28931. }
  28932. ,
  28933. n.prototype.reduce = function(e, t) {
  28934. return this.list.reduce(e, t)
  28935. }
  28936. ,
  28937. n.prototype.sort = function(e) {
  28938. return this.list.sort(e)
  28939. }
  28940. ,
  28941. n.prototype.indexOf = function(e) {
  28942. for (var t = 0; t < this.list.length; ++t)
  28943. if (this.list[t] === e)
  28944. return t;
  28945. return -1
  28946. }
  28947. ,
  28948. t.exports = n
  28949. }
  28950. ).call(this, "/js/util/IndexedCollection.js")
  28951. }
  28952. , {
  28953. "./common": 185,
  28954. "./logger": 189
  28955. }],
  28956. 176: [function(e, t, i) {
  28957. "use strict";
  28958. var n = e("../constants")
  28959. , r = {};
  28960. r.RADIANS_PER_DEGREE = Math.PI / 180,
  28961. r.DEGREES_PER_RADIAN = 180 / Math.PI,
  28962. r.Vector3 = function(e, t, i) {
  28963. this.x = e || 0,
  28964. this.y = t || 0,
  28965. this.z = i || 0
  28966. }
  28967. ,
  28968. r.Matrix4 = function() {
  28969. this.elements = new Float32Array([1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1]),
  28970. arguments.length > 0 && console.error("MathLight.Matrix4: the constructor no longer reads arguments. use .set() instead.")
  28971. }
  28972. ,
  28973. r.Matrix4.prototype = {
  28974. identity: function() {
  28975. return this.set(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1),
  28976. this
  28977. },
  28978. copy: function(e) {
  28979. return this.elements.set(e.elements),
  28980. this
  28981. },
  28982. applyToVector3: function(e) {
  28983. var t = e.x
  28984. , i = e.y
  28985. , n = e.z
  28986. , r = this.elements;
  28987. return e.x = r[0] * t + r[4] * i + r[8] * n + r[12],
  28988. e.y = r[1] * t + r[5] * i + r[9] * n + r[13],
  28989. e.z = r[2] * t + r[6] * i + r[10] * n + r[14],
  28990. this
  28991. },
  28992. getInverse: function(e, t) {
  28993. var i = this.elements
  28994. , n = e.elements
  28995. , r = n[0]
  28996. , o = n[1]
  28997. , a = n[2]
  28998. , s = n[3]
  28999. , l = n[4]
  29000. , c = n[5]
  29001. , h = n[6]
  29002. , u = n[7]
  29003. , d = n[8]
  29004. , p = n[9]
  29005. , f = n[10]
  29006. , g = n[11]
  29007. , m = n[12]
  29008. , v = n[13]
  29009. , A = n[14]
  29010. , y = n[15]
  29011. , C = p * A * u - v * f * u + v * h * g - c * A * g - p * h * y + c * f * y
  29012. , I = m * f * u - d * A * u - m * h * g + l * A * g + d * h * y - l * f * y
  29013. , E = d * v * u - m * p * u + m * c * g - l * v * g - d * c * y + l * p * y
  29014. , b = m * p * h - d * v * h - m * c * f + l * v * f + d * c * A - l * p * A
  29015. , w = r * C + o * I + a * E + s * b;
  29016. if (0 === w) {
  29017. var _ = "MathLight.Matrix4.getInverse(): can't invert matrix, determinant is 0";
  29018. if (t)
  29019. throw new Error(_);
  29020. return console.warn(_),
  29021. this.identity()
  29022. }
  29023. var T = 1 / w;
  29024. return i[0] = C * T,
  29025. i[1] = (v * f * s - p * A * s - v * a * g + o * A * g + p * a * y - o * f * y) * T,
  29026. i[2] = (c * A * s - v * h * s + v * a * u - o * A * u - c * a * y + o * h * y) * T,
  29027. i[3] = (p * h * s - c * f * s - p * a * u + o * f * u + c * a * g - o * h * g) * T,
  29028. i[4] = I * T,
  29029. i[5] = (d * A * s - m * f * s + m * a * g - r * A * g - d * a * y + r * f * y) * T,
  29030. i[6] = (m * h * s - l * A * s - m * a * u + r * A * u + l * a * y - r * h * y) * T,
  29031. i[7] = (l * f * s - d * h * s + d * a * u - r * f * u - l * a * g + r * h * g) * T,
  29032. i[8] = E * T,
  29033. i[9] = (m * p * s - d * v * s - m * o * g + r * v * g + d * o * y - r * p * y) * T,
  29034. i[10] = (l * v * s - m * c * s + m * o * u - r * v * u - l * o * y + r * c * y) * T,
  29035. i[11] = (d * c * s - l * p * s - d * o * u + r * p * u + l * o * g - r * c * g) * T,
  29036. i[12] = b * T,
  29037. i[13] = (d * v * a - m * p * a + m * o * f - r * v * f - d * o * A + r * p * A) * T,
  29038. i[14] = (m * c * a - l * v * a - m * o * h + r * v * h + l * o * A - r * c * A) * T,
  29039. i[15] = (l * p * a - d * c * a + d * o * h - r * p * h - l * o * f + r * c * f) * T,
  29040. this
  29041. },
  29042. makeRotationFromQuaternion: function(e) {
  29043. var t = this.elements
  29044. , i = e.x
  29045. , n = e.y
  29046. , r = e.z
  29047. , o = e.w
  29048. , a = i + i
  29049. , s = n + n
  29050. , l = r + r
  29051. , c = i * a
  29052. , h = i * s
  29053. , u = i * l
  29054. , d = n * s
  29055. , p = n * l
  29056. , f = r * l
  29057. , g = o * a
  29058. , m = o * s
  29059. , v = o * l;
  29060. return t[0] = 1 - (d + f),
  29061. t[4] = h - v,
  29062. t[8] = u + m,
  29063. t[1] = h + v,
  29064. t[5] = 1 - (c + f),
  29065. t[9] = p - g,
  29066. t[2] = u - m,
  29067. t[6] = p + g,
  29068. t[10] = 1 - (c + d),
  29069. t[3] = 0,
  29070. t[7] = 0,
  29071. t[11] = 0,
  29072. t[12] = 0,
  29073. t[13] = 0,
  29074. t[14] = 0,
  29075. t[15] = 1,
  29076. this
  29077. }
  29078. },
  29079. r.Quaternion = function(e, t, i, n) {
  29080. this._x = e || 0,
  29081. this._y = t || 0,
  29082. this._z = i || 0,
  29083. this._w = void 0 !== n ? n : 1
  29084. }
  29085. ,
  29086. r.Quaternion.prototype = {
  29087. get x() {
  29088. return this._x
  29089. },
  29090. set x(e) {
  29091. this._x = e
  29092. },
  29093. get y() {
  29094. return this._y
  29095. },
  29096. set y(e) {
  29097. this._y = e
  29098. },
  29099. get z() {
  29100. return this._z
  29101. },
  29102. set z(e) {
  29103. this._z = e
  29104. },
  29105. get w() {
  29106. return this._w
  29107. },
  29108. set w(e) {
  29109. this._w = e
  29110. },
  29111. copy: function(e) {
  29112. this._x = e.x,
  29113. this._y = e.y,
  29114. this._z = e.z,
  29115. this._w = e.w
  29116. },
  29117. inverse: function() {
  29118. return this.conjugate().normalize()
  29119. },
  29120. conjugate: function() {
  29121. return this._x *= -1,
  29122. this._y *= -1,
  29123. this._z *= -1,
  29124. this
  29125. },
  29126. length: function() {
  29127. return Math.sqrt(this._x * this._x + this._y * this._y + this._z * this._z + this._w * this._w)
  29128. },
  29129. normalize: function() {
  29130. var e = this.length();
  29131. return 0 === e ? (this._x = 0,
  29132. this._y = 0,
  29133. this._z = 0,
  29134. this._w = 1) : (e = 1 / e,
  29135. this._x = this._x * e,
  29136. this._y = this._y * e,
  29137. this._z = this._z * e,
  29138. this._w = this._w * e),
  29139. this
  29140. },
  29141. setFromAxisAngle: function(e, t) {
  29142. var i = t / 2
  29143. , n = Math.sin(i);
  29144. return this._x = e.x * n,
  29145. this._y = e.y * n,
  29146. this._z = e.z * n,
  29147. this._w = Math.cos(i),
  29148. this
  29149. },
  29150. setFromUnitVectors: function() {
  29151. var e, t, i = 1e-6;
  29152. return function(n, o) {
  29153. return void 0 === e && (e = new r.Vector3),
  29154. t = r.dot(n, o) + 1,
  29155. t < i ? (t = 0,
  29156. 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),
  29157. this._x = e.x,
  29158. this._y = e.y,
  29159. this._z = e.z,
  29160. this._w = t,
  29161. this.normalize()
  29162. }
  29163. }(),
  29164. multiply: function(e) {
  29165. return this.multiplyQuaternions(this, e)
  29166. },
  29167. premultiply: function(e) {
  29168. return this.multiplyQuaternions(e, this)
  29169. },
  29170. multiplyQuaternions: function(e, t) {
  29171. var i = e._x
  29172. , n = e._y
  29173. , r = e._z
  29174. , o = e._w
  29175. , a = t._x
  29176. , s = t._y
  29177. , l = t._z
  29178. , c = t._w;
  29179. return this._x = i * c + o * a + n * l - r * s,
  29180. this._y = n * c + o * s + r * a - i * l,
  29181. this._z = r * c + o * l + i * s - n * a,
  29182. this._w = o * c - i * a - n * s - r * l,
  29183. this
  29184. }
  29185. },
  29186. r.convertWorkshopVector = function(e) {
  29187. return new r.Vector3(-e.x,e.y,e.z)
  29188. }
  29189. ,
  29190. r.convertWorkshopQuaternion = function(e) {
  29191. 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))
  29192. }
  29193. ;
  29194. r.convertWorkshopOrthoZoom = function(e) {//xzw
  29195. //return e === -1 ? -1 : e / 16 * ($("#player").width() / $("#player").height()) / n.workshopApsect
  29196. return e === -1 ? -1 : e * ($("#player").width() / $("#player").height()) / g_snapShotWidth * g_snapShotHeight;
  29197. }
  29198. ,
  29199. r.convertWorkshopPanoramaQuaternion = function(e) {
  29200. 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))
  29201. }
  29202. ,
  29203. r.normalize = function(e) {
  29204. var t = e.x * e.x + e.y * e.y + e.z * e.z
  29205. , i = Math.sqrt(t);
  29206. e.x /= i,
  29207. e.y /= i,
  29208. e.z /= i
  29209. }
  29210. ,
  29211. r.dot = function(e, t) {
  29212. return e.x * t.x + e.y * t.y + e.z * t.z
  29213. }
  29214. ,
  29215. r.cross = function(e, t, i) {
  29216. var n = e.x
  29217. , r = e.y
  29218. , o = e.z;
  29219. i.x = r * t.z - o * t.y,
  29220. i.y = o * t.x - n * t.z,
  29221. i.z = n * t.y - r * t.x
  29222. }
  29223. ,
  29224. r.setVector = function(e, t, i, n) {
  29225. e.x = t,
  29226. e.y = i,
  29227. e.z = n
  29228. }
  29229. ,
  29230. r.copyVector = function(e, t) {
  29231. t.x = e.x,
  29232. t.y = e.y,
  29233. t.z = e.z
  29234. }
  29235. ,
  29236. r.addVector = function(e, t) {
  29237. e.x += t.x,
  29238. e.y += t.y,
  29239. e.z += t.z
  29240. }
  29241. ,
  29242. r.subVector = function(e, t) {
  29243. e.x -= t.x,
  29244. e.y -= t.y,
  29245. e.z -= t.z
  29246. }
  29247. ,
  29248. r.applyQuaternionToVector = function(e, t) {
  29249. var i = t.x
  29250. , n = t.y
  29251. , r = t.z
  29252. , o = e.x
  29253. , a = e.y
  29254. , s = e.z
  29255. , l = e.w
  29256. , c = l * i + a * r - s * n
  29257. , h = l * n + s * i - o * r
  29258. , u = l * r + o * n - a * i
  29259. , d = -o * i - a * n - s * r;
  29260. t.x = c * l + d * -o + h * -s - u * -a,
  29261. t.y = h * l + d * -a + u * -o - c * -s,
  29262. t.z = u * l + d * -s + c * -a - h * -o
  29263. }
  29264. ,
  29265. r.angleBetweenVectors = function(e, t) {
  29266. return Math.acos(r.dot(e, t))
  29267. }
  29268. ,
  29269. t.exports = r
  29270. }
  29271. , {
  29272. "../constants": 8
  29273. }],
  29274. 177: [function(e, t, i) {
  29275. (function(i) {
  29276. "use strict";
  29277. function n(e) {
  29278. this.cache = null,
  29279. this.expires = 0
  29280. }
  29281. function r() {
  29282. this.baseUrl = null,
  29283. this.cache = null,
  29284. this.expires = 0
  29285. }
  29286. function o() {
  29287. this.baseUrl = null,
  29288. this.expires = 0
  29289. }
  29290. function a(e) {
  29291. this.initialLoadingPromise = null,
  29292. this.endpoint = e + "?type=3",
  29293. this.urlContainer = null,
  29294. this.authorizationHeader = h.getAuthorizationHeader(),
  29295. this.containerClasses = [o, r, n]
  29296. }
  29297. var s = e("./ajax")
  29298. , l = e("./logger")
  29299. , c = e("../constants")
  29300. , h = e("./showcase")
  29301. , u = (e("../ab"),
  29302. new l(i));
  29303. n.prototype = {
  29304. version: 1,
  29305. validate: function(e) {
  29306. return "catalog.json"in e && Object.keys(e).length > 0
  29307. },
  29308. update: function(e) {
  29309. return this.cache = e,
  29310. this.expires = Date.now() + c.signedUrlDefaultExpireTime,
  29311. $.when()
  29312. },
  29313. get: function(e) {
  29314. return this.cache[e]
  29315. }
  29316. },
  29317. r.prototype = {
  29318. version: 2,
  29319. validate: function(e) {
  29320. return "catalog.json"in e && "base.url"in e && Object.keys(e).length > 1
  29321. },
  29322. update: function(e) {
  29323. return this.baseUrl = e["base.url"],
  29324. this.cache = e,
  29325. this.expires = Date.now() + c.signedUrlDefaultExpireTime,
  29326. $.when()
  29327. },
  29328. get: function(e) {
  29329. var t = this.cache[e];
  29330. return t ? this.baseUrl.replace("{{filename}}", e) + t : null
  29331. }
  29332. },
  29333. o.prototype = {
  29334. version: 3,
  29335. validate: function(e) {
  29336. return e.templates && e.catalog_file && (!e.expires || 1e3 * e.expires > Date.now())
  29337. },
  29338. update: function(e) {
  29339. return this.baseUrl = e.templates[0],
  29340. e.expires ? this.expires = 1e3 * e.expires : this.expires = Date.now() + c.signedUrlDefaultExpireTime,
  29341. $.when()
  29342. },
  29343. get: function(e) {
  29344. return this.baseUrl.replace("{{filename}}", e)
  29345. }
  29346. },
  29347. a.prototype = {
  29348. init: function() {
  29349. return this.initialLoadingPromise ? this.initialLoadingPromise : (setInterval(function() {
  29350. var e = this.urlContainer ? this.urlContainer.expires : Date.now();
  29351. Date.now() + c.signedUrlRefreshBuffer > e && (u.debug("Refreshing urls..."),
  29352. this.refresh().done(function() {
  29353. u.debug("Refreshed")
  29354. }).fail(function() {
  29355. u.error("Failed url refresh, urls might go stale soon")
  29356. }))
  29357. }
  29358. .bind(this), c.signedUrlCheckInterval),
  29359. this.initialLoadingPromise = this.refresh(),
  29360. this.initialLoadingPromise)
  29361. },
  29362. refresh: function(e) { //已经在someData.js里加载过了 不用再加载file了吧
  29363. e = e || {};
  29364. /*var t = void 0 === e.cache || e.cache;
  29365. return s.get( this.endpoint , { //file
  29366. responseType: "json",
  29367. prefetchFrom: t ? "files" : null,
  29368. cache: t,
  29369. auth: this.authorizationHeader
  29370. }).then(function(e) {
  29371. if (this.urlContainer && this.urlContainer.validate(e))
  29372. return this.urlContainer.update(e);
  29373. for (var i = 0; i < this.containerClasses.length; i++) {
  29374. var n = this.containerClasses[i]
  29375. , r = new n;
  29376. if (r.validate(e))
  29377. return u.info("Using urls version " + r.version),
  29378. this.urlContainer = r,
  29379. this.urlContainer.update(e)
  29380. }
  29381. return t ? this.refresh({
  29382. cache: !1
  29383. }) : $.Deferred().reject("missing-urls")
  29384. }
  29385. .bind(this), function(e) {
  29386. return "loading-failed"
  29387. }) */
  29388. return $.Deferred().resolve();
  29389. },
  29390. get: function(e) {
  29391. //return this.urlContainer.get(e)
  29392. return window.DATA.files.templates[0].replace("{{filename}}", e)
  29393. }
  29394. },
  29395. t.exports = a
  29396. }
  29397. ).call(this, "/js/util/ModelUrls.js")
  29398. }
  29399. , {
  29400. "../ab": 3,
  29401. "../constants": 8,
  29402. "./ajax": 181,
  29403. "./logger": 189,
  29404. "./showcase": 193
  29405. }],
  29406. 178: [function(e, t, i) {
  29407. (function(i) {
  29408. "use strict";
  29409. function n() {
  29410. u.call(this),
  29411. this.neighbourMap = {},
  29412. this.map = null
  29413. }
  29414. var r = e("three")
  29415. , o = e("./common")
  29416. , a = e("../settings")
  29417. , s = e("../objects/Panorama")
  29418. , a = e("../settings")
  29419. , l = e("./aStar")
  29420. , c = e("./logger")
  29421. , h = new c(i)
  29422. , u = e("./IndexedCollection")
  29423. , d = e("./transitions");
  29424. o.inherit(n, u),
  29425. n.prototype.getIndex = function(e) {
  29426. return e.id
  29427. }
  29428. ,
  29429. n.prototype.find = function(e, t) {
  29430. var i = o.filterAll(this.list, e);
  29431. return 0 === i.length ? null : (t && t.forEach(function(e) {
  29432. i = o.stableSort(i, e)
  29433. }),
  29434. i[0])
  29435. }
  29436. /* n.prototype.sortByScore = function(e, t) {
  29437. var i = o.filterAll(this.list, e);
  29438. return 0 === i.length ? null : i = i.map(function(e) {
  29439. return {
  29440. pano: e,
  29441. score: t.reduce(function(t, i) {
  29442. return t + i(e)
  29443. }, 0)
  29444. }
  29445. }).sort(function(e, t) {
  29446. return t.score - e.score;
  29447. })
  29448. } */
  29449. ,
  29450. n.prototype.sortByScore = function( request, rank){
  29451. return common.sortByScore(this.list, request, rank)
  29452. }
  29453. ,
  29454. n.prototype.lowestByScore = function(e, t, i) {
  29455. return this.findRankedByScore(0, e, t, i)
  29456. }
  29457. ,
  29458. n.prototype.findRankedByScore = function(e, t, i, n) {
  29459. n && (n.candidates = null,
  29460. n.pano = null),
  29461. e || (e = 0);
  29462. var r = this.sortByScore(t, i);
  29463. return !r || 0 === r.length || e >= r.length ? null : (n && (n.candidates = r,
  29464. n.pano = r[e].item),
  29465. r[e].item)
  29466. }
  29467. ,
  29468. n.prototype.showPanoScores = function(e) {
  29469. this.list.forEach(function(e) {
  29470. e.removeTextSprite()
  29471. });
  29472. var t = 6344768;
  29473. e.forEach(function(e) {
  29474. e.pano.addTextSprite(e.score.toFixed(2), t),
  29475. t = 16428055
  29476. })
  29477. }
  29478. ,
  29479. n.prototype.isNeighbour = function(e, t) {
  29480. return this.neighbourMap[e.id][t.id]
  29481. }
  29482. ,
  29483. n.prototype.getNeighbours = function(e) {
  29484. return this.neighbourMap[e.id]
  29485. }
  29486. ,
  29487. n.prototype.setNeighbour = function(e, t, i) {
  29488. return this.neighbourMap[e.id] || (this.neighbourMap[e.id] = {}),
  29489. this.neighbourMap[t.id] || (this.neighbourMap[t.id] = {}),
  29490. this.neighbourMap[e.id][e.id] = !0,
  29491. this.neighbourMap[t.id][t.id] = !0,
  29492. this.neighbourMap[e.id][t.id] = i,
  29493. this.neighbourMap[t.id][e.id] = i,
  29494. this.neighbourMap[e.id]
  29495. }
  29496. ,
  29497. n.prototype.findClosest = function(e, t) {
  29498. var i = [s.filters.isPanoAligned()];
  29499. return t && i.push(s.filters.inDirection(e, t, .75)),
  29500. this.find(i, [s.sortFunctions.distanceToPoint(e)])
  29501. }
  29502. ,
  29503. n.prototype.dualNeighbors = function(e, t) {
  29504. var i, n = [];
  29505. for (i in this.neighbourMap[e.id])
  29506. this.neighbourMap[t.id][i] && n.push(i);
  29507. return n
  29508. }
  29509. ,
  29510. n.prototype.populate_path_graph = function() {
  29511. 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;
  29512. for (e = 0; e < this.list.length; e += 1) {
  29513. o = this.list[e],
  29514. s = {},
  29515. l = !1,
  29516. i = o.neighbourPanos || o.findNeighourPanos();
  29517. for (t in i)
  29518. if (i[t]) {
  29519. a = this.index[t],
  29520. p.copy(o.floorPosition),
  29521. p.sub(a.floorPosition);
  29522. var m = Math.sqrt(p.x * p.x + p.z * p.z)
  29523. , v = (Math.abs(p.y) / Math.max(m, .01),
  29524. Math.max(0, Math.abs(p.y) - .2));
  29525. v > 0 ? (f += 1,
  29526. v = Math.pow(4 * v, 2),
  29527. m = Math.pow(m, 2),
  29528. n = Math.sqrt(v * v + m * m)) : (g += 1,
  29529. n = p.length()),
  29530. s[a.id] = n,
  29531. l = !0
  29532. }
  29533. l ? u[o.id] = s : d += 1
  29534. }
  29535. this.map = u,
  29536. h.info("graph ready in " + (Date.now() - c) + "ms, " + d + " had no neighbors")
  29537. }
  29538. ,
  29539. n.prototype.aStarSearch = function(e, t) {
  29540. var i = Date.now()
  29541. , n = new l({
  29542. start: e,
  29543. isEnd: function(e) {
  29544. return e === t
  29545. },
  29546. neighbor: function(e) {
  29547. var t = e.neighbourPanos || e.findNeighourPanos()
  29548. , i = [];
  29549. for (var n in t)
  29550. t[n] && i.push(this.index[n]); //add: t[n] &&
  29551. return i
  29552. }
  29553. .bind(this),
  29554. distance: function(e, t) {
  29555. var i = this.map[e.id]
  29556. , n = i[t.id];
  29557. return n
  29558. }
  29559. .bind(this),
  29560. heuristic: function(e, t) {
  29561. return 1
  29562. }
  29563. .bind(this),
  29564. hash: function(e) {
  29565. return e.id
  29566. },
  29567. timeout: 5e3
  29568. });
  29569. if (h.debug("A* search in " + (Date.now() - i) + "ms"),
  29570. "success" !== n.status)
  29571. return h.debug("Did not find A* path from " + e + " to " + t),
  29572. null;
  29573. h.debug("Total cost " + n.cost.toPrecision(3) + ", " + n.path.length + " steps");
  29574. var r = [];
  29575. return n.path.forEach(function(e) {
  29576. r.push(e.id)
  29577. }),
  29578. r
  29579. }
  29580. ,
  29581. n.prototype.includeNodesNearPath = function() {
  29582. var e = new r.Vector3
  29583. , t = new r.Vector3
  29584. , i = new r.Vector3
  29585. , n = new r.Vector3
  29586. , o = new r.Vector3
  29587. , a = new r.Vector3
  29588. , s = new r.Vector3
  29589. , l = new r.Vector3
  29590. , c = []
  29591. , h = new r.Vector3
  29592. , u = new r.Vector3;
  29593. return function(r, d) {
  29594. if (r)
  29595. for (var p = function(e, t, i) {
  29596. return o.copy(t).sub(e),
  29597. o.dot(i)
  29598. }, f = function(e, t) {
  29599. return p(h, e.position, i) - p(h, t.position, i)
  29600. }, g = 0; g < r.length - 1; ) {
  29601. var m = r[g]
  29602. , v = r[g + 1]
  29603. , A = this.index[m]
  29604. , y = this.index[v];
  29605. h.copy(A.position),
  29606. u.copy(y.position),
  29607. c.length = 0,
  29608. e.copy(u).sub(h),
  29609. i.copy(e).normalize();
  29610. for (var C = 0; C < this.list.length; C++) {
  29611. var I = this.list[C];
  29612. o.copy(I.position).sub(h);
  29613. var E = o.dot(i);
  29614. if (E > 0) {
  29615. s.copy(i),
  29616. s.multiplyScalar(E),
  29617. a.copy(o),
  29618. a.sub(s);
  29619. var b = a.length();
  29620. if (b < d) {
  29621. t.copy(e).negate(),
  29622. n.copy(t).normalize(),
  29623. l.copy(I.position).sub(u);
  29624. var w = l.dot(n);
  29625. w > 0 && c.push(I)
  29626. }
  29627. }
  29628. }
  29629. if (c.length > 0) {
  29630. c.sort(f);
  29631. for (var _ = r.length + c.length - 1; _ >= g + c.length; _--)
  29632. r[_] = r[_ - c.length];
  29633. for (var T = 0; T < c.length; T++)
  29634. r[T + g + 1] = c[T].id
  29635. }
  29636. g += c.length + 1
  29637. }
  29638. }
  29639. }(),
  29640. /* n.prototype.fadeMarkerOpacity = function(e, t) {
  29641. var i = void 0 === e ? a.panorama.markerOpacity : e
  29642. , n = this.list.findIndex(function(e) {
  29643. return e.marker
  29644. });
  29645. if (!(n < 0)) {
  29646. var r = this.list[n].marker.material.opacity;
  29647. if (r !== e) {
  29648. var o = i - r;
  29649. d.trigger({
  29650. func: function(e, t) {
  29651. var i = r + e * o;
  29652. this.forEach(function(e) {
  29653. e.marker && (e.marker.material.opacity = i)
  29654. })
  29655. }
  29656. .bind(this),
  29657. duration: void 0 === t ? a.markerOpacityTransitionTime : t,
  29658. name: "_fpm"
  29659. })
  29660. }
  29661. }
  29662. } */
  29663. n.prototype.fadeMarkerOpacity = function(e, t, gr) {
  29664. d.cancelById('fadeMarkerOpacity')
  29665. var n = this.list.findIndex(function (e) {
  29666. //why? 难道没有marker的pano吗 findeIndex:获取数组中函数返回值不为fasle的第一个元素索引位置
  29667. return e.marker
  29668. })
  29669. if (n < 0) {
  29670. //logger.info('marker findIndex<0')
  29671. return
  29672. }
  29673. var group
  29674. var tran = function (list, index) {
  29675. list.member = list.member.filter(function (m) {
  29676. return m.marker && m.marker.material.opacity != list.toOp
  29677. })
  29678. transitions.trigger({
  29679. func: function (e, t) {
  29680. //e:0-1
  29681. list.member.forEach(function (m) {
  29682. var o = m.marker.oldOpacity
  29683. var i = o + e * (list.toOp - o)
  29684. m.marker && (m.marker.material.opacity = i)
  29685. })
  29686. }.bind(this),
  29687. duration: void 0 == t ? a.markerOpacityTransitionTime : t,
  29688. name: '_fpm_' + index,
  29689. id: 'fadeMarkerOpacity',
  29690. })
  29691. }
  29692. this.forEach(function (e) {
  29693. //先记录旧的opacity
  29694. e.marker && (e.marker.oldOpacity = e.marker.material.opacity)
  29695. })
  29696. group = gr
  29697. /* if (e > 0 && gr) {
  29698. group = gr
  29699. } else {
  29700. group = [
  29701. {
  29702. member: this.list,
  29703. toOp: 0,
  29704. },
  29705. ]
  29706. } */
  29707. for (var i = 0; i < group.length; i++) {
  29708. tran(group[i], i)
  29709. }
  29710. }
  29711. ,
  29712. t.exports = n
  29713. }
  29714. ).call(this, "/js/util/PanoramaCollection.js")
  29715. }
  29716. , {
  29717. "../objects/Panorama": 148,
  29718. "../settings": 166,
  29719. "./IndexedCollection": 175,
  29720. "./aStar": 180,
  29721. "./common": 185,
  29722. "./logger": 189,
  29723. "./transitions": 195,
  29724. three: 217
  29725. }],
  29726. 179: [function(e, t, i) {
  29727. "use strict";
  29728. function n() {
  29729. this.actionSequence = [],
  29730. this.actionSequenceInProgress = !1
  29731. }
  29732. function r(e, t, i, n) {
  29733. s.trackAlways("zoom_" + e, {
  29734. from: t,
  29735. to: i,
  29736. pano: n
  29737. })
  29738. }
  29739. function o(e, t) {
  29740. r("initial", 1, e, t)
  29741. }
  29742. function a(e, t, i) {
  29743. r("followup", e, t, i)
  29744. }
  29745. var s = e("../analytics");
  29746. n.prototype.reset = function(e) {
  29747. this.actionSequenceInProgress = !1,
  29748. this.actionSequence.length = 0
  29749. }
  29750. ,
  29751. n.prototype.addZoomAction = function() {
  29752. var e = null
  29753. , t = null
  29754. , i = !1
  29755. , n = function() {
  29756. if (e = null,
  29757. this.actionSequence.length > 0) {
  29758. var i = this.actionSequence[0].start
  29759. , n = this.actionSequence[this.actionSequence.length - 1].end;
  29760. 1 === i ? o(n, t) : a(i, n, t)
  29761. }
  29762. this.reset()
  29763. };
  29764. return function(r, o, a) {
  29765. if (r !== o) {
  29766. i || (n = n.bind(this),
  29767. i = !0),
  29768. e && (window.clearTimeout(e),
  29769. e = null),
  29770. a === t && this.actionSequenceInProgress || (this.reset(),
  29771. t = a),
  29772. this.actionSequenceInProgress = !0;
  29773. var s = {
  29774. start: r,
  29775. end: o
  29776. };
  29777. this.actionSequence.push(s),
  29778. e = window.setTimeout(n, 150)
  29779. }
  29780. }
  29781. }(),
  29782. t.exports = n
  29783. }
  29784. , {
  29785. "../analytics": 4
  29786. }],
  29787. 180: [function(e, t, i) {
  29788. "use strict";
  29789. function n(e) {
  29790. void 0 === e.timeout && (e.timeout = 1 / 0);
  29791. var t = e.hash || o
  29792. , i = {
  29793. data: e.start,
  29794. g: 0,
  29795. h: e.heuristic(e.start)
  29796. }
  29797. , n = i;
  29798. i.f = i.h;
  29799. var h = new s
  29800. , u = new l(a)
  29801. , d = c();
  29802. u.push(i),
  29803. d.set(t(i.data), i);
  29804. for (var p = new Date; u.size(); ) {
  29805. if (new Date - p > e.timeout)
  29806. return {
  29807. status: "timeout",
  29808. cost: n.g,
  29809. path: r(n)
  29810. };
  29811. var f = u.pop();
  29812. if (d.delete(t(f.data)),
  29813. e.isEnd(f.data))
  29814. return {
  29815. status: "success",
  29816. cost: f.g,
  29817. path: r(f)
  29818. };
  29819. h.add(t(f.data));
  29820. for (var g = e.neighbor(f.data), m = 0; m < g.length; m++) {
  29821. var v = g[m];
  29822. if (!h.contains(t(v))) {
  29823. var A = f.g + e.distance(f.data, v)
  29824. , y = d.get(t(v))
  29825. , C = !1;
  29826. if (void 0 === y)
  29827. y = {
  29828. data: v
  29829. },
  29830. d.set(t(v), y);
  29831. else {
  29832. if (y.g < A)
  29833. continue;
  29834. C = !0
  29835. }
  29836. y.parent = f,
  29837. y.g = A,
  29838. y.h = e.heuristic(v),
  29839. y.f = A + y.h,
  29840. y.h < n.h && (n = y),
  29841. C ? u.heapify() : u.push(y)
  29842. }
  29843. }
  29844. }
  29845. return {
  29846. status: "noPath",
  29847. cost: n.g,
  29848. path: r(n)
  29849. }
  29850. }
  29851. function r(e) {
  29852. if (void 0 !== e.parent) {
  29853. var t = r(e.parent);
  29854. return t.push(e.data),
  29855. t
  29856. }
  29857. return [e.data]
  29858. }
  29859. function o(e) {
  29860. return e.toString()
  29861. }
  29862. function a(e, t) {
  29863. return e.f - t.f
  29864. }
  29865. var s = e("Set")
  29866. , l = e("heap")
  29867. , c = e("dict");
  29868. t.exports = n
  29869. }
  29870. , {
  29871. Set: 196,
  29872. dict: 210,
  29873. heap: 211
  29874. }],
  29875. 181: [function(e, t, i) {
  29876. (function(i) {
  29877. "use strict";
  29878. function n(e, t, i) {
  29879. var n = new XMLHttpRequest;
  29880. if (i && "withCredentials"in n)
  29881. n.open(e, t, i);
  29882. else if ("undefined" != typeof XDomainRequest)
  29883. n = new XDomainRequest,
  29884. n.open(e, t);
  29885. else {
  29886. if (i)
  29887. throw "Browser does not support CORS!";
  29888. n.open(e, t)
  29889. }
  29890. return n
  29891. }
  29892. function r(e, t, i) {
  29893. function o() {
  29894. u.warn("Retrying ", t),
  29895. r(e, t, i).done(c.resolve.bind(c)).progress(c.notify.bind(c)).fail(c.reject.bind(c))
  29896. }
  29897. function a(e, t) {
  29898. var i = e.response;
  29899. if ("json" === t && "object" != typeof i)
  29900. try {
  29901. i = JSON.parse(e.responseText)
  29902. } catch (e) {
  29903. return void c.reject({
  29904. error: "Failed parsing JSON"
  29905. })
  29906. }
  29907. else if ("image/jpeg" === t) {
  29908. var n = new Uint8Array(e.response)
  29909. , r = new Blob([n],{
  29910. type: "image/jpeg"
  29911. })
  29912. , o = URL.createObjectURL(r);
  29913. i = new Image,
  29914. i.src = o,
  29915. i.crossOrigin = "Anonymous",
  29916. i.onload = function() {
  29917. URL.revokeObjectURL(o)
  29918. }
  29919. }
  29920. return i
  29921. }
  29922. var s = n(e, t, !1);
  29923. if (i = i || {},
  29924. i.retries = void 0 !== i.retries ? i.retries : 0,
  29925. i.retry = void 0 !== i.retry ? i.retry : "get" === e.toLowerCase(),
  29926. i.responseType)
  29927. if (["arraybuffer", "text", "json"].indexOf(i.responseType) > -1)
  29928. s.responseType = i.responseType;
  29929. else {
  29930. if ("image/jpeg" !== i.responseType)
  29931. throw new Error('reponseType can only be one of "arraybuffer", "text" or "json", "image/jpeg"');
  29932. s.responseType = "arraybuffer"
  29933. }
  29934. if ("json" === i.responseType && s.setRequestHeader("Accept", "application/json"),
  29935. i.auth && s.setRequestHeader("Authorization", i.auth),
  29936. "object" == typeof i.data && (i.data = JSON.stringify(i.data),
  29937. s.setRequestHeader("Content-Type", "application/json")),
  29938. "object" == typeof i.headers)
  29939. for (var l in i.headers)
  29940. s.setRequestHeader(l, i.headers[l]);
  29941. var c = $.Deferred();
  29942. return s.onreadystatechange = function(e) {
  29943. if (4 === this.readyState)
  29944. if (this.status >= 500 && this.status <= 600 && i.retry && i.retries < 3)
  29945. i.retries++,
  29946. setTimeout(o, 1e3);
  29947. else if (200 === this.status) {
  29948. var t = a(this, i.responseType);
  29949. c.resolve(t)
  29950. } else
  29951. c.reject(this)
  29952. }
  29953. ,
  29954. s.onprogress = function(e) {
  29955. c.notify(e)
  29956. }
  29957. ,
  29958. s.send(i.data),
  29959. c.promise()
  29960. }
  29961. function o(e) {
  29962. return Object.keys(e).sort().map(function(t) {
  29963. return {
  29964. key: t,
  29965. value: e[t]
  29966. }
  29967. })
  29968. }
  29969. function a(e, t) {
  29970. var i = t.responseType || null
  29971. , n = t.auth || null
  29972. , r = t.prefetchFrom || null
  29973. , a = e + "__" + i + "__" + n + "__" + r;
  29974. return t.headers && o(t.headers).forEach(function(e) {
  29975. a += "__" + e.key + ":" + e.value
  29976. }),
  29977. a
  29978. }
  29979. function s(e, t) {
  29980. return window.MP_REQUEST_CACHE ? window.MP_REQUEST_CACHE[a(e, t)] : null
  29981. }
  29982. function l(e, t, i) {
  29983. window.MP_REQUEST_CACHE && (window.MP_REQUEST_CACHE[a(e, t)] = i)
  29984. }
  29985. var c = e("./logger")
  29986. , h = e("../ab")
  29987. , u = new c(i);
  29988. window.URL = window.URL || window.webkitURL,
  29989. window.MP_REQUEST_CACHE = window.MP_REQUEST_CACHE || {},
  29990. window.DATA = window.DATA || {}
  29991. /* setTimeout(function() {//MP-- xzw delete
  29992. window.MP_REQUEST_CACHE = null,
  29993. window.DATA = {}
  29994. }, 6e4),
  29995. window.onpageshow = function(e) {
  29996. e.persisted && (window.MP_REQUEST_CACHE = null,
  29997. window.DATA = {})
  29998. } */
  29999. ,
  30000. t.exports = {
  30001. get: function(e, t) {
  30002. t = t || {};
  30003. var i = void 0 === t.cache || t.cache;
  30004. if (i) {
  30005. var n = s(e, t);
  30006. if (n)
  30007. return n
  30008. }
  30009. var o;
  30010. return o = t.prefetchFrom && window.DATA[t.prefetchFrom] ? $.when(window.DATA[t.prefetchFrom]) : r("GET", e, t),
  30011. i && l(e, t, o),
  30012. o
  30013. },
  30014. post: function(e, t) {
  30015. return r("POST", e, t)
  30016. },
  30017. patch: function(e, t) {
  30018. return r("PATCH", e, t)
  30019. },
  30020. getImage: function(e, t) {
  30021. function i() {
  30022. u.warn("Retrying ", e),
  30023. o.getImage(e, t - 1).done(n.resolve.bind(n)).progress(n.notify.bind(n)).fail(n.reject.bind(n))
  30024. }
  30025. var n = $.Deferred()
  30026. , r = new Image
  30027. , o = this;
  30028. return e = h.changeIfImageOptimzing(e),
  30029. null !== t && void 0 !== t || (t = 3),
  30030. r.onerror = function() {
  30031. t > 0 ? setTimeout(i, 1e3) : n.reject()
  30032. }
  30033. ,
  30034. r.onload = function() {
  30035. n.resolve(r)
  30036. }
  30037. ,
  30038. r.crossOrigin = "anonymous",
  30039. r.src = e,
  30040. n
  30041. }
  30042. }
  30043. }
  30044. ).call(this, "/js/util/ajax.js")
  30045. }
  30046. , {
  30047. "../ab": 3,
  30048. "./logger": 189
  30049. }],
  30050. 182: [function(e, t, i) {
  30051. "use strict";
  30052. function n(e, t) {
  30053. var i = window.navigator.userAgent
  30054. , n = i.match(e);
  30055. return n = n ? n[1].split(t) : [],
  30056. {
  30057. major: parseInt(n[0]) || 0,
  30058. minor: parseInt(n[1]) || 0,
  30059. patch: parseInt(n[2]) || 0
  30060. }
  30061. }
  30062. var r = e("../exception/DeviceMismatchException");
  30063. window.browser = t.exports = {
  30064. isFullscreen: function() {
  30065. return document.fullscreenElement || document.mozFullscreenElement || document.mozFullScreenElement || document.webkitFullscreenElement || document.msFullscreenElement
  30066. },
  30067. supportsFullscreen: function() {
  30068. return document.fullscreenEnabled || document.mozFullscreenEnabled || document.mozFullScreenEnabled || document.webkitFullscreenEnabled || document.msFullscreenEnabled
  30069. },
  30070. isPointerLocked: function() {
  30071. return document.pointerLockElement || document.mozPointerLockElement || document.webkitPointerLockElement
  30072. },
  30073. requestFullscreen: function(e, t) {
  30074. e.requestFullscreen ? e.requestFullscreen() : e.mozRequestFullScreen ? e.mozRequestFullScreen() : e.webkitRequestFullscreen ? e.webkitRequestFullscreen(Element.ALLOW_KEYBOARD_INPUT) : e.msRequestFullscreen && e.msRequestFullscreen(),
  30075. t && $(document).on("fullscreenchange webkitfullscreenchange mozfullscreenchange MSFullscreenChange", browser.requestPointerLock)
  30076. },
  30077. requestPointerLock: function() {
  30078. var e;
  30079. if (document.fullscreenElement)
  30080. e = document.fullscreenElement();
  30081. else if (document.mozFullscreenElement)
  30082. e = document.mozFullscreenElement();
  30083. else if (document.mozFullScreenElement)
  30084. e = document.mozFullScreenElement();
  30085. else {
  30086. if (!document.webkitFullscreenElement)
  30087. return;
  30088. e = document.webkitFullscreenElement()
  30089. }
  30090. e.requestPointerLock = e.requestPointerLock || e.mozRequestPointerLock || e.webkitRequestPointerLock,
  30091. e.requestPointerLock(),
  30092. $(document).off("fullscreenchange webkitfullscreenchange mozfullscreenchange MSFullscreenChange", this)
  30093. },
  30094. exitPointerLock: function() {
  30095. document.exitPointerLock = document.exitPointerLock || document.mozExitPointerLock || document.webkitExitPointerLock,
  30096. document.exitPointerLock()
  30097. },
  30098. exitFullscreen: function() {
  30099. document.exitFullscreen ? document.exitFullscreen() : document.msExitFullscreen ? document.msExitFullscreen() : document.mozCancelFullScreen ? document.mozCancelFullScreen() : document.webkitExitFullscreen && document.webkitExitFullscreen()
  30100. },
  30101. details: function() {
  30102. var e = navigator.userAgent.match("(Firefox|Chrome|Safari)/([\\d]+)");
  30103. return e ? {
  30104. name: e[1],
  30105. version: parseInt(e[2]),
  30106. platform: navigator.platform
  30107. } : {}
  30108. },
  30109. is: function(e) {
  30110. return this.details() && this.details().name === e
  30111. },
  30112. inIframe: function() {
  30113. return window.parent !== window
  30114. },
  30115. aspectRatio: function() {
  30116. var e = $("#player").width() / $("#player").height();
  30117. return isFinite(e) ? e : 0
  30118. },
  30119. userAgent: function() {
  30120. return window.navigator.userAgent
  30121. },
  30122. isMobile: function() {
  30123. var e = navigator.userAgent || navigator.vendor || window.opera;
  30124. 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))
  30125. },
  30126. isLandscape: function() {
  30127. return this.isMobile && this.aspectRatio() > 1
  30128. },
  30129. isSmallScreen: function() {
  30130. var e = screen.width / window.devicePixelRatio;
  30131. return e < 240
  30132. },
  30133. detectIE: function() {
  30134. var e = window.navigator.userAgent
  30135. , t = e.indexOf("MSIE ");
  30136. return t !== -1 || !!navigator.userAgent.match(/Trident.*rv\:11\./)
  30137. },
  30138. detectSafari: function() {
  30139. var e = window.navigator.userAgent
  30140. , t = e.indexOf("Safari");
  30141. return t !== -1 && !this.detectChrome()
  30142. },
  30143. detectFirefox: function() {
  30144. var e = window.navigator.userAgent;
  30145. return e.indexOf("Firefox") !== -1
  30146. },
  30147. detectChrome: function() {
  30148. var e = window.navigator.userAgent;
  30149. return e.indexOf("Chrome") !== -1 && !this.detectOpera()
  30150. },
  30151. detectOpera: function() {
  30152. var e = window.navigator.userAgent;
  30153. return e.indexOf("OPR") !== -1
  30154. },
  30155. detectIOS: function() {
  30156. return this.detectIPhone() || this.detectIPad() || this.detectIPod()
  30157. },
  30158. detectIPad: function() {
  30159. var e = window.navigator.userAgent
  30160. , t = /iPad/;
  30161. return t.test(e)
  30162. },
  30163. detectIPod: function() {
  30164. var e = window.navigator.userAgent
  30165. , t = /iPod/;
  30166. return t.test(e)
  30167. },
  30168. detectIPhone: function() {
  30169. var e = window.navigator.userAgent
  30170. , t = /iPhone/;
  30171. return t.test(e)
  30172. },
  30173. detectAndroid: function() {
  30174. var e = window.navigator.userAgent;
  30175. return e.indexOf("Android") !== -1
  30176. },
  30177. detectAndroidMobile: function() {
  30178. var e = window.navigator.userAgent;
  30179. return this.detectAndroid() && e.indexOf("Mobile") !== -1
  30180. },
  30181. detectSamsungNative: function() {
  30182. var e = window.navigator.userAgent;
  30183. return e.indexOf("SM-G900H") !== -1 || e.indexOf("GT-I9500") !== -1 || e.indexOf("SM-N900") !== -1
  30184. },
  30185. detectSamsungS6: function() {
  30186. var e = window.navigator.userAgent;
  30187. return e.indexOf("SM-G92") !== -1
  30188. },
  30189. /************************************************************fyz改from徐世廷*************************************************************/
  30190. detectHUAWEI5X: function() {
  30191. return -1 !== window.navigator.userAgent.indexOf("KIW-TL00H")
  30192. },
  30193. /*******************************************************************************************************************************/
  30194. detectWebVR: function() {
  30195. return !(!window.navigator.getVRDisplays || !window.VRDisplay)
  30196. },
  30197. getVRDisplay: function() {
  30198. var e = $.Deferred();
  30199. return this.detectWebVR() ? (navigator.getVRDisplays().then(function(t) {
  30200. t.length >= 1 && e.resolve(t[0]),
  30201. e.reject(null)
  30202. }),
  30203. e) : e.reject(null)
  30204. },
  30205. iosVersion: function() {
  30206. if (!this.detectIOS())
  30207. throw new r("Did not detect an iDevice");
  30208. var e = /((?:\d+\_?){1,3}) like Mac OS/
  30209. , t = "_";
  30210. return n(e, t)
  30211. },
  30212. androidVersion: function() {
  30213. if (!this.detectAndroid())
  30214. throw new r("Did not detect an Android based device");
  30215. var e = /Android ((?:\d+\.?){1,3})/
  30216. , t = ".";
  30217. return n(e, t)
  30218. },
  30219. valueFromCookie: function(e, t) {
  30220. var i = new RegExp(e + "=([0-9a-f]+)(; ?|$)").exec(document.cookie);
  30221. if (!i)
  30222. return t;
  30223. var n = i[1];
  30224. return "boolean" == typeof t ? "true" === n || "1" === n : "number" == typeof t ? parseFloat(n) : n
  30225. },
  30226. valueFromHash: function(e, t) {
  30227. var i = new RegExp("[#&?]" + e + "=([^#&?]*)")
  30228. , n = i.exec(window.location.href);
  30229. if (!n)
  30230. return t;
  30231. var r = n[1];
  30232. return "boolean" == typeof t ? "true" === r || "1" === r : "number" == typeof t ? parseFloat(r) : window.decodeURIComponent(r)
  30233. }
  30234. }
  30235. // changeLog()
  30236. }
  30237. , {
  30238. "../exception/DeviceMismatchException": 56
  30239. }],
  30240. 183: [function(e, t, i) {
  30241. (function(i) {
  30242. "use strict";
  30243. function n(e, t) {
  30244. var i = r(t);
  30245. var replaceAll = function (str, f, e) {
  30246. //f全部替换成e
  30247. var reg = new RegExp(f, "g"); //创建正则RegExp对象
  30248. return str.replace(reg, e);
  30249. };
  30250. var urlFirstView = c.valueFromHash('firstView');
  30251. if(urlFirstView){
  30252. try{
  30253. urlFirstView = replaceAll(urlFirstView, "pano:", '"pano":"')
  30254. urlFirstView = replaceAll(urlFirstView, ",qua:", '","qua":[')
  30255. urlFirstView = "{"+urlFirstView+"]}"
  30256. let info = JSON.parse(urlFirstView);
  30257. i.pano = t.index[info.pano] //panos.get(info.pano)
  30258. if(!i.pano){
  30259. urlFirstView = false
  30260. console.error('检测到firstView但是 找不到该pano')
  30261. }else{
  30262. i.quaternion = new THREE.Quaternion().fromArray(info.qua)
  30263. i.zoom = -1;
  30264. i.mode = "panorama"
  30265. i.setByUrl = true
  30266. }
  30267. }catch(e){
  30268. urlFirstView = false
  30269. console.error('检测到firstView但是解析出错'+e)
  30270. }
  30271. }
  30272. if (Object.keys(i).length > 0)
  30273. return i;
  30274. if (e.heroImage)
  30275. i = o(e, t);
  30276. else if (window.DATA.camera_start) {
  30277. var n = window.DATA.camera_start;
  30278. try {
  30279. Object.keys(n).length > 0 && !l.isEmptyQuaternion(n.camera.quaternion) && (i.mode = h.convertWorkshopModeInt(n.mode),
  30280. i.position = n.camera.position,
  30281. //i.quaternion = n.camera.quaternion,
  30282. i.quaternion = new th.Quaternion().fromArray(n.camera.quaternion),//xzw
  30283. i.zoom = l.convertWorkshopOrthoZoom(n.camera.zoom),
  30284. n.pano && (i.pano = t.get(n.pano.uuid) || t.findClosest(i.position),
  30285. d.debug("Using camera_start"),
  30286. d.debug("Modeldata pano: ", i.pano.quaternion),
  30287. d.debug("Camera start pano: ", n.pano.quaternion)),
  30288. i.mode !== h.PANORAMA && (i.floorVisibility = e.heroImage.metadata.floor_visibility))
  30289. } catch (e) {
  30290. d.warn(e.message)
  30291. if(i.mode == "panorama" && !i.pano)i.pano = t.list[0]
  30292. }
  30293. }
  30294. if (e.outsideAllowed() || i.mode === h.PANORAMA || (i = {}),
  30295. i.mode === h.MESH && i.position && (i.mode = h.PANORAMA,
  30296. i.pano = t.findClosest(i.position),
  30297. i.quaternion = i.pano.quaternion),
  30298. 0 === Object.keys(i).length) {
  30299. var a = t.list[0];
  30300. a && (i.mode = h.PANORAMA,
  30301. i.pano = a,
  30302. i.position = a.position,
  30303. i.quaternion = a.quaternion,
  30304. d.info("Starting at 1st pano " + a.id))
  30305. }
  30306. return i.mode = i.mode || h.DOLLHOUSE,
  30307. i
  30308. }
  30309. function r(e) {
  30310. var t = c.valueFromHash("start", "")
  30311. , i = {};
  30312. if ("" !== t) {
  30313. d.debug("Start override found in parameters, trying to parse..."),
  30314. i = a(t) || {};
  30315. var n = c.valueFromHash("tag", null);
  30316. n && (i.tag = n),
  30317. i.panoId && (i.pano = e.get(i.panoId))
  30318. }
  30319. return i
  30320. }
  30321. function o(e, t) {
  30322. if (!e.heroImage || !e.heroImage.metadata.camera_position)
  30323. return {};
  30324. var i = {}
  30325. , n = e.heroImage.metadata;
  30326. d.debug("Using start position from thumbnail image"),
  30327. i.position = n.camera_position,
  30328. i.quaternion = n.camera_quaternion;
  30329. try {
  30330. i.mode = h.convertWorkshopModeInt(n.camera_mode),
  30331. i.mode === h.PANORAMA ? i.pano = t.get(n.scan_id) : i.floorVisibility = n.floor_visibility
  30332. } catch (e) {
  30333. d.debug(e.message)
  30334. }
  30335. return i
  30336. }
  30337. function a(e) {
  30338. return s.deserialize(e)
  30339. }
  30340. var s = e("../controls/serializer")
  30341. , l = e("../util/math")
  30342. , c = e("./browser")
  30343. , h = e("../enum/Viewmode")
  30344. , u = e("../util/logger")
  30345. , th = e("three")//xzw
  30346. , d = new u(i);
  30347. t.exports = {
  30348. getStartCameraOptions: n
  30349. }
  30350. }
  30351. ).call(this, "/js/util/camera.js")
  30352. }
  30353. , {
  30354. "../controls/serializer": 14,
  30355. "../enum/Viewmode": 51,
  30356. "../util/logger": 189,
  30357. "../util/math": 190,
  30358. "./browser": 182,
  30359. "three": 217
  30360. }],
  30361. 184: [function(e, t, i) {
  30362. "use strict";
  30363. function n(e, t, i) {
  30364. return o(e.fov, t, i)
  30365. }
  30366. var r = e("./MathLight")
  30367. , o = function(e, t, i) {
  30368. var n = t
  30369. , o = i
  30370. , a = 2 * Math.atan(Math.tan(e * r.RADIANS_PER_DEGREE / 2) * (n / o)) * r.DEGREES_PER_RADIAN;
  30371. return a
  30372. }
  30373. , a = function(e, t, i) {
  30374. var n = t
  30375. , o = i
  30376. , a = 2 * Math.atan(Math.tan(e * r.RADIANS_PER_DEGREE / 2) * (o / n)) * r.DEGREES_PER_RADIAN;
  30377. return a
  30378. }
  30379. , s = function(e, t, i, n) {
  30380. var r = o(e, i, n);
  30381. return r > t ? a(t, i, n) : e
  30382. };
  30383. t.exports = {
  30384. clampVFOV: s,
  30385. getHFOVForCamera: n,
  30386. getHFOVFromVFOV: o,
  30387. getVFOVFromHFOV: a
  30388. }
  30389. window.MathLight = t.exports
  30390. MathLight.closeTo = function(e1,e2, precision){//xzw add 判断e1,e2是否接近
  30391. var prec = Math.pow(10, - (precision || 4));
  30392. var s1 = Math.abs(e1.x - e2.x) < prec && Math.abs(e1.y - e2.y) < prec && Math.abs(e1.z - e2.z) < prec
  30393. if(e1.w){
  30394. return s1 && Math.abs(e1.w - e2.w) < prec
  30395. }else return s1
  30396. }
  30397. }
  30398. , {
  30399. "./MathLight": 176
  30400. }],
  30401. 185: [function(e, t, i) {
  30402. "use strict";
  30403. var n = e("three");
  30404. t.exports = {
  30405. delayOneFrame: function(e) {
  30406. window.setTimeout(e, 1)
  30407. },
  30408. normalizeUrl: function(e) {
  30409. return e.replace("https://", "http://")
  30410. },
  30411. domainFromUrl: function(e) {
  30412. var t = /^([^:]*:\/\/)?(www\.)?([^\/]+)/.exec(e);
  30413. return t ? t[3] : e
  30414. },
  30415. average: function(e, t) {
  30416. if (0 === e.length)
  30417. return null;
  30418. for (var i = 0, n = 0, r = 0; r < e.length; r++) {
  30419. var o = t ? e[r][t] : e[r];
  30420. i += o,
  30421. n++
  30422. }
  30423. return i / n
  30424. },
  30425. countUnique: function(e) {
  30426. for (var t = {}, i = 0; i < e.length; i++)
  30427. t[e[i]] = 1 + (t[e[i]] || 0);
  30428. return Object.keys(t).length
  30429. },
  30430. averageVectors: function(e, t) {
  30431. var i = new n.Vector3;
  30432. if (0 === e.length)
  30433. return i;
  30434. for (var r = 0, o = 0; o < e.length; o++) {
  30435. var a = t ? e[o][t] : e[o];
  30436. i.add(a),
  30437. r++
  30438. }
  30439. return i.divideScalar(r)
  30440. },
  30441. equalLists: function(e, t) {
  30442. if (e.length !== t.length)
  30443. return !1;
  30444. for (var i = 0; i < e.length; i++)
  30445. if (e[i] !== t[i])
  30446. return !1;
  30447. return !0
  30448. },
  30449. lowerMedian: function(e, t) {
  30450. if (0 === e.length)
  30451. return null;
  30452. t = t || 2,
  30453. e.sort(function(e, t) {
  30454. return e - t
  30455. });
  30456. var i = Math.floor(e.length / t);
  30457. return e[i]
  30458. },
  30459. stableSort: function(e, t) {
  30460. return e.map(function(e, t) {
  30461. return {
  30462. value: e,
  30463. index: t
  30464. }
  30465. }).sort(function(e, i) {
  30466. var n = t(e.value, i.value);
  30467. return 0 !== n ? n : e.index - i.index
  30468. }).map(function(e) {
  30469. return e.value
  30470. })
  30471. },
  30472. filterAll: function(e, t) {
  30473. return e.filter(function(e) {
  30474. return t.every(function(t) {
  30475. return t(e)
  30476. })
  30477. })
  30478. },
  30479. formatDate: function(e) {
  30480. return [e.getFullYear(), e.getMonth() + 1, e.getDate()].join("-")
  30481. },
  30482. formatDatetime: function(e) {
  30483. return [e.getFullYear(), e.getMonth() + 1, e.getDate(), e.getHours(), e.getMinutes()].join("-")
  30484. },
  30485. randomString: function(e) {
  30486. for (var t = "", i = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789", n = 0; n < e; n++)
  30487. t += i.charAt(Math.floor(Math.random() * i.length));
  30488. return t
  30489. },
  30490. uint8ToBase64: function(e, t) {
  30491. t && "number" == typeof t || (t = 8192);
  30492. for (var i = [], n = 0; n < e.length; n += t)
  30493. i.push(String.fromCharCode.apply(null, e.subarray(n, n + t)));
  30494. return btoa(i.join(""))
  30495. },
  30496. uuid4: function e(t) {
  30497. return t ? (t ^ 16 * Math.random() >> t / 4).toString(16) : ([1e7] + -1e3 + -4e3 + -8e3 + -1e11).replace(/[018]/g, e)
  30498. },
  30499. nth: function(e) {
  30500. return e %= 10,
  30501. 1 === e ? e + "st" : 2 === e ? e + "nd" : 3 === e ? e + "rd" : e + "th"
  30502. },
  30503. extendObject: function(e, t) {
  30504. return Object.keys(t).forEach(function(i) {
  30505. e[i] = t[i]
  30506. }),
  30507. e
  30508. },
  30509. deepExtend: function e(t) {
  30510. t = t || {};
  30511. for (var i = 1; i < arguments.length; i++) {
  30512. var n = arguments[i];
  30513. if (n)
  30514. for (var r in n)
  30515. n.hasOwnProperty(r) && ("object" == typeof n[r] ? t[r] = e(t[r], n[r]) : t[r] = n[r])
  30516. }
  30517. return t
  30518. },
  30519. inherit: function(e, t) {
  30520. e.prototype = Object.create(t.prototype),
  30521. e.prototype.constructor = e
  30522. },
  30523. extend: function(e, t) {
  30524. for (var i in t.prototype)
  30525. e.prototype[i] = t.prototype[i]
  30526. }
  30527. ,
  30528. getFileNameFromUrl:function(url){
  30529. return url.split('/').pop();
  30530. }
  30531. },
  30532. Math.sign = function(e) {
  30533. return e < 0 ? -1 : 1
  30534. }
  30535. window.common = t.exports
  30536. expandCommon(common)
  30537. }
  30538. , {
  30539. three: 217
  30540. }],
  30541. 186: [function(e, t, i) {
  30542. "use strict";
  30543. var n = {};
  30544. n.linearTween = function(e, t, i, n) {
  30545. return i * e / n + t
  30546. }
  30547. ,
  30548. n.easeInQuad = function(e, t, i, n) {
  30549. return e /= n,
  30550. i * e * e + t
  30551. }
  30552. ,
  30553. n.easeOutQuad = function(e, t, i, n) {
  30554. return e /= n,
  30555. -i * e * (e - 2) + t
  30556. }
  30557. ,
  30558. n.easeInOutQuad = function(e, t, i, n) {
  30559. return e /= n / 2,
  30560. e < 1 ? i / 2 * e * e + t : (e--,
  30561. -i / 2 * (e * (e - 2) - 1) + t)
  30562. }
  30563. ,
  30564. n.easeInCubic = function(e, t, i, n) {
  30565. return e /= n,
  30566. i * e * e * e + t
  30567. }
  30568. ,
  30569. n.easeOutCubic = function(e, t, i, n) {
  30570. return e /= n,
  30571. e--,
  30572. i * (e * e * e + 1) + t
  30573. }
  30574. ,
  30575. n.easeInOutCubic = function(e, t, i, n) {
  30576. return e /= n / 2,
  30577. e < 1 ? i / 2 * e * e * e + t : (e -= 2,
  30578. i / 2 * (e * e * e + 2) + t)
  30579. }
  30580. ,
  30581. n.easeInQuart = function(e, t, i, n) {
  30582. return e /= n,
  30583. i * e * e * e * e + t
  30584. }
  30585. ,
  30586. n.easeOutQuart = function(e, t, i, n) {
  30587. return e /= n,
  30588. e--,
  30589. -i * (e * e * e * e - 1) + t
  30590. }
  30591. ,
  30592. n.easeInOutQuart = function(e, t, i, n) {
  30593. return e /= n / 2,
  30594. e < 1 ? i / 2 * e * e * e * e + t : (e -= 2,
  30595. -i / 2 * (e * e * e * e - 2) + t)
  30596. }
  30597. ,
  30598. n.easeInQuint = function(e, t, i, n) {
  30599. return e /= n,
  30600. i * e * e * e * e * e + t
  30601. }
  30602. ,
  30603. n.easeOutQuint = function(e, t, i, n) {
  30604. return e /= n,
  30605. e--,
  30606. i * (e * e * e * e * e + 1) + t
  30607. }
  30608. ,
  30609. n.easeInOutQuint = function(e, t, i, n) {
  30610. return e /= n / 2,
  30611. e < 1 ? i / 2 * e * e * e * e * e + t : (e -= 2,
  30612. i / 2 * (e * e * e * e * e + 2) + t)
  30613. }
  30614. ,
  30615. n.easeInSine = function(e, t, i, n) {
  30616. return -i * Math.cos(e / n * (Math.PI / 2)) + i + t
  30617. }
  30618. ,
  30619. n.easeOutSine = function(e, t, i, n) {
  30620. return i * Math.sin(e / n * (Math.PI / 2)) + t
  30621. }
  30622. ,
  30623. n.easeInOutSine = function(e, t, i, n) {
  30624. return -i / 2 * (Math.cos(Math.PI * e / n) - 1) + t
  30625. }
  30626. ,
  30627. n.easeInExpo = function(e, t, i, n) {
  30628. return i * Math.pow(2, 10 * (e / n - 1)) + t
  30629. }
  30630. ,
  30631. n.easeOutExpo = function(e, t, i, n) {
  30632. return i * (-Math.pow(2, -10 * e / n) + 1) + t
  30633. }
  30634. ,
  30635. n.easeInOutExpo = function(e, t, i, n) {
  30636. return e /= n / 2,
  30637. e < 1 ? i / 2 * Math.pow(2, 10 * (e - 1)) + t : (e--,
  30638. i / 2 * (-Math.pow(2, -10 * e) + 2) + t)
  30639. }
  30640. ,
  30641. n.easeInCirc = function(e, t, i, n) {
  30642. return e /= n,
  30643. -i * (Math.sqrt(1 - e * e) - 1) + t
  30644. }
  30645. ,
  30646. n.easeOutCirc = function(e, t, i, n) {
  30647. return e /= n,
  30648. e--,
  30649. i * Math.sqrt(1 - e * e) + t
  30650. }
  30651. ,
  30652. n.easeInOutCirc = function(e, t, i, n) {
  30653. return e /= n / 2,
  30654. e < 1 ? -i / 2 * (Math.sqrt(1 - e * e) - 1) + t : (e -= 2,
  30655. i / 2 * (Math.sqrt(1 - e * e) + 1) + t)
  30656. }
  30657. ,
  30658. n.easeInElastic = function(e, t, i, n) {
  30659. var r = 1.70158
  30660. , o = 0
  30661. , a = i;
  30662. return 0 === e ? t : 1 === (e /= n) ? t + i : (o || (o = .3 * n),
  30663. a < Math.abs(i) ? (a = i,
  30664. r = o / 4) : r = o / (2 * Math.PI) * Math.asin(i / a),
  30665. -(a * Math.pow(2, 10 * (e -= 1)) * Math.sin((e * n - r) * (2 * Math.PI) / o)) + t)
  30666. }
  30667. ,
  30668. n.easeOutElastic = function(e, t, i, n) {
  30669. var r = 1.70158
  30670. , o = 0
  30671. , a = i;
  30672. return 0 === e ? t : 1 === (e /= n) ? t + i : (o || (o = .3 * n),
  30673. a < Math.abs(i) ? (a = i,
  30674. r = o / 4) : r = o / (2 * Math.PI) * Math.asin(i / a),
  30675. a * Math.pow(2, -10 * e) * Math.sin((e * n - r) * (2 * Math.PI) / o) + i + t)
  30676. }
  30677. ,
  30678. n.easeInOutElastic = function(e, t, i, n) {
  30679. var r = 1.70158
  30680. , o = 0
  30681. , a = i;
  30682. return 0 === e ? t : 2 === (e /= n / 2) ? t + i : (o || (o = n * (.3 * 1.5)),
  30683. a < Math.abs(i) ? (a = i,
  30684. r = o / 4) : r = o / (2 * Math.PI) * Math.asin(i / a),
  30685. 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)
  30686. }
  30687. ,
  30688. n.easeInBack = function(e, t, i, n, r) {
  30689. return void 0 === r && (r = 1.70158),
  30690. i * (e /= n) * e * ((r + 1) * e - r) + t
  30691. }
  30692. ,
  30693. n.easeOutBack = function(e, t, i, n, r) {
  30694. return void 0 === r && (r = 1.70158),
  30695. i * ((e = e / n - 1) * e * ((r + 1) * e + r) + 1) + t
  30696. }
  30697. ,
  30698. n.easeInOutBack = function(e, t, i, n, r) {
  30699. return void 0 === r && (r = 1.70158),
  30700. (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
  30701. }
  30702. ,
  30703. n.easeOutBounce = function(e, t, i, n) {
  30704. 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
  30705. }
  30706. ,
  30707. n.easeInBounce = function(e, t, i, r) {
  30708. return i - n.easeOutBounce(r - e, 0, i, r) + t
  30709. }
  30710. ,
  30711. n.easeInOutBounce = function(e, t, i, r) {
  30712. 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
  30713. }
  30714. ,
  30715. t.exports = n
  30716. window.easing = n
  30717. }
  30718. , {}],
  30719. 187: [function(e, t, i) {
  30720. "use strict";
  30721. function n() {
  30722. this.events = [],
  30723. this.valid = !1
  30724. }
  30725. var r = e("../enum/Joystick");
  30726. n.prototype.push = function(e, t) {
  30727. this.events.push({
  30728. direction: e,
  30729. pano: t
  30730. }),
  30731. this.valid = !0
  30732. }
  30733. ,
  30734. n.prototype.pop = function(e) {
  30735. var t = this.events.pop();
  30736. return this.events.length < 1 && (this.valid = !1),
  30737. t
  30738. }
  30739. ,
  30740. n.prototype.peek = function() {
  30741. return this.events.length ? this.events[this.events.length - 1] : {
  30742. direction: null,
  30743. pano: null
  30744. }
  30745. }
  30746. ,
  30747. n.prototype.invalidate = function() {
  30748. this.events = [],
  30749. this.valid = !1
  30750. }
  30751. ,
  30752. n.prototype.reversePano = function(e) {
  30753. if (!this.valid)
  30754. return null;
  30755. var t = this.peek();
  30756. return r.opposite(e) === t.direction ? (this.pop(),
  30757. t.pano) : null
  30758. }
  30759. ,
  30760. t.exports = n
  30761. }
  30762. , {
  30763. "../enum/Joystick": 29
  30764. }],
  30765. 188: [function(e, t, i) {
  30766. "use strict";
  30767. window.lerp = t.exports = {
  30768. vector: function(e, t) {
  30769. var i = e.clone();
  30770. return t = t.clone(),
  30771. function(n) {
  30772. e.set(i.x * (1 - n) + t.x * n, i.y * (1 - n) + t.y * n, i.z * (1 - n) + t.z * n)
  30773. }
  30774. },
  30775. quaternion: function(e, t) {
  30776. var i = e.clone();
  30777. return function(n) {
  30778. e.copy(i).slerp(t, n)
  30779. }
  30780. },
  30781. property: function(e, t, i, n) {
  30782. var r = e[t];
  30783. return function(o) {
  30784. e[t] = r * (1 - o) + i * o,
  30785. n && n(e[t])
  30786. }
  30787. },
  30788. uniform: function(e, t, i) {
  30789. var n = e.material.uniforms[t].value;
  30790. return function(r) {
  30791. e.material.uniforms[t] && (e.material.uniforms[t].value = n * (1 - r) + i * r)
  30792. }
  30793. },
  30794. matrix4: function(e, t) {
  30795. var i = e.clone();
  30796. return function(n) {
  30797. for (var r = e.elements, o = i.elements, a = t.elements, s = 0; s < 16; s++)
  30798. r[s] = o[s] * (1 - n) + a[s] * n
  30799. }
  30800. },
  30801. allUniforms: function(e, t, i) {
  30802. var n = e.map(function(e) {
  30803. return this.uniform(e, t, i)
  30804. }
  30805. .bind(this));
  30806. return function(e) {
  30807. n.forEach(function(t) {
  30808. t(e)
  30809. })
  30810. }
  30811. }
  30812. }
  30813. }
  30814. , {}],
  30815. 189: [function(e, t, i) {
  30816. "use strict";
  30817. function n(e) {
  30818. var t, i, o, a, s = e.split("/"), l = "[" + s[s.length - 1].replace(".js", "") + "]", c = {};
  30819. if (n.consoleEnabled) {
  30820. var h = function(e) {
  30821. $("#debug-console").append("<p>" + e + "</p>"),
  30822. $("#debug-console")[0].scrollTop = $("#debug-console")[0].scrollHeight
  30823. };
  30824. t = function(e) {
  30825. h(Array.prototype.slice.call(arguments).join(" "))
  30826. }
  30827. ,
  30828. i = function(e) {
  30829. h(Array.prototype.slice.call(arguments).join(" "))
  30830. }
  30831. ,
  30832. o = function(e) {
  30833. h("WARN: " + Array.prototype.slice.call(arguments).join(" "))
  30834. }
  30835. ,
  30836. a = function(e) {
  30837. h("ERROR: " + Array.prototype.slice.call(arguments).join(" "))
  30838. }
  30839. } else
  30840. console.log ? (t = console.log,
  30841. i = console.info ? console.info : console.log,
  30842. o = console.warn ? console.warn : console.log,
  30843. a = console.error ? console.error : console.log) : t = i = o = a = function() {}
  30844. ;
  30845. var u = function(e) {
  30846. return [l, n.timestamp()].concat(Array.prototype.slice.call(e))
  30847. }
  30848. , d = function(t, i) {
  30849. if (r) {
  30850. var o = Array.prototype.slice.call(t).join(" ");
  30851. r.captureMessage(o, {
  30852. level: i,
  30853. path: e,
  30854. timestamp: n.timestamp()
  30855. })
  30856. }
  30857. }
  30858. , p = function(t, i) {
  30859. if (r) {
  30860. var o = Array.prototype.slice.call(t).join(" ");
  30861. r.captureException(new Error(o), {
  30862. level: i,
  30863. path: e,
  30864. timestamp: n.timestamp()
  30865. })
  30866. }
  30867. };
  30868. return {
  30869. debug: function() {
  30870. n.level >= n.levels.debug && t.apply(console, u(arguments))
  30871. },
  30872. info: function() {
  30873. n.level >= n.levels.info && i.apply(console, u(arguments))
  30874. },
  30875. warn: function() {
  30876. d(arguments, "warn"),
  30877. n.level >= n.levels.warn && o.apply(console, u(arguments))
  30878. },
  30879. error: function() {
  30880. p(arguments, "error"),
  30881. n.level >= n.levels.error && a.apply(console, u(arguments))
  30882. },
  30883. v3str: function(e, t) {
  30884. var i = void 0 === t ? 2 : t;
  30885. return "(" + e.x.toPrecision(i) + ", " + e.y.toPrecision(i) + ", " + e.z.toPrecision(i) + ")"
  30886. },
  30887. eulstr: function(e, t) {
  30888. var i = void 0 === t ? 2 : t;
  30889. return "(" + THREE.Math.radToDeg(e.x).toPrecision(i) + ", " + THREE.Math.radToDeg(e.y).toPrecision(i) + ", " + THREE.Math.radToDeg(e.z).toPrecision(i) + ' "' + e.order + '")'
  30890. },
  30891. time: function(e) {
  30892. n.level >= n.levels.debug && (c[e] = Date.now())
  30893. },
  30894. timeEnd: function(e) {
  30895. if (n.level >= n.levels.debug) {
  30896. var t = c[e];
  30897. if (!t)
  30898. return;
  30899. var i = (Date.now() - t) / 1e3;
  30900. this.debug(e, i + "s")
  30901. }
  30902. }
  30903. }
  30904. }
  30905. var r = window.Raven;
  30906. n.timestamp = function() {
  30907. return (Date.now() - window.navigationStart) / 1e3 + "s"
  30908. }
  30909. ,
  30910. n.levels = {
  30911. debug: 3,
  30912. info: 2,
  30913. warn: 1,
  30914. error: 0
  30915. },
  30916. n.level = n.levels.info,
  30917. t.exports = n
  30918. }
  30919. , {}],
  30920. 190: [function(e, t, i) {
  30921. "use strict";
  30922. var n = e("three")
  30923. , r = e("../enum/GLCubeFaces")
  30924. , o = e("../constants");
  30925. t.exports = {
  30926. convertVisionVector: function(e) {
  30927. return new n.Vector3(e.x,e.z,-e.y)
  30928. },
  30929. convertVisionQuaternion: function(e) {
  30930. 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)))
  30931. },
  30932. convertWorkshopVector: function(e) {
  30933. return new n.Vector3(-e.x,e.y,e.z)
  30934. },
  30935. convertWorkshopQuaternion: function(e) {
  30936. 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))
  30937. },
  30938. convertWorkshopPanoramaQuaternion: function(e) {
  30939. 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)))
  30940. },
  30941. convertWorkshopOrthoZoom: function(e) {// xzw
  30942. //return e === -1 ? -1 : e / 16 * ($("#player").width() / $("#player").height()) / o.workshopApsect
  30943. //return e;
  30944. return e === -1 ? -1 : e * ($("#player").width() / $("#player").height()) / g_snapShotWidth * g_snapShotHeight;
  30945. },
  30946. toPrecision: function(e, t) {//xzw change
  30947. var f = function(e, t){
  30948. var i = Math.pow(10, t);
  30949. return Math.round(e * i) / i
  30950. }
  30951. if(e instanceof Array){
  30952. for(var s=0; s<e.length; s++){
  30953. e[s] = f(e[s],t);
  30954. }
  30955. return e;
  30956. }
  30957. else return f(e,t)
  30958. },
  30959. isEmptyQuaternion: function(e) {
  30960. return 0 === Math.abs(e.x) && 0 === Math.abs(e.y) && 0 === Math.abs(e.z) && 0 === Math.abs(e.w)
  30961. },
  30962. projectPositionToCanvas: function(e, t, i) {
  30963. i = i || new n.Vector3,
  30964. i.copy(e);
  30965. var r = .5 * $("#player").width()
  30966. , o = .5 * $("#player").height();
  30967. return i.project(t),
  30968. i.x = i.x * r + r,
  30969. i.y = -(i.y * o) + o,
  30970. i
  30971. },
  30972. convertScreenPositionToNDC: function(e, t, i) {
  30973. return i = i || new n.Vector2,
  30974. i.x = e / $("#player").width() * 2 - 1,
  30975. i.y = 2 * -(t / $("#player").height()) + 1,
  30976. i
  30977. },
  30978. constrainedTurn: function(e) {
  30979. var t = e % (2 * Math.PI);
  30980. return t = t > Math.PI ? t -= 2 * Math.PI : t < -Math.PI ? t += 2 * Math.PI : t
  30981. },
  30982. getFOVDotThreshold: function(e) {
  30983. return Math.cos(n.Math.degToRad(e / 2))
  30984. },
  30985. transform2DForwardVectorByCubeFace: function(e, t, i, n) {
  30986. switch (e) {
  30987. case r.GL_TEXTURE_CUBE_MAP_POSITIVE_X:
  30988. i.set(1, t.y, t.x);
  30989. break;
  30990. case r.GL_TEXTURE_CUBE_MAP_NEGATIVE_X:
  30991. i.set(-1, t.y, -t.x);
  30992. break;
  30993. case r.GL_TEXTURE_CUBE_MAP_POSITIVE_Y:
  30994. i.set(-t.x, 1, -t.y);
  30995. break;
  30996. case r.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y:
  30997. i.set(-t.x, -1, t.y);
  30998. break;
  30999. case r.GL_TEXTURE_CUBE_MAP_POSITIVE_Z:
  31000. i.set(-t.x, t.y, 1);
  31001. break;
  31002. case r.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z:
  31003. i.set(t.x, t.y, -1)
  31004. }
  31005. n && i.normalize()
  31006. },
  31007. //add:
  31008. getPos2d : function(point, camera, dom){
  31009. var camera = camera ;
  31010. var dom = dom;
  31011. 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);
  31012. var x,y;
  31013. x = (pos.x + 1) / 2 * dom.clientWidth;
  31014. y = (1 - (pos.y + 1) / 2) * dom.clientHeight;
  31015. var inSight = x <= dom.clientWidth && x >= 0
  31016. && y <= dom.clientHeight && y >= 0
  31017. return {
  31018. pos: new THREE.Vector2(x,y),
  31019. vector: pos,
  31020. trueSide : pos.z<1, //trueSide为false时,即使在屏幕范围内可见,也是反方向的另一个不可以被渲染的点 参见Tag.update
  31021. inSight : inSight //在屏幕范围内可见
  31022. };
  31023. },
  31024. getDirByLonLat: function(lon, lat) {
  31025. var dir = new THREE.Vector3();
  31026. var phi = THREE.Math.degToRad(90 - lat);
  31027. var theta = THREE.Math.degToRad(lon);
  31028. dir.x = Math.sin(phi) * Math.cos(theta);
  31029. dir.y = Math.cos(phi);
  31030. dir.z = Math.sin(phi) * Math.sin(theta);
  31031. return dir.negate();
  31032. }
  31033. }
  31034. window.math = t.exports
  31035. }
  31036. , {
  31037. "../constants": 8,
  31038. "../enum/GLCubeFaces": 25,
  31039. three: 217
  31040. }],
  31041. 191: [function(e, t, i) {
  31042. "use strict";
  31043. function n(e, t, i) {
  31044. return a.map(function(n, o) {
  31045. return e.get("pan/" + i + "/" + t + "_skybox" + r(n) + ".jpg")
  31046. }
  31047. .bind(this))
  31048. }
  31049. function r(e) {
  31050. return s[e]
  31051. }
  31052. var o = e("../enum/GLCubeFaces")
  31053. , a = [0, 1, 2, 3, 4, 5]
  31054. , s = {
  31055. 0: o.GL_TEXTURE_CUBE_MAP_POSITIVE_Y,
  31056. 1: o.GL_TEXTURE_CUBE_MAP_POSITIVE_Z,
  31057. 2: o.GL_TEXTURE_CUBE_MAP_POSITIVE_X,
  31058. 3: o.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z,
  31059. 4: o.GL_TEXTURE_CUBE_MAP_NEGATIVE_X,
  31060. 5: o.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y
  31061. };
  31062. t.exports = {
  31063. mapFaceToCubemapFace: r,
  31064. getCubemapUrls: n
  31065. }
  31066. }
  31067. , {
  31068. "../enum/GLCubeFaces": 25
  31069. }],
  31070. 192: [function(e, t, i) {
  31071. "use strict";
  31072. t.exports = {
  31073. captureErrors: function(e, t, i) {
  31074. if ("Raven"in window) {
  31075. Raven.config(e, t).install(),
  31076. i && Raven.setTagsContext(i);
  31077. var n = console.warn
  31078. , r = console.error;
  31079. console.warn = function() {
  31080. var e = Array.prototype.slice.call(arguments);
  31081. Raven.captureMessage(e.join(" "), {
  31082. level: "warning"
  31083. }),
  31084. n.apply(console, e)
  31085. }
  31086. ,
  31087. console.error = function() {
  31088. var e = Array.prototype.slice.call(arguments);
  31089. Raven.captureException(new Error(e.join(" ")), {
  31090. level: "error"
  31091. }),
  31092. r.apply(console, e)
  31093. }
  31094. } else
  31095. console.error("Raven not found, not capturing errors.")
  31096. }
  31097. }
  31098. }
  31099. , {}],
  31100. 193: [function(e, t, i) {
  31101. (function(i) {
  31102. "use strict";
  31103. var n = e("./browser")
  31104. , r = e("../constants")
  31105. , o = e("url")
  31106. , a = e("./logger")
  31107. , ss = e('three')
  31108. , s = new a(i)
  31109. , l = {
  31110. getAuthorizationHeader: function() {
  31111. var e = n.valueFromHash("auth");
  31112. if (e)
  31113. return e.replace(",", " ");
  31114. var t = n.valueFromCookie("token");
  31115. return t ? "Token " + t : null
  31116. },
  31117. parseSidUrl: function(e) {
  31118. var t, i;
  31119. t=g_Prefix;
  31120. if (e = e || "",
  31121. e.match(/^https?/)) {
  31122. var n = o.parse(e);
  31123. t = g_Prefix,
  31124. i = e
  31125. } else{
  31126. //xzw 原先的不能用
  31127. //t = window.location.protocol + "//" + window.location.host, //MP
  31128. t = g_Prefix
  31129. //i = t + "/api/player/models/" + e; //MP
  31130. i = t + "data/" + e;
  31131. }
  31132. return {
  31133. urlBase: t,
  31134. urlModel: i,
  31135. urlFiles: i + (i.match(/\/$/) ? "files" : "/files"),
  31136. urlThumb: i + (i.match(/\/$/) ? "thumb" : "/thumb")
  31137. }
  31138. },
  31139. getModelIDFromQueryString: function() {
  31140. return n.valueFromHash("model") || n.valueFromHash("m")
  31141. },
  31142. /* normalizeModeldata: function(e, t) {//xzw 修改导览images数据
  31143. e = JSON.parse(JSON.stringify(e));
  31144. var i = null;
  31145. if (e.images.forEach(function(n) {
  31146. if(!n.metadata) return;
  31147. if ("string" == typeof n.metadata)
  31148. try {
  31149. n.metadata = JSON.parse(n.metadata)
  31150. } catch (e) {
  31151. s.warn("Unable to parse image metadata"),
  31152. n.metadata = null
  31153. }
  31154. else{
  31155. "object" == typeof n.metadata && s.debug("image.metadata already a JSON object");
  31156. }
  31157. if(n.metadata.camera_position instanceof Array){//xzw 改的格式
  31158. n.metadata.camera_position = new ss.Vector3().fromArray(n.metadata.camera_position);
  31159. n.metadata.camera_quaternion = new ss.Quaternion().fromArray(n.metadata.camera_quaternion);
  31160. }else{
  31161. n.metadata.camera_quaternion && (n.metadata.camera_quaternion = t.convertWorkshopQuaternion(n.metadata.camera_quaternion)),
  31162. n.metadata.camera_position && (n.metadata.camera_position = t.convertWorkshopVector(n.metadata.camera_position))
  31163. n.metadata.zoom = n.metadata.zoom || 1;
  31164. }
  31165. !i && e.icon && e.icon === n.sid && (i = n.metadata)
  31166. }),
  31167. //icon初始视角的:
  31168. i && i.camera_quaternion && i.camera_position && i.scan_position && i.scan_quaternion) {
  31169. var n = {};
  31170. n.pano = {
  31171. quaternion: t.convertWorkshopPanoramaQuaternion(i.scan_quaternion),
  31172. position: t.convertWorkshopVector(i.scan_position),
  31173. uuid: i.scan_id
  31174. },
  31175. n.camera = {
  31176. quaternion: i.camera_quaternion,
  31177. position: i.camera_position
  31178. },
  31179. e.startPano = n
  31180. }
  31181. return e
  31182. },
  31183. */
  31184. normalizeModeldata: function(e, t) {//xzw 修改导览images数据
  31185. e = JSON.parse(JSON.stringify(e));
  31186. var i = null;
  31187. var deal = function(n) {
  31188. if(!n.metadata) return;
  31189. if ("string" == typeof n.metadata)
  31190. try {
  31191. n.metadata = JSON.parse(n.metadata)
  31192. } catch (e) {
  31193. s.warn("Unable to parse image metadata"),
  31194. n.metadata = null
  31195. }
  31196. else{
  31197. "object" == typeof n.metadata && s.debug("image.metadata already a JSON object");
  31198. }
  31199. if(n.metadata.camera_position instanceof Array){//xzw 改的格式
  31200. n.metadata.camera_position = new ss.Vector3().fromArray(n.metadata.camera_position);
  31201. n.metadata.camera_quaternion = new ss.Quaternion().fromArray(n.metadata.camera_quaternion);
  31202. }else{
  31203. n.metadata.camera_position = new ss.Vector3().copy(n.metadata.camera_position)
  31204. n.metadata.camera_quaternion = new ss.Quaternion().copy(n.metadata.camera_quaternion)
  31205. /* n.metadata.camera_quaternion && (n.metadata.camera_quaternion = i.convertWorkshopQuaternion(n.metadata.camera_quaternion)),
  31206. n.metadata.camera_position && (n.metadata.camera_position = i.convertWorkshopVector(n.metadata.camera_position)) */
  31207. }
  31208. !i && e.icon && e.icon === n.sid && (i = n.metadata)
  31209. }
  31210. //改
  31211. e.images.forEach(info=>{
  31212. if(info.locations){
  31213. info.locations.forEach(a=>deal(a))
  31214. }else{
  31215. deal(info)
  31216. }
  31217. })
  31218. //icon初始视角的:
  31219. if(i && i.camera_quaternion && i.camera_position && i.scan_position && i.scan_quaternion) {
  31220. var n = {};
  31221. n.pano = {
  31222. quaternion: t.convertWorkshopPanoramaQuaternion(i.scan_quaternion),
  31223. position: t.convertWorkshopVector(i.scan_position),
  31224. uuid: i.scan_id
  31225. },
  31226. n.camera = {
  31227. quaternion: i.camera_quaternion,
  31228. position: i.camera_position
  31229. },
  31230. e.startPano = n
  31231. }
  31232. return e
  31233. },
  31234. visionVersionToInt: function() {
  31235. var e = new RegExp(["(?:[0-9.]+\\.){1,4}", "([0-9]+)", "[^\\.]*$"].join(""));
  31236. return function(t) {
  31237. if (!t)
  31238. throw new Error("Vision version is required");
  31239. var i = e.exec(t);
  31240. if (null === i)
  31241. throw new Error("String is not a vision version: " + t);
  31242. return parseInt(i[1])
  31243. }
  31244. }(),
  31245. modelDataPromisesTiles: function(e) {
  31246. var vision_version = e.vision_version || window.DATA.vision_version
  31247. if (vision_version)
  31248. try {
  31249. return l.visionVersionToInt(vision_version) >= l.visionVersionToInt(r.visionTilingStartVersion)
  31250. } catch (t) {
  31251. s.warn("Invalid vision version: " + vision_version)
  31252. }
  31253. // var t = e.created ? new Date(e.created) : null;
  31254. // return t && t >= r.visionTilingStartDate
  31255. return false
  31256. }
  31257. };
  31258. t.exports = l
  31259. }
  31260. ).call(this, "/js/util/showcase.js")
  31261. }
  31262. , {
  31263. "../constants": 8,
  31264. "./browser": 182,
  31265. "./logger": 189,
  31266. three:217,
  31267. url: 208
  31268. }],
  31269. 194: [function(e, t, i) {
  31270. "use strict";
  31271. var n = e("../util/ajax")
  31272. , r = e("three")
  31273. , o = e("../settings")
  31274. , a = {};
  31275. t.exports = {
  31276. load: function(e, t, i) {
  31277. var s = a[e];
  31278. return s ? (t && setTimeout(function() {
  31279. t(s)
  31280. }, 1),
  31281. s) : (s = new r.Texture,
  31282. o.minimalMemoryMode && (s.minFilter = r.LinearFilter,
  31283. s.magFilter = r.LinearFilter,
  31284. s.generateMipmaps = !1),
  31285. s.sourceFile = e,
  31286. a[e] = s,
  31287. n.getImage(e).then(function(e) {
  31288. s.image = e,
  31289. s.needsUpdate = !0,
  31290. t && t(s)
  31291. }).fail(i),
  31292. s)
  31293. },
  31294. loadBase64: function(e, t) {
  31295. t = t || "png";
  31296. var i = new r.Texture;
  31297. return i.image = document.createElement("img"),
  31298. i.image.setAttribute("src", "data:image/" + t + ";base64," + e),
  31299. o.minimalMemoryMode && (i.minFilter = r.LinearFilter,
  31300. i.magFilter = r.LinearFilter,
  31301. i.generateMipmaps = !1),
  31302. i.needsUpdate = !0,
  31303. i
  31304. },
  31305. isLoaded: function(e) {
  31306. return !!a[e]
  31307. }
  31308. }
  31309. window.Texture = t.exports
  31310. }
  31311. , {
  31312. "../settings": 166,
  31313. "../util/ajax": 181,
  31314. three: 217
  31315. }],
  31316. 195: [function(e, t, i) {
  31317. "use strict";
  31318. var n = e("./easing");
  31319. window.transitions = t.exports = {
  31320. globalDone: null,
  31321. funcs: [],
  31322. counter: 0,
  31323. uniqueID: 0,
  31324. start: function(e, t, i, r, o, a, s) {
  31325. return r = r || 0,
  31326. this.funcs.push({
  31327. func: e,
  31328. current: -r * Math.abs(t),
  31329. duration: (1 - Math.max(r, 0)) * Math.abs(t),
  31330. done: i,
  31331. easing: o || n.linearTween,
  31332. cycling: t < 0,
  31333. running: !0,
  31334. debug: r < 0,
  31335. name: a || "T" + this.counter,
  31336. id: void 0 === s ? this.counter : s,
  31337. paused: !1
  31338. }),
  31339. e(0, 16),
  31340. this.counter += 1,
  31341. e
  31342. },
  31343. trigger: function(e) {
  31344. var t = void 0 === e.delayRatio ? 0 : e.delayRatio
  31345. , i = e.func || function() {}
  31346. , r = void 0 === e.duration ? 0 : e.duration;
  31347. void 0 !== e.cycling && e.cycling && (r = -Math.abs(r));
  31348. var o = e.done || null
  31349. , a = e.easing || n.linearTween
  31350. , s = e.name || "R" + this.counter
  31351. , l = void 0 === e.id ? this.counter : e.id;
  31352. return this.start(i, r, o, t, a, s, l)
  31353. },
  31354. setTimeout: function(e, t, i) {
  31355. var n = void 0 === i ? this.counter : i;
  31356. return this.trigger({
  31357. done: e,
  31358. duration: void 0 === t ? 0 : t,
  31359. name: "O" + this.counter,
  31360. id: n
  31361. })
  31362. },
  31363. pause: function() {
  31364. this.paused = !0
  31365. },
  31366. resume: function() {
  31367. this.paused = !1
  31368. },
  31369. update: function(e) {
  31370. this.funcs.forEach(function(t) {
  31371. if (!(t.paused || (t.current += 1e3 * e,
  31372. t.current < 0)))
  31373. if (t.current >= t.duration && !t.cycling) {
  31374. var i = t.easing(1, 0, 1, 1);
  31375. t.func(i, 1e3 * e),
  31376. t.done && t.done(),
  31377. t.running = !1
  31378. } else {
  31379. var n = t.easing(t.current % t.duration / t.duration, 0, 1, 1)
  31380. , r = t.func(n, 1e3 * e) || !1;
  31381. r && (t.done && t.done(),
  31382. t.running = !1)
  31383. }
  31384. });
  31385. var t = this.funcs.length;
  31386. this.funcs = this.funcs.filter(function(e) {
  31387. return e.running
  31388. });
  31389. var i = this.funcs.length;
  31390. if (t > 0 && 0 === i && this.globalDone) {
  31391. var n = this.globalDone;
  31392. this.globalDone = null,
  31393. n()
  31394. }
  31395. },
  31396. adjustSpeed: function(e, t) {
  31397. for (var i = this.getById(e), n = 0; n < i.length; n++) {
  31398. var r = i[n];
  31399. r.duration /= t,
  31400. r.current /= t
  31401. }
  31402. },
  31403. getById: function(e) {
  31404. return this.funcs.filter(function(t) {
  31405. return e === t.id
  31406. })
  31407. },
  31408. get: function(e) {
  31409. for (var t = 0; t < this.funcs.length; t += 1)
  31410. if (this.funcs[t].func === e)
  31411. return this.funcs[t];
  31412. return null
  31413. },
  31414. isRunning: function(e) {
  31415. var t = this.get(e);
  31416. return null !== t && t.running
  31417. },
  31418. countActive: function() {
  31419. for (var e = 0, t = 0; t < this.funcs.length; t += 1)
  31420. e += this.funcs[t].running;
  31421. return e
  31422. },
  31423. listActive: function() {
  31424. for (var e = [], t = 0; t < this.funcs.length; t += 1)
  31425. this.funcs[t].running && e.push(this.funcs[t].name);
  31426. return e
  31427. },
  31428. done: function(e) {
  31429. this.globalDone = e
  31430. },
  31431. cancelById: function(e) {
  31432. var t = void 0 === e ? 0 : e;
  31433. this.funcs = this.funcs.filter(function(e) {
  31434. return e.id !== t
  31435. })
  31436. },
  31437. cancel: function(e) {
  31438. this.funcs = this.funcs.filter(function(t) {
  31439. return t.func !== e
  31440. })
  31441. },
  31442. getUniqueId: function() {
  31443. return this.uniqueID -= 1,
  31444. this.uniqueID
  31445. }
  31446. }
  31447. }
  31448. , {
  31449. "./easing": 186
  31450. }],
  31451. 196: [function(e, t, i) {
  31452. function n(e) {
  31453. if (this.set = {},
  31454. this.infContains = function() {
  31455. return !0
  31456. }
  31457. ,
  31458. "object" == typeof e)
  31459. if (e instanceof Array)
  31460. for (var t = 0; t < e.length; t++)
  31461. this.set[e[t]] = !0;
  31462. else
  31463. this.set = e;
  31464. else if ("function" == typeof e)
  31465. this.infContains = e;
  31466. else if ("undefined" != typeof e)
  31467. throw new Error("set must be either an array or an object.")
  31468. }
  31469. t.exports = n,
  31470. n.prototype.contains = function(e) {
  31471. return !!this.set[e]
  31472. }
  31473. ,
  31474. n.prototype.has = n.prototype.contains,
  31475. n.prototype.add = function(e) {
  31476. if (1 == arguments.length)
  31477. this.set[e] = !0;
  31478. else
  31479. for (var t = 0; t < arguments.length; t++)
  31480. this.set[arguments[t]] = !0
  31481. }
  31482. ,
  31483. n.prototype.addAll = function(e) {
  31484. if ("object" != typeof e && !(e instanceof Array))
  31485. throw new Error("arr must be an array.");
  31486. for (var t = 0; t < e.length; t++)
  31487. this.add(e[t])
  31488. }
  31489. ,
  31490. n.prototype.remove = function(e) {
  31491. if (1 == arguments.length)
  31492. delete this.set[e];
  31493. else
  31494. for (var t = 0; t < arguments.length; t++)
  31495. delete this.set[arguments[t]]
  31496. }
  31497. ,
  31498. n.prototype.delete = n.prototype.remove,
  31499. n.prototype.clear = function() {
  31500. this.set = {}
  31501. }
  31502. ,
  31503. n.prototype.size = function() {
  31504. return Object.keys(this.set).length
  31505. }
  31506. ,
  31507. n.prototype.toString = function() {
  31508. return "{" + Object.keys(this.set).toString() + "}"
  31509. }
  31510. ,
  31511. n.prototype.toArray = function() {
  31512. return "undefined" == typeof this.set ? [] : Object.keys(this.set)
  31513. }
  31514. ,
  31515. n.prototype["*values"] = n.prototype.toArray
  31516. }
  31517. , {}],
  31518. 197: [function(e, t, i) {}
  31519. , {}],
  31520. 198: [function(e, t, i) {
  31521. (function(t) {
  31522. "use strict";
  31523. function n() {
  31524. try {
  31525. var e = new Uint8Array(1);
  31526. return e.__proto__ = {
  31527. __proto__: Uint8Array.prototype,
  31528. foo: function() {
  31529. return 42
  31530. }
  31531. },
  31532. 42 === e.foo() && "function" == typeof e.subarray && 0 === e.subarray(1, 1).byteLength
  31533. } catch (e) {
  31534. return !1
  31535. }
  31536. }
  31537. function r() {
  31538. return a.TYPED_ARRAY_SUPPORT ? 2147483647 : 1073741823
  31539. }
  31540. function o(e, t) {
  31541. if (r() < t)
  31542. throw new RangeError("Invalid typed array length");
  31543. return a.TYPED_ARRAY_SUPPORT ? (e = new Uint8Array(t),
  31544. e.__proto__ = a.prototype) : (null === e && (e = new a(t)),
  31545. e.length = t),
  31546. e
  31547. }
  31548. function a(e, t, i) {
  31549. if (!(a.TYPED_ARRAY_SUPPORT || this instanceof a))
  31550. return new a(e,t,i);
  31551. if ("number" == typeof e) {
  31552. if ("string" == typeof t)
  31553. throw new Error("If encoding is specified then the first argument must be a string");
  31554. return h(this, e)
  31555. }
  31556. return s(this, e, t, i)
  31557. }
  31558. function s(e, t, i, n) {
  31559. if ("number" == typeof t)
  31560. throw new TypeError('"value" argument must not be a number');
  31561. return "undefined" != typeof ArrayBuffer && t instanceof ArrayBuffer ? p(e, t, i, n) : "string" == typeof t ? u(e, t, i) : f(e, t)
  31562. }
  31563. function l(e) {
  31564. if ("number" != typeof e)
  31565. throw new TypeError('"size" argument must be a number');
  31566. if (e < 0)
  31567. throw new RangeError('"size" argument must not be negative')
  31568. }
  31569. function c(e, t, i, n) {
  31570. return l(t),
  31571. 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)
  31572. }
  31573. function h(e, t) {
  31574. if (l(t),
  31575. e = o(e, t < 0 ? 0 : 0 | g(t)),
  31576. !a.TYPED_ARRAY_SUPPORT)
  31577. for (var i = 0; i < t; ++i)
  31578. e[i] = 0;
  31579. return e
  31580. }
  31581. function u(e, t, i) {
  31582. if ("string" == typeof i && "" !== i || (i = "utf8"),
  31583. !a.isEncoding(i))
  31584. throw new TypeError('"encoding" must be a valid string encoding');
  31585. var n = 0 | v(t, i);
  31586. e = o(e, n);
  31587. var r = e.write(t, i);
  31588. return r !== n && (e = e.slice(0, r)),
  31589. e
  31590. }
  31591. function d(e, t) {
  31592. var i = t.length < 0 ? 0 : 0 | g(t.length);
  31593. e = o(e, i);
  31594. for (var n = 0; n < i; n += 1)
  31595. e[n] = 255 & t[n];
  31596. return e
  31597. }
  31598. function p(e, t, i, n) {
  31599. if (t.byteLength,
  31600. i < 0 || t.byteLength < i)
  31601. throw new RangeError("'offset' is out of bounds");
  31602. if (t.byteLength < i + (n || 0))
  31603. throw new RangeError("'length' is out of bounds");
  31604. return t = void 0 === i && void 0 === n ? new Uint8Array(t) : void 0 === n ? new Uint8Array(t,i) : new Uint8Array(t,i,n),
  31605. a.TYPED_ARRAY_SUPPORT ? (e = t,
  31606. e.__proto__ = a.prototype) : e = d(e, t),
  31607. e
  31608. }
  31609. function f(e, t) {
  31610. if (a.isBuffer(t)) {
  31611. var i = 0 | g(t.length);
  31612. return e = o(e, i),
  31613. 0 === e.length ? e : (t.copy(e, 0, 0, i),
  31614. e)
  31615. }
  31616. if (t) {
  31617. if ("undefined" != typeof ArrayBuffer && t.buffer instanceof ArrayBuffer || "length"in t)
  31618. return "number" != typeof t.length || K(t.length) ? o(e, 0) : d(e, t);
  31619. if ("Buffer" === t.type && $(t.data))
  31620. return d(e, t.data)
  31621. }
  31622. throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")
  31623. }
  31624. function g(e) {
  31625. if (e >= r())
  31626. throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x" + r().toString(16) + " bytes");
  31627. return 0 | e
  31628. }
  31629. function m(e) {
  31630. return +e != e && (e = 0),
  31631. a.alloc(+e)
  31632. }
  31633. function v(e, t) {
  31634. if (a.isBuffer(e))
  31635. return e.length;
  31636. if ("undefined" != typeof ArrayBuffer && "function" == typeof ArrayBuffer.isView && (ArrayBuffer.isView(e) || e instanceof ArrayBuffer))
  31637. return e.byteLength;
  31638. "string" != typeof e && (e = "" + e);
  31639. var i = e.length;
  31640. if (0 === i)
  31641. return 0;
  31642. for (var n = !1; ; )
  31643. switch (t) {
  31644. case "ascii":
  31645. case "latin1":
  31646. case "binary":
  31647. return i;
  31648. case "utf8":
  31649. case "utf-8":
  31650. case void 0:
  31651. return j(e).length;
  31652. case "ucs2":
  31653. case "ucs-2":
  31654. case "utf16le":
  31655. case "utf-16le":
  31656. return 2 * i;
  31657. case "hex":
  31658. return i >>> 1;
  31659. case "base64":
  31660. return Z(e).length;
  31661. default:
  31662. if (n)
  31663. return j(e).length;
  31664. t = ("" + t).toLowerCase(),
  31665. n = !0
  31666. }
  31667. }
  31668. function A(e, t, i) {
  31669. var n = !1;
  31670. if ((void 0 === t || t < 0) && (t = 0),
  31671. t > this.length)
  31672. return "";
  31673. if ((void 0 === i || i > this.length) && (i = this.length),
  31674. i <= 0)
  31675. return "";
  31676. if (i >>>= 0,
  31677. t >>>= 0,
  31678. i <= t)
  31679. return "";
  31680. for (e || (e = "utf8"); ; )
  31681. switch (e) {
  31682. case "hex":
  31683. return L(this, t, i);
  31684. case "utf8":
  31685. case "utf-8":
  31686. return M(this, t, i);
  31687. case "ascii":
  31688. return P(this, t, i);
  31689. case "latin1":
  31690. case "binary":
  31691. return O(this, t, i);
  31692. case "base64":
  31693. return S(this, t, i);
  31694. case "ucs2":
  31695. case "ucs-2":
  31696. case "utf16le":
  31697. case "utf-16le":
  31698. return D(this, t, i);
  31699. default:
  31700. if (n)
  31701. throw new TypeError("Unknown encoding: " + e);
  31702. e = (e + "").toLowerCase(),
  31703. n = !0
  31704. }
  31705. }
  31706. function y(e, t, i) {
  31707. var n = e[t];
  31708. e[t] = e[i],
  31709. e[i] = n
  31710. }
  31711. function C(e, t, i, n, r) {
  31712. if (0 === e.length)
  31713. return -1;
  31714. if ("string" == typeof i ? (n = i,
  31715. i = 0) : i > 2147483647 ? i = 2147483647 : i < -2147483648 && (i = -2147483648),
  31716. i = +i,
  31717. isNaN(i) && (i = r ? 0 : e.length - 1),
  31718. i < 0 && (i = e.length + i),
  31719. i >= e.length) {
  31720. if (r)
  31721. return -1;
  31722. i = e.length - 1
  31723. } else if (i < 0) {
  31724. if (!r)
  31725. return -1;
  31726. i = 0
  31727. }
  31728. if ("string" == typeof t && (t = a.from(t, n)),
  31729. a.isBuffer(t))
  31730. return 0 === t.length ? -1 : I(e, t, i, n, r);
  31731. if ("number" == typeof t)
  31732. return t &= 255,
  31733. 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);
  31734. throw new TypeError("val must be string, number or Buffer")
  31735. }
  31736. function I(e, t, i, n, r) {
  31737. function o(e, t) {
  31738. return 1 === a ? e[t] : e.readUInt16BE(t * a)
  31739. }
  31740. var a = 1
  31741. , s = e.length
  31742. , l = t.length;
  31743. if (void 0 !== n && (n = String(n).toLowerCase(),
  31744. "ucs2" === n || "ucs-2" === n || "utf16le" === n || "utf-16le" === n)) {
  31745. if (e.length < 2 || t.length < 2)
  31746. return -1;
  31747. a = 2,
  31748. s /= 2,
  31749. l /= 2,
  31750. i /= 2
  31751. }
  31752. var c;
  31753. if (r) {
  31754. var h = -1;
  31755. for (c = i; c < s; c++)
  31756. if (o(e, c) === o(t, h === -1 ? 0 : c - h)) {
  31757. if (h === -1 && (h = c),
  31758. c - h + 1 === l)
  31759. return h * a
  31760. } else
  31761. h !== -1 && (c -= c - h),
  31762. h = -1
  31763. } else
  31764. for (i + l > s && (i = s - l),
  31765. c = i; c >= 0; c--) {
  31766. for (var u = !0, d = 0; d < l; d++)
  31767. if (o(e, c + d) !== o(t, d)) {
  31768. u = !1;
  31769. break
  31770. }
  31771. if (u)
  31772. return c
  31773. }
  31774. return -1
  31775. }
  31776. function E(e, t, i, n) {
  31777. i = Number(i) || 0;
  31778. var r = e.length - i;
  31779. n ? (n = Number(n),
  31780. n > r && (n = r)) : n = r;
  31781. var o = t.length;
  31782. if (o % 2 !== 0)
  31783. throw new TypeError("Invalid hex string");
  31784. n > o / 2 && (n = o / 2);
  31785. for (var a = 0; a < n; ++a) {
  31786. var s = parseInt(t.substr(2 * a, 2), 16);
  31787. if (isNaN(s))
  31788. return a;
  31789. e[i + a] = s
  31790. }
  31791. return a
  31792. }
  31793. function b(e, t, i, n) {
  31794. return q(j(t, e.length - i), e, i, n)
  31795. }
  31796. function w(e, t, i, n) {
  31797. return q(Y(t), e, i, n)
  31798. }
  31799. function _(e, t, i, n) {
  31800. return w(e, t, i, n)
  31801. }
  31802. function T(e, t, i, n) {
  31803. return q(Z(t), e, i, n)
  31804. }
  31805. function x(e, t, i, n) {
  31806. return q(X(t, e.length - i), e, i, n)
  31807. }
  31808. function S(e, t, i) {
  31809. return 0 === t && i === e.length ? Q.fromByteArray(e) : Q.fromByteArray(e.slice(t, i))
  31810. }
  31811. function M(e, t, i) {
  31812. i = Math.min(e.length, i);
  31813. for (var n = [], r = t; r < i; ) {
  31814. var o = e[r]
  31815. , a = null
  31816. , s = o > 239 ? 4 : o > 223 ? 3 : o > 191 ? 2 : 1;
  31817. if (r + s <= i) {
  31818. var l, c, h, u;
  31819. switch (s) {
  31820. case 1:
  31821. o < 128 && (a = o);
  31822. break;
  31823. case 2:
  31824. l = e[r + 1],
  31825. 128 === (192 & l) && (u = (31 & o) << 6 | 63 & l,
  31826. u > 127 && (a = u));
  31827. break;
  31828. case 3:
  31829. l = e[r + 1],
  31830. c = e[r + 2],
  31831. 128 === (192 & l) && 128 === (192 & c) && (u = (15 & o) << 12 | (63 & l) << 6 | 63 & c,
  31832. u > 2047 && (u < 55296 || u > 57343) && (a = u));
  31833. break;
  31834. case 4:
  31835. l = e[r + 1],
  31836. c = e[r + 2],
  31837. h = e[r + 3],
  31838. 128 === (192 & l) && 128 === (192 & c) && 128 === (192 & h) && (u = (15 & o) << 18 | (63 & l) << 12 | (63 & c) << 6 | 63 & h,
  31839. u > 65535 && u < 1114112 && (a = u))
  31840. }
  31841. }
  31842. null === a ? (a = 65533,
  31843. s = 1) : a > 65535 && (a -= 65536,
  31844. n.push(a >>> 10 & 1023 | 55296),
  31845. a = 56320 | 1023 & a),
  31846. n.push(a),
  31847. r += s
  31848. }
  31849. return R(n)
  31850. }
  31851. function R(e) {
  31852. var t = e.length;
  31853. if (t <= ee)
  31854. return String.fromCharCode.apply(String, e);
  31855. for (var i = "", n = 0; n < t; )
  31856. i += String.fromCharCode.apply(String, e.slice(n, n += ee));
  31857. return i
  31858. }
  31859. function P(e, t, i) {
  31860. var n = "";
  31861. i = Math.min(e.length, i);
  31862. for (var r = t; r < i; ++r)
  31863. n += String.fromCharCode(127 & e[r]);
  31864. return n
  31865. }
  31866. function O(e, t, i) {
  31867. var n = "";
  31868. i = Math.min(e.length, i);
  31869. for (var r = t; r < i; ++r)
  31870. n += String.fromCharCode(e[r]);
  31871. return n
  31872. }
  31873. function L(e, t, i) {
  31874. var n = e.length;
  31875. (!t || t < 0) && (t = 0),
  31876. (!i || i < 0 || i > n) && (i = n);
  31877. for (var r = "", o = t; o < i; ++o)
  31878. r += W(e[o]);
  31879. return r
  31880. }
  31881. function D(e, t, i) {
  31882. for (var n = e.slice(t, i), r = "", o = 0; o < n.length; o += 2)
  31883. r += String.fromCharCode(n[o] + 256 * n[o + 1]);
  31884. return r
  31885. }
  31886. function N(e, t, i) {
  31887. if (e % 1 !== 0 || e < 0)
  31888. throw new RangeError("offset is not uint");
  31889. if (e + t > i)
  31890. throw new RangeError("Trying to access beyond buffer length")
  31891. }
  31892. function B(e, t, i, n, r, o) {
  31893. if (!a.isBuffer(e))
  31894. throw new TypeError('"buffer" argument must be a Buffer instance');
  31895. if (t > r || t < o)
  31896. throw new RangeError('"value" argument is out of bounds');
  31897. if (i + n > e.length)
  31898. throw new RangeError("Index out of range")
  31899. }
  31900. function F(e, t, i, n) {
  31901. t < 0 && (t = 65535 + t + 1);
  31902. for (var r = 0, o = Math.min(e.length - i, 2); r < o; ++r)
  31903. e[i + r] = (t & 255 << 8 * (n ? r : 1 - r)) >>> 8 * (n ? r : 1 - r)
  31904. }
  31905. function V(e, t, i, n) {
  31906. t < 0 && (t = 4294967295 + t + 1);
  31907. for (var r = 0, o = Math.min(e.length - i, 4); r < o; ++r)
  31908. e[i + r] = t >>> 8 * (n ? r : 3 - r) & 255
  31909. }
  31910. function U(e, t, i, n, r, o) {
  31911. if (i + n > e.length)
  31912. throw new RangeError("Index out of range");
  31913. if (i < 0)
  31914. throw new RangeError("Index out of range")
  31915. }
  31916. function k(e, t, i, n, r) {
  31917. return r || U(e, t, i, 4, 3.4028234663852886e38, -3.4028234663852886e38),
  31918. J.write(e, t, i, n, 23, 4),
  31919. i + 4
  31920. }
  31921. function H(e, t, i, n, r) {
  31922. return r || U(e, t, i, 8, 1.7976931348623157e308, -1.7976931348623157e308),
  31923. J.write(e, t, i, n, 52, 8),
  31924. i + 8
  31925. }
  31926. function G(e) {
  31927. if (e = z(e).replace(te, ""),
  31928. e.length < 2)
  31929. return "";
  31930. for (; e.length % 4 !== 0; )
  31931. e += "=";
  31932. return e
  31933. }
  31934. function z(e) {
  31935. return e.trim ? e.trim() : e.replace(/^\s+|\s+$/g, "")
  31936. }
  31937. function W(e) {
  31938. return e < 16 ? "0" + e.toString(16) : e.toString(16)
  31939. }
  31940. function j(e, t) {
  31941. t = t || 1 / 0;
  31942. for (var i, n = e.length, r = null, o = [], a = 0; a < n; ++a) {
  31943. if (i = e.charCodeAt(a),
  31944. i > 55295 && i < 57344) {
  31945. if (!r) {
  31946. if (i > 56319) {
  31947. (t -= 3) > -1 && o.push(239, 191, 189);
  31948. continue
  31949. }
  31950. if (a + 1 === n) {
  31951. (t -= 3) > -1 && o.push(239, 191, 189);
  31952. continue
  31953. }
  31954. r = i;
  31955. continue
  31956. }
  31957. if (i < 56320) {
  31958. (t -= 3) > -1 && o.push(239, 191, 189),
  31959. r = i;
  31960. continue
  31961. }
  31962. i = (r - 55296 << 10 | i - 56320) + 65536
  31963. } else
  31964. r && (t -= 3) > -1 && o.push(239, 191, 189);
  31965. if (r = null,
  31966. i < 128) {
  31967. if ((t -= 1) < 0)
  31968. break;
  31969. o.push(i)
  31970. } else if (i < 2048) {
  31971. if ((t -= 2) < 0)
  31972. break;
  31973. o.push(i >> 6 | 192, 63 & i | 128)
  31974. } else if (i < 65536) {
  31975. if ((t -= 3) < 0)
  31976. break;
  31977. o.push(i >> 12 | 224, i >> 6 & 63 | 128, 63 & i | 128)
  31978. } else {
  31979. if (!(i < 1114112))
  31980. throw new Error("Invalid code point");
  31981. if ((t -= 4) < 0)
  31982. break;
  31983. o.push(i >> 18 | 240, i >> 12 & 63 | 128, i >> 6 & 63 | 128, 63 & i | 128)
  31984. }
  31985. }
  31986. return o
  31987. }
  31988. function Y(e) {
  31989. for (var t = [], i = 0; i < e.length; ++i)
  31990. t.push(255 & e.charCodeAt(i));
  31991. return t
  31992. }
  31993. function X(e, t) {
  31994. for (var i, n, r, o = [], a = 0; a < e.length && !((t -= 2) < 0); ++a)
  31995. i = e.charCodeAt(a),
  31996. n = i >> 8,
  31997. r = i % 256,
  31998. o.push(r),
  31999. o.push(n);
  32000. return o
  32001. }
  32002. function Z(e) {
  32003. return Q.toByteArray(G(e))
  32004. }
  32005. function q(e, t, i, n) {
  32006. for (var r = 0; r < n && !(r + i >= t.length || r >= e.length); ++r)
  32007. t[r + i] = e[r];
  32008. return r
  32009. }
  32010. function K(e) {
  32011. return e !== e
  32012. }
  32013. var Q = e("base64-js")
  32014. , J = e("ieee754")
  32015. , $ = e("isarray");
  32016. i.Buffer = a,
  32017. i.SlowBuffer = m,
  32018. i.INSPECT_MAX_BYTES = 50,
  32019. a.TYPED_ARRAY_SUPPORT = void 0 !== t.TYPED_ARRAY_SUPPORT ? t.TYPED_ARRAY_SUPPORT : n(),
  32020. i.kMaxLength = r(),
  32021. a.poolSize = 8192,
  32022. a._augment = function(e) {
  32023. return e.__proto__ = a.prototype,
  32024. e
  32025. }
  32026. ,
  32027. a.from = function(e, t, i) {
  32028. return s(null, e, t, i)
  32029. }
  32030. ,
  32031. a.TYPED_ARRAY_SUPPORT && (a.prototype.__proto__ = Uint8Array.prototype,
  32032. a.__proto__ = Uint8Array,
  32033. "undefined" != typeof Symbol && Symbol.species && a[Symbol.species] === a && Object.defineProperty(a, Symbol.species, {
  32034. value: null,
  32035. configurable: !0
  32036. })),
  32037. a.alloc = function(e, t, i) {
  32038. return c(null, e, t, i)
  32039. }
  32040. ,
  32041. a.allocUnsafe = function(e) {
  32042. return h(null, e)
  32043. }
  32044. ,
  32045. a.allocUnsafeSlow = function(e) {
  32046. return h(null, e)
  32047. }
  32048. ,
  32049. a.isBuffer = function(e) {
  32050. return !(null == e || !e._isBuffer)
  32051. }
  32052. ,
  32053. a.compare = function(e, t) {
  32054. if (!a.isBuffer(e) || !a.isBuffer(t))
  32055. throw new TypeError("Arguments must be Buffers");
  32056. if (e === t)
  32057. return 0;
  32058. for (var i = e.length, n = t.length, r = 0, o = Math.min(i, n); r < o; ++r)
  32059. if (e[r] !== t[r]) {
  32060. i = e[r],
  32061. n = t[r];
  32062. break
  32063. }
  32064. return i < n ? -1 : n < i ? 1 : 0
  32065. }
  32066. ,
  32067. a.isEncoding = function(e) {
  32068. switch (String(e).toLowerCase()) {
  32069. case "hex":
  32070. case "utf8":
  32071. case "utf-8":
  32072. case "ascii":
  32073. case "latin1":
  32074. case "binary":
  32075. case "base64":
  32076. case "ucs2":
  32077. case "ucs-2":
  32078. case "utf16le":
  32079. case "utf-16le":
  32080. return !0;
  32081. default:
  32082. return !1
  32083. }
  32084. }
  32085. ,
  32086. a.concat = function(e, t) {
  32087. if (!$(e))
  32088. throw new TypeError('"list" argument must be an Array of Buffers');
  32089. if (0 === e.length)
  32090. return a.alloc(0);
  32091. var i;
  32092. if (void 0 === t)
  32093. for (t = 0,
  32094. i = 0; i < e.length; ++i)
  32095. t += e[i].length;
  32096. var n = a.allocUnsafe(t)
  32097. , r = 0;
  32098. for (i = 0; i < e.length; ++i) {
  32099. var o = e[i];
  32100. if (!a.isBuffer(o))
  32101. throw new TypeError('"list" argument must be an Array of Buffers');
  32102. o.copy(n, r),
  32103. r += o.length
  32104. }
  32105. return n
  32106. }
  32107. ,
  32108. a.byteLength = v,
  32109. a.prototype._isBuffer = !0,
  32110. a.prototype.swap16 = function() {
  32111. var e = this.length;
  32112. if (e % 2 !== 0)
  32113. throw new RangeError("Buffer size must be a multiple of 16-bits");
  32114. for (var t = 0; t < e; t += 2)
  32115. y(this, t, t + 1);
  32116. return this
  32117. }
  32118. ,
  32119. a.prototype.swap32 = function() {
  32120. var e = this.length;
  32121. if (e % 4 !== 0)
  32122. throw new RangeError("Buffer size must be a multiple of 32-bits");
  32123. for (var t = 0; t < e; t += 4)
  32124. y(this, t, t + 3),
  32125. y(this, t + 1, t + 2);
  32126. return this
  32127. }
  32128. ,
  32129. a.prototype.swap64 = function() {
  32130. var e = this.length;
  32131. if (e % 8 !== 0)
  32132. throw new RangeError("Buffer size must be a multiple of 64-bits");
  32133. for (var t = 0; t < e; t += 8)
  32134. y(this, t, t + 7),
  32135. y(this, t + 1, t + 6),
  32136. y(this, t + 2, t + 5),
  32137. y(this, t + 3, t + 4);
  32138. return this
  32139. }
  32140. ,
  32141. a.prototype.toString = function() {
  32142. var e = 0 | this.length;
  32143. return 0 === e ? "" : 0 === arguments.length ? M(this, 0, e) : A.apply(this, arguments)
  32144. }
  32145. ,
  32146. a.prototype.equals = function(e) {
  32147. if (!a.isBuffer(e))
  32148. throw new TypeError("Argument must be a Buffer");
  32149. return this === e || 0 === a.compare(this, e)
  32150. }
  32151. ,
  32152. a.prototype.inspect = function() {
  32153. var e = ""
  32154. , t = i.INSPECT_MAX_BYTES;
  32155. return this.length > 0 && (e = this.toString("hex", 0, t).match(/.{2}/g).join(" "),
  32156. this.length > t && (e += " ... ")),
  32157. "<Buffer " + e + ">"
  32158. }
  32159. ,
  32160. a.prototype.compare = function(e, t, i, n, r) {
  32161. if (!a.isBuffer(e))
  32162. throw new TypeError("Argument must be a Buffer");
  32163. if (void 0 === t && (t = 0),
  32164. void 0 === i && (i = e ? e.length : 0),
  32165. void 0 === n && (n = 0),
  32166. void 0 === r && (r = this.length),
  32167. t < 0 || i > e.length || n < 0 || r > this.length)
  32168. throw new RangeError("out of range index");
  32169. if (n >= r && t >= i)
  32170. return 0;
  32171. if (n >= r)
  32172. return -1;
  32173. if (t >= i)
  32174. return 1;
  32175. if (t >>>= 0,
  32176. i >>>= 0,
  32177. n >>>= 0,
  32178. r >>>= 0,
  32179. this === e)
  32180. return 0;
  32181. 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)
  32182. if (c[u] !== h[u]) {
  32183. o = c[u],
  32184. s = h[u];
  32185. break
  32186. }
  32187. return o < s ? -1 : s < o ? 1 : 0
  32188. }
  32189. ,
  32190. a.prototype.includes = function(e, t, i) {
  32191. return this.indexOf(e, t, i) !== -1
  32192. }
  32193. ,
  32194. a.prototype.indexOf = function(e, t, i) {
  32195. return C(this, e, t, i, !0)
  32196. }
  32197. ,
  32198. a.prototype.lastIndexOf = function(e, t, i) {
  32199. return C(this, e, t, i, !1)
  32200. }
  32201. ,
  32202. a.prototype.write = function(e, t, i, n) {
  32203. if (void 0 === t)
  32204. n = "utf8",
  32205. i = this.length,
  32206. t = 0;
  32207. else if (void 0 === i && "string" == typeof t)
  32208. n = t,
  32209. i = this.length,
  32210. t = 0;
  32211. else {
  32212. if (!isFinite(t))
  32213. throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");
  32214. t |= 0,
  32215. isFinite(i) ? (i |= 0,
  32216. void 0 === n && (n = "utf8")) : (n = i,
  32217. i = void 0)
  32218. }
  32219. var r = this.length - t;
  32220. if ((void 0 === i || i > r) && (i = r),
  32221. e.length > 0 && (i < 0 || t < 0) || t > this.length)
  32222. throw new RangeError("Attempt to write outside buffer bounds");
  32223. n || (n = "utf8");
  32224. for (var o = !1; ; )
  32225. switch (n) {
  32226. case "hex":
  32227. return E(this, e, t, i);
  32228. case "utf8":
  32229. case "utf-8":
  32230. return b(this, e, t, i);
  32231. case "ascii":
  32232. return w(this, e, t, i);
  32233. case "latin1":
  32234. case "binary":
  32235. return _(this, e, t, i);
  32236. case "base64":
  32237. return T(this, e, t, i);
  32238. case "ucs2":
  32239. case "ucs-2":
  32240. case "utf16le":
  32241. case "utf-16le":
  32242. return x(this, e, t, i);
  32243. default:
  32244. if (o)
  32245. throw new TypeError("Unknown encoding: " + n);
  32246. n = ("" + n).toLowerCase(),
  32247. o = !0
  32248. }
  32249. }
  32250. ,
  32251. a.prototype.toJSON = function() {
  32252. return {
  32253. type: "Buffer",
  32254. data: Array.prototype.slice.call(this._arr || this, 0)
  32255. }
  32256. }
  32257. ;
  32258. var ee = 4096;
  32259. a.prototype.slice = function(e, t) {
  32260. var i = this.length;
  32261. e = ~~e,
  32262. t = void 0 === t ? i : ~~t,
  32263. e < 0 ? (e += i,
  32264. e < 0 && (e = 0)) : e > i && (e = i),
  32265. t < 0 ? (t += i,
  32266. t < 0 && (t = 0)) : t > i && (t = i),
  32267. t < e && (t = e);
  32268. var n;
  32269. if (a.TYPED_ARRAY_SUPPORT)
  32270. n = this.subarray(e, t),
  32271. n.__proto__ = a.prototype;
  32272. else {
  32273. var r = t - e;
  32274. n = new a(r,void 0);
  32275. for (var o = 0; o < r; ++o)
  32276. n[o] = this[o + e]
  32277. }
  32278. return n
  32279. }
  32280. ,
  32281. a.prototype.readUIntLE = function(e, t, i) {
  32282. e |= 0,
  32283. t |= 0,
  32284. i || N(e, t, this.length);
  32285. for (var n = this[e], r = 1, o = 0; ++o < t && (r *= 256); )
  32286. n += this[e + o] * r;
  32287. return n
  32288. }
  32289. ,
  32290. a.prototype.readUIntBE = function(e, t, i) {
  32291. e |= 0,
  32292. t |= 0,
  32293. i || N(e, t, this.length);
  32294. for (var n = this[e + --t], r = 1; t > 0 && (r *= 256); )
  32295. n += this[e + --t] * r;
  32296. return n
  32297. }
  32298. ,
  32299. a.prototype.readUInt8 = function(e, t) {
  32300. return t || N(e, 1, this.length),
  32301. this[e]
  32302. }
  32303. ,
  32304. a.prototype.readUInt16LE = function(e, t) {
  32305. return t || N(e, 2, this.length),
  32306. this[e] | this[e + 1] << 8
  32307. }
  32308. ,
  32309. a.prototype.readUInt16BE = function(e, t) {
  32310. return t || N(e, 2, this.length),
  32311. this[e] << 8 | this[e + 1]
  32312. }
  32313. ,
  32314. a.prototype.readUInt32LE = function(e, t) {
  32315. return t || N(e, 4, this.length),
  32316. (this[e] | this[e + 1] << 8 | this[e + 2] << 16) + 16777216 * this[e + 3]
  32317. }
  32318. ,
  32319. a.prototype.readUInt32BE = function(e, t) {
  32320. return t || N(e, 4, this.length),
  32321. 16777216 * this[e] + (this[e + 1] << 16 | this[e + 2] << 8 | this[e + 3])
  32322. }
  32323. ,
  32324. a.prototype.readIntLE = function(e, t, i) {
  32325. e |= 0,
  32326. t |= 0,
  32327. i || N(e, t, this.length);
  32328. for (var n = this[e], r = 1, o = 0; ++o < t && (r *= 256); )
  32329. n += this[e + o] * r;
  32330. return r *= 128,
  32331. n >= r && (n -= Math.pow(2, 8 * t)),
  32332. n
  32333. }
  32334. ,
  32335. a.prototype.readIntBE = function(e, t, i) {
  32336. e |= 0,
  32337. t |= 0,
  32338. i || N(e, t, this.length);
  32339. for (var n = t, r = 1, o = this[e + --n]; n > 0 && (r *= 256); )
  32340. o += this[e + --n] * r;
  32341. return r *= 128,
  32342. o >= r && (o -= Math.pow(2, 8 * t)),
  32343. o
  32344. }
  32345. ,
  32346. a.prototype.readInt8 = function(e, t) {
  32347. return t || N(e, 1, this.length),
  32348. 128 & this[e] ? (255 - this[e] + 1) * -1 : this[e]
  32349. }
  32350. ,
  32351. a.prototype.readInt16LE = function(e, t) {
  32352. t || N(e, 2, this.length);
  32353. var i = this[e] | this[e + 1] << 8;
  32354. return 32768 & i ? 4294901760 | i : i
  32355. }
  32356. ,
  32357. a.prototype.readInt16BE = function(e, t) {
  32358. t || N(e, 2, this.length);
  32359. var i = this[e + 1] | this[e] << 8;
  32360. return 32768 & i ? 4294901760 | i : i
  32361. }
  32362. ,
  32363. a.prototype.readInt32LE = function(e, t) {
  32364. return t || N(e, 4, this.length),
  32365. this[e] | this[e + 1] << 8 | this[e + 2] << 16 | this[e + 3] << 24
  32366. }
  32367. ,
  32368. a.prototype.readInt32BE = function(e, t) {
  32369. return t || N(e, 4, this.length),
  32370. this[e] << 24 | this[e + 1] << 16 | this[e + 2] << 8 | this[e + 3]
  32371. }
  32372. ,
  32373. a.prototype.readFloatLE = function(e, t) {
  32374. return t || N(e, 4, this.length),
  32375. J.read(this, e, !0, 23, 4)
  32376. }
  32377. ,
  32378. a.prototype.readFloatBE = function(e, t) {
  32379. return t || N(e, 4, this.length),
  32380. J.read(this, e, !1, 23, 4)
  32381. }
  32382. ,
  32383. a.prototype.readDoubleLE = function(e, t) {
  32384. return t || N(e, 8, this.length),
  32385. J.read(this, e, !0, 52, 8)
  32386. }
  32387. ,
  32388. a.prototype.readDoubleBE = function(e, t) {
  32389. return t || N(e, 8, this.length),
  32390. J.read(this, e, !1, 52, 8)
  32391. }
  32392. ,
  32393. a.prototype.writeUIntLE = function(e, t, i, n) {
  32394. if (e = +e,
  32395. t |= 0,
  32396. i |= 0,
  32397. !n) {
  32398. var r = Math.pow(2, 8 * i) - 1;
  32399. B(this, e, t, i, r, 0)
  32400. }
  32401. var o = 1
  32402. , a = 0;
  32403. for (this[t] = 255 & e; ++a < i && (o *= 256); )
  32404. this[t + a] = e / o & 255;
  32405. return t + i
  32406. }
  32407. ,
  32408. a.prototype.writeUIntBE = function(e, t, i, n) {
  32409. if (e = +e,
  32410. t |= 0,
  32411. i |= 0,
  32412. !n) {
  32413. var r = Math.pow(2, 8 * i) - 1;
  32414. B(this, e, t, i, r, 0)
  32415. }
  32416. var o = i - 1
  32417. , a = 1;
  32418. for (this[t + o] = 255 & e; --o >= 0 && (a *= 256); )
  32419. this[t + o] = e / a & 255;
  32420. return t + i
  32421. }
  32422. ,
  32423. a.prototype.writeUInt8 = function(e, t, i) {
  32424. return e = +e,
  32425. t |= 0,
  32426. i || B(this, e, t, 1, 255, 0),
  32427. a.TYPED_ARRAY_SUPPORT || (e = Math.floor(e)),
  32428. this[t] = 255 & e,
  32429. t + 1
  32430. }
  32431. ,
  32432. a.prototype.writeUInt16LE = function(e, t, i) {
  32433. return e = +e,
  32434. t |= 0,
  32435. i || B(this, e, t, 2, 65535, 0),
  32436. a.TYPED_ARRAY_SUPPORT ? (this[t] = 255 & e,
  32437. this[t + 1] = e >>> 8) : F(this, e, t, !0),
  32438. t + 2
  32439. }
  32440. ,
  32441. a.prototype.writeUInt16BE = function(e, t, i) {
  32442. return e = +e,
  32443. t |= 0,
  32444. i || B(this, e, t, 2, 65535, 0),
  32445. a.TYPED_ARRAY_SUPPORT ? (this[t] = e >>> 8,
  32446. this[t + 1] = 255 & e) : F(this, e, t, !1),
  32447. t + 2
  32448. }
  32449. ,
  32450. a.prototype.writeUInt32LE = function(e, t, i) {
  32451. return e = +e,
  32452. t |= 0,
  32453. i || B(this, e, t, 4, 4294967295, 0),
  32454. a.TYPED_ARRAY_SUPPORT ? (this[t + 3] = e >>> 24,
  32455. this[t + 2] = e >>> 16,
  32456. this[t + 1] = e >>> 8,
  32457. this[t] = 255 & e) : V(this, e, t, !0),
  32458. t + 4
  32459. }
  32460. ,
  32461. a.prototype.writeUInt32BE = function(e, t, i) {
  32462. return e = +e,
  32463. t |= 0,
  32464. i || B(this, e, t, 4, 4294967295, 0),
  32465. a.TYPED_ARRAY_SUPPORT ? (this[t] = e >>> 24,
  32466. this[t + 1] = e >>> 16,
  32467. this[t + 2] = e >>> 8,
  32468. this[t + 3] = 255 & e) : V(this, e, t, !1),
  32469. t + 4
  32470. }
  32471. ,
  32472. a.prototype.writeIntLE = function(e, t, i, n) {
  32473. if (e = +e,
  32474. t |= 0,
  32475. !n) {
  32476. var r = Math.pow(2, 8 * i - 1);
  32477. B(this, e, t, i, r - 1, -r)
  32478. }
  32479. var o = 0
  32480. , a = 1
  32481. , s = 0;
  32482. for (this[t] = 255 & e; ++o < i && (a *= 256); )
  32483. e < 0 && 0 === s && 0 !== this[t + o - 1] && (s = 1),
  32484. this[t + o] = (e / a >> 0) - s & 255;
  32485. return t + i
  32486. }
  32487. ,
  32488. a.prototype.writeIntBE = function(e, t, i, n) {
  32489. if (e = +e,
  32490. t |= 0,
  32491. !n) {
  32492. var r = Math.pow(2, 8 * i - 1);
  32493. B(this, e, t, i, r - 1, -r)
  32494. }
  32495. var o = i - 1
  32496. , a = 1
  32497. , s = 0;
  32498. for (this[t + o] = 255 & e; --o >= 0 && (a *= 256); )
  32499. e < 0 && 0 === s && 0 !== this[t + o + 1] && (s = 1),
  32500. this[t + o] = (e / a >> 0) - s & 255;
  32501. return t + i
  32502. }
  32503. ,
  32504. a.prototype.writeInt8 = function(e, t, i) {
  32505. return e = +e,
  32506. t |= 0,
  32507. i || B(this, e, t, 1, 127, -128),
  32508. a.TYPED_ARRAY_SUPPORT || (e = Math.floor(e)),
  32509. e < 0 && (e = 255 + e + 1),
  32510. this[t] = 255 & e,
  32511. t + 1
  32512. }
  32513. ,
  32514. a.prototype.writeInt16LE = function(e, t, i) {
  32515. return e = +e,
  32516. t |= 0,
  32517. i || B(this, e, t, 2, 32767, -32768),
  32518. a.TYPED_ARRAY_SUPPORT ? (this[t] = 255 & e,
  32519. this[t + 1] = e >>> 8) : F(this, e, t, !0),
  32520. t + 2
  32521. }
  32522. ,
  32523. a.prototype.writeInt16BE = function(e, t, i) {
  32524. return e = +e,
  32525. t |= 0,
  32526. i || B(this, e, t, 2, 32767, -32768),
  32527. a.TYPED_ARRAY_SUPPORT ? (this[t] = e >>> 8,
  32528. this[t + 1] = 255 & e) : F(this, e, t, !1),
  32529. t + 2
  32530. }
  32531. ,
  32532. a.prototype.writeInt32LE = function(e, t, i) {
  32533. return e = +e,
  32534. t |= 0,
  32535. i || B(this, e, t, 4, 2147483647, -2147483648),
  32536. a.TYPED_ARRAY_SUPPORT ? (this[t] = 255 & e,
  32537. this[t + 1] = e >>> 8,
  32538. this[t + 2] = e >>> 16,
  32539. this[t + 3] = e >>> 24) : V(this, e, t, !0),
  32540. t + 4
  32541. }
  32542. ,
  32543. a.prototype.writeInt32BE = function(e, t, i) {
  32544. return e = +e,
  32545. t |= 0,
  32546. i || B(this, e, t, 4, 2147483647, -2147483648),
  32547. e < 0 && (e = 4294967295 + e + 1),
  32548. a.TYPED_ARRAY_SUPPORT ? (this[t] = e >>> 24,
  32549. this[t + 1] = e >>> 16,
  32550. this[t + 2] = e >>> 8,
  32551. this[t + 3] = 255 & e) : V(this, e, t, !1),
  32552. t + 4
  32553. }
  32554. ,
  32555. a.prototype.writeFloatLE = function(e, t, i) {
  32556. return k(this, e, t, !0, i)
  32557. }
  32558. ,
  32559. a.prototype.writeFloatBE = function(e, t, i) {
  32560. return k(this, e, t, !1, i)
  32561. }
  32562. ,
  32563. a.prototype.writeDoubleLE = function(e, t, i) {
  32564. return H(this, e, t, !0, i)
  32565. }
  32566. ,
  32567. a.prototype.writeDoubleBE = function(e, t, i) {
  32568. return H(this, e, t, !1, i)
  32569. }
  32570. ,
  32571. a.prototype.copy = function(e, t, i, n) {
  32572. if (i || (i = 0),
  32573. n || 0 === n || (n = this.length),
  32574. t >= e.length && (t = e.length),
  32575. t || (t = 0),
  32576. n > 0 && n < i && (n = i),
  32577. n === i)
  32578. return 0;
  32579. if (0 === e.length || 0 === this.length)
  32580. return 0;
  32581. if (t < 0)
  32582. throw new RangeError("targetStart out of bounds");
  32583. if (i < 0 || i >= this.length)
  32584. throw new RangeError("sourceStart out of bounds");
  32585. if (n < 0)
  32586. throw new RangeError("sourceEnd out of bounds");
  32587. n > this.length && (n = this.length),
  32588. e.length - t < n - i && (n = e.length - t + i);
  32589. var r, o = n - i;
  32590. if (this === e && i < t && t < n)
  32591. for (r = o - 1; r >= 0; --r)
  32592. e[r + t] = this[r + i];
  32593. else if (o < 1e3 || !a.TYPED_ARRAY_SUPPORT)
  32594. for (r = 0; r < o; ++r)
  32595. e[r + t] = this[r + i];
  32596. else
  32597. Uint8Array.prototype.set.call(e, this.subarray(i, i + o), t);
  32598. return o
  32599. }
  32600. ,
  32601. a.prototype.fill = function(e, t, i, n) {
  32602. if ("string" == typeof e) {
  32603. if ("string" == typeof t ? (n = t,
  32604. t = 0,
  32605. i = this.length) : "string" == typeof i && (n = i,
  32606. i = this.length),
  32607. 1 === e.length) {
  32608. var r = e.charCodeAt(0);
  32609. r < 256 && (e = r)
  32610. }
  32611. if (void 0 !== n && "string" != typeof n)
  32612. throw new TypeError("encoding must be a string");
  32613. if ("string" == typeof n && !a.isEncoding(n))
  32614. throw new TypeError("Unknown encoding: " + n)
  32615. } else
  32616. "number" == typeof e && (e &= 255);
  32617. if (t < 0 || this.length < t || this.length < i)
  32618. throw new RangeError("Out of range index");
  32619. if (i <= t)
  32620. return this;
  32621. t >>>= 0,
  32622. i = void 0 === i ? this.length : i >>> 0,
  32623. e || (e = 0);
  32624. var o;
  32625. if ("number" == typeof e)
  32626. for (o = t; o < i; ++o)
  32627. this[o] = e;
  32628. else {
  32629. var s = a.isBuffer(e) ? e : j(new a(e,n).toString())
  32630. , l = s.length;
  32631. for (o = 0; o < i - t; ++o)
  32632. this[o + t] = s[o % l]
  32633. }
  32634. return this
  32635. }
  32636. ;
  32637. var te = /[^+\/0-9A-Za-z-_]/g
  32638. }
  32639. ).call(this, "undefined" != typeof global ? global : "undefined" != typeof self ? self : "undefined" != typeof window ? window : {})
  32640. }
  32641. , {
  32642. "base64-js": 199,
  32643. ieee754: 200,
  32644. isarray: 201
  32645. }],
  32646. 199: [function(e, t, i) {
  32647. "use strict";
  32648. function n(e) {
  32649. var t = e.length;
  32650. if (t % 4 > 0)
  32651. throw new Error("Invalid string. Length must be a multiple of 4");
  32652. return "=" === e[t - 2] ? 2 : "=" === e[t - 1] ? 1 : 0
  32653. }
  32654. function r(e) {
  32655. return 3 * e.length / 4 - n(e)
  32656. }
  32657. function o(e) {
  32658. var t, i, r, o, a, s, l = e.length;
  32659. a = n(e),
  32660. s = new u(3 * l / 4 - a),
  32661. r = a > 0 ? l - 4 : l;
  32662. var c = 0;
  32663. for (t = 0,
  32664. i = 0; t < r; t += 4,
  32665. i += 3)
  32666. o = h[e.charCodeAt(t)] << 18 | h[e.charCodeAt(t + 1)] << 12 | h[e.charCodeAt(t + 2)] << 6 | h[e.charCodeAt(t + 3)],
  32667. s[c++] = o >> 16 & 255,
  32668. s[c++] = o >> 8 & 255,
  32669. s[c++] = 255 & o;
  32670. return 2 === a ? (o = h[e.charCodeAt(t)] << 2 | h[e.charCodeAt(t + 1)] >> 4,
  32671. s[c++] = 255 & o) : 1 === a && (o = h[e.charCodeAt(t)] << 10 | h[e.charCodeAt(t + 1)] << 4 | h[e.charCodeAt(t + 2)] >> 2,
  32672. s[c++] = o >> 8 & 255,
  32673. s[c++] = 255 & o),
  32674. s
  32675. }
  32676. function a(e) {
  32677. return c[e >> 18 & 63] + c[e >> 12 & 63] + c[e >> 6 & 63] + c[63 & e]
  32678. }
  32679. function s(e, t, i) {
  32680. for (var n, r = [], o = t; o < i; o += 3)
  32681. n = (e[o] << 16) + (e[o + 1] << 8) + e[o + 2],
  32682. r.push(a(n));
  32683. return r.join("")
  32684. }
  32685. function l(e) {
  32686. for (var t, i = e.length, n = i % 3, r = "", o = [], a = 16383, l = 0, h = i - n; l < h; l += a)
  32687. o.push(s(e, l, l + a > h ? h : l + a));
  32688. return 1 === n ? (t = e[i - 1],
  32689. r += c[t >> 2],
  32690. r += c[t << 4 & 63],
  32691. r += "==") : 2 === n && (t = (e[i - 2] << 8) + e[i - 1],
  32692. r += c[t >> 10],
  32693. r += c[t >> 4 & 63],
  32694. r += c[t << 2 & 63],
  32695. r += "="),
  32696. o.push(r),
  32697. o.join("")
  32698. }
  32699. i.byteLength = r,
  32700. i.toByteArray = o,
  32701. i.fromByteArray = l;
  32702. for (var c = [], h = [], u = "undefined" != typeof Uint8Array ? Uint8Array : Array, d = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", p = 0, f = d.length; p < f; ++p)
  32703. c[p] = d[p],
  32704. h[d.charCodeAt(p)] = p;
  32705. h["-".charCodeAt(0)] = 62,
  32706. h["_".charCodeAt(0)] = 63
  32707. }
  32708. , {}],
  32709. 200: [function(e, t, i) {
  32710. i.read = function(e, t, i, n, r) {
  32711. 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];
  32712. for (u += d,
  32713. o = p & (1 << -h) - 1,
  32714. p >>= -h,
  32715. h += s; h > 0; o = 256 * o + e[t + u],
  32716. u += d,
  32717. h -= 8)
  32718. ;
  32719. for (a = o & (1 << -h) - 1,
  32720. o >>= -h,
  32721. h += n; h > 0; a = 256 * a + e[t + u],
  32722. u += d,
  32723. h -= 8)
  32724. ;
  32725. if (0 === o)
  32726. o = 1 - c;
  32727. else {
  32728. if (o === l)
  32729. return a ? NaN : (p ? -1 : 1) * (1 / 0);
  32730. a += Math.pow(2, n),
  32731. o -= c
  32732. }
  32733. return (p ? -1 : 1) * a * Math.pow(2, o - n)
  32734. }
  32735. ,
  32736. i.write = function(e, t, i, n, r, o) {
  32737. 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;
  32738. for (t = Math.abs(t),
  32739. isNaN(t) || t === 1 / 0 ? (s = isNaN(t) ? 1 : 0,
  32740. a = h) : (a = Math.floor(Math.log(t) / Math.LN2),
  32741. t * (l = Math.pow(2, -a)) < 1 && (a--,
  32742. l *= 2),
  32743. t += a + u >= 1 ? d / l : d * Math.pow(2, 1 - u),
  32744. t * l >= 2 && (a++,
  32745. l /= 2),
  32746. a + u >= h ? (s = 0,
  32747. a = h) : a + u >= 1 ? (s = (t * l - 1) * Math.pow(2, r),
  32748. a += u) : (s = t * Math.pow(2, u - 1) * Math.pow(2, r),
  32749. a = 0)); r >= 8; e[i + p] = 255 & s,
  32750. p += f,
  32751. s /= 256,
  32752. r -= 8)
  32753. ;
  32754. for (a = a << r | s,
  32755. c += r; c > 0; e[i + p] = 255 & a,
  32756. p += f,
  32757. a /= 256,
  32758. c -= 8)
  32759. ;
  32760. e[i + p - f] |= 128 * g
  32761. }
  32762. }
  32763. , {}],
  32764. 201: [function(e, t, i) {
  32765. var n = {}.toString;
  32766. t.exports = Array.isArray || function(e) {
  32767. return "[object Array]" == n.call(e)
  32768. }
  32769. }
  32770. , {}],
  32771. 202: [function(e, t, i) {
  32772. function n() {
  32773. this._events = this._events || {},
  32774. this._maxListeners = this._maxListeners || void 0
  32775. }
  32776. function r(e) {
  32777. return "function" == typeof e
  32778. }
  32779. function o(e) {
  32780. return "number" == typeof e
  32781. }
  32782. function a(e) {
  32783. return "object" == typeof e && null !== e
  32784. }
  32785. function s(e) {
  32786. return void 0 === e
  32787. }
  32788. t.exports = n,
  32789. n.EventEmitter = n,
  32790. n.prototype._events = void 0,
  32791. n.prototype._maxListeners = void 0,
  32792. n.defaultMaxListeners = 10,
  32793. n.prototype.setMaxListeners = function(e) {
  32794. if (!o(e) || e < 0 || isNaN(e))
  32795. throw TypeError("n must be a positive number");
  32796. return this._maxListeners = e,
  32797. this
  32798. }
  32799. ,
  32800. n.prototype.emit = function(e) {
  32801. var t, i, n, o, l, c;
  32802. if (this._events || (this._events = {}),
  32803. "error" === e && (!this._events.error || a(this._events.error) && !this._events.error.length)) {
  32804. if (t = arguments[1],
  32805. t instanceof Error)
  32806. throw t;
  32807. var h = new Error('Uncaught, unspecified "error" event. (' + t + ")");
  32808. throw h.context = t,
  32809. h
  32810. }
  32811. if (i = this._events[e],
  32812. s(i))
  32813. return !1;
  32814. if (r(i))
  32815. switch (arguments.length) {
  32816. case 1:
  32817. i.call(this);
  32818. break;
  32819. case 2:
  32820. i.call(this, arguments[1]);
  32821. break;
  32822. case 3:
  32823. i.call(this, arguments[1], arguments[2]);
  32824. break;
  32825. default:
  32826. o = Array.prototype.slice.call(arguments, 1),
  32827. i.apply(this, o)
  32828. }
  32829. else if (a(i))
  32830. for (o = Array.prototype.slice.call(arguments, 1),
  32831. c = i.slice(),
  32832. n = c.length,
  32833. l = 0; l < n; l++)
  32834. c[l].apply(this, o);
  32835. return !0
  32836. }
  32837. ,
  32838. n.prototype.addListener = function(e, t) {
  32839. var i;
  32840. if (!r(t))
  32841. throw TypeError("listener must be a function");
  32842. return this._events || (this._events = {}),
  32843. this._events.newListener && this.emit("newListener", e, r(t.listener) ? t.listener : t),
  32844. this._events[e] ? a(this._events[e]) ? this._events[e].push(t) : this._events[e] = [this._events[e], t] : this._events[e] = t,
  32845. a(this._events[e]) && !this._events[e].warned && (i = s(this._maxListeners) ? n.defaultMaxListeners : this._maxListeners,
  32846. i && i > 0 && this._events[e].length > i && (this._events[e].warned = !0,
  32847. console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.", this._events[e].length),
  32848. "function" == typeof console.trace && console.trace())),
  32849. this
  32850. }
  32851. ,
  32852. n.prototype.on = n.prototype.addListener,
  32853. n.prototype.once = function(e, t) {
  32854. function i() {
  32855. this.removeListener(e, i),
  32856. n || (n = !0,
  32857. t.apply(this, arguments))
  32858. }
  32859. if (!r(t))
  32860. throw TypeError("listener must be a function");
  32861. var n = !1;
  32862. return i.listener = t,
  32863. this.on(e, i),
  32864. this
  32865. }
  32866. ,
  32867. n.prototype.removeListener = function(e, t) {
  32868. var i, n, o, s;
  32869. if (!r(t))
  32870. throw TypeError("listener must be a function");
  32871. if (!this._events || !this._events[e])
  32872. return this;
  32873. if (i = this._events[e],
  32874. o = i.length,
  32875. n = -1,
  32876. i === t || r(i.listener) && i.listener === t)
  32877. delete this._events[e],
  32878. this._events.removeListener && this.emit("removeListener", e, t);
  32879. else if (a(i)) {
  32880. for (s = o; s-- > 0; )
  32881. if (i[s] === t || i[s].listener && i[s].listener === t) {
  32882. n = s;
  32883. break
  32884. }
  32885. if (n < 0)
  32886. return this;
  32887. 1 === i.length ? (i.length = 0,
  32888. delete this._events[e]) : i.splice(n, 1),
  32889. this._events.removeListener && this.emit("removeListener", e, t)
  32890. }
  32891. return this
  32892. }
  32893. ,
  32894. n.prototype.removeAllListeners = function(e) {
  32895. var t, i;
  32896. if (!this._events)
  32897. return this;
  32898. if (!this._events.removeListener)
  32899. return 0 === arguments.length ? this._events = {} : this._events[e] && delete this._events[e],
  32900. this;
  32901. if (0 === arguments.length) {
  32902. for (t in this._events)
  32903. "removeListener" !== t && this.removeAllListeners(t);
  32904. return this.removeAllListeners("removeListener"),
  32905. this._events = {},
  32906. this
  32907. }
  32908. if (i = this._events[e],
  32909. r(i))
  32910. this.removeListener(e, i);
  32911. else if (i)
  32912. for (; i.length; )
  32913. this.removeListener(e, i[i.length - 1]);
  32914. return delete this._events[e],
  32915. this
  32916. }
  32917. ,
  32918. n.prototype.listeners = function(e) {
  32919. var t;
  32920. return t = this._events && this._events[e] ? r(this._events[e]) ? [this._events[e]] : this._events[e].slice() : []
  32921. }
  32922. ,
  32923. n.prototype.listenerCount = function(e) {
  32924. if (this._events) {
  32925. var t = this._events[e];
  32926. if (r(t))
  32927. return 1;
  32928. if (t)
  32929. return t.length
  32930. }
  32931. return 0
  32932. }
  32933. ,
  32934. n.listenerCount = function(e, t) {
  32935. return e.listenerCount(t)
  32936. }
  32937. }
  32938. , {}],
  32939. 203: [function(e, t, i) {
  32940. function n() {
  32941. throw new Error("setTimeout has not been defined")
  32942. }
  32943. function r() {
  32944. throw new Error("clearTimeout has not been defined")
  32945. }
  32946. function o(e) {
  32947. if (u === setTimeout)
  32948. return setTimeout(e, 0);
  32949. if ((u === n || !u) && setTimeout)
  32950. return u = setTimeout,
  32951. setTimeout(e, 0);
  32952. try {
  32953. return u(e, 0)
  32954. } catch (t) {
  32955. try {
  32956. return u.call(null, e, 0)
  32957. } catch (t) {
  32958. return u.call(this, e, 0)
  32959. }
  32960. }
  32961. }
  32962. function a(e) {
  32963. if (d === clearTimeout)
  32964. return clearTimeout(e);
  32965. if ((d === r || !d) && clearTimeout)
  32966. return d = clearTimeout,
  32967. clearTimeout(e);
  32968. try {
  32969. return d(e)
  32970. } catch (t) {
  32971. try {
  32972. return d.call(null, e)
  32973. } catch (t) {
  32974. return d.call(this, e)
  32975. }
  32976. }
  32977. }
  32978. function s() {
  32979. m && f && (m = !1,
  32980. f.length ? g = f.concat(g) : v = -1,
  32981. g.length && l())
  32982. }
  32983. function l() {
  32984. if (!m) {
  32985. var e = o(s);
  32986. m = !0;
  32987. for (var t = g.length; t; ) {
  32988. for (f = g,
  32989. g = []; ++v < t; )
  32990. f && f[v].run();
  32991. v = -1,
  32992. t = g.length
  32993. }
  32994. f = null,
  32995. m = !1,
  32996. a(e)
  32997. }
  32998. }
  32999. function c(e, t) {
  33000. this.fun = e,
  33001. this.array = t
  33002. }
  33003. function h() {}
  33004. var u, d, p = t.exports = {};
  33005. !function() {
  33006. try {
  33007. u = "function" == typeof setTimeout ? setTimeout : n
  33008. } catch (e) {
  33009. u = n
  33010. }
  33011. try {
  33012. d = "function" == typeof clearTimeout ? clearTimeout : r
  33013. } catch (e) {
  33014. d = r
  33015. }
  33016. }();
  33017. var f, g = [], m = !1, v = -1;
  33018. p.nextTick = function(e) {
  33019. var t = new Array(arguments.length - 1);
  33020. if (arguments.length > 1)
  33021. for (var i = 1; i < arguments.length; i++)
  33022. t[i - 1] = arguments[i];
  33023. g.push(new c(e,t)),
  33024. 1 !== g.length || m || o(l)
  33025. }
  33026. ,
  33027. c.prototype.run = function() {
  33028. this.fun.apply(null, this.array)
  33029. }
  33030. ,
  33031. p.title = "browser",
  33032. p.browser = !0,
  33033. p.env = {},
  33034. p.argv = [],
  33035. p.version = "",
  33036. p.versions = {},
  33037. p.on = h,
  33038. p.addListener = h,
  33039. p.once = h,
  33040. p.off = h,
  33041. p.removeListener = h,
  33042. p.removeAllListeners = h,
  33043. p.emit = h,
  33044. p.binding = function(e) {
  33045. throw new Error("process.binding is not supported")
  33046. }
  33047. ,
  33048. p.cwd = function() {
  33049. return "/"
  33050. }
  33051. ,
  33052. p.chdir = function(e) {
  33053. throw new Error("process.chdir is not supported")
  33054. }
  33055. ,
  33056. p.umask = function() {
  33057. return 0
  33058. }
  33059. }
  33060. , {}],
  33061. 204: [function(e, t, i) {
  33062. (function(e) {
  33063. !function(n) {
  33064. function r(e) {
  33065. throw new RangeError(L[e])
  33066. }
  33067. function o(e, t) {
  33068. for (var i = e.length, n = []; i--; )
  33069. n[i] = t(e[i]);
  33070. return n
  33071. }
  33072. function a(e, t) {
  33073. var i = e.split("@")
  33074. , n = "";
  33075. i.length > 1 && (n = i[0] + "@",
  33076. e = i[1]),
  33077. e = e.replace(O, ".");
  33078. var r = e.split(".")
  33079. , a = o(r, t).join(".");
  33080. return n + a
  33081. }
  33082. function s(e) {
  33083. for (var t, i, n = [], r = 0, o = e.length; r < o; )
  33084. t = e.charCodeAt(r++),
  33085. t >= 55296 && t <= 56319 && r < o ? (i = e.charCodeAt(r++),
  33086. 56320 == (64512 & i) ? n.push(((1023 & t) << 10) + (1023 & i) + 65536) : (n.push(t),
  33087. r--)) : n.push(t);
  33088. return n
  33089. }
  33090. function l(e) {
  33091. return o(e, function(e) {
  33092. var t = "";
  33093. return e > 65535 && (e -= 65536,
  33094. t += B(e >>> 10 & 1023 | 55296),
  33095. e = 56320 | 1023 & e),
  33096. t += B(e)
  33097. }).join("")
  33098. }
  33099. function c(e) {
  33100. return e - 48 < 10 ? e - 22 : e - 65 < 26 ? e - 65 : e - 97 < 26 ? e - 97 : E
  33101. }
  33102. function h(e, t) {
  33103. return e + 22 + 75 * (e < 26) - ((0 != t) << 5)
  33104. }
  33105. function u(e, t, i) {
  33106. var n = 0;
  33107. for (e = i ? N(e / T) : e >> 1,
  33108. e += N(e / t); e > D * w >> 1; n += E)
  33109. e = N(e / D);
  33110. return N(n + (D + 1) * e / (e + _))
  33111. }
  33112. function d(e) {
  33113. var t, i, n, o, a, s, h, d, p, f, g = [], m = e.length, v = 0, A = S, y = x;
  33114. for (i = e.lastIndexOf(M),
  33115. i < 0 && (i = 0),
  33116. n = 0; n < i; ++n)
  33117. e.charCodeAt(n) >= 128 && r("not-basic"),
  33118. g.push(e.charCodeAt(n));
  33119. for (o = i > 0 ? i + 1 : 0; o < m; ) {
  33120. for (a = v,
  33121. s = 1,
  33122. h = E; o >= m && r("invalid-input"),
  33123. d = c(e.charCodeAt(o++)),
  33124. (d >= E || d > N((I - v) / s)) && r("overflow"),
  33125. v += d * s,
  33126. p = h <= y ? b : h >= y + w ? w : h - y,
  33127. !(d < p); h += E)
  33128. f = E - p,
  33129. s > N(I / f) && r("overflow"),
  33130. s *= f;
  33131. t = g.length + 1,
  33132. y = u(v - a, t, 0 == a),
  33133. N(v / t) > I - A && r("overflow"),
  33134. A += N(v / t),
  33135. v %= t,
  33136. g.splice(v++, 0, A)
  33137. }
  33138. return l(g)
  33139. }
  33140. function p(e) {
  33141. var t, i, n, o, a, l, c, d, p, f, g, m, v, A, y, C = [];
  33142. for (e = s(e),
  33143. m = e.length,
  33144. t = S,
  33145. i = 0,
  33146. a = x,
  33147. l = 0; l < m; ++l)
  33148. g = e[l],
  33149. g < 128 && C.push(B(g));
  33150. for (n = o = C.length,
  33151. o && C.push(M); n < m; ) {
  33152. for (c = I,
  33153. l = 0; l < m; ++l)
  33154. g = e[l],
  33155. g >= t && g < c && (c = g);
  33156. for (v = n + 1,
  33157. c - t > N((I - i) / v) && r("overflow"),
  33158. i += (c - t) * v,
  33159. t = c,
  33160. l = 0; l < m; ++l)
  33161. if (g = e[l],
  33162. g < t && ++i > I && r("overflow"),
  33163. g == t) {
  33164. for (d = i,
  33165. p = E; f = p <= a ? b : p >= a + w ? w : p - a,
  33166. !(d < f); p += E)
  33167. y = d - f,
  33168. A = E - f,
  33169. C.push(B(h(f + y % A, 0))),
  33170. d = N(y / A);
  33171. C.push(B(h(d, 0))),
  33172. a = u(i, v, n == o),
  33173. i = 0,
  33174. ++n
  33175. }
  33176. ++i,
  33177. ++t
  33178. }
  33179. return C.join("")
  33180. }
  33181. function f(e) {
  33182. return a(e, function(e) {
  33183. return R.test(e) ? d(e.slice(4).toLowerCase()) : e
  33184. })
  33185. }
  33186. function g(e) {
  33187. return a(e, function(e) {
  33188. return P.test(e) ? "xn--" + p(e) : e
  33189. })
  33190. }
  33191. var m = "object" == typeof i && i && !i.nodeType && i
  33192. , v = "object" == typeof t && t && !t.nodeType && t
  33193. , A = "object" == typeof e && e;
  33194. A.global !== A && A.window !== A && A.self !== A || (n = A);
  33195. 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 = {
  33196. overflow: "Overflow: input needs wider integers to process",
  33197. "not-basic": "Illegal input >= 0x80 (not a basic code point)",
  33198. "invalid-input": "Invalid input"
  33199. }, D = E - b, N = Math.floor, B = String.fromCharCode;
  33200. if (y = {
  33201. version: "1.4.1",
  33202. ucs2: {
  33203. decode: s,
  33204. encode: l
  33205. },
  33206. decode: d,
  33207. encode: p,
  33208. toASCII: g,
  33209. toUnicode: f
  33210. },
  33211. "function" == typeof define && "object" == typeof define.amd && define.amd)
  33212. define("punycode", function() {
  33213. return y
  33214. });
  33215. else if (m && v)
  33216. if (t.exports == m)
  33217. v.exports = y;
  33218. else
  33219. for (C in y)
  33220. y.hasOwnProperty(C) && (m[C] = y[C]);
  33221. else
  33222. n.punycode = y
  33223. }(this)
  33224. }
  33225. ).call(this, "undefined" != typeof global ? global : "undefined" != typeof self ? self : "undefined" != typeof window ? window : {})
  33226. }
  33227. , {}],
  33228. 205: [function(e, t, i) {
  33229. "use strict";
  33230. function n(e, t) {
  33231. return Object.prototype.hasOwnProperty.call(e, t)
  33232. }
  33233. t.exports = function(e, t, i, o) {
  33234. t = t || "&",
  33235. i = i || "=";
  33236. var a = {};
  33237. if ("string" != typeof e || 0 === e.length)
  33238. return a;
  33239. var s = /\+/g;
  33240. e = e.split(t);
  33241. var l = 1e3;
  33242. o && "number" == typeof o.maxKeys && (l = o.maxKeys);
  33243. var c = e.length;
  33244. l > 0 && c > l && (c = l);
  33245. for (var h = 0; h < c; ++h) {
  33246. var u, d, p, f, g = e[h].replace(s, "%20"), m = g.indexOf(i);
  33247. m >= 0 ? (u = g.substr(0, m),
  33248. d = g.substr(m + 1)) : (u = g,
  33249. d = ""),
  33250. p = decodeURIComponent(u),
  33251. f = decodeURIComponent(d),
  33252. n(a, p) ? r(a[p]) ? a[p].push(f) : a[p] = [a[p], f] : a[p] = f
  33253. }
  33254. return a
  33255. }
  33256. ;
  33257. var r = Array.isArray || function(e) {
  33258. return "[object Array]" === Object.prototype.toString.call(e)
  33259. }
  33260. }
  33261. , {}],
  33262. 206: [function(e, t, i) {
  33263. "use strict";
  33264. function n(e, t) {
  33265. if (e.map)
  33266. return e.map(t);
  33267. for (var i = [], n = 0; n < e.length; n++)
  33268. i.push(t(e[n], n));
  33269. return i
  33270. }
  33271. var r = function(e) {
  33272. switch (typeof e) {
  33273. case "string":
  33274. return e;
  33275. case "boolean":
  33276. return e ? "true" : "false";
  33277. case "number":
  33278. return isFinite(e) ? e : "";
  33279. default:
  33280. return ""
  33281. }
  33282. };
  33283. t.exports = function(e, t, i, s) {
  33284. return t = t || "&",
  33285. i = i || "=",
  33286. null === e && (e = void 0),
  33287. "object" == typeof e ? n(a(e), function(a) {
  33288. var s = encodeURIComponent(r(a)) + i;
  33289. return o(e[a]) ? n(e[a], function(e) {
  33290. return s + encodeURIComponent(r(e))
  33291. }).join(t) : s + encodeURIComponent(r(e[a]))
  33292. }).join(t) : s ? encodeURIComponent(r(s)) + i + encodeURIComponent(r(e)) : ""
  33293. }
  33294. ;
  33295. var o = Array.isArray || function(e) {
  33296. return "[object Array]" === Object.prototype.toString.call(e)
  33297. }
  33298. , a = Object.keys || function(e) {
  33299. var t = [];
  33300. for (var i in e)
  33301. Object.prototype.hasOwnProperty.call(e, i) && t.push(i);
  33302. return t
  33303. }
  33304. }
  33305. , {}],
  33306. 207: [function(e, t, i) {
  33307. "use strict";
  33308. i.decode = i.parse = e("./decode"),
  33309. i.encode = i.stringify = e("./encode")
  33310. }
  33311. , {
  33312. "./decode": 205,
  33313. "./encode": 206
  33314. }],
  33315. 208: [function(e, t, i) {
  33316. "use strict";
  33317. function n() {
  33318. this.protocol = null,
  33319. this.slashes = null,
  33320. this.auth = null,
  33321. this.host = null,
  33322. this.port = null,
  33323. this.hostname = null,
  33324. this.hash = null,
  33325. this.search = null,
  33326. this.query = null,
  33327. this.pathname = null,
  33328. this.path = null,
  33329. this.href = null
  33330. }
  33331. function r(e, t, i) {
  33332. if (e && c.isObject(e) && e instanceof n)
  33333. return e;
  33334. var r = new n;
  33335. return r.parse(e, t, i),
  33336. r
  33337. }
  33338. function o(e) {
  33339. return c.isString(e) && (e = r(e)),
  33340. e instanceof n ? e.format() : n.prototype.format.call(e)
  33341. }
  33342. function a(e, t) {
  33343. return r(e, !1, !0).resolve(t)
  33344. }
  33345. function s(e, t) {
  33346. return e ? r(e, !1, !0).resolveObject(t) : t
  33347. }
  33348. var l = e("punycode")
  33349. , c = e("./util");
  33350. i.parse = r,
  33351. i.resolve = a,
  33352. i.resolveObject = s,
  33353. i.format = o,
  33354. i.Url = n;
  33355. var h = /^([a-z0-9.+-]+:)/i
  33356. , u = /:[0-9]*$/
  33357. , d = /^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/
  33358. , p = ["<", ">", '"', "`", " ", "\r", "\n", "\t"]
  33359. , f = ["{", "}", "|", "\\", "^", "`"].concat(p)
  33360. , g = ["'"].concat(f)
  33361. , m = ["%", "/", "?", ";", "#"].concat(g)
  33362. , v = ["/", "?", "#"]
  33363. , A = 255
  33364. , y = /^[+a-z0-9A-Z_-]{0,63}$/
  33365. , C = /^([+a-z0-9A-Z_-]{0,63})(.*)$/
  33366. , I = {
  33367. javascript: !0,
  33368. "javascript:": !0
  33369. }
  33370. , E = {
  33371. javascript: !0,
  33372. "javascript:": !0
  33373. }
  33374. , b = {
  33375. http: !0,
  33376. https: !0,
  33377. ftp: !0,
  33378. gopher: !0,
  33379. file: !0,
  33380. "http:": !0,
  33381. "https:": !0,
  33382. "ftp:": !0,
  33383. "gopher:": !0,
  33384. "file:": !0
  33385. }
  33386. , w = e("querystring");
  33387. n.prototype.parse = function(e, t, i) {
  33388. if (!c.isString(e))
  33389. throw new TypeError("Parameter 'url' must be a string, not " + typeof e);
  33390. var n = e.indexOf("?")
  33391. , r = n !== -1 && n < e.indexOf("#") ? "?" : "#"
  33392. , o = e.split(r)
  33393. , a = /\\/g;
  33394. o[0] = o[0].replace(a, "/"),
  33395. e = o.join(r);
  33396. var s = e;
  33397. if (s = s.trim(),
  33398. !i && 1 === e.split("#").length) {
  33399. var u = d.exec(s);
  33400. if (u)
  33401. return this.path = s,
  33402. this.href = s,
  33403. this.pathname = u[1],
  33404. u[2] ? (this.search = u[2],
  33405. t ? this.query = w.parse(this.search.substr(1)) : this.query = this.search.substr(1)) : t && (this.search = "",
  33406. this.query = {}),
  33407. this
  33408. }
  33409. var p = h.exec(s);
  33410. if (p) {
  33411. p = p[0];
  33412. var f = p.toLowerCase();
  33413. this.protocol = f,
  33414. s = s.substr(p.length)
  33415. }
  33416. if (i || p || s.match(/^\/\/[^@\/]+@[^@\/]+/)) {
  33417. var _ = "//" === s.substr(0, 2);
  33418. !_ || p && E[p] || (s = s.substr(2),
  33419. this.slashes = !0)
  33420. }
  33421. if (!E[p] && (_ || p && !b[p])) {
  33422. for (var T = -1, x = 0; x < v.length; x++) {
  33423. var S = s.indexOf(v[x]);
  33424. S !== -1 && (T === -1 || S < T) && (T = S)
  33425. }
  33426. var M, R;
  33427. R = T === -1 ? s.lastIndexOf("@") : s.lastIndexOf("@", T),
  33428. R !== -1 && (M = s.slice(0, R),
  33429. s = s.slice(R + 1),
  33430. this.auth = decodeURIComponent(M)),
  33431. T = -1;
  33432. for (var x = 0; x < m.length; x++) {
  33433. var S = s.indexOf(m[x]);
  33434. S !== -1 && (T === -1 || S < T) && (T = S)
  33435. }
  33436. T === -1 && (T = s.length),
  33437. this.host = s.slice(0, T),
  33438. s = s.slice(T),
  33439. this.parseHost(),
  33440. this.hostname = this.hostname || "";
  33441. var P = "[" === this.hostname[0] && "]" === this.hostname[this.hostname.length - 1];
  33442. if (!P)
  33443. for (var O = this.hostname.split(/\./), x = 0, L = O.length; x < L; x++) {
  33444. var D = O[x];
  33445. if (D && !D.match(y)) {
  33446. for (var N = "", B = 0, F = D.length; B < F; B++)
  33447. N += D.charCodeAt(B) > 127 ? "x" : D[B];
  33448. if (!N.match(y)) {
  33449. var V = O.slice(0, x)
  33450. , U = O.slice(x + 1)
  33451. , k = D.match(C);
  33452. k && (V.push(k[1]),
  33453. U.unshift(k[2])),
  33454. U.length && (s = "/" + U.join(".") + s),
  33455. this.hostname = V.join(".");
  33456. break
  33457. }
  33458. }
  33459. }
  33460. this.hostname.length > A ? this.hostname = "" : this.hostname = this.hostname.toLowerCase(),
  33461. P || (this.hostname = l.toASCII(this.hostname));
  33462. var H = this.port ? ":" + this.port : ""
  33463. , G = this.hostname || "";
  33464. this.host = G + H,
  33465. this.href += this.host,
  33466. P && (this.hostname = this.hostname.substr(1, this.hostname.length - 2),
  33467. "/" !== s[0] && (s = "/" + s))
  33468. }
  33469. if (!I[f])
  33470. for (var x = 0, L = g.length; x < L; x++) {
  33471. var z = g[x];
  33472. if (s.indexOf(z) !== -1) {
  33473. var W = encodeURIComponent(z);
  33474. W === z && (W = escape(z)),
  33475. s = s.split(z).join(W)
  33476. }
  33477. }
  33478. var j = s.indexOf("#");
  33479. j !== -1 && (this.hash = s.substr(j),
  33480. s = s.slice(0, j));
  33481. var Y = s.indexOf("?");
  33482. if (Y !== -1 ? (this.search = s.substr(Y),
  33483. this.query = s.substr(Y + 1),
  33484. t && (this.query = w.parse(this.query)),
  33485. s = s.slice(0, Y)) : t && (this.search = "",
  33486. this.query = {}),
  33487. s && (this.pathname = s),
  33488. b[f] && this.hostname && !this.pathname && (this.pathname = "/"),
  33489. this.pathname || this.search) {
  33490. var H = this.pathname || ""
  33491. , X = this.search || "";
  33492. this.path = H + X
  33493. }
  33494. return this.href = this.format(),
  33495. this
  33496. }
  33497. ,
  33498. n.prototype.format = function() {
  33499. var e = this.auth || "";
  33500. e && (e = encodeURIComponent(e),
  33501. e = e.replace(/%3A/i, ":"),
  33502. e += "@");
  33503. var t = this.protocol || ""
  33504. , i = this.pathname || ""
  33505. , n = this.hash || ""
  33506. , r = !1
  33507. , o = "";
  33508. this.host ? r = e + this.host : this.hostname && (r = e + (this.hostname.indexOf(":") === -1 ? this.hostname : "[" + this.hostname + "]"),
  33509. this.port && (r += ":" + this.port)),
  33510. this.query && c.isObject(this.query) && Object.keys(this.query).length && (o = w.stringify(this.query));
  33511. var a = this.search || o && "?" + o || "";
  33512. return t && ":" !== t.substr(-1) && (t += ":"),
  33513. this.slashes || (!t || b[t]) && r !== !1 ? (r = "//" + (r || ""),
  33514. i && "/" !== i.charAt(0) && (i = "/" + i)) : r || (r = ""),
  33515. n && "#" !== n.charAt(0) && (n = "#" + n),
  33516. a && "?" !== a.charAt(0) && (a = "?" + a),
  33517. i = i.replace(/[?#]/g, function(e) {
  33518. return encodeURIComponent(e)
  33519. }),
  33520. a = a.replace("#", "%23"),
  33521. t + r + i + a + n
  33522. }
  33523. ,
  33524. n.prototype.resolve = function(e) {
  33525. return this.resolveObject(r(e, !1, !0)).format()
  33526. }
  33527. ,
  33528. n.prototype.resolveObject = function(e) {
  33529. if (c.isString(e)) {
  33530. var t = new n;
  33531. t.parse(e, !1, !0),
  33532. e = t
  33533. }
  33534. for (var i = new n, r = Object.keys(this), o = 0; o < r.length; o++) {
  33535. var a = r[o];
  33536. i[a] = this[a]
  33537. }
  33538. if (i.hash = e.hash,
  33539. "" === e.href)
  33540. return i.href = i.format(),
  33541. i;
  33542. if (e.slashes && !e.protocol) {
  33543. for (var s = Object.keys(e), l = 0; l < s.length; l++) {
  33544. var h = s[l];
  33545. "protocol" !== h && (i[h] = e[h])
  33546. }
  33547. return b[i.protocol] && i.hostname && !i.pathname && (i.path = i.pathname = "/"),
  33548. i.href = i.format(),
  33549. i
  33550. }
  33551. if (e.protocol && e.protocol !== i.protocol) {
  33552. if (!b[e.protocol]) {
  33553. for (var u = Object.keys(e), d = 0; d < u.length; d++) {
  33554. var p = u[d];
  33555. i[p] = e[p]
  33556. }
  33557. return i.href = i.format(),
  33558. i
  33559. }
  33560. if (i.protocol = e.protocol,
  33561. e.host || E[e.protocol])
  33562. i.pathname = e.pathname;
  33563. else {
  33564. for (var f = (e.pathname || "").split("/"); f.length && !(e.host = f.shift()); )
  33565. ;
  33566. e.host || (e.host = ""),
  33567. e.hostname || (e.hostname = ""),
  33568. "" !== f[0] && f.unshift(""),
  33569. f.length < 2 && f.unshift(""),
  33570. i.pathname = f.join("/")
  33571. }
  33572. if (i.search = e.search,
  33573. i.query = e.query,
  33574. i.host = e.host || "",
  33575. i.auth = e.auth,
  33576. i.hostname = e.hostname || e.host,
  33577. i.port = e.port,
  33578. i.pathname || i.search) {
  33579. var g = i.pathname || ""
  33580. , m = i.search || "";
  33581. i.path = g + m
  33582. }
  33583. return i.slashes = i.slashes || e.slashes,
  33584. i.href = i.format(),
  33585. i
  33586. }
  33587. var v = i.pathname && "/" === i.pathname.charAt(0)
  33588. , A = e.host || e.pathname && "/" === e.pathname.charAt(0)
  33589. , y = A || v || i.host && e.pathname
  33590. , C = y
  33591. , I = i.pathname && i.pathname.split("/") || []
  33592. , f = e.pathname && e.pathname.split("/") || []
  33593. , w = i.protocol && !b[i.protocol];
  33594. if (w && (i.hostname = "",
  33595. i.port = null,
  33596. i.host && ("" === I[0] ? I[0] = i.host : I.unshift(i.host)),
  33597. i.host = "",
  33598. e.protocol && (e.hostname = null,
  33599. e.port = null,
  33600. e.host && ("" === f[0] ? f[0] = e.host : f.unshift(e.host)),
  33601. e.host = null),
  33602. y = y && ("" === f[0] || "" === I[0])),
  33603. A)
  33604. i.host = e.host || "" === e.host ? e.host : i.host,
  33605. i.hostname = e.hostname || "" === e.hostname ? e.hostname : i.hostname,
  33606. i.search = e.search,
  33607. i.query = e.query,
  33608. I = f;
  33609. else if (f.length)
  33610. I || (I = []),
  33611. I.pop(),
  33612. I = I.concat(f),
  33613. i.search = e.search,
  33614. i.query = e.query;
  33615. else if (!c.isNullOrUndefined(e.search)) {
  33616. if (w) {
  33617. i.hostname = i.host = I.shift();
  33618. var _ = !!(i.host && i.host.indexOf("@") > 0) && i.host.split("@");
  33619. _ && (i.auth = _.shift(),
  33620. i.host = i.hostname = _.shift())
  33621. }
  33622. return i.search = e.search,
  33623. i.query = e.query,
  33624. c.isNull(i.pathname) && c.isNull(i.search) || (i.path = (i.pathname ? i.pathname : "") + (i.search ? i.search : "")),
  33625. i.href = i.format(),
  33626. i
  33627. }
  33628. if (!I.length)
  33629. return i.pathname = null,
  33630. i.search ? i.path = "/" + i.search : i.path = null,
  33631. i.href = i.format(),
  33632. i;
  33633. 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--)
  33634. T = I[M],
  33635. "." === T ? I.splice(M, 1) : ".." === T ? (I.splice(M, 1),
  33636. S++) : S && (I.splice(M, 1),
  33637. S--);
  33638. if (!y && !C)
  33639. for (; S--; S)
  33640. I.unshift("..");
  33641. !y || "" === I[0] || I[0] && "/" === I[0].charAt(0) || I.unshift(""),
  33642. x && "/" !== I.join("/").substr(-1) && I.push("");
  33643. var R = "" === I[0] || I[0] && "/" === I[0].charAt(0);
  33644. if (w) {
  33645. i.hostname = i.host = R ? "" : I.length ? I.shift() : "";
  33646. var _ = !!(i.host && i.host.indexOf("@") > 0) && i.host.split("@");
  33647. _ && (i.auth = _.shift(),
  33648. i.host = i.hostname = _.shift())
  33649. }
  33650. return y = y || i.host && I.length,
  33651. y && !R && I.unshift(""),
  33652. I.length ? i.pathname = I.join("/") : (i.pathname = null,
  33653. i.path = null),
  33654. c.isNull(i.pathname) && c.isNull(i.search) || (i.path = (i.pathname ? i.pathname : "") + (i.search ? i.search : "")),
  33655. i.auth = e.auth || i.auth,
  33656. i.slashes = i.slashes || e.slashes,
  33657. i.href = i.format(),
  33658. i
  33659. }
  33660. ,
  33661. n.prototype.parseHost = function() {
  33662. var e = this.host
  33663. , t = u.exec(e);
  33664. t && (t = t[0],
  33665. ":" !== t && (this.port = t.substr(1)),
  33666. e = e.substr(0, e.length - t.length)),
  33667. e && (this.hostname = e)
  33668. }
  33669. }
  33670. , {
  33671. "./util": 209,
  33672. punycode: 204,
  33673. querystring: 207
  33674. }],
  33675. 209: [function(e, t, i) {
  33676. "use strict";
  33677. t.exports = {
  33678. isString: function(e) {
  33679. return "string" == typeof e
  33680. },
  33681. isObject: function(e) {
  33682. return "object" == typeof e && null !== e
  33683. },
  33684. isNull: function(e) {
  33685. return null === e
  33686. },
  33687. isNullOrUndefined: function(e) {
  33688. return null == e
  33689. }
  33690. }
  33691. }
  33692. , {}],
  33693. 210: [function(e, t, i) {
  33694. "use strict";
  33695. function n(e) {
  33696. return l + e
  33697. }
  33698. function r(e) {
  33699. return e.substring(l.length)
  33700. }
  33701. function o(e, t) {
  33702. for (var i in t)
  33703. Object.defineProperty(e, i, {
  33704. value: t[i],
  33705. configurable: !0,
  33706. writable: !0
  33707. })
  33708. }
  33709. function a(e) {
  33710. if ("string" != typeof e)
  33711. throw new TypeError("key must be a string.")
  33712. }
  33713. var s = Object.prototype.hasOwnProperty
  33714. , l = "~";
  33715. t.exports = function(e) {
  33716. var t = Object.create(null)
  33717. , i = 0
  33718. , l = {};
  33719. return o(l, {
  33720. get: function(e, i) {
  33721. a(e);
  33722. var r = n(e);
  33723. return r in t ? t[r] : i
  33724. },
  33725. set: function(e, r) {
  33726. a(e);
  33727. var o = n(e);
  33728. return o in t || ++i,
  33729. t[o] = r
  33730. },
  33731. has: function(e) {
  33732. return a(e),
  33733. n(e)in t
  33734. },
  33735. delete: function(e) {
  33736. a(e);
  33737. var r = n(e);
  33738. return r in t && (--i,
  33739. delete t[r],
  33740. !0)
  33741. },
  33742. clear: function() {
  33743. t = Object.create(null),
  33744. i = 0
  33745. },
  33746. forEach: function(e, i) {
  33747. if ("function" != typeof e)
  33748. throw new TypeError("`callback` must be a function");
  33749. for (var n in t)
  33750. if (s.call(t, n)) {
  33751. var o = r(n)
  33752. , a = t[n];
  33753. e.call(i, a, o, l)
  33754. }
  33755. }
  33756. }),
  33757. Object.defineProperty(l, "size", {
  33758. get: function() {
  33759. return i
  33760. },
  33761. configurable: !0
  33762. }),
  33763. "object" == typeof e && null !== e && Object.keys(e).forEach(function(t) {
  33764. l.set(t, e[t])
  33765. }),
  33766. l
  33767. }
  33768. }
  33769. , {}],
  33770. 211: [function(e, t, i) {
  33771. t.exports = e("./lib/heap")
  33772. }
  33773. , {
  33774. "./lib/heap": 212
  33775. }],
  33776. 212: [function(e, t, i) {
  33777. (function() {
  33778. var e, n, r, o, a, s, l, c, h, u, d, p, f, g, m;
  33779. r = Math.floor,
  33780. u = Math.min,
  33781. n = function(e, t) {
  33782. return e < t ? -1 : e > t ? 1 : 0
  33783. }
  33784. ,
  33785. h = function(e, t, i, o, a) {
  33786. var s;
  33787. if (null == i && (i = 0),
  33788. null == a && (a = n),
  33789. i < 0)
  33790. throw new Error("lo must be non-negative");
  33791. for (null == o && (o = e.length); i < o; )
  33792. s = r((i + o) / 2),
  33793. a(t, e[s]) < 0 ? o = s : i = s + 1;
  33794. return [].splice.apply(e, [i, i - i].concat(t)),
  33795. t
  33796. }
  33797. ,
  33798. s = function(e, t, i) {
  33799. return null == i && (i = n),
  33800. e.push(t),
  33801. g(e, 0, e.length - 1, i)
  33802. }
  33803. ,
  33804. a = function(e, t) {
  33805. var i, r;
  33806. return null == t && (t = n),
  33807. i = e.pop(),
  33808. e.length ? (r = e[0],
  33809. e[0] = i,
  33810. m(e, 0, t)) : r = i,
  33811. r
  33812. }
  33813. ,
  33814. c = function(e, t, i) {
  33815. var r;
  33816. return null == i && (i = n),
  33817. r = e[0],
  33818. e[0] = t,
  33819. m(e, 0, i),
  33820. r
  33821. }
  33822. ,
  33823. l = function(e, t, i) {
  33824. var r;
  33825. return null == i && (i = n),
  33826. e.length && i(e[0], t) < 0 && (r = [e[0], t],
  33827. t = r[0],
  33828. e[0] = r[1],
  33829. m(e, 0, i)),
  33830. t
  33831. }
  33832. ,
  33833. o = function(e, t) {
  33834. var i, o, a, s, l, c;
  33835. for (null == t && (t = n),
  33836. s = function() {
  33837. c = [];
  33838. for (var t = 0, i = r(e.length / 2); 0 <= i ? t < i : t > i; 0 <= i ? t++ : t--)
  33839. c.push(t);
  33840. return c
  33841. }
  33842. .apply(this).reverse(),
  33843. l = [],
  33844. o = 0,
  33845. a = s.length; o < a; o++)
  33846. i = s[o],
  33847. l.push(m(e, i, t));
  33848. return l
  33849. }
  33850. ,
  33851. f = function(e, t, i) {
  33852. var r;
  33853. if (null == i && (i = n),
  33854. r = e.indexOf(t),
  33855. r !== -1)
  33856. return g(e, 0, r, i),
  33857. m(e, r, i)
  33858. }
  33859. ,
  33860. d = function(e, t, i) {
  33861. var r, a, s, c, h;
  33862. if (null == i && (i = n),
  33863. a = e.slice(0, t),
  33864. !a.length)
  33865. return a;
  33866. for (o(a, i),
  33867. h = e.slice(t),
  33868. s = 0,
  33869. c = h.length; s < c; s++)
  33870. r = h[s],
  33871. l(a, r, i);
  33872. return a.sort(i).reverse()
  33873. }
  33874. ,
  33875. p = function(e, t, i) {
  33876. var r, s, l, c, d, p, f, g, m, v;
  33877. if (null == i && (i = n),
  33878. 10 * t <= e.length) {
  33879. if (c = e.slice(0, t).sort(i),
  33880. !c.length)
  33881. return c;
  33882. for (l = c[c.length - 1],
  33883. g = e.slice(t),
  33884. d = 0,
  33885. f = g.length; d < f; d++)
  33886. r = g[d],
  33887. i(r, l) < 0 && (h(c, r, 0, null, i),
  33888. c.pop(),
  33889. l = c[c.length - 1]);
  33890. return c
  33891. }
  33892. for (o(e, i),
  33893. v = [],
  33894. s = p = 0,
  33895. m = u(t, e.length); 0 <= m ? p < m : p > m; s = 0 <= m ? ++p : --p)
  33896. v.push(a(e, i));
  33897. return v
  33898. }
  33899. ,
  33900. g = function(e, t, i, r) {
  33901. var o, a, s;
  33902. for (null == r && (r = n),
  33903. o = e[i]; i > t && (s = i - 1 >> 1,
  33904. a = e[s],
  33905. r(o, a) < 0); )
  33906. e[i] = a,
  33907. i = s;
  33908. return e[i] = o
  33909. }
  33910. ,
  33911. m = function(e, t, i) {
  33912. var r, o, a, s, l;
  33913. for (null == i && (i = n),
  33914. o = e.length,
  33915. l = t,
  33916. a = e[t],
  33917. r = 2 * t + 1; r < o; )
  33918. s = r + 1,
  33919. s < o && !(i(e[r], e[s]) < 0) && (r = s),
  33920. e[t] = e[r],
  33921. t = r,
  33922. r = 2 * t + 1;
  33923. return e[t] = a,
  33924. g(e, l, t, i)
  33925. }
  33926. ,
  33927. e = function() {
  33928. function e(e) {
  33929. this.cmp = null != e ? e : n,
  33930. this.nodes = []
  33931. }
  33932. return e.push = s,
  33933. e.pop = a,
  33934. e.replace = c,
  33935. e.pushpop = l,
  33936. e.heapify = o,
  33937. e.updateItem = f,
  33938. e.nlargest = d,
  33939. e.nsmallest = p,
  33940. e.prototype.push = function(e) {
  33941. return s(this.nodes, e, this.cmp)
  33942. }
  33943. ,
  33944. e.prototype.pop = function() {
  33945. return a(this.nodes, this.cmp)
  33946. }
  33947. ,
  33948. e.prototype.peek = function() {
  33949. return this.nodes[0]
  33950. }
  33951. ,
  33952. e.prototype.contains = function(e) {
  33953. return this.nodes.indexOf(e) !== -1
  33954. }
  33955. ,
  33956. e.prototype.replace = function(e) {
  33957. return c(this.nodes, e, this.cmp)
  33958. }
  33959. ,
  33960. e.prototype.pushpop = function(e) {
  33961. return l(this.nodes, e, this.cmp)
  33962. }
  33963. ,
  33964. e.prototype.heapify = function() {
  33965. return o(this.nodes, this.cmp)
  33966. }
  33967. ,
  33968. e.prototype.updateItem = function(e) {
  33969. return f(this.nodes, e, this.cmp)
  33970. }
  33971. ,
  33972. e.prototype.clear = function() {
  33973. return this.nodes = []
  33974. }
  33975. ,
  33976. e.prototype.empty = function() {
  33977. return 0 === this.nodes.length
  33978. }
  33979. ,
  33980. e.prototype.size = function() {
  33981. return this.nodes.length
  33982. }
  33983. ,
  33984. e.prototype.clone = function() {
  33985. var t;
  33986. return t = new e,
  33987. t.nodes = this.nodes.slice(0),
  33988. t
  33989. }
  33990. ,
  33991. e.prototype.toArray = function() {
  33992. return this.nodes.slice(0)
  33993. }
  33994. ,
  33995. e.prototype.insert = e.prototype.push,
  33996. e.prototype.top = e.prototype.peek,
  33997. e.prototype.front = e.prototype.peek,
  33998. e.prototype.has = e.prototype.contains,
  33999. e.prototype.copy = e.prototype.clone,
  34000. e
  34001. }(),
  34002. function(e, n) {
  34003. return "function" == typeof define && define.amd ? define([], n) : "object" == typeof i ? t.exports = n() : e.Heap = n()
  34004. }(this, function() {
  34005. return e
  34006. })
  34007. }
  34008. ).call(this)
  34009. }
  34010. , {}],
  34011. 213: [function(e, t, i) {
  34012. !function(e) {
  34013. function i() {}
  34014. function n(e, t) {
  34015. return function() {
  34016. e.apply(t, arguments)
  34017. }
  34018. }
  34019. function r(e) {
  34020. if ("object" != typeof this)
  34021. throw new TypeError("Promises must be constructed via new");
  34022. if ("function" != typeof e)
  34023. throw new TypeError("not a function");
  34024. this._state = 0,
  34025. this._handled = !1,
  34026. this._value = void 0,
  34027. this._deferreds = [],
  34028. h(e, this)
  34029. }
  34030. function o(e, t) {
  34031. for (; 3 === e._state; )
  34032. e = e._value;
  34033. return 0 === e._state ? void e._deferreds.push(t) : (e._handled = !0,
  34034. void r._immediateFn(function() {
  34035. var i = 1 === e._state ? t.onFulfilled : t.onRejected;
  34036. if (null === i)
  34037. return void (1 === e._state ? a : s)(t.promise, e._value);
  34038. var n;
  34039. try {
  34040. n = i(e._value)
  34041. } catch (e) {
  34042. return void s(t.promise, e)
  34043. }
  34044. a(t.promise, n)
  34045. }))
  34046. }
  34047. function a(e, t) {
  34048. try {
  34049. if (t === e)
  34050. throw new TypeError("A promise cannot be resolved with itself.");
  34051. if (t && ("object" == typeof t || "function" == typeof t)) {
  34052. var i = t.then;
  34053. if (t instanceof r)
  34054. return e._state = 3,
  34055. e._value = t,
  34056. void l(e);
  34057. if ("function" == typeof i)
  34058. return void h(n(i, t), e)
  34059. }
  34060. e._state = 1,
  34061. e._value = t,
  34062. l(e)
  34063. } catch (t) {
  34064. s(e, t)
  34065. }
  34066. }
  34067. function s(e, t) {
  34068. e._state = 2,
  34069. e._value = t,
  34070. l(e)
  34071. }
  34072. function l(e) {
  34073. 2 === e._state && 0 === e._deferreds.length && r._immediateFn(function() {
  34074. e._handled || r._unhandledRejectionFn(e._value)
  34075. });
  34076. for (var t = 0, i = e._deferreds.length; t < i; t++)
  34077. o(e, e._deferreds[t]);
  34078. e._deferreds = null
  34079. }
  34080. function c(e, t, i) {
  34081. this.onFulfilled = "function" == typeof e ? e : null,
  34082. this.onRejected = "function" == typeof t ? t : null,
  34083. this.promise = i
  34084. }
  34085. function h(e, t) {
  34086. var i = !1;
  34087. try {
  34088. e(function(e) {
  34089. i || (i = !0,
  34090. a(t, e))
  34091. }, function(e) {
  34092. i || (i = !0,
  34093. s(t, e))
  34094. })
  34095. } catch (e) {
  34096. if (i)
  34097. return;
  34098. i = !0,
  34099. s(t, e)
  34100. }
  34101. }
  34102. var u = setTimeout;
  34103. r.prototype.catch = function(e) {
  34104. return this.then(null, e)
  34105. }
  34106. ,
  34107. r.prototype.then = function(e, t) {
  34108. var n = new this.constructor(i);
  34109. return o(this, new c(e,t,n)),
  34110. n
  34111. }
  34112. ,
  34113. r.all = function(e) {
  34114. var t = Array.prototype.slice.call(e);
  34115. return new r(function(e, i) {
  34116. function n(o, a) {
  34117. try {
  34118. if (a && ("object" == typeof a || "function" == typeof a)) {
  34119. var s = a.then;
  34120. if ("function" == typeof s)
  34121. return void s.call(a, function(e) {
  34122. n(o, e)
  34123. }, i)
  34124. }
  34125. t[o] = a,
  34126. 0 === --r && e(t)
  34127. } catch (e) {
  34128. i(e)
  34129. }
  34130. }
  34131. if (0 === t.length)
  34132. return e([]);
  34133. for (var r = t.length, o = 0; o < t.length; o++)
  34134. n(o, t[o])
  34135. }
  34136. )
  34137. }
  34138. ,
  34139. r.resolve = function(e) {
  34140. return e && "object" == typeof e && e.constructor === r ? e : new r(function(t) {
  34141. t(e)
  34142. }
  34143. )
  34144. }
  34145. ,
  34146. r.reject = function(e) {
  34147. return new r(function(t, i) {
  34148. i(e)
  34149. }
  34150. )
  34151. }
  34152. ,
  34153. r.race = function(e) {
  34154. return new r(function(t, i) {
  34155. for (var n = 0, r = e.length; n < r; n++)
  34156. e[n].then(t, i)
  34157. }
  34158. )
  34159. }
  34160. ,
  34161. r._immediateFn = "function" == typeof setImmediate && function(e) {
  34162. setImmediate(e)
  34163. }
  34164. || function(e) {
  34165. u(e, 0)
  34166. }
  34167. ,
  34168. r._unhandledRejectionFn = function(e) {
  34169. "undefined" != typeof console && console && console.warn("Possible Unhandled Promise Rejection:", e)
  34170. }
  34171. ,
  34172. r._setImmediateFn = function(e) {
  34173. r._immediateFn = e
  34174. }
  34175. ,
  34176. r._setUnhandledRejectionFn = function(e) {
  34177. r._unhandledRejectionFn = e
  34178. }
  34179. ,
  34180. "undefined" != typeof t && t.exports ? t.exports = r : e.Promise || (e.Promise = r)
  34181. }(this)
  34182. }
  34183. , {}],
  34184. 214: [function(e, t, i) {
  34185. (function(i) {
  34186. !function(i, n) {
  34187. "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)
  34188. }(this, function(t, n) {
  34189. "use strict";
  34190. var r = {};
  34191. return r.ByteBuffer = t,
  34192. r.Long = t.Long || null,
  34193. r.VERSION = "5.0.1",
  34194. r.WIRE_TYPES = {},
  34195. r.WIRE_TYPES.VARINT = 0,
  34196. r.WIRE_TYPES.BITS64 = 1,
  34197. r.WIRE_TYPES.LDELIM = 2,
  34198. r.WIRE_TYPES.STARTGROUP = 3,
  34199. r.WIRE_TYPES.ENDGROUP = 4,
  34200. r.WIRE_TYPES.BITS32 = 5,
  34201. r.PACKABLE_WIRE_TYPES = [r.WIRE_TYPES.VARINT, r.WIRE_TYPES.BITS64, r.WIRE_TYPES.BITS32],
  34202. r.TYPES = {
  34203. int32: {
  34204. name: "int32",
  34205. wireType: r.WIRE_TYPES.VARINT,
  34206. defaultValue: 0
  34207. },
  34208. uint32: {
  34209. name: "uint32",
  34210. wireType: r.WIRE_TYPES.VARINT,
  34211. defaultValue: 0
  34212. },
  34213. sint32: {
  34214. name: "sint32",
  34215. wireType: r.WIRE_TYPES.VARINT,
  34216. defaultValue: 0
  34217. },
  34218. int64: {
  34219. name: "int64",
  34220. wireType: r.WIRE_TYPES.VARINT,
  34221. defaultValue: r.Long ? r.Long.ZERO : void 0
  34222. },
  34223. uint64: {
  34224. name: "uint64",
  34225. wireType: r.WIRE_TYPES.VARINT,
  34226. defaultValue: r.Long ? r.Long.UZERO : void 0
  34227. },
  34228. sint64: {
  34229. name: "sint64",
  34230. wireType: r.WIRE_TYPES.VARINT,
  34231. defaultValue: r.Long ? r.Long.ZERO : void 0
  34232. },
  34233. bool: {
  34234. name: "bool",
  34235. wireType: r.WIRE_TYPES.VARINT,
  34236. defaultValue: !1
  34237. },
  34238. double: {
  34239. name: "double",
  34240. wireType: r.WIRE_TYPES.BITS64,
  34241. defaultValue: 0
  34242. },
  34243. string: {
  34244. name: "string",
  34245. wireType: r.WIRE_TYPES.LDELIM,
  34246. defaultValue: ""
  34247. },
  34248. bytes: {
  34249. name: "bytes",
  34250. wireType: r.WIRE_TYPES.LDELIM,
  34251. defaultValue: null
  34252. },
  34253. fixed32: {
  34254. name: "fixed32",
  34255. wireType: r.WIRE_TYPES.BITS32,
  34256. defaultValue: 0
  34257. },
  34258. sfixed32: {
  34259. name: "sfixed32",
  34260. wireType: r.WIRE_TYPES.BITS32,
  34261. defaultValue: 0
  34262. },
  34263. fixed64: {
  34264. name: "fixed64",
  34265. wireType: r.WIRE_TYPES.BITS64,
  34266. defaultValue: r.Long ? r.Long.UZERO : void 0
  34267. },
  34268. sfixed64: {
  34269. name: "sfixed64",
  34270. wireType: r.WIRE_TYPES.BITS64,
  34271. defaultValue: r.Long ? r.Long.ZERO : void 0
  34272. },
  34273. float: {
  34274. name: "float",
  34275. wireType: r.WIRE_TYPES.BITS32,
  34276. defaultValue: 0
  34277. },
  34278. enum: {
  34279. name: "enum",
  34280. wireType: r.WIRE_TYPES.VARINT,
  34281. defaultValue: 0
  34282. },
  34283. message: {
  34284. name: "message",
  34285. wireType: r.WIRE_TYPES.LDELIM,
  34286. defaultValue: null
  34287. },
  34288. group: {
  34289. name: "group",
  34290. wireType: r.WIRE_TYPES.STARTGROUP,
  34291. defaultValue: null
  34292. }
  34293. },
  34294. 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],
  34295. r.ID_MIN = 1,
  34296. r.ID_MAX = 536870911,
  34297. r.convertFieldsToCamelCase = !1,
  34298. r.populateAccessors = !0,
  34299. r.populateDefaults = !0,
  34300. r.Util = function() {
  34301. var t = {};
  34302. return t.IS_NODE = !("object" != typeof i || i + "" != "[object process]" || i.browser),
  34303. t.XHR = function() {
  34304. for (var e = [function() {
  34305. return new XMLHttpRequest
  34306. }
  34307. , function() {
  34308. return new ActiveXObject("Msxml2.XMLHTTP")
  34309. }
  34310. , function() {
  34311. return new ActiveXObject("Msxml3.XMLHTTP")
  34312. }
  34313. , function() {
  34314. return new ActiveXObject("Microsoft.XMLHTTP")
  34315. }
  34316. ], t = null, i = 0; i < e.length; i++) {
  34317. try {
  34318. t = e[i]()
  34319. } catch (e) {
  34320. continue
  34321. }
  34322. break
  34323. }
  34324. if (!t)
  34325. throw Error("XMLHttpRequest is not supported");
  34326. return t
  34327. }
  34328. ,
  34329. t.fetch = function(i, n) {
  34330. if (n && "function" != typeof n && (n = null),
  34331. t.IS_NODE) {
  34332. var r = e("fs");
  34333. if (n)
  34334. r.readFile(i, function(e, t) {
  34335. n(e ? null : "" + t)
  34336. });
  34337. else
  34338. try {
  34339. return r.readFileSync(i)
  34340. } catch (e) {
  34341. return null
  34342. }
  34343. } else {
  34344. var o = t.XHR();
  34345. if (o.open("GET", i, !!n),
  34346. o.setRequestHeader("Accept", "text/plain"),
  34347. "function" == typeof o.overrideMimeType && o.overrideMimeType("text/plain"),
  34348. !n)
  34349. return o.send(null),
  34350. 200 == o.status || 0 == o.status && "string" == typeof o.responseText ? o.responseText : null;
  34351. if (o.onreadystatechange = function() {
  34352. 4 == o.readyState && n(200 == o.status || 0 == o.status && "string" == typeof o.responseText ? o.responseText : null)
  34353. }
  34354. ,
  34355. 4 == o.readyState)
  34356. return;
  34357. o.send(null)
  34358. }
  34359. }
  34360. ,
  34361. t.toCamelCase = function(e) {
  34362. return e.replace(/_([a-zA-Z])/g, function(e, t) {
  34363. return t.toUpperCase()
  34364. })
  34365. }
  34366. ,
  34367. t
  34368. }(),
  34369. r.Lang = {
  34370. DELIM: /[\s\{\}=;:\[\],'"\(\)<>]/g,
  34371. RULE: /^(?:required|optional|repeated|map)$/,
  34372. TYPE: /^(?:double|float|int32|uint32|sint32|int64|uint64|sint64|fixed32|sfixed32|fixed64|sfixed64|bool|string|bytes)$/,
  34373. NAME: /^[a-zA-Z_][a-zA-Z_0-9]*$/,
  34374. TYPEDEF: /^[a-zA-Z][a-zA-Z_0-9]*$/,
  34375. TYPEREF: /^(?:\.?[a-zA-Z_][a-zA-Z_0-9]*)+$/,
  34376. FQTYPEREF: /^(?:\.[a-zA-Z][a-zA-Z_0-9]*)+$/,
  34377. NUMBER: /^-?(?:[1-9][0-9]*|0|0[xX][0-9a-fA-F]+|0[0-7]+|([0-9]*(\.[0-9]*)?([Ee][+-]?[0-9]+)?)|inf|nan)$/,
  34378. NUMBER_DEC: /^(?:[1-9][0-9]*|0)$/,
  34379. NUMBER_HEX: /^0[xX][0-9a-fA-F]+$/,
  34380. NUMBER_OCT: /^0[0-7]+$/,
  34381. NUMBER_FLT: /^([0-9]*(\.[0-9]*)?([Ee][+-]?[0-9]+)?|inf|nan)$/,
  34382. BOOL: /^(?:true|false)$/i,
  34383. ID: /^(?:[1-9][0-9]*|0|0[xX][0-9a-fA-F]+|0[0-7]+)$/,
  34384. NEGID: /^\-?(?:[1-9][0-9]*|0|0[xX][0-9a-fA-F]+|0[0-7]+)$/,
  34385. WHITESPACE: /\s/,
  34386. STRING: /(?:"([^"\\]*(?:\\.[^"\\]*)*)")|(?:'([^'\\]*(?:\\.[^'\\]*)*)')/g,
  34387. STRING_DQ: /(?:"([^"\\]*(?:\\.[^"\\]*)*)")/g,
  34388. STRING_SQ: /(?:'([^'\\]*(?:\\.[^'\\]*)*)')/g
  34389. },
  34390. r.DotProto = function(e, t) {
  34391. function i(e, i) {
  34392. var n = -1
  34393. , r = 1;
  34394. if ("-" == e.charAt(0) && (r = -1,
  34395. e = e.substring(1)),
  34396. t.NUMBER_DEC.test(e))
  34397. n = parseInt(e);
  34398. else if (t.NUMBER_HEX.test(e))
  34399. n = parseInt(e.substring(2), 16);
  34400. else {
  34401. if (!t.NUMBER_OCT.test(e))
  34402. throw Error("illegal id value: " + (r < 0 ? "-" : "") + e);
  34403. n = parseInt(e.substring(1), 8)
  34404. }
  34405. if (n = r * n | 0,
  34406. !i && n < 0)
  34407. throw Error("illegal id value: " + (r < 0 ? "-" : "") + e);
  34408. return n
  34409. }
  34410. function n(e) {
  34411. var i = 1;
  34412. if ("-" == e.charAt(0) && (i = -1,
  34413. e = e.substring(1)),
  34414. t.NUMBER_DEC.test(e))
  34415. return i * parseInt(e, 10);
  34416. if (t.NUMBER_HEX.test(e))
  34417. return i * parseInt(e.substring(2), 16);
  34418. if (t.NUMBER_OCT.test(e))
  34419. return i * parseInt(e.substring(1), 8);
  34420. if ("inf" === e)
  34421. return i * (1 / 0);
  34422. if ("nan" === e)
  34423. return NaN;
  34424. if (t.NUMBER_FLT.test(e))
  34425. return i * parseFloat(e);
  34426. throw Error("illegal number value: " + (i < 0 ? "-" : "") + e)
  34427. }
  34428. function r(e, t, i) {
  34429. "undefined" == typeof e[t] ? e[t] = i : (Array.isArray(e[t]) || (e[t] = [e[t]]),
  34430. e[t].push(i))
  34431. }
  34432. var o = {}
  34433. , a = function(e) {
  34434. this.source = e + "",
  34435. this.index = 0,
  34436. this.line = 1,
  34437. this.stack = [],
  34438. this._stringOpen = null
  34439. }
  34440. , s = a.prototype;
  34441. s._readString = function() {
  34442. var e = '"' === this._stringOpen ? t.STRING_DQ : t.STRING_SQ;
  34443. e.lastIndex = this.index - 1;
  34444. var i = e.exec(this.source);
  34445. if (!i)
  34446. throw Error("unterminated string");
  34447. return this.index = e.lastIndex,
  34448. this.stack.push(this._stringOpen),
  34449. this._stringOpen = null,
  34450. i[1]
  34451. }
  34452. ,
  34453. s.next = function() {
  34454. if (this.stack.length > 0)
  34455. return this.stack.shift();
  34456. if (this.index >= this.source.length)
  34457. return null;
  34458. if (null !== this._stringOpen)
  34459. return this._readString();
  34460. var e, i, n;
  34461. do {
  34462. for (e = !1; t.WHITESPACE.test(n = this.source.charAt(this.index)); )
  34463. if ("\n" === n && ++this.line,
  34464. ++this.index === this.source.length)
  34465. return null;
  34466. if ("/" === this.source.charAt(this.index))
  34467. if (++this.index,
  34468. "/" === this.source.charAt(this.index)) {
  34469. for (; "\n" !== this.source.charAt(++this.index); )
  34470. if (this.index == this.source.length)
  34471. return null;
  34472. ++this.index,
  34473. ++this.line,
  34474. e = !0
  34475. } else {
  34476. if ("*" !== (n = this.source.charAt(this.index)))
  34477. return "/";
  34478. do {
  34479. if ("\n" === n && ++this.line,
  34480. ++this.index === this.source.length)
  34481. return null;
  34482. i = n,
  34483. n = this.source.charAt(this.index)
  34484. } while ("*" !== i || "/" !== n);++this.index,
  34485. e = !0
  34486. }
  34487. } while (e);if (this.index === this.source.length)
  34488. return null;
  34489. var r = this.index;
  34490. t.DELIM.lastIndex = 0;
  34491. var o = t.DELIM.test(this.source.charAt(r++));
  34492. if (!o)
  34493. for (; r < this.source.length && !t.DELIM.test(this.source.charAt(r)); )
  34494. ++r;
  34495. var a = this.source.substring(this.index, this.index = r);
  34496. return '"' !== a && "'" !== a || (this._stringOpen = a),
  34497. a
  34498. }
  34499. ,
  34500. s.peek = function() {
  34501. if (0 === this.stack.length) {
  34502. var e = this.next();
  34503. if (null === e)
  34504. return null;
  34505. this.stack.push(e)
  34506. }
  34507. return this.stack[0]
  34508. }
  34509. ,
  34510. s.skip = function(e) {
  34511. var t = this.next();
  34512. if (t !== e)
  34513. throw Error("illegal '" + t + "', '" + e + "' expected")
  34514. }
  34515. ,
  34516. s.omit = function(e) {
  34517. return this.peek() === e && (this.next(),
  34518. !0)
  34519. }
  34520. ,
  34521. s.toString = function() {
  34522. return "Tokenizer (" + this.index + "/" + this.source.length + " at line " + this.line + ")"
  34523. }
  34524. ,
  34525. o.Tokenizer = a;
  34526. var l = function(e) {
  34527. this.tn = new a(e),
  34528. this.proto3 = !1
  34529. }
  34530. , c = l.prototype;
  34531. return c.parse = function() {
  34532. var e, i, n = {
  34533. name: "[ROOT]",
  34534. package: null,
  34535. messages: [],
  34536. enums: [],
  34537. imports: [],
  34538. options: {},
  34539. services: []
  34540. }, r = !0;
  34541. try {
  34542. for (; e = this.tn.next(); )
  34543. switch (e) {
  34544. case "package":
  34545. if (!r || null !== n.package)
  34546. throw Error("unexpected 'package'");
  34547. if (e = this.tn.next(),
  34548. !t.TYPEREF.test(e))
  34549. throw Error("illegal package name: " + e);
  34550. this.tn.skip(";"),
  34551. n.package = e;
  34552. break;
  34553. case "import":
  34554. if (!r)
  34555. throw Error("unexpected 'import'");
  34556. e = this.tn.peek(),
  34557. ("public" === e || (i = "weak" === e)) && this.tn.next(),
  34558. e = this._readString(),
  34559. this.tn.skip(";"),
  34560. i || n.imports.push(e);
  34561. break;
  34562. case "syntax":
  34563. if (!r)
  34564. throw Error("unexpected 'syntax'");
  34565. this.tn.skip("="),
  34566. "proto3" === (n.syntax = this._readString()) && (this.proto3 = !0),
  34567. this.tn.skip(";");
  34568. break;
  34569. case "message":
  34570. this._parseMessage(n, null),
  34571. r = !1;
  34572. break;
  34573. case "enum":
  34574. this._parseEnum(n),
  34575. r = !1;
  34576. break;
  34577. case "option":
  34578. this._parseOption(n);
  34579. break;
  34580. case "service":
  34581. this._parseService(n);
  34582. break;
  34583. case "extend":
  34584. this._parseExtend(n);
  34585. break;
  34586. default:
  34587. throw Error("unexpected '" + e + "'")
  34588. }
  34589. } catch (e) {
  34590. throw e.message = "Parse error at line " + this.tn.line + ": " + e.message,
  34591. e
  34592. }
  34593. return delete n.name,
  34594. n
  34595. }
  34596. ,
  34597. l.parse = function(e) {
  34598. return new l(e).parse()
  34599. }
  34600. ,
  34601. c._readString = function() {
  34602. var e, t, i = "";
  34603. do {
  34604. if (t = this.tn.next(),
  34605. "'" !== t && '"' !== t)
  34606. throw Error("illegal string delimiter: " + t);
  34607. i += this.tn.next(),
  34608. this.tn.skip(t),
  34609. e = this.tn.peek()
  34610. } while ('"' === e || '"' === e);return i
  34611. }
  34612. ,
  34613. c._readValue = function(e) {
  34614. var i = this.tn.peek();
  34615. if ('"' === i || "'" === i)
  34616. return this._readString();
  34617. if (this.tn.next(),
  34618. t.NUMBER.test(i))
  34619. return n(i);
  34620. if (t.BOOL.test(i))
  34621. return "true" === i.toLowerCase();
  34622. if (e && t.TYPEREF.test(i))
  34623. return i;
  34624. throw Error("illegal value: " + i)
  34625. }
  34626. ,
  34627. c._parseOption = function(e, i) {
  34628. var n = this.tn.next()
  34629. , r = !1;
  34630. if ("(" === n && (r = !0,
  34631. n = this.tn.next()),
  34632. !t.TYPEREF.test(n))
  34633. throw Error("illegal option name: " + n);
  34634. var o = n;
  34635. r && (this.tn.skip(")"),
  34636. o = "(" + o + ")",
  34637. n = this.tn.peek(),
  34638. t.FQTYPEREF.test(n) && (o += n,
  34639. this.tn.next())),
  34640. this.tn.skip("="),
  34641. this._parseOptionValue(e, o),
  34642. i || this.tn.skip(";")
  34643. }
  34644. ,
  34645. c._parseOptionValue = function(e, i) {
  34646. var n = this.tn.peek();
  34647. if ("{" !== n)
  34648. r(e.options, i, this._readValue(!0));
  34649. else
  34650. for (this.tn.skip("{"); "}" !== (n = this.tn.next()); ) {
  34651. if (!t.NAME.test(n))
  34652. throw Error("illegal option name: " + i + "." + n);
  34653. this.tn.omit(":") ? r(e.options, i + "." + n, this._readValue(!0)) : this._parseOptionValue(e, i + "." + n)
  34654. }
  34655. }
  34656. ,
  34657. c._parseService = function(e) {
  34658. var i = this.tn.next();
  34659. if (!t.NAME.test(i))
  34660. throw Error("illegal service name at line " + this.tn.line + ": " + i);
  34661. var n = i
  34662. , r = {
  34663. name: n,
  34664. rpc: {},
  34665. options: {}
  34666. };
  34667. for (this.tn.skip("{"); "}" !== (i = this.tn.next()); )
  34668. if ("option" === i)
  34669. this._parseOption(r);
  34670. else {
  34671. if ("rpc" !== i)
  34672. throw Error("illegal service token: " + i);
  34673. this._parseServiceRPC(r)
  34674. }
  34675. this.tn.omit(";"),
  34676. e.services.push(r)
  34677. }
  34678. ,
  34679. c._parseServiceRPC = function(e) {
  34680. var i = "rpc"
  34681. , n = this.tn.next();
  34682. if (!t.NAME.test(n))
  34683. throw Error("illegal rpc service method name: " + n);
  34684. var r = n
  34685. , o = {
  34686. request: null,
  34687. response: null,
  34688. request_stream: !1,
  34689. response_stream: !1,
  34690. options: {}
  34691. };
  34692. if (this.tn.skip("("),
  34693. n = this.tn.next(),
  34694. "stream" === n.toLowerCase() && (o.request_stream = !0,
  34695. n = this.tn.next()),
  34696. !t.TYPEREF.test(n))
  34697. throw Error("illegal rpc service request type: " + n);
  34698. if (o.request = n,
  34699. this.tn.skip(")"),
  34700. n = this.tn.next(),
  34701. "returns" !== n.toLowerCase())
  34702. throw Error("illegal rpc service request type delimiter: " + n);
  34703. if (this.tn.skip("("),
  34704. n = this.tn.next(),
  34705. "stream" === n.toLowerCase() && (o.response_stream = !0,
  34706. n = this.tn.next()),
  34707. o.response = n,
  34708. this.tn.skip(")"),
  34709. n = this.tn.peek(),
  34710. "{" === n) {
  34711. for (this.tn.next(); "}" !== (n = this.tn.next()); ) {
  34712. if ("option" !== n)
  34713. throw Error("illegal rpc service token: " + n);
  34714. this._parseOption(o)
  34715. }
  34716. this.tn.omit(";")
  34717. } else
  34718. this.tn.skip(";");
  34719. "undefined" == typeof e[i] && (e[i] = {}),
  34720. e[i][r] = o
  34721. }
  34722. ,
  34723. c._parseMessage = function(e, n) {
  34724. var r = !!n
  34725. , o = this.tn.next()
  34726. , a = {
  34727. name: "",
  34728. fields: [],
  34729. enums: [],
  34730. messages: [],
  34731. options: {},
  34732. services: [],
  34733. oneofs: {}
  34734. };
  34735. if (!t.NAME.test(o))
  34736. throw Error("illegal " + (r ? "group" : "message") + " name: " + o);
  34737. for (a.name = o,
  34738. r && (this.tn.skip("="),
  34739. n.id = i(this.tn.next()),
  34740. a.isGroup = !0),
  34741. o = this.tn.peek(),
  34742. "[" === o && n && this._parseFieldOptions(n),
  34743. this.tn.skip("{"); "}" !== (o = this.tn.next()); )
  34744. if (t.RULE.test(o))
  34745. this._parseMessageField(a, o);
  34746. else if ("oneof" === o)
  34747. this._parseMessageOneOf(a);
  34748. else if ("enum" === o)
  34749. this._parseEnum(a);
  34750. else if ("message" === o)
  34751. this._parseMessage(a);
  34752. else if ("option" === o)
  34753. this._parseOption(a);
  34754. else if ("service" === o)
  34755. this._parseService(a);
  34756. else if ("extensions" === o)
  34757. a.extensions = this._parseExtensionRanges();
  34758. else if ("reserved" === o)
  34759. this._parseIgnored();
  34760. else if ("extend" === o)
  34761. this._parseExtend(a);
  34762. else {
  34763. if (!t.TYPEREF.test(o))
  34764. throw Error("illegal message token: " + o);
  34765. if (!this.proto3)
  34766. throw Error("illegal field rule: " + o);
  34767. this._parseMessageField(a, "optional", o)
  34768. }
  34769. return this.tn.omit(";"),
  34770. e.messages.push(a),
  34771. a
  34772. }
  34773. ,
  34774. c._parseIgnored = function() {
  34775. for (; ";" !== this.tn.peek(); )
  34776. this.tn.next();
  34777. this.tn.skip(";")
  34778. }
  34779. ,
  34780. c._parseMessageField = function(e, n, r) {
  34781. if (!t.RULE.test(n))
  34782. throw Error("illegal message field rule: " + n);
  34783. var o, a = {
  34784. rule: n,
  34785. type: "",
  34786. name: "",
  34787. options: {},
  34788. id: 0
  34789. };
  34790. if ("map" === n) {
  34791. if (r)
  34792. throw Error("illegal type: " + r);
  34793. if (this.tn.skip("<"),
  34794. o = this.tn.next(),
  34795. !t.TYPE.test(o) && !t.TYPEREF.test(o))
  34796. throw Error("illegal message field type: " + o);
  34797. if (a.keytype = o,
  34798. this.tn.skip(","),
  34799. o = this.tn.next(),
  34800. !t.TYPE.test(o) && !t.TYPEREF.test(o))
  34801. throw Error("illegal message field: " + o);
  34802. if (a.type = o,
  34803. this.tn.skip(">"),
  34804. o = this.tn.next(),
  34805. !t.NAME.test(o))
  34806. throw Error("illegal message field name: " + o);
  34807. a.name = o,
  34808. this.tn.skip("="),
  34809. a.id = i(this.tn.next()),
  34810. o = this.tn.peek(),
  34811. "[" === o && this._parseFieldOptions(a),
  34812. this.tn.skip(";")
  34813. } else if (r = "undefined" != typeof r ? r : this.tn.next(),
  34814. "group" === r) {
  34815. var s = this._parseMessage(e, a);
  34816. if (!/^[A-Z]/.test(s.name))
  34817. throw Error("illegal group name: " + s.name);
  34818. a.type = s.name,
  34819. a.name = s.name.toLowerCase(),
  34820. this.tn.omit(";")
  34821. } else {
  34822. if (!t.TYPE.test(r) && !t.TYPEREF.test(r))
  34823. throw Error("illegal message field type: " + r);
  34824. if (a.type = r,
  34825. o = this.tn.next(),
  34826. !t.NAME.test(o))
  34827. throw Error("illegal message field name: " + o);
  34828. a.name = o,
  34829. this.tn.skip("="),
  34830. a.id = i(this.tn.next()),
  34831. o = this.tn.peek(),
  34832. "[" === o && this._parseFieldOptions(a),
  34833. this.tn.skip(";")
  34834. }
  34835. return e.fields.push(a),
  34836. a
  34837. }
  34838. ,
  34839. c._parseMessageOneOf = function(e) {
  34840. var i = this.tn.next();
  34841. if (!t.NAME.test(i))
  34842. throw Error("illegal oneof name: " + i);
  34843. var n, r = i, o = [];
  34844. for (this.tn.skip("{"); "}" !== (i = this.tn.next()); )
  34845. n = this._parseMessageField(e, "optional", i),
  34846. n.oneof = r,
  34847. o.push(n.id);
  34848. this.tn.omit(";"),
  34849. e.oneofs[r] = o
  34850. }
  34851. ,
  34852. c._parseFieldOptions = function(e) {
  34853. this.tn.skip("[");
  34854. for (var t, i = !0; "]" !== (t = this.tn.peek()); )
  34855. i || this.tn.skip(","),
  34856. this._parseOption(e, !0),
  34857. i = !1;
  34858. this.tn.next()
  34859. }
  34860. ,
  34861. c._parseEnum = function(e) {
  34862. var n = {
  34863. name: "",
  34864. values: [],
  34865. options: {}
  34866. }
  34867. , r = this.tn.next();
  34868. if (!t.NAME.test(r))
  34869. throw Error("illegal name: " + r);
  34870. for (n.name = r,
  34871. this.tn.skip("{"); "}" !== (r = this.tn.next()); )
  34872. if ("option" === r)
  34873. this._parseOption(n);
  34874. else {
  34875. if (!t.NAME.test(r))
  34876. throw Error("illegal name: " + r);
  34877. this.tn.skip("=");
  34878. var o = {
  34879. name: r,
  34880. id: i(this.tn.next(), !0)
  34881. };
  34882. r = this.tn.peek(),
  34883. "[" === r && this._parseFieldOptions({
  34884. options: {}
  34885. }),
  34886. this.tn.skip(";"),
  34887. n.values.push(o)
  34888. }
  34889. this.tn.omit(";"),
  34890. e.enums.push(n)
  34891. }
  34892. ,
  34893. c._parseExtensionRanges = function() {
  34894. var t, i, r, o = [];
  34895. do {
  34896. for (i = []; ; ) {
  34897. switch (t = this.tn.next()) {
  34898. case "min":
  34899. r = e.ID_MIN;
  34900. break;
  34901. case "max":
  34902. r = e.ID_MAX;
  34903. break;
  34904. default:
  34905. r = n(t)
  34906. }
  34907. if (i.push(r),
  34908. 2 === i.length)
  34909. break;
  34910. if ("to" !== this.tn.peek()) {
  34911. i.push(r);
  34912. break
  34913. }
  34914. this.tn.next()
  34915. }
  34916. o.push(i)
  34917. } while (this.tn.omit(","));return this.tn.skip(";"),
  34918. o
  34919. }
  34920. ,
  34921. c._parseExtend = function(e) {
  34922. var i = this.tn.next();
  34923. if (!t.TYPEREF.test(i))
  34924. throw Error("illegal extend reference: " + i);
  34925. var n = {
  34926. ref: i,
  34927. fields: []
  34928. };
  34929. for (this.tn.skip("{"); "}" !== (i = this.tn.next()); )
  34930. if (t.RULE.test(i))
  34931. this._parseMessageField(n, i);
  34932. else {
  34933. if (!t.TYPEREF.test(i))
  34934. throw Error("illegal extend token: " + i);
  34935. if (!this.proto3)
  34936. throw Error("illegal field rule: " + i);
  34937. this._parseMessageField(n, "optional", i)
  34938. }
  34939. return this.tn.omit(";"),
  34940. e.messages.push(n),
  34941. n
  34942. }
  34943. ,
  34944. c.toString = function() {
  34945. return "Parser at line " + this.tn.line
  34946. }
  34947. ,
  34948. o.Parser = l,
  34949. o
  34950. }(r, r.Lang),
  34951. r.Reflect = function(e) {
  34952. function i(i) {
  34953. if ("string" == typeof i && (i = e.TYPES[i]),
  34954. "undefined" == typeof i.defaultValue)
  34955. throw Error("default value for type " + i.name + " is not supported");
  34956. return i == e.TYPES.bytes ? new t(0) : i.defaultValue
  34957. }
  34958. function n(t, i) {
  34959. if (t && "number" == typeof t.low && "number" == typeof t.high && "boolean" == typeof t.unsigned && t.low === t.low && t.high === t.high)
  34960. return new e.Long(t.low,t.high,"undefined" == typeof i ? t.unsigned : i);
  34961. if ("string" == typeof t)
  34962. return e.Long.fromString(t, i || !1, 10);
  34963. if ("number" == typeof t)
  34964. return e.Long.fromNumber(t, i || !1);
  34965. throw Error("not convertible to Long")
  34966. }
  34967. function r(t, i) {
  34968. var n = i.readVarint32()
  34969. , o = 7 & n
  34970. , a = n >>> 3;
  34971. switch (o) {
  34972. case e.WIRE_TYPES.VARINT:
  34973. do
  34974. n = i.readUint8();
  34975. while (128 === (128 & n));break;
  34976. case e.WIRE_TYPES.BITS64:
  34977. i.offset += 8;
  34978. break;
  34979. case e.WIRE_TYPES.LDELIM:
  34980. n = i.readVarint32(),
  34981. i.offset += n;
  34982. break;
  34983. case e.WIRE_TYPES.STARTGROUP:
  34984. r(a, i);
  34985. break;
  34986. case e.WIRE_TYPES.ENDGROUP:
  34987. if (a === t)
  34988. return !1;
  34989. throw Error("Illegal GROUPEND after unknown group: " + a + " (" + t + " expected)");
  34990. case e.WIRE_TYPES.BITS32:
  34991. i.offset += 4;
  34992. break;
  34993. default:
  34994. throw Error("Illegal wire type in unknown group " + t + ": " + o)
  34995. }
  34996. return !0
  34997. }
  34998. var o = {}
  34999. , a = function(e, t, i) {
  35000. this.builder = e,
  35001. this.parent = t,
  35002. this.name = i,
  35003. this.className
  35004. }
  35005. , s = a.prototype;
  35006. s.fqn = function() {
  35007. for (var e = this.name, t = this; ; ) {
  35008. if (t = t.parent,
  35009. null == t)
  35010. break;
  35011. e = t.name + "." + e
  35012. }
  35013. return e
  35014. }
  35015. ,
  35016. s.toString = function(e) {
  35017. return (e ? this.className + " " : "") + this.fqn()
  35018. }
  35019. ,
  35020. s.build = function() {
  35021. throw Error(this.toString(!0) + " cannot be built directly")
  35022. }
  35023. ,
  35024. o.T = a;
  35025. var l = function(e, t, i, n, r) {
  35026. a.call(this, e, t, i),
  35027. this.className = "Namespace",
  35028. this.children = [],
  35029. this.options = n || {},
  35030. this.syntax = r || "proto2"
  35031. }
  35032. , c = l.prototype = Object.create(a.prototype);
  35033. c.getChildren = function(e) {
  35034. if (e = e || null,
  35035. null == e)
  35036. return this.children.slice();
  35037. for (var t = [], i = 0, n = this.children.length; i < n; ++i)
  35038. this.children[i]instanceof e && t.push(this.children[i]);
  35039. return t
  35040. }
  35041. ,
  35042. c.addChild = function(e) {
  35043. var t;
  35044. if (t = this.getChild(e.name))
  35045. if (t instanceof d.Field && t.name !== t.originalName && null === this.getChild(t.originalName))
  35046. t.name = t.originalName;
  35047. else {
  35048. if (!(e instanceof d.Field && e.name !== e.originalName && null === this.getChild(e.originalName)))
  35049. throw Error("Duplicate name in namespace " + this.toString(!0) + ": " + e.name);
  35050. e.name = e.originalName
  35051. }
  35052. this.children.push(e)
  35053. }
  35054. ,
  35055. c.getChild = function(e) {
  35056. for (var t = "number" == typeof e ? "id" : "name", i = 0, n = this.children.length; i < n; ++i)
  35057. if (this.children[i][t] === e)
  35058. return this.children[i];
  35059. return null
  35060. }
  35061. ,
  35062. c.resolve = function(e, t) {
  35063. var i = "string" == typeof e ? e.split(".") : e
  35064. , n = this
  35065. , r = 0;
  35066. if ("" === i[r]) {
  35067. for (; null !== n.parent; )
  35068. n = n.parent;
  35069. r++
  35070. }
  35071. var a;
  35072. do {
  35073. do {
  35074. if (!(n instanceof o.Namespace)) {
  35075. n = null;
  35076. break
  35077. }
  35078. if (a = n.getChild(i[r]),
  35079. !a || !(a instanceof o.T) || t && !(a instanceof o.Namespace)) {
  35080. n = null;
  35081. break
  35082. }
  35083. n = a,
  35084. r++
  35085. } while (r < i.length);if (null != n)
  35086. break;
  35087. if (null !== this.parent)
  35088. return this.parent.resolve(e, t)
  35089. } while (null != n);return n
  35090. }
  35091. ,
  35092. c.qn = function(e) {
  35093. var t = []
  35094. , i = e;
  35095. do
  35096. t.unshift(i.name),
  35097. i = i.parent;
  35098. while (null !== i);for (var n = 1; n <= t.length; n++) {
  35099. var r = t.slice(t.length - n);
  35100. if (e === this.resolve(r, e instanceof o.Namespace))
  35101. return r.join(".")
  35102. }
  35103. return e.fqn()
  35104. }
  35105. ,
  35106. c.build = function() {
  35107. for (var e, t = {}, i = this.children, n = 0, r = i.length; n < r; ++n)
  35108. e = i[n],
  35109. e instanceof l && (t[e.name] = e.build());
  35110. return Object.defineProperty && Object.defineProperty(t, "$options", {
  35111. value: this.buildOpt()
  35112. }),
  35113. t
  35114. }
  35115. ,
  35116. c.buildOpt = function() {
  35117. for (var e = {}, t = Object.keys(this.options), i = 0, n = t.length; i < n; ++i) {
  35118. var r = t[i]
  35119. , o = this.options[t[i]];
  35120. e[r] = o
  35121. }
  35122. return e
  35123. }
  35124. ,
  35125. c.getOption = function(e) {
  35126. return "undefined" == typeof e ? this.options : "undefined" != typeof this.options[e] ? this.options[e] : null
  35127. }
  35128. ,
  35129. o.Namespace = l;
  35130. var h = function(t, i, n, r) {
  35131. if (this.type = t,
  35132. this.resolvedType = i,
  35133. this.isMapKey = n,
  35134. this.syntax = r,
  35135. n && e.MAP_KEY_TYPES.indexOf(t) < 0)
  35136. throw Error("Invalid map key type: " + t.name)
  35137. }
  35138. , u = h.prototype;
  35139. h.defaultFieldValue = i,
  35140. u.verifyValue = function(i) {
  35141. function r(e, t) {
  35142. throw Error("Illegal value for " + o.toString(!0) + " of type " + o.type.name + ": " + e + " (" + t + ")")
  35143. }
  35144. var o = this;
  35145. switch (this.type) {
  35146. case e.TYPES.int32:
  35147. case e.TYPES.sint32:
  35148. case e.TYPES.sfixed32:
  35149. return ("number" != typeof i || i === i && i % 1 !== 0) && r(typeof i, "not an integer"),
  35150. i > 4294967295 ? 0 | i : i;
  35151. case e.TYPES.uint32:
  35152. case e.TYPES.fixed32:
  35153. return ("number" != typeof i || i === i && i % 1 !== 0) && r(typeof i, "not an integer"),
  35154. i < 0 ? i >>> 0 : i;
  35155. case e.TYPES.int64:
  35156. case e.TYPES.sint64:
  35157. case e.TYPES.sfixed64:
  35158. if (e.Long)
  35159. try {
  35160. return n(i, !1)
  35161. } catch (e) {
  35162. r(typeof i, e.message)
  35163. }
  35164. else
  35165. r(typeof i, "requires Long.js");
  35166. case e.TYPES.uint64:
  35167. case e.TYPES.fixed64:
  35168. if (e.Long)
  35169. try {
  35170. return n(i, !0)
  35171. } catch (e) {
  35172. r(typeof i, e.message)
  35173. }
  35174. else
  35175. r(typeof i, "requires Long.js");
  35176. case e.TYPES.bool:
  35177. return "boolean" != typeof i && r(typeof i, "not a boolean"),
  35178. i;
  35179. case e.TYPES.float:
  35180. case e.TYPES.double:
  35181. return "number" != typeof i && r(typeof i, "not a number"),
  35182. i;
  35183. case e.TYPES.string:
  35184. return "string" == typeof i || i && i instanceof String || r(typeof i, "not a string"),
  35185. "" + i;
  35186. case e.TYPES.bytes:
  35187. return t.isByteBuffer(i) ? i : t.wrap(i, "base64");
  35188. case e.TYPES.enum:
  35189. var a = this.resolvedType.getChildren(e.Reflect.Enum.Value);
  35190. for (l = 0; l < a.length; l++) {
  35191. if (a[l].name == i)
  35192. return a[l].id;
  35193. if (a[l].id == i)
  35194. return a[l].id
  35195. }
  35196. if ("proto3" === this.syntax)
  35197. return ("number" != typeof i || i === i && i % 1 !== 0) && r(typeof i, "not an integer"),
  35198. (i > 4294967295 || i < 0) && r(typeof i, "not in range for uint32"),
  35199. i;
  35200. r(i, "not a valid enum value");
  35201. case e.TYPES.group:
  35202. case e.TYPES.message:
  35203. if (i && "object" == typeof i || r(typeof i, "object expected"),
  35204. i instanceof this.resolvedType.clazz)
  35205. return i;
  35206. if (i instanceof e.Builder.Message) {
  35207. var s = {};
  35208. for (var l in i)
  35209. i.hasOwnProperty(l) && (s[l] = i[l]);
  35210. i = s
  35211. }
  35212. return new this.resolvedType.clazz(i)
  35213. }
  35214. throw Error("[INTERNAL] Illegal value for " + this.toString(!0) + ": " + i + " (undefined type " + this.type + ")")
  35215. }
  35216. ,
  35217. u.calculateLength = function(i, n) {
  35218. if (null === n)
  35219. return 0;
  35220. var r;
  35221. switch (this.type) {
  35222. case e.TYPES.int32:
  35223. return n < 0 ? t.calculateVarint64(n) : t.calculateVarint32(n);
  35224. case e.TYPES.uint32:
  35225. return t.calculateVarint32(n);
  35226. case e.TYPES.sint32:
  35227. return t.calculateVarint32(t.zigZagEncode32(n));
  35228. case e.TYPES.fixed32:
  35229. case e.TYPES.sfixed32:
  35230. case e.TYPES.float:
  35231. return 4;
  35232. case e.TYPES.int64:
  35233. case e.TYPES.uint64:
  35234. return t.calculateVarint64(n);
  35235. case e.TYPES.sint64:
  35236. return t.calculateVarint64(t.zigZagEncode64(n));
  35237. case e.TYPES.fixed64:
  35238. case e.TYPES.sfixed64:
  35239. return 8;
  35240. case e.TYPES.bool:
  35241. return 1;
  35242. case e.TYPES.enum:
  35243. return t.calculateVarint32(n);
  35244. case e.TYPES.double:
  35245. return 8;
  35246. case e.TYPES.string:
  35247. return r = t.calculateUTF8Bytes(n),
  35248. t.calculateVarint32(r) + r;
  35249. case e.TYPES.bytes:
  35250. if (n.remaining() < 0)
  35251. throw Error("Illegal value for " + this.toString(!0) + ": " + n.remaining() + " bytes remaining");
  35252. return t.calculateVarint32(n.remaining()) + n.remaining();
  35253. case e.TYPES.message:
  35254. return r = this.resolvedType.calculate(n),
  35255. t.calculateVarint32(r) + r;
  35256. case e.TYPES.group:
  35257. return r = this.resolvedType.calculate(n),
  35258. r + t.calculateVarint32(i << 3 | e.WIRE_TYPES.ENDGROUP)
  35259. }
  35260. throw Error("[INTERNAL] Illegal value to encode in " + this.toString(!0) + ": " + n + " (unknown type)")
  35261. }
  35262. ,
  35263. u.encodeValue = function(i, n, r) {
  35264. if (null === n)
  35265. return r;
  35266. switch (this.type) {
  35267. case e.TYPES.int32:
  35268. n < 0 ? r.writeVarint64(n) : r.writeVarint32(n);
  35269. break;
  35270. case e.TYPES.uint32:
  35271. r.writeVarint32(n);
  35272. break;
  35273. case e.TYPES.sint32:
  35274. r.writeVarint32ZigZag(n);
  35275. break;
  35276. case e.TYPES.fixed32:
  35277. r.writeUint32(n);
  35278. break;
  35279. case e.TYPES.sfixed32:
  35280. r.writeInt32(n);
  35281. break;
  35282. case e.TYPES.int64:
  35283. case e.TYPES.uint64:
  35284. r.writeVarint64(n);
  35285. break;
  35286. case e.TYPES.sint64:
  35287. r.writeVarint64ZigZag(n);
  35288. break;
  35289. case e.TYPES.fixed64:
  35290. r.writeUint64(n);
  35291. break;
  35292. case e.TYPES.sfixed64:
  35293. r.writeInt64(n);
  35294. break;
  35295. case e.TYPES.bool:
  35296. "string" == typeof n ? r.writeVarint32("false" === n.toLowerCase() ? 0 : !!n) : r.writeVarint32(n ? 1 : 0);
  35297. break;
  35298. case e.TYPES.enum:
  35299. r.writeVarint32(n);
  35300. break;
  35301. case e.TYPES.float:
  35302. r.writeFloat32(n);
  35303. break;
  35304. case e.TYPES.double:
  35305. r.writeFloat64(n);
  35306. break;
  35307. case e.TYPES.string:
  35308. r.writeVString(n);
  35309. break;
  35310. case e.TYPES.bytes:
  35311. if (n.remaining() < 0)
  35312. throw Error("Illegal value for " + this.toString(!0) + ": " + n.remaining() + " bytes remaining");
  35313. var o = n.offset;
  35314. r.writeVarint32(n.remaining()),
  35315. r.append(n),
  35316. n.offset = o;
  35317. break;
  35318. case e.TYPES.message:
  35319. var a = (new t).LE();
  35320. this.resolvedType.encode(n, a),
  35321. r.writeVarint32(a.offset),
  35322. r.append(a.flip());
  35323. break;
  35324. case e.TYPES.group:
  35325. this.resolvedType.encode(n, r),
  35326. r.writeVarint32(i << 3 | e.WIRE_TYPES.ENDGROUP);
  35327. break;
  35328. default:
  35329. throw Error("[INTERNAL] Illegal value to encode in " + this.toString(!0) + ": " + n + " (unknown type)")
  35330. }
  35331. return r
  35332. }
  35333. ,
  35334. u.decode = function(t, i, n) {
  35335. if (i != this.type.wireType)
  35336. throw Error("Unexpected wire type for element");
  35337. var r, o;
  35338. switch (this.type) {
  35339. case e.TYPES.int32:
  35340. return 0 | t.readVarint32();
  35341. case e.TYPES.uint32:
  35342. return t.readVarint32() >>> 0;
  35343. case e.TYPES.sint32:
  35344. return 0 | t.readVarint32ZigZag();
  35345. case e.TYPES.fixed32:
  35346. return t.readUint32() >>> 0;
  35347. case e.TYPES.sfixed32:
  35348. return 0 | t.readInt32();
  35349. case e.TYPES.int64:
  35350. return t.readVarint64();
  35351. case e.TYPES.uint64:
  35352. return t.readVarint64().toUnsigned();
  35353. case e.TYPES.sint64:
  35354. return t.readVarint64ZigZag();
  35355. case e.TYPES.fixed64:
  35356. return t.readUint64();
  35357. case e.TYPES.sfixed64:
  35358. return t.readInt64();
  35359. case e.TYPES.bool:
  35360. return !!t.readVarint32();
  35361. case e.TYPES.enum:
  35362. return t.readVarint32();
  35363. case e.TYPES.float:
  35364. return t.readFloat();
  35365. case e.TYPES.double:
  35366. return t.readDouble();
  35367. case e.TYPES.string:
  35368. return t.readVString();
  35369. case e.TYPES.bytes:
  35370. if (o = t.readVarint32(),
  35371. t.remaining() < o)
  35372. throw Error("Illegal number of bytes for " + this.toString(!0) + ": " + o + " required but got only " + t.remaining());
  35373. return r = t.clone(),
  35374. r.limit = r.offset + o,
  35375. t.offset += o,
  35376. r;
  35377. case e.TYPES.message:
  35378. return o = t.readVarint32(),
  35379. this.resolvedType.decode(t, o);
  35380. case e.TYPES.group:
  35381. return this.resolvedType.decode(t, -1, n)
  35382. }
  35383. throw Error("[INTERNAL] Illegal decode type")
  35384. }
  35385. ,
  35386. u.valueFromString = function(i) {
  35387. if (!this.isMapKey)
  35388. throw Error("valueFromString() called on non-map-key element");
  35389. switch (this.type) {
  35390. case e.TYPES.int32:
  35391. case e.TYPES.sint32:
  35392. case e.TYPES.sfixed32:
  35393. case e.TYPES.uint32:
  35394. case e.TYPES.fixed32:
  35395. return this.verifyValue(parseInt(i));
  35396. case e.TYPES.int64:
  35397. case e.TYPES.sint64:
  35398. case e.TYPES.sfixed64:
  35399. case e.TYPES.uint64:
  35400. case e.TYPES.fixed64:
  35401. return this.verifyValue(i);
  35402. case e.TYPES.bool:
  35403. return "true" === i;
  35404. case e.TYPES.string:
  35405. return this.verifyValue(i);
  35406. case e.TYPES.bytes:
  35407. return t.fromBinary(i)
  35408. }
  35409. }
  35410. ,
  35411. u.valueToString = function(t) {
  35412. if (!this.isMapKey)
  35413. throw Error("valueToString() called on non-map-key element");
  35414. return this.type === e.TYPES.bytes ? t.toString("binary") : t.toString()
  35415. }
  35416. ,
  35417. o.Element = h;
  35418. var d = function(e, t, i, n, r, o) {
  35419. l.call(this, e, t, i, n, o),
  35420. this.className = "Message",
  35421. this.extensions = void 0,
  35422. this.clazz = null,
  35423. this.isGroup = !!r,
  35424. this._fields = null,
  35425. this._fieldsById = null,
  35426. this._fieldsByName = null
  35427. }
  35428. , p = d.prototype = Object.create(l.prototype);
  35429. p.build = function(i) {
  35430. if (this.clazz && !i)
  35431. return this.clazz;
  35432. var n = function(e, i) {
  35433. function n(i, r, o, a) {
  35434. if (null === i || "object" != typeof i) {
  35435. if (a && a instanceof e.Reflect.Enum) {
  35436. var s = e.Reflect.Enum.getName(a.object, i);
  35437. if (null !== s)
  35438. return s
  35439. }
  35440. return i
  35441. }
  35442. if (t.isByteBuffer(i))
  35443. return r ? i.toBase64() : i.toBuffer();
  35444. if (e.Long.isLong(i))
  35445. return o ? i.toString() : e.Long.fromValue(i);
  35446. var l;
  35447. if (Array.isArray(i))
  35448. return l = [],
  35449. i.forEach(function(e, t) {
  35450. l[t] = n(e, r, o, a)
  35451. }),
  35452. l;
  35453. if (l = {},
  35454. i instanceof e.Map) {
  35455. for (var c = i.entries(), h = c.next(); !h.done; h = c.next())
  35456. l[i.keyElem.valueToString(h.value[0])] = n(h.value[1], r, o, i.valueElem.resolvedType);
  35457. return l
  35458. }
  35459. var u = i.$type
  35460. , d = void 0;
  35461. for (var p in i)
  35462. i.hasOwnProperty(p) && (u && (d = u.getChild(p)) ? l[p] = n(i[p], r, o, d.resolvedType) : l[p] = n(i[p], r, o));
  35463. return l
  35464. }
  35465. var r = i.getChildren(e.Reflect.Message.Field)
  35466. , o = i.getChildren(e.Reflect.Message.OneOf)
  35467. , a = function(n, s) {
  35468. e.Builder.Message.call(this);
  35469. for (var l = 0, c = o.length; l < c; ++l)
  35470. this[o[l].name] = null;
  35471. for (l = 0,
  35472. c = r.length; l < c; ++l) {
  35473. var h = r[l];
  35474. this[h.name] = h.repeated ? [] : h.map ? new e.Map(h) : null,
  35475. !h.required && "proto3" !== i.syntax || null === h.defaultValue || (this[h.name] = h.defaultValue)
  35476. }
  35477. if (arguments.length > 0) {
  35478. var u;
  35479. 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)
  35480. for (l = 0,
  35481. c = arguments.length; l < c; ++l)
  35482. "undefined" != typeof (u = arguments[l]) && this.$set(r[l].name, u);
  35483. else
  35484. this.$set(n)
  35485. }
  35486. }
  35487. , s = a.prototype = Object.create(e.Builder.Message.prototype);
  35488. s.add = function(t, n, r) {
  35489. var o = i._fieldsByName[t];
  35490. if (!r) {
  35491. if (!o)
  35492. throw Error(this + "#" + t + " is undefined");
  35493. if (!(o instanceof e.Reflect.Message.Field))
  35494. throw Error(this + "#" + t + " is not a field: " + o.toString(!0));
  35495. if (!o.repeated)
  35496. throw Error(this + "#" + t + " is not a repeated field");
  35497. n = o.verifyValue(n, !0)
  35498. }
  35499. return null === this[t] && (this[t] = []),
  35500. this[t].push(n),
  35501. this
  35502. }
  35503. ,
  35504. s.$add = s.add,
  35505. s.set = function(t, n, r) {
  35506. if (t && "object" == typeof t) {
  35507. r = n;
  35508. for (var o in t)
  35509. t.hasOwnProperty(o) && "undefined" != typeof (n = t[o]) && this.$set(o, n, r);
  35510. return this
  35511. }
  35512. var a = i._fieldsByName[t];
  35513. if (r)
  35514. this[t] = n;
  35515. else {
  35516. if (!a)
  35517. throw Error(this + "#" + t + " is not a field: undefined");
  35518. if (!(a instanceof e.Reflect.Message.Field))
  35519. throw Error(this + "#" + t + " is not a field: " + a.toString(!0));
  35520. this[a.name] = n = a.verifyValue(n)
  35521. }
  35522. if (a && a.oneof) {
  35523. var s = this[a.oneof.name];
  35524. null !== n ? (null !== s && s !== a.name && (this[s] = null),
  35525. this[a.oneof.name] = a.name) : s === t && (this[a.oneof.name] = null)
  35526. }
  35527. return this
  35528. }
  35529. ,
  35530. s.$set = s.set,
  35531. s.get = function(t, n) {
  35532. if (n)
  35533. return this[t];
  35534. var r = i._fieldsByName[t];
  35535. if (!(r && r instanceof e.Reflect.Message.Field))
  35536. throw Error(this + "#" + t + " is not a field: undefined");
  35537. if (!(r instanceof e.Reflect.Message.Field))
  35538. throw Error(this + "#" + t + " is not a field: " + r.toString(!0));
  35539. return this[r.name]
  35540. }
  35541. ,
  35542. s.$get = s.get;
  35543. for (var l = 0; l < r.length; l++) {
  35544. var c = r[l];
  35545. c instanceof e.Reflect.Message.ExtensionField || i.builder.options.populateAccessors && function(e) {
  35546. var t = e.originalName.replace(/(_[a-zA-Z])/g, function(e) {
  35547. return e.toUpperCase().replace("_", "")
  35548. });
  35549. t = t.substring(0, 1).toUpperCase() + t.substring(1);
  35550. var n = e.originalName.replace(/([A-Z])/g, function(e) {
  35551. return "_" + e
  35552. })
  35553. , r = function(t, i) {
  35554. return this[e.name] = i ? t : e.verifyValue(t),
  35555. this
  35556. }
  35557. , o = function() {
  35558. return this[e.name]
  35559. };
  35560. null === i.getChild("set" + t) && (s["set" + t] = r),
  35561. null === i.getChild("set_" + n) && (s["set_" + n] = r),
  35562. null === i.getChild("get" + t) && (s["get" + t] = o),
  35563. null === i.getChild("get_" + n) && (s["get_" + n] = o)
  35564. }(c)
  35565. }
  35566. s.encode = function(e, n) {
  35567. "boolean" == typeof e && (n = e,
  35568. e = void 0);
  35569. var r = !1;
  35570. e || (e = new t,
  35571. r = !0);
  35572. var o = e.littleEndian;
  35573. try {
  35574. return i.encode(this, e.LE(), n),
  35575. (r ? e.flip() : e).LE(o)
  35576. } catch (t) {
  35577. throw e.LE(o),
  35578. t
  35579. }
  35580. }
  35581. ,
  35582. a.encode = function(e, t, i) {
  35583. return new a(e).encode(t, i)
  35584. }
  35585. ,
  35586. s.calculate = function() {
  35587. return i.calculate(this)
  35588. }
  35589. ,
  35590. s.encodeDelimited = function(e, n) {
  35591. var r = !1;
  35592. e || (e = new t,
  35593. r = !0);
  35594. var o = (new t).LE();
  35595. return i.encode(this, o, n).flip(),
  35596. e.writeVarint32(o.remaining()),
  35597. e.append(o),
  35598. r ? e.flip() : e
  35599. }
  35600. ,
  35601. s.encodeAB = function() {
  35602. try {
  35603. return this.encode().toArrayBuffer()
  35604. } catch (e) {
  35605. throw e.encoded && (e.encoded = e.encoded.toArrayBuffer()),
  35606. e
  35607. }
  35608. }
  35609. ,
  35610. s.toArrayBuffer = s.encodeAB,
  35611. s.encodeNB = function() {
  35612. try {
  35613. return this.encode().toBuffer()
  35614. } catch (e) {
  35615. throw e.encoded && (e.encoded = e.encoded.toBuffer()),
  35616. e
  35617. }
  35618. }
  35619. ,
  35620. s.toBuffer = s.encodeNB,
  35621. s.encode64 = function() {
  35622. try {
  35623. return this.encode().toBase64()
  35624. } catch (e) {
  35625. throw e.encoded && (e.encoded = e.encoded.toBase64()),
  35626. e
  35627. }
  35628. }
  35629. ,
  35630. s.toBase64 = s.encode64,
  35631. s.encodeHex = function() {
  35632. try {
  35633. return this.encode().toHex()
  35634. } catch (e) {
  35635. throw e.encoded && (e.encoded = e.encoded.toHex()),
  35636. e
  35637. }
  35638. }
  35639. ,
  35640. s.toHex = s.encodeHex,
  35641. s.toRaw = function(e, t) {
  35642. return n(this, !!e, !!t, this.$type)
  35643. }
  35644. ,
  35645. s.encodeJSON = function() {
  35646. return JSON.stringify(n(this, !0, !0, this.$type))
  35647. }
  35648. ,
  35649. a.decode = function(e, n, r) {
  35650. "string" == typeof n && (r = n,
  35651. n = -1),
  35652. "string" == typeof e && (e = t.wrap(e, r ? r : "base64")),
  35653. e = t.isByteBuffer(e) ? e : t.wrap(e);
  35654. var o = e.littleEndian;
  35655. try {
  35656. var a = i.decode(e.LE());
  35657. return e.LE(o),
  35658. a
  35659. } catch (t) {
  35660. throw e.LE(o),
  35661. t
  35662. }
  35663. }
  35664. ,
  35665. a.decodeDelimited = function(e, n) {
  35666. if ("string" == typeof e && (e = t.wrap(e, n ? n : "base64")),
  35667. e = t.isByteBuffer(e) ? e : t.wrap(e),
  35668. e.remaining() < 1)
  35669. return null;
  35670. var r = e.offset
  35671. , o = e.readVarint32();
  35672. if (e.remaining() < o)
  35673. return e.offset = r,
  35674. null;
  35675. try {
  35676. var a = i.decode(e.slice(e.offset, e.offset + o).LE());
  35677. return e.offset += o,
  35678. a
  35679. } catch (t) {
  35680. throw e.offset += o,
  35681. t
  35682. }
  35683. }
  35684. ,
  35685. a.decode64 = function(e) {
  35686. return a.decode(e, "base64")
  35687. }
  35688. ,
  35689. a.decodeHex = function(e) {
  35690. return a.decode(e, "hex")
  35691. }
  35692. ,
  35693. a.decodeJSON = function(e) {
  35694. return new a(JSON.parse(e))
  35695. }
  35696. ,
  35697. s.toString = function() {
  35698. return i.toString()
  35699. }
  35700. ;
  35701. return Object.defineProperty && (Object.defineProperty(a, "$options", {
  35702. value: i.buildOpt()
  35703. }),
  35704. Object.defineProperty(s, "$options", {
  35705. value: a.$options
  35706. }),
  35707. Object.defineProperty(a, "$type", {
  35708. value: i
  35709. }),
  35710. Object.defineProperty(s, "$type", {
  35711. value: i
  35712. })),
  35713. a
  35714. }(e, this);
  35715. this._fields = [],
  35716. this._fieldsById = {},
  35717. this._fieldsByName = {};
  35718. for (var r, o = 0, a = this.children.length; o < a; o++)
  35719. if (r = this.children[o],
  35720. r instanceof A || r instanceof d || r instanceof E) {
  35721. if (n.hasOwnProperty(r.name))
  35722. throw Error("Illegal reflect child of " + this.toString(!0) + ": " + r.toString(!0) + " cannot override static property '" + r.name + "'");
  35723. n[r.name] = r.build()
  35724. } else if (r instanceof d.Field)
  35725. r.build(),
  35726. this._fields.push(r),
  35727. this._fieldsById[r.id] = r,
  35728. this._fieldsByName[r.name] = r;
  35729. else if (!(r instanceof d.OneOf || r instanceof I))
  35730. throw Error("Illegal reflect child of " + this.toString(!0) + ": " + this.children[o].toString(!0));
  35731. return this.clazz = n
  35732. }
  35733. ,
  35734. p.encode = function(e, t, i) {
  35735. for (var n, r, o = null, a = 0, s = this._fields.length; a < s; ++a)
  35736. n = this._fields[a],
  35737. r = e[n.name],
  35738. n.required && null === r ? null === o && (o = n) : n.encode(i ? r : n.verifyValue(r), t, e);
  35739. if (null !== o) {
  35740. var l = Error("Missing at least one required field for " + this.toString(!0) + ": " + o);
  35741. throw l.encoded = t,
  35742. l
  35743. }
  35744. return t
  35745. }
  35746. ,
  35747. p.calculate = function(e) {
  35748. for (var t, i, n = 0, r = 0, o = this._fields.length; r < o; ++r) {
  35749. if (t = this._fields[r],
  35750. i = e[t.name],
  35751. t.required && null === i)
  35752. throw Error("Missing at least one required field for " + this.toString(!0) + ": " + t);
  35753. n += t.calculate(i, e)
  35754. }
  35755. return n
  35756. }
  35757. ,
  35758. p.decode = function(t, i, n) {
  35759. i = "number" == typeof i ? i : -1;
  35760. for (var o, a, s, l, c = t.offset, h = new this.clazz; t.offset < c + i || i === -1 && t.remaining() > 0; ) {
  35761. if (o = t.readVarint32(),
  35762. a = 7 & o,
  35763. s = o >>> 3,
  35764. a === e.WIRE_TYPES.ENDGROUP) {
  35765. if (s !== n)
  35766. throw Error("Illegal group end indicator for " + this.toString(!0) + ": " + s + " (" + (n ? n + " expected" : "not a group") + ")");
  35767. break
  35768. }
  35769. if (l = this._fieldsById[s]) {
  35770. if (l.repeated && !l.options.packed)
  35771. h[l.name].push(l.decode(a, t));
  35772. else if (l.map) {
  35773. var u = l.decode(a, t);
  35774. h[l.name].set(u[0], u[1])
  35775. } else if (h[l.name] = l.decode(a, t),
  35776. l.oneof) {
  35777. var d = h[l.oneof.name];
  35778. null !== d && d !== l.name && (h[d] = null),
  35779. h[l.oneof.name] = l.name
  35780. }
  35781. } else
  35782. switch (a) {
  35783. case e.WIRE_TYPES.VARINT:
  35784. t.readVarint32();
  35785. break;
  35786. case e.WIRE_TYPES.BITS32:
  35787. t.offset += 4;
  35788. break;
  35789. case e.WIRE_TYPES.BITS64:
  35790. t.offset += 8;
  35791. break;
  35792. case e.WIRE_TYPES.LDELIM:
  35793. var p = t.readVarint32();
  35794. t.offset += p;
  35795. break;
  35796. case e.WIRE_TYPES.STARTGROUP:
  35797. for (; r(s, t); )
  35798. ;
  35799. break;
  35800. default:
  35801. throw Error("Illegal wire type for unknown field " + s + " in " + this.toString(!0) + "#decode: " + a)
  35802. }
  35803. }
  35804. for (var f = 0, g = this._fields.length; f < g; ++f)
  35805. if (l = this._fields[f],
  35806. null === h[l.name])
  35807. if ("proto3" === this.syntax)
  35808. h[l.name] = l.defaultValue;
  35809. else {
  35810. if (l.required) {
  35811. var m = Error("Missing at least one required field for " + this.toString(!0) + ": " + l.name);
  35812. throw m.decoded = h,
  35813. m
  35814. }
  35815. e.populateDefaults && null !== l.defaultValue && (h[l.name] = l.defaultValue)
  35816. }
  35817. return h
  35818. }
  35819. ,
  35820. o.Message = d;
  35821. var f = function(t, i, n, r, o, s, l, c, h, u) {
  35822. a.call(this, t, i, s),
  35823. this.className = "Message.Field",
  35824. this.required = "required" === n,
  35825. this.repeated = "repeated" === n,
  35826. this.map = "map" === n,
  35827. this.keyType = r || null,
  35828. this.type = o,
  35829. this.resolvedType = null,
  35830. this.id = l,
  35831. this.options = c || {},
  35832. this.defaultValue = null,
  35833. this.oneof = h || null,
  35834. this.syntax = u || "proto2",
  35835. this.originalName = this.name,
  35836. this.element = null,
  35837. this.keyElement = null,
  35838. !this.builder.options.convertFieldsToCamelCase || this instanceof d.ExtensionField || (this.name = e.Util.toCamelCase(this.name))
  35839. }
  35840. , g = f.prototype = Object.create(a.prototype);
  35841. g.build = function() {
  35842. this.element = new h(this.type,this.resolvedType,!1,this.syntax),
  35843. this.map && (this.keyElement = new h(this.keyType,void 0,!0,this.syntax)),
  35844. "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)
  35845. }
  35846. ,
  35847. g.verifyValue = function(t, i) {
  35848. function n(e, t) {
  35849. throw Error("Illegal value for " + r.toString(!0) + " of type " + r.type.name + ": " + e + " (" + t + ")")
  35850. }
  35851. i = i || !1;
  35852. var r = this;
  35853. if (null === t)
  35854. return this.required && n(typeof t, "required"),
  35855. "proto3" === this.syntax && this.type !== e.TYPES.message && n(typeof t, "proto3 field without field presence cannot be null"),
  35856. null;
  35857. var o;
  35858. if (this.repeated && !i) {
  35859. Array.isArray(t) || (t = [t]);
  35860. var a = [];
  35861. for (o = 0; o < t.length; o++)
  35862. a.push(this.element.verifyValue(t[o]));
  35863. return a
  35864. }
  35865. return this.map && !i ? t instanceof e.Map ? t : (t instanceof Object || n(typeof t, "expected ProtoBuf.Map or raw object for map field"),
  35866. new e.Map(this,t)) : (!this.repeated && Array.isArray(t) && n(typeof t, "no array expected"),
  35867. this.element.verifyValue(t))
  35868. }
  35869. ,
  35870. g.hasWirePresence = function(t, i) {
  35871. if ("proto3" !== this.syntax)
  35872. return null !== t;
  35873. if (this.oneof && i[this.oneof.name] === this.name)
  35874. return !0;
  35875. switch (this.type) {
  35876. case e.TYPES.int32:
  35877. case e.TYPES.sint32:
  35878. case e.TYPES.sfixed32:
  35879. case e.TYPES.uint32:
  35880. case e.TYPES.fixed32:
  35881. return 0 !== t;
  35882. case e.TYPES.int64:
  35883. case e.TYPES.sint64:
  35884. case e.TYPES.sfixed64:
  35885. case e.TYPES.uint64:
  35886. case e.TYPES.fixed64:
  35887. return 0 !== t.low || 0 !== t.high;
  35888. case e.TYPES.bool:
  35889. return t;
  35890. case e.TYPES.float:
  35891. case e.TYPES.double:
  35892. return 0 !== t;
  35893. case e.TYPES.string:
  35894. return t.length > 0;
  35895. case e.TYPES.bytes:
  35896. return t.remaining() > 0;
  35897. case e.TYPES.enum:
  35898. return 0 !== t;
  35899. case e.TYPES.message:
  35900. return null !== t;
  35901. default:
  35902. return !0
  35903. }
  35904. }
  35905. ,
  35906. g.encode = function(i, n, r) {
  35907. if (null === this.type || "object" != typeof this.type)
  35908. throw Error("[INTERNAL] Unresolved type in " + this.toString(!0) + ": " + this.type);
  35909. if (null === i || this.repeated && 0 == i.length)
  35910. return n;
  35911. try {
  35912. if (this.repeated) {
  35913. var o;
  35914. if (this.options.packed && e.PACKABLE_WIRE_TYPES.indexOf(this.type.wireType) >= 0) {
  35915. n.writeVarint32(this.id << 3 | e.WIRE_TYPES.LDELIM),
  35916. n.ensureCapacity(n.offset += 1);
  35917. var a = n.offset;
  35918. for (o = 0; o < i.length; o++)
  35919. this.element.encodeValue(this.id, i[o], n);
  35920. var s = n.offset - a
  35921. , l = t.calculateVarint32(s);
  35922. if (l > 1) {
  35923. var c = n.slice(a, n.offset);
  35924. a += l - 1,
  35925. n.offset = a,
  35926. n.append(c)
  35927. }
  35928. n.writeVarint32(s, a - l)
  35929. } else
  35930. for (o = 0; o < i.length; o++)
  35931. n.writeVarint32(this.id << 3 | this.type.wireType),
  35932. this.element.encodeValue(this.id, i[o], n)
  35933. } else
  35934. this.map ? i.forEach(function(i, r, o) {
  35935. var a = t.calculateVarint32(8 | this.keyType.wireType) + this.keyElement.calculateLength(1, r) + t.calculateVarint32(16 | this.type.wireType) + this.element.calculateLength(2, i);
  35936. n.writeVarint32(this.id << 3 | e.WIRE_TYPES.LDELIM),
  35937. n.writeVarint32(a),
  35938. n.writeVarint32(8 | this.keyType.wireType),
  35939. this.keyElement.encodeValue(1, r, n),
  35940. n.writeVarint32(16 | this.type.wireType),
  35941. this.element.encodeValue(2, i, n)
  35942. }, this) : this.hasWirePresence(i, r) && (n.writeVarint32(this.id << 3 | this.type.wireType),
  35943. this.element.encodeValue(this.id, i, n))
  35944. } catch (e) {
  35945. throw Error("Illegal value for " + this.toString(!0) + ": " + i + " (" + e + ")")
  35946. }
  35947. return n
  35948. }
  35949. ,
  35950. g.calculate = function(i, n) {
  35951. if (i = this.verifyValue(i),
  35952. null === this.type || "object" != typeof this.type)
  35953. throw Error("[INTERNAL] Unresolved type in " + this.toString(!0) + ": " + this.type);
  35954. if (null === i || this.repeated && 0 == i.length)
  35955. return 0;
  35956. var r = 0;
  35957. try {
  35958. if (this.repeated) {
  35959. var o, a;
  35960. if (this.options.packed && e.PACKABLE_WIRE_TYPES.indexOf(this.type.wireType) >= 0) {
  35961. for (r += t.calculateVarint32(this.id << 3 | e.WIRE_TYPES.LDELIM),
  35962. a = 0,
  35963. o = 0; o < i.length; o++)
  35964. a += this.element.calculateLength(this.id, i[o]);
  35965. r += t.calculateVarint32(a),
  35966. r += a
  35967. } else
  35968. for (o = 0; o < i.length; o++)
  35969. r += t.calculateVarint32(this.id << 3 | this.type.wireType),
  35970. r += this.element.calculateLength(this.id, i[o])
  35971. } else
  35972. this.map ? i.forEach(function(i, n, o) {
  35973. var a = t.calculateVarint32(8 | this.keyType.wireType) + this.keyElement.calculateLength(1, n) + t.calculateVarint32(16 | this.type.wireType) + this.element.calculateLength(2, i);
  35974. r += t.calculateVarint32(this.id << 3 | e.WIRE_TYPES.LDELIM),
  35975. r += t.calculateVarint32(a),
  35976. r += a
  35977. }, this) : this.hasWirePresence(i, n) && (r += t.calculateVarint32(this.id << 3 | this.type.wireType),
  35978. r += this.element.calculateLength(this.id, i))
  35979. } catch (e) {
  35980. throw Error("Illegal value for " + this.toString(!0) + ": " + i + " (" + e + ")")
  35981. }
  35982. return r
  35983. }
  35984. ,
  35985. g.decode = function(t, i, n) {
  35986. 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;
  35987. if (!a)
  35988. throw Error("Illegal wire type for field " + this.toString(!0) + ": " + t + " (" + this.type.wireType + " expected)");
  35989. if (t == e.WIRE_TYPES.LDELIM && this.repeated && this.options.packed && e.PACKABLE_WIRE_TYPES.indexOf(this.type.wireType) >= 0 && !n) {
  35990. o = i.readVarint32(),
  35991. o = i.offset + o;
  35992. for (var s = []; i.offset < o; )
  35993. s.push(this.decode(this.type.wireType, i, !0));
  35994. return s
  35995. }
  35996. if (this.map) {
  35997. var l = h.defaultFieldValue(this.keyType);
  35998. if (r = h.defaultFieldValue(this.type),
  35999. o = i.readVarint32(),
  36000. i.remaining() < o)
  36001. throw Error("Illegal number of bytes for " + this.toString(!0) + ": " + o + " required but got only " + i.remaining());
  36002. var c = i.clone();
  36003. for (c.limit = c.offset + o,
  36004. i.offset += o; c.remaining() > 0; ) {
  36005. var u = c.readVarint32();
  36006. t = 7 & u;
  36007. var d = u >>> 3;
  36008. if (1 === d)
  36009. l = this.keyElement.decode(c, t, d);
  36010. else {
  36011. if (2 !== d)
  36012. throw Error("Unexpected tag in map field key/value submessage");
  36013. r = this.element.decode(c, t, d)
  36014. }
  36015. }
  36016. return [l, r]
  36017. }
  36018. return this.element.decode(i, t, this.id)
  36019. }
  36020. ,
  36021. o.Message.Field = f;
  36022. var m = function(e, t, i, n, r, o, a) {
  36023. f.call(this, e, t, i, null, n, r, o, a),
  36024. this.extension
  36025. };
  36026. m.prototype = Object.create(f.prototype),
  36027. o.Message.ExtensionField = m;
  36028. var v = function(e, t, i) {
  36029. a.call(this, e, t, i),
  36030. this.fields = []
  36031. };
  36032. o.Message.OneOf = v;
  36033. var A = function(e, t, i, n, r) {
  36034. l.call(this, e, t, i, n, r),
  36035. this.className = "Enum",
  36036. this.object = null
  36037. };
  36038. A.getName = function(e, t) {
  36039. for (var i, n = Object.keys(e), r = 0; r < n.length; ++r)
  36040. if (e[i = n[r]] === t)
  36041. return i;
  36042. return null
  36043. }
  36044. ;
  36045. var y = A.prototype = Object.create(l.prototype);
  36046. y.build = function(t) {
  36047. if (this.object && !t)
  36048. return this.object;
  36049. for (var i = new e.Builder.Enum, n = this.getChildren(A.Value), r = 0, o = n.length; r < o; ++r)
  36050. i[n[r].name] = n[r].id;
  36051. return Object.defineProperty && Object.defineProperty(i, "$options", {
  36052. value: this.buildOpt(),
  36053. enumerable: !1
  36054. }),
  36055. this.object = i
  36056. }
  36057. ,
  36058. o.Enum = A;
  36059. var C = function(e, t, i, n) {
  36060. a.call(this, e, t, i),
  36061. this.className = "Enum.Value",
  36062. this.id = n
  36063. };
  36064. C.prototype = Object.create(a.prototype),
  36065. o.Enum.Value = C;
  36066. var I = function(e, t, i, n) {
  36067. a.call(this, e, t, i),
  36068. this.field = n
  36069. };
  36070. I.prototype = Object.create(a.prototype),
  36071. o.Extension = I;
  36072. var E = function(e, t, i, n) {
  36073. l.call(this, e, t, i, n),
  36074. this.className = "Service",
  36075. this.clazz = null
  36076. }
  36077. , b = E.prototype = Object.create(l.prototype);
  36078. b.build = function(i) {
  36079. return this.clazz && !i ? this.clazz : this.clazz = function(e, i) {
  36080. for (var n = function(t) {
  36081. e.Builder.Service.call(this),
  36082. this.rpcImpl = t || function(e, t, i) {
  36083. setTimeout(i.bind(this, Error("Not implemented, see: https://github.com/dcodeIO/ProtoBuf.js/wiki/Services")), 0)
  36084. }
  36085. }, r = n.prototype = Object.create(e.Builder.Service.prototype), o = i.getChildren(e.Reflect.Service.RPCMethod), a = 0; a < o.length; a++)
  36086. !function(e) {
  36087. r[e.name] = function(n, r) {
  36088. try {
  36089. try {
  36090. n = e.resolvedRequestType.clazz.decode(t.wrap(n))
  36091. } catch (e) {
  36092. if (!(e instanceof TypeError))
  36093. throw e
  36094. }
  36095. if (null === n || "object" != typeof n)
  36096. throw Error("Illegal arguments");
  36097. n instanceof e.resolvedRequestType.clazz || (n = new e.resolvedRequestType.clazz(n)),
  36098. this.rpcImpl(e.fqn(), n, function(t, n) {
  36099. if (t)
  36100. return void r(t);
  36101. null === n && (n = "");
  36102. try {
  36103. n = e.resolvedResponseType.clazz.decode(n)
  36104. } catch (e) {}
  36105. 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))
  36106. })
  36107. } catch (e) {
  36108. setTimeout(r.bind(this, e), 0)
  36109. }
  36110. }
  36111. ,
  36112. n[e.name] = function(t, i, r) {
  36113. new n(t)[e.name](i, r)
  36114. }
  36115. ,
  36116. Object.defineProperty && (Object.defineProperty(n[e.name], "$options", {
  36117. value: e.buildOpt()
  36118. }),
  36119. Object.defineProperty(r[e.name], "$options", {
  36120. value: n[e.name].$options
  36121. }))
  36122. }(o[a]);
  36123. return Object.defineProperty && (Object.defineProperty(n, "$options", {
  36124. value: i.buildOpt()
  36125. }),
  36126. Object.defineProperty(r, "$options", {
  36127. value: n.$options
  36128. }),
  36129. Object.defineProperty(n, "$type", {
  36130. value: i
  36131. }),
  36132. Object.defineProperty(r, "$type", {
  36133. value: i
  36134. })),
  36135. n
  36136. }(e, this)
  36137. }
  36138. ,
  36139. o.Service = E;
  36140. var w = function(e, t, i, n) {
  36141. a.call(this, e, t, i),
  36142. this.className = "Service.Method",
  36143. this.options = n || {}
  36144. }
  36145. , _ = w.prototype = Object.create(a.prototype);
  36146. _.buildOpt = c.buildOpt,
  36147. o.Service.Method = w;
  36148. var T = function(e, t, i, n, r, o, a, s) {
  36149. w.call(this, e, t, i, s),
  36150. this.className = "Service.RPCMethod",
  36151. this.requestName = n,
  36152. this.responseName = r,
  36153. this.requestStream = o,
  36154. this.responseStream = a,
  36155. this.resolvedRequestType = null,
  36156. this.resolvedResponseType = null
  36157. };
  36158. return T.prototype = Object.create(w.prototype),
  36159. o.Service.RPCMethod = T,
  36160. o
  36161. }(r),
  36162. r.Builder = function(t, i, n) {
  36163. function r(e) {
  36164. e.messages && e.messages.forEach(function(t) {
  36165. t.syntax = e.syntax,
  36166. r(t)
  36167. }),
  36168. e.enums && e.enums.forEach(function(t) {
  36169. t.syntax = e.syntax
  36170. })
  36171. }
  36172. var o = function(e) {
  36173. this.ns = new n.Namespace(this,null,""),
  36174. this.ptr = this.ns,
  36175. this.resolved = !1,
  36176. this.result = null,
  36177. this.files = {},
  36178. this.importRoot = null,
  36179. this.options = e || {}
  36180. }
  36181. , a = o.prototype;
  36182. return o.isMessage = function(e) {
  36183. return "string" == typeof e.name && ("undefined" == typeof e.values && "undefined" == typeof e.rpc)
  36184. }
  36185. ,
  36186. o.isMessageField = function(e) {
  36187. return "string" == typeof e.rule && "string" == typeof e.name && "string" == typeof e.type && "undefined" != typeof e.id
  36188. }
  36189. ,
  36190. o.isEnum = function(e) {
  36191. return "string" == typeof e.name && !("undefined" == typeof e.values || !Array.isArray(e.values) || 0 === e.values.length)
  36192. }
  36193. ,
  36194. o.isService = function(e) {
  36195. return !("string" != typeof e.name || "object" != typeof e.rpc || !e.rpc)
  36196. }
  36197. ,
  36198. o.isExtend = function(e) {
  36199. return "string" == typeof e.ref
  36200. }
  36201. ,
  36202. a.reset = function() {
  36203. return this.ptr = this.ns,
  36204. this
  36205. }
  36206. ,
  36207. a.define = function(e) {
  36208. if ("string" != typeof e || !i.TYPEREF.test(e))
  36209. throw Error("illegal namespace: " + e);
  36210. return e.split(".").forEach(function(e) {
  36211. var t = this.ptr.getChild(e);
  36212. null === t && this.ptr.addChild(t = new n.Namespace(this,this.ptr,e)),
  36213. this.ptr = t
  36214. }, this),
  36215. this
  36216. }
  36217. ,
  36218. a.create = function(e) {
  36219. if (!e)
  36220. return this;
  36221. if (Array.isArray(e)) {
  36222. if (0 === e.length)
  36223. return this;
  36224. e = e.slice()
  36225. } else
  36226. e = [e];
  36227. for (var i = [e]; i.length > 0; ) {
  36228. if (e = i.pop(),
  36229. !Array.isArray(e))
  36230. throw Error("not a valid namespace: " + JSON.stringify(e));
  36231. for (; e.length > 0; ) {
  36232. var r = e.shift();
  36233. if (o.isMessage(r)) {
  36234. var a = new n.Message(this,this.ptr,r.name,r.options,r.isGroup,r.syntax)
  36235. , s = {};
  36236. r.oneofs && Object.keys(r.oneofs).forEach(function(e) {
  36237. a.addChild(s[e] = new n.Message.OneOf(this,a,e))
  36238. }, this),
  36239. r.fields && r.fields.forEach(function(e) {
  36240. if (null !== a.getChild(0 | e.id))
  36241. throw Error("duplicate or invalid field id in " + a.name + ": " + e.id);
  36242. if (e.options && "object" != typeof e.options)
  36243. throw Error("illegal field options in " + a.name + "#" + e.name);
  36244. var t = null;
  36245. if ("string" == typeof e.oneof && !(t = s[e.oneof]))
  36246. throw Error("illegal oneof in " + a.name + "#" + e.name + ": " + e.oneof);
  36247. e = new n.Message.Field(this,a,e.rule,e.keytype,e.type,e.name,e.id,e.options,t,r.syntax),
  36248. t && t.fields.push(e),
  36249. a.addChild(e)
  36250. }, this);
  36251. var l = [];
  36252. if (r.enums && r.enums.forEach(function(e) {
  36253. l.push(e)
  36254. }),
  36255. r.messages && r.messages.forEach(function(e) {
  36256. l.push(e)
  36257. }),
  36258. r.services && r.services.forEach(function(e) {
  36259. l.push(e)
  36260. }),
  36261. r.extensions && ("number" == typeof r.extensions[0] ? a.extensions = [r.extensions] : a.extensions = r.extensions),
  36262. this.ptr.addChild(a),
  36263. l.length > 0) {
  36264. i.push(e),
  36265. e = l,
  36266. l = null,
  36267. this.ptr = a,
  36268. a = null;
  36269. continue
  36270. }
  36271. l = null
  36272. } else if (o.isEnum(r))
  36273. a = new n.Enum(this,this.ptr,r.name,r.options,r.syntax),
  36274. r.values.forEach(function(e) {
  36275. a.addChild(new n.Enum.Value(this,a,e.name,e.id))
  36276. }, this),
  36277. this.ptr.addChild(a);
  36278. else if (o.isService(r))
  36279. a = new n.Service(this,this.ptr,r.name,r.options),
  36280. Object.keys(r.rpc).forEach(function(e) {
  36281. var t = r.rpc[e];
  36282. a.addChild(new n.Service.RPCMethod(this,a,e,t.request,t.response,!!t.request_stream,!!t.response_stream,t.options))
  36283. }, this),
  36284. this.ptr.addChild(a);
  36285. else {
  36286. if (!o.isExtend(r))
  36287. throw Error("not a valid definition: " + JSON.stringify(r));
  36288. if (a = this.ptr.resolve(r.ref, !0))
  36289. r.fields.forEach(function(e) {
  36290. if (null !== a.getChild(0 | e.id))
  36291. throw Error("duplicate extended field id in " + a.name + ": " + e.id);
  36292. if (a.extensions) {
  36293. var i = !1;
  36294. if (a.extensions.forEach(function(t) {
  36295. e.id >= t[0] && e.id <= t[1] && (i = !0)
  36296. }),
  36297. !i)
  36298. throw Error("illegal extended field id in " + a.name + ": " + e.id + " (not within valid ranges)")
  36299. }
  36300. var r = e.name;
  36301. this.options.convertFieldsToCamelCase && (r = t.Util.toCamelCase(r));
  36302. var o = new n.Message.ExtensionField(this,a,e.rule,e.type,this.ptr.fqn() + "." + r,e.id,e.options)
  36303. , s = new n.Extension(this,this.ptr,e.name,o);
  36304. o.extension = s,
  36305. this.ptr.addChild(s),
  36306. a.addChild(o)
  36307. }, this);
  36308. else if (!/\.?google\.protobuf\./.test(r.ref))
  36309. throw Error("extended message " + r.ref + " is not defined")
  36310. }
  36311. r = null,
  36312. a = null
  36313. }
  36314. e = null,
  36315. this.ptr = this.ptr.parent
  36316. }
  36317. return this.resolved = !1,
  36318. this.result = null,
  36319. this
  36320. }
  36321. ,
  36322. a.import = function(i, n) {
  36323. var o = "/";
  36324. if ("string" == typeof n) {
  36325. if (t.Util.IS_NODE && (n = e("path").resolve(n)),
  36326. this.files[n] === !0)
  36327. return this.reset();
  36328. this.files[n] = !0
  36329. } else if ("object" == typeof n) {
  36330. var a = n.root;
  36331. t.Util.IS_NODE && (a = e("path").resolve(a)),
  36332. (a.indexOf("\\") >= 0 || n.file.indexOf("\\") >= 0) && (o = "\\");
  36333. var s = a + o + n.file;
  36334. if (this.files[s] === !0)
  36335. return this.reset();
  36336. this.files[s] = !0
  36337. }
  36338. if (i.imports && i.imports.length > 0) {
  36339. var l, c = !1;
  36340. "object" == typeof n ? (this.importRoot = n.root,
  36341. c = !0,
  36342. l = this.importRoot,
  36343. n = n.file,
  36344. (l.indexOf("\\") >= 0 || n.indexOf("\\") >= 0) && (o = "\\")) : "string" == typeof n ? this.importRoot ? l = this.importRoot : n.indexOf("/") >= 0 ? (l = n.replace(/\/[^\/]*$/, ""),
  36345. "" === l && (l = "/")) : n.indexOf("\\") >= 0 ? (l = n.replace(/\\[^\\]*$/, ""),
  36346. o = "\\") : l = "." : l = null;
  36347. for (var h = 0; h < i.imports.length; h++)
  36348. if ("string" == typeof i.imports[h]) {
  36349. if (!l)
  36350. throw Error("cannot determine import root");
  36351. var u = i.imports[h];
  36352. if ("google/protobuf/descriptor.proto" === u)
  36353. continue;
  36354. if (u = l + o + u,
  36355. this.files[u] === !0)
  36356. continue;
  36357. /\.proto$/i.test(u) && !t.DotProto && (u = u.replace(/\.proto$/, ".json"));
  36358. var d = t.Util.fetch(u);
  36359. if (null === d)
  36360. throw Error("failed to import '" + u + "' in '" + n + "': file not found");
  36361. /\.json$/i.test(u) ? this.import(JSON.parse(d + ""), u) : this.import(t.DotProto.Parser.parse(d), u)
  36362. } else
  36363. n ? /\.(\w+)$/.test(n) ? this.import(i.imports[h], n.replace(/^(.+)\.(\w+)$/, function(e, t, i) {
  36364. return t + "_import" + h + "." + i
  36365. })) : this.import(i.imports[h], n + "_import" + h) : this.import(i.imports[h]);
  36366. c && (this.importRoot = null)
  36367. }
  36368. i.package && this.define(i.package),
  36369. i.syntax && r(i);
  36370. var p = this.ptr;
  36371. return i.options && Object.keys(i.options).forEach(function(e) {
  36372. p.options[e] = i.options[e]
  36373. }),
  36374. i.messages && (this.create(i.messages),
  36375. this.ptr = p),
  36376. i.enums && (this.create(i.enums),
  36377. this.ptr = p),
  36378. i.services && (this.create(i.services),
  36379. this.ptr = p),
  36380. i.extends && this.create(i.extends),
  36381. this.reset()
  36382. }
  36383. ,
  36384. a.resolveAll = function() {
  36385. var e;
  36386. if (null == this.ptr || "object" == typeof this.ptr.type)
  36387. return this;
  36388. if (this.ptr instanceof n.Namespace)
  36389. this.ptr.children.forEach(function(e) {
  36390. this.ptr = e,
  36391. this.resolveAll()
  36392. }, this);
  36393. else if (this.ptr instanceof n.Message.Field) {
  36394. if (i.TYPE.test(this.ptr.type))
  36395. this.ptr.type = t.TYPES[this.ptr.type];
  36396. else {
  36397. if (!i.TYPEREF.test(this.ptr.type))
  36398. throw Error("illegal type reference in " + this.ptr.toString(!0) + ": " + this.ptr.type);
  36399. if (e = (this.ptr instanceof n.Message.ExtensionField ? this.ptr.extension.parent : this.ptr.parent).resolve(this.ptr.type, !0),
  36400. !e)
  36401. throw Error("unresolvable type reference in " + this.ptr.toString(!0) + ": " + this.ptr.type);
  36402. if (this.ptr.resolvedType = e,
  36403. e instanceof n.Enum) {
  36404. if (this.ptr.type = t.TYPES.enum,
  36405. "proto3" === this.ptr.syntax && "proto3" !== e.syntax)
  36406. throw Error("proto3 message cannot reference proto2 enum")
  36407. } else {
  36408. if (!(e instanceof n.Message))
  36409. throw Error("illegal type reference in " + this.ptr.toString(!0) + ": " + this.ptr.type);
  36410. this.ptr.type = e.isGroup ? t.TYPES.group : t.TYPES.message
  36411. }
  36412. }
  36413. if (this.ptr.map) {
  36414. if (!i.TYPE.test(this.ptr.keyType))
  36415. throw Error("illegal key type for map field in " + this.ptr.toString(!0) + ": " + this.ptr.keyType);
  36416. this.ptr.keyType = t.TYPES[this.ptr.keyType]
  36417. }
  36418. } else if (this.ptr instanceof t.Reflect.Service.Method) {
  36419. if (!(this.ptr instanceof t.Reflect.Service.RPCMethod))
  36420. throw Error("illegal service type in " + this.ptr.toString(!0));
  36421. if (e = this.ptr.parent.resolve(this.ptr.requestName, !0),
  36422. !(e && e instanceof t.Reflect.Message))
  36423. throw Error("Illegal type reference in " + this.ptr.toString(!0) + ": " + this.ptr.requestName);
  36424. if (this.ptr.resolvedRequestType = e,
  36425. e = this.ptr.parent.resolve(this.ptr.responseName, !0),
  36426. !(e && e instanceof t.Reflect.Message))
  36427. throw Error("Illegal type reference in " + this.ptr.toString(!0) + ": " + this.ptr.responseName);
  36428. this.ptr.resolvedResponseType = e
  36429. } else if (!(this.ptr instanceof t.Reflect.Message.OneOf || this.ptr instanceof t.Reflect.Extension || this.ptr instanceof t.Reflect.Enum.Value))
  36430. throw Error("illegal object in namespace: " + typeof this.ptr + ": " + this.ptr);
  36431. return this.reset()
  36432. }
  36433. ,
  36434. a.build = function(e) {
  36435. if (this.reset(),
  36436. this.resolved || (this.resolveAll(),
  36437. this.resolved = !0,
  36438. this.result = null),
  36439. null === this.result && (this.result = this.ns.build()),
  36440. !e)
  36441. return this.result;
  36442. for (var t = "string" == typeof e ? e.split(".") : e, i = this.result, n = 0; n < t.length; n++) {
  36443. if (!i[t[n]]) {
  36444. i = null;
  36445. break
  36446. }
  36447. i = i[t[n]]
  36448. }
  36449. return i
  36450. }
  36451. ,
  36452. a.lookup = function(e, t) {
  36453. return e ? this.ns.resolve(e, t) : this.ns
  36454. }
  36455. ,
  36456. a.toString = function() {
  36457. return "Builder"
  36458. }
  36459. ,
  36460. o.Message = function() {}
  36461. ,
  36462. o.Enum = function() {}
  36463. ,
  36464. o.Service = function() {}
  36465. ,
  36466. o
  36467. }(r, r.Lang, r.Reflect),
  36468. r.Map = function(e, t) {
  36469. function i(e) {
  36470. var t = 0;
  36471. return {
  36472. next: function() {
  36473. return t < e.length ? {
  36474. done: !1,
  36475. value: e[t++]
  36476. } : {
  36477. done: !0
  36478. }
  36479. }
  36480. }
  36481. }
  36482. var n = function(e, i) {
  36483. if (!e.map)
  36484. throw Error("field is not a map");
  36485. if (this.field = e,
  36486. this.keyElem = new t.Element(e.keyType,null,!0,e.syntax),
  36487. this.valueElem = new t.Element(e.type,e.resolvedType,!1,e.syntax),
  36488. this.map = {},
  36489. Object.defineProperty(this, "size", {
  36490. get: function() {
  36491. return Object.keys(this.map).length
  36492. }
  36493. }),
  36494. i)
  36495. for (var n = Object.keys(i), r = 0; r < n.length; r++) {
  36496. var o = this.keyElem.valueFromString(n[r])
  36497. , a = this.valueElem.verifyValue(i[n[r]]);
  36498. this.map[this.keyElem.valueToString(o)] = {
  36499. key: o,
  36500. value: a
  36501. }
  36502. }
  36503. }
  36504. , r = n.prototype;
  36505. return r.clear = function() {
  36506. this.map = {}
  36507. }
  36508. ,
  36509. r.delete = function(e) {
  36510. var t = this.keyElem.valueToString(this.keyElem.verifyValue(e))
  36511. , i = t in this.map;
  36512. return delete this.map[t],
  36513. i
  36514. }
  36515. ,
  36516. r.entries = function() {
  36517. for (var e, t = [], n = Object.keys(this.map), r = 0; r < n.length; r++)
  36518. t.push([(e = this.map[n[r]]).key, e.value]);
  36519. return i(t)
  36520. }
  36521. ,
  36522. r.keys = function() {
  36523. for (var e = [], t = Object.keys(this.map), n = 0; n < t.length; n++)
  36524. e.push(this.map[t[n]].key);
  36525. return i(e)
  36526. }
  36527. ,
  36528. r.values = function() {
  36529. for (var e = [], t = Object.keys(this.map), n = 0; n < t.length; n++)
  36530. e.push(this.map[t[n]].value);
  36531. return i(e)
  36532. }
  36533. ,
  36534. r.forEach = function(e, t) {
  36535. for (var i, n = Object.keys(this.map), r = 0; r < n.length; r++)
  36536. e.call(t, (i = this.map[n[r]]).value, i.key, this)
  36537. }
  36538. ,
  36539. r.set = function(e, t) {
  36540. var i = this.keyElem.verifyValue(e)
  36541. , n = this.valueElem.verifyValue(t);
  36542. return this.map[this.keyElem.valueToString(i)] = {
  36543. key: i,
  36544. value: n
  36545. },
  36546. this
  36547. }
  36548. ,
  36549. r.get = function(e) {
  36550. var t = this.keyElem.valueToString(this.keyElem.verifyValue(e));
  36551. if (t in this.map)
  36552. return this.map[t].value
  36553. }
  36554. ,
  36555. r.has = function(e) {
  36556. var t = this.keyElem.valueToString(this.keyElem.verifyValue(e));
  36557. return t in this.map
  36558. }
  36559. ,
  36560. n
  36561. }(r, r.Reflect),
  36562. r.loadProto = function(e, t, i) {
  36563. return ("string" == typeof t || t && "string" == typeof t.file && "string" == typeof t.root) && (i = t,
  36564. t = void 0),
  36565. r.loadJson(r.DotProto.Parser.parse(e), t, i)
  36566. }
  36567. ,
  36568. r.protoFromString = r.loadProto,
  36569. r.loadProtoFile = function(e, t, i) {
  36570. if (t && "object" == typeof t ? (i = t,
  36571. t = null) : t && "function" == typeof t || (t = null),
  36572. t)
  36573. return r.Util.fetch("string" == typeof e ? e : e.root + "/" + e.file, function(n) {
  36574. if (null === n)
  36575. return void t(Error("Failed to fetch file"));
  36576. try {
  36577. t(null, r.loadProto(n, i, e))
  36578. } catch (e) {
  36579. t(e)
  36580. }
  36581. });
  36582. var n = r.Util.fetch("object" == typeof e ? e.root + "/" + e.file : e);
  36583. return null === n ? null : r.loadProto(n, i, e)
  36584. }
  36585. ,
  36586. r.protoFromFile = r.loadProtoFile,
  36587. r.newBuilder = function(e) {
  36588. return e = e || {},
  36589. "undefined" == typeof e.convertFieldsToCamelCase && (e.convertFieldsToCamelCase = r.convertFieldsToCamelCase),
  36590. "undefined" == typeof e.populateAccessors && (e.populateAccessors = r.populateAccessors),
  36591. new r.Builder(e)
  36592. }
  36593. ,
  36594. r.loadJson = function(e, t, i) {
  36595. return ("string" == typeof t || t && "string" == typeof t.file && "string" == typeof t.root) && (i = t,
  36596. t = null),
  36597. t && "object" == typeof t || (t = r.newBuilder()),
  36598. "string" == typeof e && (e = JSON.parse(e)),
  36599. t.import(e, i),
  36600. t.resolveAll(),
  36601. t
  36602. }
  36603. ,
  36604. r.loadJsonFile = function(e, t, i) {
  36605. if (t && "object" == typeof t ? (i = t,
  36606. t = null) : t && "function" == typeof t || (t = null),
  36607. t)
  36608. return r.Util.fetch("string" == typeof e ? e : e.root + "/" + e.file, function(n) {
  36609. if (null === n)
  36610. return void t(Error("Failed to fetch file"));
  36611. try {
  36612. t(null, r.loadJson(JSON.parse(n), i, e))
  36613. } catch (e) {
  36614. t(e)
  36615. }
  36616. });
  36617. var n = r.Util.fetch("object" == typeof e ? e.root + "/" + e.file : e);
  36618. return null === n ? null : r.loadJson(JSON.parse(n), i, e)
  36619. }
  36620. ,
  36621. r
  36622. })
  36623. }
  36624. ).call(this, e("_process"))
  36625. }
  36626. , {
  36627. _process: 203,
  36628. bytebuffer: 215,
  36629. fs: 197,
  36630. path: 197
  36631. }],
  36632. 215: [function(e, t, i) {
  36633. !function(i, n) {
  36634. "function" == typeof define && define.amd ? define(["long"], n) : "function" == typeof e && "object" == typeof t && t && t.exports ? t.exports = function() {
  36635. var t;
  36636. try {
  36637. t = e("long")
  36638. } catch (e) {}
  36639. return n(t)
  36640. }() : (i.dcodeIO = i.dcodeIO || {}).ByteBuffer = n(i.dcodeIO.Long)
  36641. }(this, function(e) {
  36642. "use strict";
  36643. function t(e) {
  36644. var t = 0;
  36645. return function() {
  36646. return t < e.length ? e.charCodeAt(t++) : null
  36647. }
  36648. }
  36649. function i() {
  36650. var e = []
  36651. , t = [];
  36652. return function() {
  36653. return 0 === arguments.length ? t.join("") + l.apply(String, e) : (e.length + arguments.length > 1024 && (t.push(l.apply(String, e)),
  36654. e.length = 0),
  36655. void Array.prototype.push.apply(e, arguments))
  36656. }
  36657. }
  36658. function n(e, t, i, n, r) {
  36659. 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];
  36660. for (u += d,
  36661. o = p & (1 << -h) - 1,
  36662. p >>= -h,
  36663. h += s; h > 0; o = 256 * o + e[t + u],
  36664. u += d,
  36665. h -= 8)
  36666. ;
  36667. for (a = o & (1 << -h) - 1,
  36668. o >>= -h,
  36669. h += n; h > 0; a = 256 * a + e[t + u],
  36670. u += d,
  36671. h -= 8)
  36672. ;
  36673. if (0 === o)
  36674. o = 1 - c;
  36675. else {
  36676. if (o === l)
  36677. return a ? NaN : (p ? -1 : 1) * (1 / 0);
  36678. a += Math.pow(2, n),
  36679. o -= c
  36680. }
  36681. return (p ? -1 : 1) * a * Math.pow(2, o - n)
  36682. }
  36683. function r(e, t, i, n, r, o) {
  36684. 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;
  36685. for (t = Math.abs(t),
  36686. isNaN(t) || t === 1 / 0 ? (s = isNaN(t) ? 1 : 0,
  36687. a = h) : (a = Math.floor(Math.log(t) / Math.LN2),
  36688. t * (l = Math.pow(2, -a)) < 1 && (a--,
  36689. l *= 2),
  36690. t += a + u >= 1 ? d / l : d * Math.pow(2, 1 - u),
  36691. t * l >= 2 && (a++,
  36692. l /= 2),
  36693. a + u >= h ? (s = 0,
  36694. a = h) : a + u >= 1 ? (s = (t * l - 1) * Math.pow(2, r),
  36695. a += u) : (s = t * Math.pow(2, u - 1) * Math.pow(2, r),
  36696. a = 0)); r >= 8; e[i + p] = 255 & s,
  36697. p += f,
  36698. s /= 256,
  36699. r -= 8)
  36700. ;
  36701. for (a = a << r | s,
  36702. c += r; c > 0; e[i + p] = 255 & a,
  36703. p += f,
  36704. a /= 256,
  36705. c -= 8)
  36706. ;
  36707. e[i + p - f] |= 128 * g
  36708. }
  36709. var o = function(e, t, i) {
  36710. if ("undefined" == typeof e && (e = o.DEFAULT_CAPACITY),
  36711. "undefined" == typeof t && (t = o.DEFAULT_ENDIAN),
  36712. "undefined" == typeof i && (i = o.DEFAULT_NOASSERT),
  36713. !i) {
  36714. if (e |= 0,
  36715. e < 0)
  36716. throw RangeError("Illegal capacity");
  36717. t = !!t,
  36718. i = !!i
  36719. }
  36720. this.buffer = 0 === e ? s : new ArrayBuffer(e),
  36721. this.view = 0 === e ? null : new Uint8Array(this.buffer),
  36722. this.offset = 0,
  36723. this.markedOffset = -1,
  36724. this.limit = e,
  36725. this.littleEndian = t,
  36726. this.noAssert = i
  36727. };
  36728. o.VERSION = "5.0.1",
  36729. o.LITTLE_ENDIAN = !0,
  36730. o.BIG_ENDIAN = !1,
  36731. o.DEFAULT_CAPACITY = 16,
  36732. o.DEFAULT_ENDIAN = o.BIG_ENDIAN,
  36733. o.DEFAULT_NOASSERT = !1,
  36734. o.Long = e || null;
  36735. var a = o.prototype;
  36736. a.__isByteBuffer__,
  36737. Object.defineProperty(a, "__isByteBuffer__", {
  36738. value: !0,
  36739. enumerable: !1,
  36740. configurable: !1
  36741. });
  36742. var s = new ArrayBuffer(0)
  36743. , l = String.fromCharCode;
  36744. o.accessor = function() {
  36745. return Uint8Array
  36746. }
  36747. ,
  36748. o.allocate = function(e, t, i) {
  36749. return new o(e,t,i)
  36750. }
  36751. ,
  36752. o.concat = function(e, t, i, n) {
  36753. "boolean" != typeof t && "string" == typeof t || (n = i,
  36754. i = t,
  36755. t = void 0);
  36756. for (var r, a = 0, s = 0, l = e.length; s < l; ++s)
  36757. o.isByteBuffer(e[s]) || (e[s] = o.wrap(e[s], t)),
  36758. r = e[s].limit - e[s].offset,
  36759. r > 0 && (a += r);
  36760. if (0 === a)
  36761. return new o(0,i,n);
  36762. var c, h = new o(a,i,n);
  36763. for (s = 0; s < l; )
  36764. c = e[s++],
  36765. r = c.limit - c.offset,
  36766. r <= 0 || (h.view.set(c.view.subarray(c.offset, c.limit), h.offset),
  36767. h.offset += r);
  36768. return h.limit = h.offset,
  36769. h.offset = 0,
  36770. h
  36771. }
  36772. ,
  36773. o.isByteBuffer = function(e) {
  36774. return (e && e.__isByteBuffer__) === !0
  36775. }
  36776. ,
  36777. o.type = function() {
  36778. return ArrayBuffer
  36779. }
  36780. ,
  36781. o.wrap = function(e, t, i, n) {
  36782. if ("string" != typeof t && (n = i,
  36783. i = t,
  36784. t = void 0),
  36785. "string" == typeof e)
  36786. switch ("undefined" == typeof t && (t = "utf8"),
  36787. t) {
  36788. case "base64":
  36789. return o.fromBase64(e, i);
  36790. case "hex":
  36791. return o.fromHex(e, i);
  36792. case "binary":
  36793. return o.fromBinary(e, i);
  36794. case "utf8":
  36795. return o.fromUTF8(e, i);
  36796. case "debug":
  36797. return o.fromDebug(e, i);
  36798. default:
  36799. throw Error("Unsupported encoding: " + t)
  36800. }
  36801. if (null === e || "object" != typeof e)
  36802. throw TypeError("Illegal buffer");
  36803. var r;
  36804. if (o.isByteBuffer(e))
  36805. return r = a.clone.call(e),
  36806. r.markedOffset = -1,
  36807. r;
  36808. if (e instanceof Uint8Array)
  36809. r = new o(0,i,n),
  36810. e.length > 0 && (r.buffer = e.buffer,
  36811. r.offset = e.byteOffset,
  36812. r.limit = e.byteOffset + e.byteLength,
  36813. r.view = new Uint8Array(e.buffer));
  36814. else if (e instanceof ArrayBuffer)
  36815. r = new o(0,i,n),
  36816. e.byteLength > 0 && (r.buffer = e,
  36817. r.offset = 0,
  36818. r.limit = e.byteLength,
  36819. r.view = e.byteLength > 0 ? new Uint8Array(e) : null);
  36820. else {
  36821. if ("[object Array]" !== Object.prototype.toString.call(e))
  36822. throw TypeError("Illegal buffer");
  36823. r = new o(e.length,i,n),
  36824. r.limit = e.length;
  36825. for (var s = 0; s < e.length; ++s)
  36826. r.view[s] = e[s]
  36827. }
  36828. return r
  36829. }
  36830. ,
  36831. a.writeBitSet = function(e, t) {
  36832. var i = "undefined" == typeof t;
  36833. if (i && (t = this.offset),
  36834. !this.noAssert) {
  36835. if (!(e instanceof Array))
  36836. throw TypeError("Illegal BitSet: Not an array");
  36837. if ("number" != typeof t || t % 1 !== 0)
  36838. throw TypeError("Illegal offset: " + t + " (not an integer)");
  36839. if (t >>>= 0,
  36840. t < 0 || t + 0 > this.buffer.byteLength)
  36841. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  36842. }
  36843. var n, r = t, o = e.length, a = o >> 3, s = 0;
  36844. for (t += this.writeVarint32(o, t); a--; )
  36845. 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,
  36846. this.writeByte(n, t++);
  36847. if (s < o) {
  36848. var l = 0;
  36849. for (n = 0; s < o; )
  36850. n |= (1 & !!e[s++]) << l++;
  36851. this.writeByte(n, t++)
  36852. }
  36853. return i ? (this.offset = t,
  36854. this) : t - r
  36855. }
  36856. ,
  36857. a.readBitSet = function(e) {
  36858. var t = "undefined" == typeof e;
  36859. t && (e = this.offset);
  36860. var i, n = this.readVarint32(e), r = n.value, o = r >> 3, a = 0, s = [];
  36861. for (e += n.length; o--; )
  36862. i = this.readByte(e++),
  36863. s[a++] = !!(1 & i),
  36864. s[a++] = !!(2 & i),
  36865. s[a++] = !!(4 & i),
  36866. s[a++] = !!(8 & i),
  36867. s[a++] = !!(16 & i),
  36868. s[a++] = !!(32 & i),
  36869. s[a++] = !!(64 & i),
  36870. s[a++] = !!(128 & i);
  36871. if (a < r) {
  36872. var l = 0;
  36873. for (i = this.readByte(e++); a < r; )
  36874. s[a++] = !!(i >> l++ & 1)
  36875. }
  36876. return t && (this.offset = e),
  36877. s
  36878. }
  36879. ,
  36880. a.readBytes = function(e, t) {
  36881. var i = "undefined" == typeof t;
  36882. if (i && (t = this.offset),
  36883. !this.noAssert) {
  36884. if ("number" != typeof t || t % 1 !== 0)
  36885. throw TypeError("Illegal offset: " + t + " (not an integer)");
  36886. if (t >>>= 0,
  36887. t < 0 || t + e > this.buffer.byteLength)
  36888. throw RangeError("Illegal offset: 0 <= " + t + " (+" + e + ") <= " + this.buffer.byteLength)
  36889. }
  36890. var n = this.slice(t, t + e);
  36891. return i && (this.offset += e),
  36892. n
  36893. }
  36894. ,
  36895. a.writeBytes = a.append,
  36896. a.writeInt8 = function(e, t) {
  36897. var i = "undefined" == typeof t;
  36898. if (i && (t = this.offset),
  36899. !this.noAssert) {
  36900. if ("number" != typeof e || e % 1 !== 0)
  36901. throw TypeError("Illegal value: " + e + " (not an integer)");
  36902. if (e |= 0,
  36903. "number" != typeof t || t % 1 !== 0)
  36904. throw TypeError("Illegal offset: " + t + " (not an integer)");
  36905. if (t >>>= 0,
  36906. t < 0 || t + 0 > this.buffer.byteLength)
  36907. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  36908. }
  36909. t += 1;
  36910. var n = this.buffer.byteLength;
  36911. return t > n && this.resize((n *= 2) > t ? n : t),
  36912. t -= 1,
  36913. this.view[t] = e,
  36914. i && (this.offset += 1),
  36915. this
  36916. }
  36917. ,
  36918. a.writeByte = a.writeInt8,
  36919. a.readInt8 = function(e) {
  36920. var t = "undefined" == typeof e;
  36921. if (t && (e = this.offset),
  36922. !this.noAssert) {
  36923. if ("number" != typeof e || e % 1 !== 0)
  36924. throw TypeError("Illegal offset: " + e + " (not an integer)");
  36925. if (e >>>= 0,
  36926. e < 0 || e + 1 > this.buffer.byteLength)
  36927. throw RangeError("Illegal offset: 0 <= " + e + " (+1) <= " + this.buffer.byteLength)
  36928. }
  36929. var i = this.view[e];
  36930. return 128 === (128 & i) && (i = -(255 - i + 1)),
  36931. t && (this.offset += 1),
  36932. i
  36933. }
  36934. ,
  36935. a.readByte = a.readInt8,
  36936. a.writeUint8 = function(e, t) {
  36937. var i = "undefined" == typeof t;
  36938. if (i && (t = this.offset),
  36939. !this.noAssert) {
  36940. if ("number" != typeof e || e % 1 !== 0)
  36941. throw TypeError("Illegal value: " + e + " (not an integer)");
  36942. if (e >>>= 0,
  36943. "number" != typeof t || t % 1 !== 0)
  36944. throw TypeError("Illegal offset: " + t + " (not an integer)");
  36945. if (t >>>= 0,
  36946. t < 0 || t + 0 > this.buffer.byteLength)
  36947. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  36948. }
  36949. t += 1;
  36950. var n = this.buffer.byteLength;
  36951. return t > n && this.resize((n *= 2) > t ? n : t),
  36952. t -= 1,
  36953. this.view[t] = e,
  36954. i && (this.offset += 1),
  36955. this
  36956. }
  36957. ,
  36958. a.writeUInt8 = a.writeUint8,
  36959. a.readUint8 = function(e) {
  36960. var t = "undefined" == typeof e;
  36961. if (t && (e = this.offset),
  36962. !this.noAssert) {
  36963. if ("number" != typeof e || e % 1 !== 0)
  36964. throw TypeError("Illegal offset: " + e + " (not an integer)");
  36965. if (e >>>= 0,
  36966. e < 0 || e + 1 > this.buffer.byteLength)
  36967. throw RangeError("Illegal offset: 0 <= " + e + " (+1) <= " + this.buffer.byteLength)
  36968. }
  36969. var i = this.view[e];
  36970. return t && (this.offset += 1),
  36971. i
  36972. }
  36973. ,
  36974. a.readUInt8 = a.readUint8,
  36975. a.writeInt16 = function(e, t) {
  36976. var i = "undefined" == typeof t;
  36977. if (i && (t = this.offset),
  36978. !this.noAssert) {
  36979. if ("number" != typeof e || e % 1 !== 0)
  36980. throw TypeError("Illegal value: " + e + " (not an integer)");
  36981. if (e |= 0,
  36982. "number" != typeof t || t % 1 !== 0)
  36983. throw TypeError("Illegal offset: " + t + " (not an integer)");
  36984. if (t >>>= 0,
  36985. t < 0 || t + 0 > this.buffer.byteLength)
  36986. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  36987. }
  36988. t += 2;
  36989. var n = this.buffer.byteLength;
  36990. return t > n && this.resize((n *= 2) > t ? n : t),
  36991. t -= 2,
  36992. this.littleEndian ? (this.view[t + 1] = (65280 & e) >>> 8,
  36993. this.view[t] = 255 & e) : (this.view[t] = (65280 & e) >>> 8,
  36994. this.view[t + 1] = 255 & e),
  36995. i && (this.offset += 2),
  36996. this
  36997. }
  36998. ,
  36999. a.writeShort = a.writeInt16,
  37000. a.readInt16 = function(e) {
  37001. var t = "undefined" == typeof e;
  37002. if (t && (e = this.offset),
  37003. !this.noAssert) {
  37004. if ("number" != typeof e || e % 1 !== 0)
  37005. throw TypeError("Illegal offset: " + e + " (not an integer)");
  37006. if (e >>>= 0,
  37007. e < 0 || e + 2 > this.buffer.byteLength)
  37008. throw RangeError("Illegal offset: 0 <= " + e + " (+2) <= " + this.buffer.byteLength)
  37009. }
  37010. var i = 0;
  37011. return this.littleEndian ? (i = this.view[e],
  37012. i |= this.view[e + 1] << 8) : (i = this.view[e] << 8,
  37013. i |= this.view[e + 1]),
  37014. 32768 === (32768 & i) && (i = -(65535 - i + 1)),
  37015. t && (this.offset += 2),
  37016. i
  37017. }
  37018. ,
  37019. a.readShort = a.readInt16,
  37020. a.writeUint16 = function(e, t) {
  37021. var i = "undefined" == typeof t;
  37022. if (i && (t = this.offset),
  37023. !this.noAssert) {
  37024. if ("number" != typeof e || e % 1 !== 0)
  37025. throw TypeError("Illegal value: " + e + " (not an integer)");
  37026. if (e >>>= 0,
  37027. "number" != typeof t || t % 1 !== 0)
  37028. throw TypeError("Illegal offset: " + t + " (not an integer)");
  37029. if (t >>>= 0,
  37030. t < 0 || t + 0 > this.buffer.byteLength)
  37031. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  37032. }
  37033. t += 2;
  37034. var n = this.buffer.byteLength;
  37035. return t > n && this.resize((n *= 2) > t ? n : t),
  37036. t -= 2,
  37037. this.littleEndian ? (this.view[t + 1] = (65280 & e) >>> 8,
  37038. this.view[t] = 255 & e) : (this.view[t] = (65280 & e) >>> 8,
  37039. this.view[t + 1] = 255 & e),
  37040. i && (this.offset += 2),
  37041. this
  37042. }
  37043. ,
  37044. a.writeUInt16 = a.writeUint16,
  37045. a.readUint16 = function(e) {
  37046. var t = "undefined" == typeof e;
  37047. if (t && (e = this.offset),
  37048. !this.noAssert) {
  37049. if ("number" != typeof e || e % 1 !== 0)
  37050. throw TypeError("Illegal offset: " + e + " (not an integer)");
  37051. if (e >>>= 0,
  37052. e < 0 || e + 2 > this.buffer.byteLength)
  37053. throw RangeError("Illegal offset: 0 <= " + e + " (+2) <= " + this.buffer.byteLength)
  37054. }
  37055. var i = 0;
  37056. return this.littleEndian ? (i = this.view[e],
  37057. i |= this.view[e + 1] << 8) : (i = this.view[e] << 8,
  37058. i |= this.view[e + 1]),
  37059. t && (this.offset += 2),
  37060. i
  37061. }
  37062. ,
  37063. a.readUInt16 = a.readUint16,
  37064. a.writeInt32 = function(e, t) {
  37065. var i = "undefined" == typeof t;
  37066. if (i && (t = this.offset),
  37067. !this.noAssert) {
  37068. if ("number" != typeof e || e % 1 !== 0)
  37069. throw TypeError("Illegal value: " + e + " (not an integer)");
  37070. if (e |= 0,
  37071. "number" != typeof t || t % 1 !== 0)
  37072. throw TypeError("Illegal offset: " + t + " (not an integer)");
  37073. if (t >>>= 0,
  37074. t < 0 || t + 0 > this.buffer.byteLength)
  37075. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  37076. }
  37077. t += 4;
  37078. var n = this.buffer.byteLength;
  37079. return t > n && this.resize((n *= 2) > t ? n : t),
  37080. t -= 4,
  37081. this.littleEndian ? (this.view[t + 3] = e >>> 24 & 255,
  37082. this.view[t + 2] = e >>> 16 & 255,
  37083. this.view[t + 1] = e >>> 8 & 255,
  37084. this.view[t] = 255 & e) : (this.view[t] = e >>> 24 & 255,
  37085. this.view[t + 1] = e >>> 16 & 255,
  37086. this.view[t + 2] = e >>> 8 & 255,
  37087. this.view[t + 3] = 255 & e),
  37088. i && (this.offset += 4),
  37089. this
  37090. }
  37091. ,
  37092. a.writeInt = a.writeInt32,
  37093. a.readInt32 = function(e) {
  37094. var t = "undefined" == typeof e;
  37095. if (t && (e = this.offset),
  37096. !this.noAssert) {
  37097. if ("number" != typeof e || e % 1 !== 0)
  37098. throw TypeError("Illegal offset: " + e + " (not an integer)");
  37099. if (e >>>= 0,
  37100. e < 0 || e + 4 > this.buffer.byteLength)
  37101. throw RangeError("Illegal offset: 0 <= " + e + " (+4) <= " + this.buffer.byteLength)
  37102. }
  37103. var i = 0;
  37104. return this.littleEndian ? (i = this.view[e + 2] << 16,
  37105. i |= this.view[e + 1] << 8,
  37106. i |= this.view[e],
  37107. i += this.view[e + 3] << 24 >>> 0) : (i = this.view[e + 1] << 16,
  37108. i |= this.view[e + 2] << 8,
  37109. i |= this.view[e + 3],
  37110. i += this.view[e] << 24 >>> 0),
  37111. i |= 0,
  37112. t && (this.offset += 4),
  37113. i
  37114. }
  37115. ,
  37116. a.readInt = a.readInt32,
  37117. a.writeUint32 = function(e, t) {
  37118. var i = "undefined" == typeof t;
  37119. if (i && (t = this.offset),
  37120. !this.noAssert) {
  37121. if ("number" != typeof e || e % 1 !== 0)
  37122. throw TypeError("Illegal value: " + e + " (not an integer)");
  37123. if (e >>>= 0,
  37124. "number" != typeof t || t % 1 !== 0)
  37125. throw TypeError("Illegal offset: " + t + " (not an integer)");
  37126. if (t >>>= 0,
  37127. t < 0 || t + 0 > this.buffer.byteLength)
  37128. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  37129. }
  37130. t += 4;
  37131. var n = this.buffer.byteLength;
  37132. return t > n && this.resize((n *= 2) > t ? n : t),
  37133. t -= 4,
  37134. this.littleEndian ? (this.view[t + 3] = e >>> 24 & 255,
  37135. this.view[t + 2] = e >>> 16 & 255,
  37136. this.view[t + 1] = e >>> 8 & 255,
  37137. this.view[t] = 255 & e) : (this.view[t] = e >>> 24 & 255,
  37138. this.view[t + 1] = e >>> 16 & 255,
  37139. this.view[t + 2] = e >>> 8 & 255,
  37140. this.view[t + 3] = 255 & e),
  37141. i && (this.offset += 4),
  37142. this
  37143. }
  37144. ,
  37145. a.writeUInt32 = a.writeUint32,
  37146. a.readUint32 = function(e) {
  37147. var t = "undefined" == typeof e;
  37148. if (t && (e = this.offset),
  37149. !this.noAssert) {
  37150. if ("number" != typeof e || e % 1 !== 0)
  37151. throw TypeError("Illegal offset: " + e + " (not an integer)");
  37152. if (e >>>= 0,
  37153. e < 0 || e + 4 > this.buffer.byteLength)
  37154. throw RangeError("Illegal offset: 0 <= " + e + " (+4) <= " + this.buffer.byteLength)
  37155. }
  37156. var i = 0;
  37157. return this.littleEndian ? (i = this.view[e + 2] << 16,
  37158. i |= this.view[e + 1] << 8,
  37159. i |= this.view[e],
  37160. i += this.view[e + 3] << 24 >>> 0) : (i = this.view[e + 1] << 16,
  37161. i |= this.view[e + 2] << 8,
  37162. i |= this.view[e + 3],
  37163. i += this.view[e] << 24 >>> 0),
  37164. t && (this.offset += 4),
  37165. i
  37166. }
  37167. ,
  37168. a.readUInt32 = a.readUint32,
  37169. e && (a.writeInt64 = function(t, i) {
  37170. var n = "undefined" == typeof i;
  37171. if (n && (i = this.offset),
  37172. !this.noAssert) {
  37173. if ("number" == typeof t)
  37174. t = e.fromNumber(t);
  37175. else if ("string" == typeof t)
  37176. t = e.fromString(t);
  37177. else if (!(t && t instanceof e))
  37178. throw TypeError("Illegal value: " + t + " (not an integer or Long)");
  37179. if ("number" != typeof i || i % 1 !== 0)
  37180. throw TypeError("Illegal offset: " + i + " (not an integer)");
  37181. if (i >>>= 0,
  37182. i < 0 || i + 0 > this.buffer.byteLength)
  37183. throw RangeError("Illegal offset: 0 <= " + i + " (+0) <= " + this.buffer.byteLength)
  37184. }
  37185. "number" == typeof t ? t = e.fromNumber(t) : "string" == typeof t && (t = e.fromString(t)),
  37186. i += 8;
  37187. var r = this.buffer.byteLength;
  37188. i > r && this.resize((r *= 2) > i ? r : i),
  37189. i -= 8;
  37190. var o = t.low
  37191. , a = t.high;
  37192. return this.littleEndian ? (this.view[i + 3] = o >>> 24 & 255,
  37193. this.view[i + 2] = o >>> 16 & 255,
  37194. this.view[i + 1] = o >>> 8 & 255,
  37195. this.view[i] = 255 & o,
  37196. i += 4,
  37197. this.view[i + 3] = a >>> 24 & 255,
  37198. this.view[i + 2] = a >>> 16 & 255,
  37199. this.view[i + 1] = a >>> 8 & 255,
  37200. this.view[i] = 255 & a) : (this.view[i] = a >>> 24 & 255,
  37201. this.view[i + 1] = a >>> 16 & 255,
  37202. this.view[i + 2] = a >>> 8 & 255,
  37203. this.view[i + 3] = 255 & a,
  37204. i += 4,
  37205. this.view[i] = o >>> 24 & 255,
  37206. this.view[i + 1] = o >>> 16 & 255,
  37207. this.view[i + 2] = o >>> 8 & 255,
  37208. this.view[i + 3] = 255 & o),
  37209. n && (this.offset += 8),
  37210. this
  37211. }
  37212. ,
  37213. a.writeLong = a.writeInt64,
  37214. a.readInt64 = function(t) {
  37215. var i = "undefined" == typeof t;
  37216. if (i && (t = this.offset),
  37217. !this.noAssert) {
  37218. if ("number" != typeof t || t % 1 !== 0)
  37219. throw TypeError("Illegal offset: " + t + " (not an integer)");
  37220. if (t >>>= 0,
  37221. t < 0 || t + 8 > this.buffer.byteLength)
  37222. throw RangeError("Illegal offset: 0 <= " + t + " (+8) <= " + this.buffer.byteLength)
  37223. }
  37224. var n = 0
  37225. , r = 0;
  37226. this.littleEndian ? (n = this.view[t + 2] << 16,
  37227. n |= this.view[t + 1] << 8,
  37228. n |= this.view[t],
  37229. n += this.view[t + 3] << 24 >>> 0,
  37230. t += 4,
  37231. r = this.view[t + 2] << 16,
  37232. r |= this.view[t + 1] << 8,
  37233. r |= this.view[t],
  37234. r += this.view[t + 3] << 24 >>> 0) : (r = this.view[t + 1] << 16,
  37235. r |= this.view[t + 2] << 8,
  37236. r |= this.view[t + 3],
  37237. r += this.view[t] << 24 >>> 0,
  37238. t += 4,
  37239. n = this.view[t + 1] << 16,
  37240. n |= this.view[t + 2] << 8,
  37241. n |= this.view[t + 3],
  37242. n += this.view[t] << 24 >>> 0);
  37243. var o = new e(n,r,!1);
  37244. return i && (this.offset += 8),
  37245. o
  37246. }
  37247. ,
  37248. a.readLong = a.readInt64,
  37249. a.writeUint64 = function(t, i) {
  37250. var n = "undefined" == typeof i;
  37251. if (n && (i = this.offset),
  37252. !this.noAssert) {
  37253. if ("number" == typeof t)
  37254. t = e.fromNumber(t);
  37255. else if ("string" == typeof t)
  37256. t = e.fromString(t);
  37257. else if (!(t && t instanceof e))
  37258. throw TypeError("Illegal value: " + t + " (not an integer or Long)");
  37259. if ("number" != typeof i || i % 1 !== 0)
  37260. throw TypeError("Illegal offset: " + i + " (not an integer)");
  37261. if (i >>>= 0,
  37262. i < 0 || i + 0 > this.buffer.byteLength)
  37263. throw RangeError("Illegal offset: 0 <= " + i + " (+0) <= " + this.buffer.byteLength)
  37264. }
  37265. "number" == typeof t ? t = e.fromNumber(t) : "string" == typeof t && (t = e.fromString(t)),
  37266. i += 8;
  37267. var r = this.buffer.byteLength;
  37268. i > r && this.resize((r *= 2) > i ? r : i),
  37269. i -= 8;
  37270. var o = t.low
  37271. , a = t.high;
  37272. return this.littleEndian ? (this.view[i + 3] = o >>> 24 & 255,
  37273. this.view[i + 2] = o >>> 16 & 255,
  37274. this.view[i + 1] = o >>> 8 & 255,
  37275. this.view[i] = 255 & o,
  37276. i += 4,
  37277. this.view[i + 3] = a >>> 24 & 255,
  37278. this.view[i + 2] = a >>> 16 & 255,
  37279. this.view[i + 1] = a >>> 8 & 255,
  37280. this.view[i] = 255 & a) : (this.view[i] = a >>> 24 & 255,
  37281. this.view[i + 1] = a >>> 16 & 255,
  37282. this.view[i + 2] = a >>> 8 & 255,
  37283. this.view[i + 3] = 255 & a,
  37284. i += 4,
  37285. this.view[i] = o >>> 24 & 255,
  37286. this.view[i + 1] = o >>> 16 & 255,
  37287. this.view[i + 2] = o >>> 8 & 255,
  37288. this.view[i + 3] = 255 & o),
  37289. n && (this.offset += 8),
  37290. this
  37291. }
  37292. ,
  37293. a.writeUInt64 = a.writeUint64,
  37294. a.readUint64 = function(t) {
  37295. var i = "undefined" == typeof t;
  37296. if (i && (t = this.offset),
  37297. !this.noAssert) {
  37298. if ("number" != typeof t || t % 1 !== 0)
  37299. throw TypeError("Illegal offset: " + t + " (not an integer)");
  37300. if (t >>>= 0,
  37301. t < 0 || t + 8 > this.buffer.byteLength)
  37302. throw RangeError("Illegal offset: 0 <= " + t + " (+8) <= " + this.buffer.byteLength)
  37303. }
  37304. var n = 0
  37305. , r = 0;
  37306. this.littleEndian ? (n = this.view[t + 2] << 16,
  37307. n |= this.view[t + 1] << 8,
  37308. n |= this.view[t],
  37309. n += this.view[t + 3] << 24 >>> 0,
  37310. t += 4,
  37311. r = this.view[t + 2] << 16,
  37312. r |= this.view[t + 1] << 8,
  37313. r |= this.view[t],
  37314. r += this.view[t + 3] << 24 >>> 0) : (r = this.view[t + 1] << 16,
  37315. r |= this.view[t + 2] << 8,
  37316. r |= this.view[t + 3],
  37317. r += this.view[t] << 24 >>> 0,
  37318. t += 4,
  37319. n = this.view[t + 1] << 16,
  37320. n |= this.view[t + 2] << 8,
  37321. n |= this.view[t + 3],
  37322. n += this.view[t] << 24 >>> 0);
  37323. var o = new e(n,r,!0);
  37324. return i && (this.offset += 8),
  37325. o
  37326. }
  37327. ,
  37328. a.readUInt64 = a.readUint64),
  37329. a.writeFloat32 = function(e, t) {
  37330. var i = "undefined" == typeof t;
  37331. if (i && (t = this.offset),
  37332. !this.noAssert) {
  37333. if ("number" != typeof e)
  37334. throw TypeError("Illegal value: " + e + " (not a number)");
  37335. if ("number" != typeof t || t % 1 !== 0)
  37336. throw TypeError("Illegal offset: " + t + " (not an integer)");
  37337. if (t >>>= 0,
  37338. t < 0 || t + 0 > this.buffer.byteLength)
  37339. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  37340. }
  37341. t += 4;
  37342. var n = this.buffer.byteLength;
  37343. return t > n && this.resize((n *= 2) > t ? n : t),
  37344. t -= 4,
  37345. r(this.view, e, t, this.littleEndian, 23, 4),
  37346. i && (this.offset += 4),
  37347. this
  37348. }
  37349. ,
  37350. a.writeFloat = a.writeFloat32,
  37351. a.readFloat32 = function(e) {
  37352. var t = "undefined" == typeof e;
  37353. if (t && (e = this.offset),
  37354. !this.noAssert) {
  37355. if ("number" != typeof e || e % 1 !== 0)
  37356. throw TypeError("Illegal offset: " + e + " (not an integer)");
  37357. if (e >>>= 0,
  37358. e < 0 || e + 4 > this.buffer.byteLength)
  37359. throw RangeError("Illegal offset: 0 <= " + e + " (+4) <= " + this.buffer.byteLength)
  37360. }
  37361. var i = n(this.view, e, this.littleEndian, 23, 4);
  37362. return t && (this.offset += 4),
  37363. i
  37364. }
  37365. ,
  37366. a.readFloat = a.readFloat32,
  37367. a.writeFloat64 = function(e, t) {
  37368. var i = "undefined" == typeof t;
  37369. if (i && (t = this.offset),
  37370. !this.noAssert) {
  37371. if ("number" != typeof e)
  37372. throw TypeError("Illegal value: " + e + " (not a number)");
  37373. if ("number" != typeof t || t % 1 !== 0)
  37374. throw TypeError("Illegal offset: " + t + " (not an integer)");
  37375. if (t >>>= 0,
  37376. t < 0 || t + 0 > this.buffer.byteLength)
  37377. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  37378. }
  37379. t += 8;
  37380. var n = this.buffer.byteLength;
  37381. return t > n && this.resize((n *= 2) > t ? n : t),
  37382. t -= 8,
  37383. r(this.view, e, t, this.littleEndian, 52, 8),
  37384. i && (this.offset += 8),
  37385. this
  37386. }
  37387. ,
  37388. a.writeDouble = a.writeFloat64,
  37389. a.readFloat64 = function(e) {
  37390. var t = "undefined" == typeof e;
  37391. if (t && (e = this.offset),
  37392. !this.noAssert) {
  37393. if ("number" != typeof e || e % 1 !== 0)
  37394. throw TypeError("Illegal offset: " + e + " (not an integer)");
  37395. if (e >>>= 0,
  37396. e < 0 || e + 8 > this.buffer.byteLength)
  37397. throw RangeError("Illegal offset: 0 <= " + e + " (+8) <= " + this.buffer.byteLength)
  37398. }
  37399. var i = n(this.view, e, this.littleEndian, 52, 8);
  37400. return t && (this.offset += 8),
  37401. i
  37402. }
  37403. ,
  37404. a.readDouble = a.readFloat64,
  37405. o.MAX_VARINT32_BYTES = 5,
  37406. o.calculateVarint32 = function(e) {
  37407. return e >>>= 0,
  37408. e < 128 ? 1 : e < 16384 ? 2 : e < 1 << 21 ? 3 : e < 1 << 28 ? 4 : 5
  37409. }
  37410. ,
  37411. o.zigZagEncode32 = function(e) {
  37412. return ((e |= 0) << 1 ^ e >> 31) >>> 0
  37413. }
  37414. ,
  37415. o.zigZagDecode32 = function(e) {
  37416. return e >>> 1 ^ -(1 & e) | 0
  37417. }
  37418. ,
  37419. a.writeVarint32 = function(e, t) {
  37420. var i = "undefined" == typeof t;
  37421. if (i && (t = this.offset),
  37422. !this.noAssert) {
  37423. if ("number" != typeof e || e % 1 !== 0)
  37424. throw TypeError("Illegal value: " + e + " (not an integer)");
  37425. if (e |= 0,
  37426. "number" != typeof t || t % 1 !== 0)
  37427. throw TypeError("Illegal offset: " + t + " (not an integer)");
  37428. if (t >>>= 0,
  37429. t < 0 || t + 0 > this.buffer.byteLength)
  37430. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  37431. }
  37432. var n, r = o.calculateVarint32(e);
  37433. t += r;
  37434. var a = this.buffer.byteLength;
  37435. for (t > a && this.resize((a *= 2) > t ? a : t),
  37436. t -= r,
  37437. e >>>= 0; e >= 128; )
  37438. n = 127 & e | 128,
  37439. this.view[t++] = n,
  37440. e >>>= 7;
  37441. return this.view[t++] = e,
  37442. i ? (this.offset = t,
  37443. this) : r
  37444. }
  37445. ,
  37446. a.writeVarint32ZigZag = function(e, t) {
  37447. return this.writeVarint32(o.zigZagEncode32(e), t)
  37448. }
  37449. ,
  37450. a.readVarint32 = function(e) {
  37451. var t = "undefined" == typeof e;
  37452. if (t && (e = this.offset),
  37453. !this.noAssert) {
  37454. if ("number" != typeof e || e % 1 !== 0)
  37455. throw TypeError("Illegal offset: " + e + " (not an integer)");
  37456. if (e >>>= 0,
  37457. e < 0 || e + 1 > this.buffer.byteLength)
  37458. throw RangeError("Illegal offset: 0 <= " + e + " (+1) <= " + this.buffer.byteLength)
  37459. }
  37460. var i, n = 0, r = 0;
  37461. do {
  37462. if (!this.noAssert && e > this.limit) {
  37463. var o = Error("Truncated");
  37464. throw o.truncated = !0,
  37465. o
  37466. }
  37467. i = this.view[e++],
  37468. n < 5 && (r |= (127 & i) << 7 * n),
  37469. ++n
  37470. } while (0 !== (128 & i));return r |= 0,
  37471. t ? (this.offset = e,
  37472. r) : {
  37473. value: r,
  37474. length: n
  37475. }
  37476. }
  37477. ,
  37478. a.readVarint32ZigZag = function(e) {
  37479. var t = this.readVarint32(e);
  37480. return "object" == typeof t ? t.value = o.zigZagDecode32(t.value) : t = o.zigZagDecode32(t),
  37481. t
  37482. }
  37483. ,
  37484. e && (o.MAX_VARINT64_BYTES = 10,
  37485. o.calculateVarint64 = function(t) {
  37486. "number" == typeof t ? t = e.fromNumber(t) : "string" == typeof t && (t = e.fromString(t));
  37487. var i = t.toInt() >>> 0
  37488. , n = t.shiftRightUnsigned(28).toInt() >>> 0
  37489. , r = t.shiftRightUnsigned(56).toInt() >>> 0;
  37490. 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
  37491. }
  37492. ,
  37493. o.zigZagEncode64 = function(t) {
  37494. return "number" == typeof t ? t = e.fromNumber(t, !1) : "string" == typeof t ? t = e.fromString(t, !1) : t.unsigned !== !1 && (t = t.toSigned()),
  37495. t.shiftLeft(1).xor(t.shiftRight(63)).toUnsigned()
  37496. }
  37497. ,
  37498. o.zigZagDecode64 = function(t) {
  37499. return "number" == typeof t ? t = e.fromNumber(t, !1) : "string" == typeof t ? t = e.fromString(t, !1) : t.unsigned !== !1 && (t = t.toSigned()),
  37500. t.shiftRightUnsigned(1).xor(t.and(e.ONE).toSigned().negate()).toSigned()
  37501. }
  37502. ,
  37503. a.writeVarint64 = function(t, i) {
  37504. var n = "undefined" == typeof i;
  37505. if (n && (i = this.offset),
  37506. !this.noAssert) {
  37507. if ("number" == typeof t)
  37508. t = e.fromNumber(t);
  37509. else if ("string" == typeof t)
  37510. t = e.fromString(t);
  37511. else if (!(t && t instanceof e))
  37512. throw TypeError("Illegal value: " + t + " (not an integer or Long)");
  37513. if ("number" != typeof i || i % 1 !== 0)
  37514. throw TypeError("Illegal offset: " + i + " (not an integer)");
  37515. if (i >>>= 0,
  37516. i < 0 || i + 0 > this.buffer.byteLength)
  37517. throw RangeError("Illegal offset: 0 <= " + i + " (+0) <= " + this.buffer.byteLength)
  37518. }
  37519. "number" == typeof t ? t = e.fromNumber(t, !1) : "string" == typeof t ? t = e.fromString(t, !1) : t.unsigned !== !1 && (t = t.toSigned());
  37520. var r = o.calculateVarint64(t)
  37521. , a = t.toInt() >>> 0
  37522. , s = t.shiftRightUnsigned(28).toInt() >>> 0
  37523. , l = t.shiftRightUnsigned(56).toInt() >>> 0;
  37524. i += r;
  37525. var c = this.buffer.byteLength;
  37526. switch (i > c && this.resize((c *= 2) > i ? c : i),
  37527. i -= r,
  37528. r) {
  37529. case 10:
  37530. this.view[i + 9] = l >>> 7 & 1;
  37531. case 9:
  37532. this.view[i + 8] = 9 !== r ? 128 | l : 127 & l;
  37533. case 8:
  37534. this.view[i + 7] = 8 !== r ? s >>> 21 | 128 : s >>> 21 & 127;
  37535. case 7:
  37536. this.view[i + 6] = 7 !== r ? s >>> 14 | 128 : s >>> 14 & 127;
  37537. case 6:
  37538. this.view[i + 5] = 6 !== r ? s >>> 7 | 128 : s >>> 7 & 127;
  37539. case 5:
  37540. this.view[i + 4] = 5 !== r ? 128 | s : 127 & s;
  37541. case 4:
  37542. this.view[i + 3] = 4 !== r ? a >>> 21 | 128 : a >>> 21 & 127;
  37543. case 3:
  37544. this.view[i + 2] = 3 !== r ? a >>> 14 | 128 : a >>> 14 & 127;
  37545. case 2:
  37546. this.view[i + 1] = 2 !== r ? a >>> 7 | 128 : a >>> 7 & 127;
  37547. case 1:
  37548. this.view[i] = 1 !== r ? 128 | a : 127 & a
  37549. }
  37550. return n ? (this.offset += r,
  37551. this) : r
  37552. }
  37553. ,
  37554. a.writeVarint64ZigZag = function(e, t) {
  37555. return this.writeVarint64(o.zigZagEncode64(e), t)
  37556. }
  37557. ,
  37558. a.readVarint64 = function(t) {
  37559. var i = "undefined" == typeof t;
  37560. if (i && (t = this.offset),
  37561. !this.noAssert) {
  37562. if ("number" != typeof t || t % 1 !== 0)
  37563. throw TypeError("Illegal offset: " + t + " (not an integer)");
  37564. if (t >>>= 0,
  37565. t < 0 || t + 1 > this.buffer.byteLength)
  37566. throw RangeError("Illegal offset: 0 <= " + t + " (+1) <= " + this.buffer.byteLength)
  37567. }
  37568. var n = t
  37569. , r = 0
  37570. , o = 0
  37571. , a = 0
  37572. , s = 0;
  37573. if (s = this.view[t++],
  37574. r = 127 & s,
  37575. 128 & s && (s = this.view[t++],
  37576. r |= (127 & s) << 7,
  37577. (128 & s || this.noAssert && "undefined" == typeof s) && (s = this.view[t++],
  37578. r |= (127 & s) << 14,
  37579. (128 & s || this.noAssert && "undefined" == typeof s) && (s = this.view[t++],
  37580. r |= (127 & s) << 21,
  37581. (128 & s || this.noAssert && "undefined" == typeof s) && (s = this.view[t++],
  37582. o = 127 & s,
  37583. (128 & s || this.noAssert && "undefined" == typeof s) && (s = this.view[t++],
  37584. o |= (127 & s) << 7,
  37585. (128 & s || this.noAssert && "undefined" == typeof s) && (s = this.view[t++],
  37586. o |= (127 & s) << 14,
  37587. (128 & s || this.noAssert && "undefined" == typeof s) && (s = this.view[t++],
  37588. o |= (127 & s) << 21,
  37589. (128 & s || this.noAssert && "undefined" == typeof s) && (s = this.view[t++],
  37590. a = 127 & s,
  37591. (128 & s || this.noAssert && "undefined" == typeof s) && (s = this.view[t++],
  37592. a |= (127 & s) << 7,
  37593. 128 & s || this.noAssert && "undefined" == typeof s))))))))))
  37594. throw Error("Buffer overrun");
  37595. var l = e.fromBits(r | o << 28, o >>> 4 | a << 24, !1);
  37596. return i ? (this.offset = t,
  37597. l) : {
  37598. value: l,
  37599. length: t - n
  37600. }
  37601. }
  37602. ,
  37603. a.readVarint64ZigZag = function(t) {
  37604. var i = this.readVarint64(t);
  37605. return i && i.value instanceof e ? i.value = o.zigZagDecode64(i.value) : i = o.zigZagDecode64(i),
  37606. i
  37607. }
  37608. ),
  37609. a.writeCString = function(e, i) {
  37610. var n = "undefined" == typeof i;
  37611. n && (i = this.offset);
  37612. var r, o = e.length;
  37613. if (!this.noAssert) {
  37614. if ("string" != typeof e)
  37615. throw TypeError("Illegal str: Not a string");
  37616. for (r = 0; r < o; ++r)
  37617. if (0 === e.charCodeAt(r))
  37618. throw RangeError("Illegal str: Contains NULL-characters");
  37619. if ("number" != typeof i || i % 1 !== 0)
  37620. throw TypeError("Illegal offset: " + i + " (not an integer)");
  37621. if (i >>>= 0,
  37622. i < 0 || i + 0 > this.buffer.byteLength)
  37623. throw RangeError("Illegal offset: 0 <= " + i + " (+0) <= " + this.buffer.byteLength)
  37624. }
  37625. o = h.calculateUTF16asUTF8(t(e))[1],
  37626. i += o + 1;
  37627. var a = this.buffer.byteLength;
  37628. return i > a && this.resize((a *= 2) > i ? a : i),
  37629. i -= o + 1,
  37630. h.encodeUTF16toUTF8(t(e), function(e) {
  37631. this.view[i++] = e
  37632. }
  37633. .bind(this)),
  37634. this.view[i++] = 0,
  37635. n ? (this.offset = i,
  37636. this) : o
  37637. }
  37638. ,
  37639. a.readCString = function(e) {
  37640. var t = "undefined" == typeof e;
  37641. if (t && (e = this.offset),
  37642. !this.noAssert) {
  37643. if ("number" != typeof e || e % 1 !== 0)
  37644. throw TypeError("Illegal offset: " + e + " (not an integer)");
  37645. if (e >>>= 0,
  37646. e < 0 || e + 1 > this.buffer.byteLength)
  37647. throw RangeError("Illegal offset: 0 <= " + e + " (+1) <= " + this.buffer.byteLength)
  37648. }
  37649. var n, r = e, o = -1;
  37650. return h.decodeUTF8toUTF16(function() {
  37651. if (0 === o)
  37652. return null;
  37653. if (e >= this.limit)
  37654. throw RangeError("Illegal range: Truncated data, " + e + " < " + this.limit);
  37655. return o = this.view[e++],
  37656. 0 === o ? null : o
  37657. }
  37658. .bind(this), n = i(), !0),
  37659. t ? (this.offset = e,
  37660. n()) : {
  37661. string: n(),
  37662. length: e - r
  37663. }
  37664. }
  37665. ,
  37666. a.writeIString = function(e, i) {
  37667. var n = "undefined" == typeof i;
  37668. if (n && (i = this.offset),
  37669. !this.noAssert) {
  37670. if ("string" != typeof e)
  37671. throw TypeError("Illegal str: Not a string");
  37672. if ("number" != typeof i || i % 1 !== 0)
  37673. throw TypeError("Illegal offset: " + i + " (not an integer)");
  37674. if (i >>>= 0,
  37675. i < 0 || i + 0 > this.buffer.byteLength)
  37676. throw RangeError("Illegal offset: 0 <= " + i + " (+0) <= " + this.buffer.byteLength)
  37677. }
  37678. var r, o = i;
  37679. r = h.calculateUTF16asUTF8(t(e), this.noAssert)[1],
  37680. i += 4 + r;
  37681. var a = this.buffer.byteLength;
  37682. if (i > a && this.resize((a *= 2) > i ? a : i),
  37683. i -= 4 + r,
  37684. this.littleEndian ? (this.view[i + 3] = r >>> 24 & 255,
  37685. this.view[i + 2] = r >>> 16 & 255,
  37686. this.view[i + 1] = r >>> 8 & 255,
  37687. this.view[i] = 255 & r) : (this.view[i] = r >>> 24 & 255,
  37688. this.view[i + 1] = r >>> 16 & 255,
  37689. this.view[i + 2] = r >>> 8 & 255,
  37690. this.view[i + 3] = 255 & r),
  37691. i += 4,
  37692. h.encodeUTF16toUTF8(t(e), function(e) {
  37693. this.view[i++] = e
  37694. }
  37695. .bind(this)),
  37696. i !== o + 4 + r)
  37697. throw RangeError("Illegal range: Truncated data, " + i + " == " + (i + 4 + r));
  37698. return n ? (this.offset = i,
  37699. this) : i - o
  37700. }
  37701. ,
  37702. a.readIString = function(e) {
  37703. var t = "undefined" == typeof e;
  37704. if (t && (e = this.offset),
  37705. !this.noAssert) {
  37706. if ("number" != typeof e || e % 1 !== 0)
  37707. throw TypeError("Illegal offset: " + e + " (not an integer)");
  37708. if (e >>>= 0,
  37709. e < 0 || e + 4 > this.buffer.byteLength)
  37710. throw RangeError("Illegal offset: 0 <= " + e + " (+4) <= " + this.buffer.byteLength)
  37711. }
  37712. var i = e
  37713. , n = this.readUint32(e)
  37714. , r = this.readUTF8String(n, o.METRICS_BYTES, e += 4);
  37715. return e += r.length,
  37716. t ? (this.offset = e,
  37717. r.string) : {
  37718. string: r.string,
  37719. length: e - i
  37720. }
  37721. }
  37722. ,
  37723. o.METRICS_CHARS = "c",
  37724. o.METRICS_BYTES = "b",
  37725. a.writeUTF8String = function(e, i) {
  37726. var n = "undefined" == typeof i;
  37727. if (n && (i = this.offset),
  37728. !this.noAssert) {
  37729. if ("number" != typeof i || i % 1 !== 0)
  37730. throw TypeError("Illegal offset: " + i + " (not an integer)");
  37731. if (i >>>= 0,
  37732. i < 0 || i + 0 > this.buffer.byteLength)
  37733. throw RangeError("Illegal offset: 0 <= " + i + " (+0) <= " + this.buffer.byteLength)
  37734. }
  37735. var r, o = i;
  37736. r = h.calculateUTF16asUTF8(t(e))[1],
  37737. i += r;
  37738. var a = this.buffer.byteLength;
  37739. return i > a && this.resize((a *= 2) > i ? a : i),
  37740. i -= r,
  37741. h.encodeUTF16toUTF8(t(e), function(e) {
  37742. this.view[i++] = e
  37743. }
  37744. .bind(this)),
  37745. n ? (this.offset = i,
  37746. this) : i - o
  37747. }
  37748. ,
  37749. a.writeString = a.writeUTF8String,
  37750. o.calculateUTF8Chars = function(e) {
  37751. return h.calculateUTF16asUTF8(t(e))[0]
  37752. }
  37753. ,
  37754. o.calculateUTF8Bytes = function(e) {
  37755. return h.calculateUTF16asUTF8(t(e))[1]
  37756. }
  37757. ,
  37758. o.calculateString = o.calculateUTF8Bytes,
  37759. a.readUTF8String = function(e, t, n) {
  37760. "number" == typeof t && (n = t,
  37761. t = void 0);
  37762. var r = "undefined" == typeof n;
  37763. if (r && (n = this.offset),
  37764. "undefined" == typeof t && (t = o.METRICS_CHARS),
  37765. !this.noAssert) {
  37766. if ("number" != typeof e || e % 1 !== 0)
  37767. throw TypeError("Illegal length: " + e + " (not an integer)");
  37768. if (e |= 0,
  37769. "number" != typeof n || n % 1 !== 0)
  37770. throw TypeError("Illegal offset: " + n + " (not an integer)");
  37771. if (n >>>= 0,
  37772. n < 0 || n + 0 > this.buffer.byteLength)
  37773. throw RangeError("Illegal offset: 0 <= " + n + " (+0) <= " + this.buffer.byteLength)
  37774. }
  37775. var a, s = 0, l = n;
  37776. if (t === o.METRICS_CHARS) {
  37777. if (a = i(),
  37778. h.decodeUTF8(function() {
  37779. return s < e && n < this.limit ? this.view[n++] : null
  37780. }
  37781. .bind(this), function(e) {
  37782. ++s,
  37783. h.UTF8toUTF16(e, a)
  37784. }),
  37785. s !== e)
  37786. throw RangeError("Illegal range: Truncated data, " + s + " == " + e);
  37787. return r ? (this.offset = n,
  37788. a()) : {
  37789. string: a(),
  37790. length: n - l
  37791. }
  37792. }
  37793. if (t === o.METRICS_BYTES) {
  37794. if (!this.noAssert) {
  37795. if ("number" != typeof n || n % 1 !== 0)
  37796. throw TypeError("Illegal offset: " + n + " (not an integer)");
  37797. if (n >>>= 0,
  37798. n < 0 || n + e > this.buffer.byteLength)
  37799. throw RangeError("Illegal offset: 0 <= " + n + " (+" + e + ") <= " + this.buffer.byteLength)
  37800. }
  37801. var c = n + e;
  37802. if (h.decodeUTF8toUTF16(function() {
  37803. return n < c ? this.view[n++] : null
  37804. }
  37805. .bind(this), a = i(), this.noAssert),
  37806. n !== c)
  37807. throw RangeError("Illegal range: Truncated data, " + n + " == " + c);
  37808. return r ? (this.offset = n,
  37809. a()) : {
  37810. string: a(),
  37811. length: n - l
  37812. }
  37813. }
  37814. throw TypeError("Unsupported metrics: " + t)
  37815. }
  37816. ,
  37817. a.readString = a.readUTF8String,
  37818. a.writeVString = function(e, i) {
  37819. var n = "undefined" == typeof i;
  37820. if (n && (i = this.offset),
  37821. !this.noAssert) {
  37822. if ("string" != typeof e)
  37823. throw TypeError("Illegal str: Not a string");
  37824. if ("number" != typeof i || i % 1 !== 0)
  37825. throw TypeError("Illegal offset: " + i + " (not an integer)");
  37826. if (i >>>= 0,
  37827. i < 0 || i + 0 > this.buffer.byteLength)
  37828. throw RangeError("Illegal offset: 0 <= " + i + " (+0) <= " + this.buffer.byteLength)
  37829. }
  37830. var r, a, s = i;
  37831. r = h.calculateUTF16asUTF8(t(e), this.noAssert)[1],
  37832. a = o.calculateVarint32(r),
  37833. i += a + r;
  37834. var l = this.buffer.byteLength;
  37835. if (i > l && this.resize((l *= 2) > i ? l : i),
  37836. i -= a + r,
  37837. i += this.writeVarint32(r, i),
  37838. h.encodeUTF16toUTF8(t(e), function(e) {
  37839. this.view[i++] = e
  37840. }
  37841. .bind(this)),
  37842. i !== s + r + a)
  37843. throw RangeError("Illegal range: Truncated data, " + i + " == " + (i + r + a));
  37844. return n ? (this.offset = i,
  37845. this) : i - s
  37846. }
  37847. ,
  37848. a.readVString = function(e) {
  37849. var t = "undefined" == typeof e;
  37850. if (t && (e = this.offset),
  37851. !this.noAssert) {
  37852. if ("number" != typeof e || e % 1 !== 0)
  37853. throw TypeError("Illegal offset: " + e + " (not an integer)");
  37854. if (e >>>= 0,
  37855. e < 0 || e + 1 > this.buffer.byteLength)
  37856. throw RangeError("Illegal offset: 0 <= " + e + " (+1) <= " + this.buffer.byteLength)
  37857. }
  37858. var i = e
  37859. , n = this.readVarint32(e)
  37860. , r = this.readUTF8String(n.value, o.METRICS_BYTES, e += n.length);
  37861. return e += r.length,
  37862. t ? (this.offset = e,
  37863. r.string) : {
  37864. string: r.string,
  37865. length: e - i
  37866. }
  37867. }
  37868. ,
  37869. a.append = function(e, t, i) {
  37870. "number" != typeof t && "string" == typeof t || (i = t,
  37871. t = void 0);
  37872. var n = "undefined" == typeof i;
  37873. if (n && (i = this.offset),
  37874. !this.noAssert) {
  37875. if ("number" != typeof i || i % 1 !== 0)
  37876. throw TypeError("Illegal offset: " + i + " (not an integer)");
  37877. if (i >>>= 0,
  37878. i < 0 || i + 0 > this.buffer.byteLength)
  37879. throw RangeError("Illegal offset: 0 <= " + i + " (+0) <= " + this.buffer.byteLength)
  37880. }
  37881. e instanceof o || (e = o.wrap(e, t));
  37882. var r = e.limit - e.offset;
  37883. if (r <= 0)
  37884. return this;
  37885. i += r;
  37886. var a = this.buffer.byteLength;
  37887. return i > a && this.resize((a *= 2) > i ? a : i),
  37888. i -= r,
  37889. this.view.set(e.view.subarray(e.offset, e.limit), i),
  37890. e.offset += r,
  37891. n && (this.offset += r),
  37892. this
  37893. }
  37894. ,
  37895. a.appendTo = function(e, t) {
  37896. return e.append(this, t),
  37897. this
  37898. }
  37899. ,
  37900. a.assert = function(e) {
  37901. return this.noAssert = !e,
  37902. this
  37903. }
  37904. ,
  37905. a.capacity = function() {
  37906. return this.buffer.byteLength
  37907. }
  37908. ,
  37909. a.clear = function() {
  37910. return this.offset = 0,
  37911. this.limit = this.buffer.byteLength,
  37912. this.markedOffset = -1,
  37913. this
  37914. }
  37915. ,
  37916. a.clone = function(e) {
  37917. var t = new o(0,this.littleEndian,this.noAssert);
  37918. return e ? (t.buffer = new ArrayBuffer(this.buffer.byteLength),
  37919. t.view = new Uint8Array(t.buffer)) : (t.buffer = this.buffer,
  37920. t.view = this.view),
  37921. t.offset = this.offset,
  37922. t.markedOffset = this.markedOffset,
  37923. t.limit = this.limit,
  37924. t
  37925. }
  37926. ,
  37927. a.compact = function(e, t) {
  37928. if ("undefined" == typeof e && (e = this.offset),
  37929. "undefined" == typeof t && (t = this.limit),
  37930. !this.noAssert) {
  37931. if ("number" != typeof e || e % 1 !== 0)
  37932. throw TypeError("Illegal begin: Not an integer");
  37933. if (e >>>= 0,
  37934. "number" != typeof t || t % 1 !== 0)
  37935. throw TypeError("Illegal end: Not an integer");
  37936. if (t >>>= 0,
  37937. e < 0 || e > t || t > this.buffer.byteLength)
  37938. throw RangeError("Illegal range: 0 <= " + e + " <= " + t + " <= " + this.buffer.byteLength)
  37939. }
  37940. if (0 === e && t === this.buffer.byteLength)
  37941. return this;
  37942. var i = t - e;
  37943. if (0 === i)
  37944. return this.buffer = s,
  37945. this.view = null,
  37946. this.markedOffset >= 0 && (this.markedOffset -= e),
  37947. this.offset = 0,
  37948. this.limit = 0,
  37949. this;
  37950. var n = new ArrayBuffer(i)
  37951. , r = new Uint8Array(n);
  37952. return r.set(this.view.subarray(e, t)),
  37953. this.buffer = n,
  37954. this.view = r,
  37955. this.markedOffset >= 0 && (this.markedOffset -= e),
  37956. this.offset = 0,
  37957. this.limit = i,
  37958. this
  37959. }
  37960. ,
  37961. a.copy = function(e, t) {
  37962. if ("undefined" == typeof e && (e = this.offset),
  37963. "undefined" == typeof t && (t = this.limit),
  37964. !this.noAssert) {
  37965. if ("number" != typeof e || e % 1 !== 0)
  37966. throw TypeError("Illegal begin: Not an integer");
  37967. if (e >>>= 0,
  37968. "number" != typeof t || t % 1 !== 0)
  37969. throw TypeError("Illegal end: Not an integer");
  37970. if (t >>>= 0,
  37971. e < 0 || e > t || t > this.buffer.byteLength)
  37972. throw RangeError("Illegal range: 0 <= " + e + " <= " + t + " <= " + this.buffer.byteLength)
  37973. }
  37974. if (e === t)
  37975. return new o(0,this.littleEndian,this.noAssert);
  37976. var i = t - e
  37977. , n = new o(i,this.littleEndian,this.noAssert);
  37978. return n.offset = 0,
  37979. n.limit = i,
  37980. n.markedOffset >= 0 && (n.markedOffset -= e),
  37981. this.copyTo(n, 0, e, t),
  37982. n
  37983. }
  37984. ,
  37985. a.copyTo = function(e, t, i, n) {
  37986. var r, a;
  37987. if (!this.noAssert && !o.isByteBuffer(e))
  37988. throw TypeError("Illegal target: Not a ByteBuffer");
  37989. if (t = (a = "undefined" == typeof t) ? e.offset : 0 | t,
  37990. i = (r = "undefined" == typeof i) ? this.offset : 0 | i,
  37991. n = "undefined" == typeof n ? this.limit : 0 | n,
  37992. t < 0 || t > e.buffer.byteLength)
  37993. throw RangeError("Illegal target range: 0 <= " + t + " <= " + e.buffer.byteLength);
  37994. if (i < 0 || n > this.buffer.byteLength)
  37995. throw RangeError("Illegal source range: 0 <= " + i + " <= " + this.buffer.byteLength);
  37996. var s = n - i;
  37997. return 0 === s ? e : (e.ensureCapacity(t + s),
  37998. e.view.set(this.view.subarray(i, n), t),
  37999. r && (this.offset += s),
  38000. a && (e.offset += s),
  38001. this)
  38002. }
  38003. ,
  38004. a.ensureCapacity = function(e) {
  38005. var t = this.buffer.byteLength;
  38006. return t < e ? this.resize((t *= 2) > e ? t : e) : this
  38007. }
  38008. ,
  38009. a.fill = function(e, t, i) {
  38010. var n = "undefined" == typeof t;
  38011. if (n && (t = this.offset),
  38012. "string" == typeof e && e.length > 0 && (e = e.charCodeAt(0)),
  38013. "undefined" == typeof t && (t = this.offset),
  38014. "undefined" == typeof i && (i = this.limit),
  38015. !this.noAssert) {
  38016. if ("number" != typeof e || e % 1 !== 0)
  38017. throw TypeError("Illegal value: " + e + " (not an integer)");
  38018. if (e |= 0,
  38019. "number" != typeof t || t % 1 !== 0)
  38020. throw TypeError("Illegal begin: Not an integer");
  38021. if (t >>>= 0,
  38022. "number" != typeof i || i % 1 !== 0)
  38023. throw TypeError("Illegal end: Not an integer");
  38024. if (i >>>= 0,
  38025. t < 0 || t > i || i > this.buffer.byteLength)
  38026. throw RangeError("Illegal range: 0 <= " + t + " <= " + i + " <= " + this.buffer.byteLength)
  38027. }
  38028. if (t >= i)
  38029. return this;
  38030. for (; t < i; )
  38031. this.view[t++] = e;
  38032. return n && (this.offset = t),
  38033. this
  38034. }
  38035. ,
  38036. a.flip = function() {
  38037. return this.limit = this.offset,
  38038. this.offset = 0,
  38039. this
  38040. }
  38041. ,
  38042. a.mark = function(e) {
  38043. if (e = "undefined" == typeof e ? this.offset : e,
  38044. !this.noAssert) {
  38045. if ("number" != typeof e || e % 1 !== 0)
  38046. throw TypeError("Illegal offset: " + e + " (not an integer)");
  38047. if (e >>>= 0,
  38048. e < 0 || e + 0 > this.buffer.byteLength)
  38049. throw RangeError("Illegal offset: 0 <= " + e + " (+0) <= " + this.buffer.byteLength)
  38050. }
  38051. return this.markedOffset = e,
  38052. this
  38053. }
  38054. ,
  38055. a.order = function(e) {
  38056. if (!this.noAssert && "boolean" != typeof e)
  38057. throw TypeError("Illegal littleEndian: Not a boolean");
  38058. return this.littleEndian = !!e,
  38059. this
  38060. }
  38061. ,
  38062. a.LE = function(e) {
  38063. return this.littleEndian = "undefined" == typeof e || !!e,
  38064. this
  38065. }
  38066. ,
  38067. a.BE = function(e) {
  38068. return this.littleEndian = "undefined" != typeof e && !e,
  38069. this
  38070. }
  38071. ,
  38072. a.prepend = function(e, t, i) {
  38073. "number" != typeof t && "string" == typeof t || (i = t,
  38074. t = void 0);
  38075. var n = "undefined" == typeof i;
  38076. if (n && (i = this.offset),
  38077. !this.noAssert) {
  38078. if ("number" != typeof i || i % 1 !== 0)
  38079. throw TypeError("Illegal offset: " + i + " (not an integer)");
  38080. if (i >>>= 0,
  38081. i < 0 || i + 0 > this.buffer.byteLength)
  38082. throw RangeError("Illegal offset: 0 <= " + i + " (+0) <= " + this.buffer.byteLength)
  38083. }
  38084. e instanceof o || (e = o.wrap(e, t));
  38085. var r = e.limit - e.offset;
  38086. if (r <= 0)
  38087. return this;
  38088. var a = r - i;
  38089. if (a > 0) {
  38090. var s = new ArrayBuffer(this.buffer.byteLength + a)
  38091. , l = new Uint8Array(s);
  38092. l.set(this.view.subarray(i, this.buffer.byteLength), r),
  38093. this.buffer = s,
  38094. this.view = l,
  38095. this.offset += a,
  38096. this.markedOffset >= 0 && (this.markedOffset += a),
  38097. this.limit += a,
  38098. i += a
  38099. } else {
  38100. new Uint8Array(this.buffer)
  38101. }
  38102. return this.view.set(e.view.subarray(e.offset, e.limit), i - r),
  38103. e.offset = e.limit,
  38104. n && (this.offset -= r),
  38105. this
  38106. }
  38107. ,
  38108. a.prependTo = function(e, t) {
  38109. return e.prepend(this, t),
  38110. this
  38111. }
  38112. ,
  38113. a.printDebug = function(e) {
  38114. "function" != typeof e && (e = console.log.bind(console)),
  38115. e(this.toString() + "\n-------------------------------------------------------------------\n" + this.toDebug(!0))
  38116. }
  38117. ,
  38118. a.remaining = function() {
  38119. return this.limit - this.offset
  38120. }
  38121. ,
  38122. a.reset = function() {
  38123. return this.markedOffset >= 0 ? (this.offset = this.markedOffset,
  38124. this.markedOffset = -1) : this.offset = 0,
  38125. this
  38126. }
  38127. ,
  38128. a.resize = function(e) {
  38129. if (!this.noAssert) {
  38130. if ("number" != typeof e || e % 1 !== 0)
  38131. throw TypeError("Illegal capacity: " + e + " (not an integer)");
  38132. if (e |= 0,
  38133. e < 0)
  38134. throw RangeError("Illegal capacity: 0 <= " + e)
  38135. }
  38136. if (this.buffer.byteLength < e) {
  38137. var t = new ArrayBuffer(e)
  38138. , i = new Uint8Array(t);
  38139. i.set(this.view),
  38140. this.buffer = t,
  38141. this.view = i
  38142. }
  38143. return this
  38144. }
  38145. ,
  38146. a.reverse = function(e, t) {
  38147. if ("undefined" == typeof e && (e = this.offset),
  38148. "undefined" == typeof t && (t = this.limit),
  38149. !this.noAssert) {
  38150. if ("number" != typeof e || e % 1 !== 0)
  38151. throw TypeError("Illegal begin: Not an integer");
  38152. if (e >>>= 0,
  38153. "number" != typeof t || t % 1 !== 0)
  38154. throw TypeError("Illegal end: Not an integer");
  38155. if (t >>>= 0,
  38156. e < 0 || e > t || t > this.buffer.byteLength)
  38157. throw RangeError("Illegal range: 0 <= " + e + " <= " + t + " <= " + this.buffer.byteLength)
  38158. }
  38159. return e === t ? this : (Array.prototype.reverse.call(this.view.subarray(e, t)),
  38160. this)
  38161. }
  38162. ,
  38163. a.skip = function(e) {
  38164. if (!this.noAssert) {
  38165. if ("number" != typeof e || e % 1 !== 0)
  38166. throw TypeError("Illegal length: " + e + " (not an integer)");
  38167. e |= 0
  38168. }
  38169. var t = this.offset + e;
  38170. if (!this.noAssert && (t < 0 || t > this.buffer.byteLength))
  38171. throw RangeError("Illegal length: 0 <= " + this.offset + " + " + e + " <= " + this.buffer.byteLength);
  38172. return this.offset = t,
  38173. this
  38174. }
  38175. ,
  38176. a.slice = function(e, t) {
  38177. if ("undefined" == typeof e && (e = this.offset),
  38178. "undefined" == typeof t && (t = this.limit),
  38179. !this.noAssert) {
  38180. if ("number" != typeof e || e % 1 !== 0)
  38181. throw TypeError("Illegal begin: Not an integer");
  38182. if (e >>>= 0,
  38183. "number" != typeof t || t % 1 !== 0)
  38184. throw TypeError("Illegal end: Not an integer");
  38185. if (t >>>= 0,
  38186. e < 0 || e > t || t > this.buffer.byteLength)
  38187. throw RangeError("Illegal range: 0 <= " + e + " <= " + t + " <= " + this.buffer.byteLength)
  38188. }
  38189. var i = this.clone();
  38190. return i.offset = e,
  38191. i.limit = t,
  38192. i
  38193. }
  38194. ,
  38195. a.toBuffer = function(e) {
  38196. var t = this.offset
  38197. , i = this.limit;
  38198. if (!this.noAssert) {
  38199. if ("number" != typeof t || t % 1 !== 0)
  38200. throw TypeError("Illegal offset: Not an integer");
  38201. if (t >>>= 0,
  38202. "number" != typeof i || i % 1 !== 0)
  38203. throw TypeError("Illegal limit: Not an integer");
  38204. if (i >>>= 0,
  38205. t < 0 || t > i || i > this.buffer.byteLength)
  38206. throw RangeError("Illegal range: 0 <= " + t + " <= " + i + " <= " + this.buffer.byteLength)
  38207. }
  38208. if (!e && 0 === t && i === this.buffer.byteLength)
  38209. return this.buffer;
  38210. if (t === i)
  38211. return s;
  38212. var n = new ArrayBuffer(i - t);
  38213. return new Uint8Array(n).set(new Uint8Array(this.buffer).subarray(t, i), 0),
  38214. n
  38215. }
  38216. ,
  38217. a.toArrayBuffer = a.toBuffer,
  38218. a.toString = function(e, t, i) {
  38219. if ("undefined" == typeof e)
  38220. return "ByteBufferAB(offset=" + this.offset + ",markedOffset=" + this.markedOffset + ",limit=" + this.limit + ",capacity=" + this.capacity() + ")";
  38221. switch ("number" == typeof e && (e = "utf8",
  38222. t = e,
  38223. i = t),
  38224. e) {
  38225. case "utf8":
  38226. return this.toUTF8(t, i);
  38227. case "base64":
  38228. return this.toBase64(t, i);
  38229. case "hex":
  38230. return this.toHex(t, i);
  38231. case "binary":
  38232. return this.toBinary(t, i);
  38233. case "debug":
  38234. return this.toDebug();
  38235. case "columns":
  38236. return this.toColumns();
  38237. default:
  38238. throw Error("Unsupported encoding: " + e)
  38239. }
  38240. }
  38241. ;
  38242. var c = function() {
  38243. 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)
  38244. i[t[n]] = n;
  38245. return e.encode = function(e, i) {
  38246. for (var n, r; null !== (n = e()); )
  38247. i(t[n >> 2 & 63]),
  38248. r = (3 & n) << 4,
  38249. null !== (n = e()) ? (r |= n >> 4 & 15,
  38250. i(t[63 & (r | n >> 4 & 15)]),
  38251. r = (15 & n) << 2,
  38252. null !== (n = e()) ? (i(t[63 & (r | n >> 6 & 3)]),
  38253. i(t[63 & n])) : (i(t[63 & r]),
  38254. i(61))) : (i(t[63 & r]),
  38255. i(61),
  38256. i(61))
  38257. }
  38258. ,
  38259. e.decode = function(e, t) {
  38260. function n(e) {
  38261. throw Error("Illegal character code: " + e)
  38262. }
  38263. for (var r, o, a; null !== (r = e()); )
  38264. if (o = i[r],
  38265. "undefined" == typeof o && n(r),
  38266. null !== (r = e()) && (a = i[r],
  38267. "undefined" == typeof a && n(r),
  38268. t(o << 2 >>> 0 | (48 & a) >> 4),
  38269. null !== (r = e()))) {
  38270. if (o = i[r],
  38271. "undefined" == typeof o) {
  38272. if (61 === r)
  38273. break;
  38274. n(r)
  38275. }
  38276. if (t((15 & a) << 4 >>> 0 | (60 & o) >> 2),
  38277. null !== (r = e())) {
  38278. if (a = i[r],
  38279. "undefined" == typeof a) {
  38280. if (61 === r)
  38281. break;
  38282. n(r)
  38283. }
  38284. t((3 & o) << 6 >>> 0 | a)
  38285. }
  38286. }
  38287. }
  38288. ,
  38289. e.test = function(e) {
  38290. return /^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/.test(e)
  38291. }
  38292. ,
  38293. e
  38294. }();
  38295. a.toBase64 = function(e, t) {
  38296. if ("undefined" == typeof e && (e = this.offset),
  38297. "undefined" == typeof t && (t = this.limit),
  38298. e |= 0,
  38299. t |= 0,
  38300. e < 0 || t > this.capacity || e > t)
  38301. throw RangeError("begin, end");
  38302. var n;
  38303. return c.encode(function() {
  38304. return e < t ? this.view[e++] : null
  38305. }
  38306. .bind(this), n = i()),
  38307. n()
  38308. }
  38309. ,
  38310. o.fromBase64 = function(e, i) {
  38311. if ("string" != typeof e)
  38312. throw TypeError("str");
  38313. var n = new o(e.length / 4 * 3,i)
  38314. , r = 0;
  38315. return c.decode(t(e), function(e) {
  38316. n.view[r++] = e
  38317. }),
  38318. n.limit = r,
  38319. n
  38320. }
  38321. ,
  38322. o.btoa = function(e) {
  38323. return o.fromBinary(e).toBase64()
  38324. }
  38325. ,
  38326. o.atob = function(e) {
  38327. return o.fromBase64(e).toBinary()
  38328. }
  38329. ,
  38330. a.toBinary = function(e, t) {
  38331. if ("undefined" == typeof e && (e = this.offset),
  38332. "undefined" == typeof t && (t = this.limit),
  38333. e |= 0,
  38334. t |= 0,
  38335. e < 0 || t > this.capacity() || e > t)
  38336. throw RangeError("begin, end");
  38337. if (e === t)
  38338. return "";
  38339. for (var i = [], n = []; e < t; )
  38340. i.push(this.view[e++]),
  38341. i.length >= 1024 && (n.push(String.fromCharCode.apply(String, i)),
  38342. i = []);
  38343. return n.join("") + String.fromCharCode.apply(String, i)
  38344. }
  38345. ,
  38346. o.fromBinary = function(e, t) {
  38347. if ("string" != typeof e)
  38348. throw TypeError("str");
  38349. for (var i, n = 0, r = e.length, a = new o(r,t); n < r; ) {
  38350. if (i = e.charCodeAt(n),
  38351. i > 255)
  38352. throw RangeError("illegal char code: " + i);
  38353. a.view[n++] = i
  38354. }
  38355. return a.limit = r,
  38356. a
  38357. }
  38358. ,
  38359. a.toDebug = function(e) {
  38360. for (var t, i = -1, n = this.buffer.byteLength, r = "", o = "", a = ""; i < n; ) {
  38361. if (i !== -1 && (t = this.view[i],
  38362. r += t < 16 ? "0" + t.toString(16).toUpperCase() : t.toString(16).toUpperCase(),
  38363. e && (o += t > 32 && t < 127 ? String.fromCharCode(t) : ".")),
  38364. ++i,
  38365. e && i > 0 && i % 16 === 0 && i !== n) {
  38366. for (; r.length < 51; )
  38367. r += " ";
  38368. a += r + o + "\n",
  38369. r = o = ""
  38370. }
  38371. 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 ? " " : ""
  38372. }
  38373. if (e && " " !== r) {
  38374. for (; r.length < 51; )
  38375. r += " ";
  38376. a += r + o + "\n"
  38377. }
  38378. return e ? a : r
  38379. }
  38380. ,
  38381. o.fromDebug = function(e, t, i) {
  38382. 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; ) {
  38383. switch (n = e.charAt(l++)) {
  38384. case "!":
  38385. if (!i) {
  38386. if (u || d || p) {
  38387. f = !0;
  38388. break
  38389. }
  38390. u = d = p = !0
  38391. }
  38392. s.offset = s.markedOffset = s.limit = c,
  38393. h = !1;
  38394. break;
  38395. case "|":
  38396. if (!i) {
  38397. if (u || p) {
  38398. f = !0;
  38399. break
  38400. }
  38401. u = p = !0
  38402. }
  38403. s.offset = s.limit = c,
  38404. h = !1;
  38405. break;
  38406. case "[":
  38407. if (!i) {
  38408. if (u || d) {
  38409. f = !0;
  38410. break
  38411. }
  38412. u = d = !0
  38413. }
  38414. s.offset = s.markedOffset = c,
  38415. h = !1;
  38416. break;
  38417. case "<":
  38418. if (!i) {
  38419. if (u) {
  38420. f = !0;
  38421. break
  38422. }
  38423. u = !0
  38424. }
  38425. s.offset = c,
  38426. h = !1;
  38427. break;
  38428. case "]":
  38429. if (!i) {
  38430. if (p || d) {
  38431. f = !0;
  38432. break
  38433. }
  38434. p = d = !0
  38435. }
  38436. s.limit = s.markedOffset = c,
  38437. h = !1;
  38438. break;
  38439. case ">":
  38440. if (!i) {
  38441. if (p) {
  38442. f = !0;
  38443. break
  38444. }
  38445. p = !0
  38446. }
  38447. s.limit = c,
  38448. h = !1;
  38449. break;
  38450. case "'":
  38451. if (!i) {
  38452. if (d) {
  38453. f = !0;
  38454. break
  38455. }
  38456. d = !0
  38457. }
  38458. s.markedOffset = c,
  38459. h = !1;
  38460. break;
  38461. case " ":
  38462. h = !1;
  38463. break;
  38464. default:
  38465. if (!i && h) {
  38466. f = !0;
  38467. break
  38468. }
  38469. if (r = parseInt(n + e.charAt(l++), 16),
  38470. !i && (isNaN(r) || r < 0 || r > 255))
  38471. throw TypeError("Illegal str: Not a debug encoded string");
  38472. s.view[c++] = r,
  38473. h = !0
  38474. }
  38475. if (f)
  38476. throw TypeError("Illegal str: Invalid symbol at " + l)
  38477. }
  38478. if (!i) {
  38479. if (!u || !p)
  38480. throw TypeError("Illegal str: Missing offset or limit");
  38481. if (c < s.buffer.byteLength)
  38482. throw TypeError("Illegal str: Not a debug encoded string (is it hex?) " + c + " < " + a)
  38483. }
  38484. return s
  38485. }
  38486. ,
  38487. a.toHex = function(e, t) {
  38488. if (e = "undefined" == typeof e ? this.offset : e,
  38489. t = "undefined" == typeof t ? this.limit : t,
  38490. !this.noAssert) {
  38491. if ("number" != typeof e || e % 1 !== 0)
  38492. throw TypeError("Illegal begin: Not an integer");
  38493. if (e >>>= 0,
  38494. "number" != typeof t || t % 1 !== 0)
  38495. throw TypeError("Illegal end: Not an integer");
  38496. if (t >>>= 0,
  38497. e < 0 || e > t || t > this.buffer.byteLength)
  38498. throw RangeError("Illegal range: 0 <= " + e + " <= " + t + " <= " + this.buffer.byteLength)
  38499. }
  38500. for (var i, n = new Array(t - e); e < t; )
  38501. i = this.view[e++],
  38502. i < 16 ? n.push("0", i.toString(16)) : n.push(i.toString(16));
  38503. return n.join("")
  38504. }
  38505. ,
  38506. o.fromHex = function(e, t, i) {
  38507. if (!i) {
  38508. if ("string" != typeof e)
  38509. throw TypeError("Illegal str: Not a string");
  38510. if (e.length % 2 !== 0)
  38511. throw TypeError("Illegal str: Length not a multiple of 2")
  38512. }
  38513. for (var n, r = e.length, a = new o(r / 2 | 0,t), s = 0, l = 0; s < r; s += 2) {
  38514. if (n = parseInt(e.substring(s, s + 2), 16),
  38515. !i && (!isFinite(n) || n < 0 || n > 255))
  38516. throw TypeError("Illegal str: Contains non-hex characters");
  38517. a.view[l++] = n
  38518. }
  38519. return a.limit = l,
  38520. a
  38521. }
  38522. ;
  38523. var h = function() {
  38524. var e = {};
  38525. return e.MAX_CODEPOINT = 1114111,
  38526. e.encodeUTF8 = function(e, t) {
  38527. var i = null;
  38528. for ("number" == typeof e && (i = e,
  38529. e = function() {
  38530. return null
  38531. }
  38532. ); null !== i || null !== (i = e()); )
  38533. i < 128 ? t(127 & i) : i < 2048 ? (t(i >> 6 & 31 | 192),
  38534. t(63 & i | 128)) : i < 65536 ? (t(i >> 12 & 15 | 224),
  38535. t(i >> 6 & 63 | 128),
  38536. t(63 & i | 128)) : (t(i >> 18 & 7 | 240),
  38537. t(i >> 12 & 63 | 128),
  38538. t(i >> 6 & 63 | 128),
  38539. t(63 & i | 128)),
  38540. i = null
  38541. }
  38542. ,
  38543. e.decodeUTF8 = function(e, t) {
  38544. for (var i, n, r, o, a = function(e) {
  38545. e = e.slice(0, e.indexOf(null));
  38546. var t = Error(e.toString());
  38547. throw t.name = "TruncatedError",
  38548. t.bytes = e,
  38549. t
  38550. }; null !== (i = e()); )
  38551. if (0 === (128 & i))
  38552. t(i);
  38553. else if (192 === (224 & i))
  38554. null === (n = e()) && a([i, n]),
  38555. t((31 & i) << 6 | 63 & n);
  38556. else if (224 === (240 & i))
  38557. (null === (n = e()) || null === (r = e())) && a([i, n, r]),
  38558. t((15 & i) << 12 | (63 & n) << 6 | 63 & r);
  38559. else {
  38560. if (240 !== (248 & i))
  38561. throw RangeError("Illegal starting byte: " + i);
  38562. (null === (n = e()) || null === (r = e()) || null === (o = e())) && a([i, n, r, o]),
  38563. t((7 & i) << 18 | (63 & n) << 12 | (63 & r) << 6 | 63 & o)
  38564. }
  38565. }
  38566. ,
  38567. e.UTF16toUTF8 = function(e, t) {
  38568. for (var i, n = null; ; ) {
  38569. if (null === (i = null !== n ? n : e()))
  38570. break;
  38571. i >= 55296 && i <= 57343 && null !== (n = e()) && n >= 56320 && n <= 57343 ? (t(1024 * (i - 55296) + n - 56320 + 65536),
  38572. n = null) : t(i)
  38573. }
  38574. null !== n && t(n)
  38575. }
  38576. ,
  38577. e.UTF8toUTF16 = function(e, t) {
  38578. var i = null;
  38579. for ("number" == typeof e && (i = e,
  38580. e = function() {
  38581. return null
  38582. }
  38583. ); null !== i || null !== (i = e()); )
  38584. i <= 65535 ? t(i) : (i -= 65536,
  38585. t((i >> 10) + 55296),
  38586. t(i % 1024 + 56320)),
  38587. i = null
  38588. }
  38589. ,
  38590. e.encodeUTF16toUTF8 = function(t, i) {
  38591. e.UTF16toUTF8(t, function(t) {
  38592. e.encodeUTF8(t, i)
  38593. })
  38594. }
  38595. ,
  38596. e.decodeUTF8toUTF16 = function(t, i) {
  38597. e.decodeUTF8(t, function(t) {
  38598. e.UTF8toUTF16(t, i)
  38599. })
  38600. }
  38601. ,
  38602. e.calculateCodePoint = function(e) {
  38603. return e < 128 ? 1 : e < 2048 ? 2 : e < 65536 ? 3 : 4
  38604. }
  38605. ,
  38606. e.calculateUTF8 = function(e) {
  38607. for (var t, i = 0; null !== (t = e()); )
  38608. i += t < 128 ? 1 : t < 2048 ? 2 : t < 65536 ? 3 : 4;
  38609. return i
  38610. }
  38611. ,
  38612. e.calculateUTF16asUTF8 = function(t) {
  38613. var i = 0
  38614. , n = 0;
  38615. return e.UTF16toUTF8(t, function(e) {
  38616. ++i,
  38617. n += e < 128 ? 1 : e < 2048 ? 2 : e < 65536 ? 3 : 4
  38618. }),
  38619. [i, n]
  38620. }
  38621. ,
  38622. e
  38623. }();
  38624. return a.toUTF8 = function(e, t) {
  38625. if ("undefined" == typeof e && (e = this.offset),
  38626. "undefined" == typeof t && (t = this.limit),
  38627. !this.noAssert) {
  38628. if ("number" != typeof e || e % 1 !== 0)
  38629. throw TypeError("Illegal begin: Not an integer");
  38630. if (e >>>= 0,
  38631. "number" != typeof t || t % 1 !== 0)
  38632. throw TypeError("Illegal end: Not an integer");
  38633. if (t >>>= 0,
  38634. e < 0 || e > t || t > this.buffer.byteLength)
  38635. throw RangeError("Illegal range: 0 <= " + e + " <= " + t + " <= " + this.buffer.byteLength)
  38636. }
  38637. var n;
  38638. try {
  38639. h.decodeUTF8toUTF16(function() {
  38640. return e < t ? this.view[e++] : null
  38641. }
  38642. .bind(this), n = i())
  38643. } catch (i) {
  38644. if (e !== t)
  38645. throw RangeError("Illegal range: Truncated data, " + e + " != " + t)
  38646. }
  38647. return n()
  38648. }
  38649. ,
  38650. o.fromUTF8 = function(e, i, n) {
  38651. if (!n && "string" != typeof e)
  38652. throw TypeError("Illegal str: Not a string");
  38653. var r = new o(h.calculateUTF16asUTF8(t(e), !0)[1],i,n)
  38654. , a = 0;
  38655. return h.encodeUTF16toUTF8(t(e), function(e) {
  38656. r.view[a++] = e
  38657. }),
  38658. r.limit = a,
  38659. r
  38660. }
  38661. ,
  38662. o
  38663. })
  38664. }
  38665. , {
  38666. long: 216
  38667. }],
  38668. 216: [function(e, t, i) {
  38669. !function(i, n) {
  38670. "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()
  38671. }(this, function() {
  38672. "use strict";
  38673. function e(e, t, i) {
  38674. this.low = 0 | e,
  38675. this.high = 0 | t,
  38676. this.unsigned = !!i
  38677. }
  38678. function t(e) {
  38679. return (e && e.__isLong__) === !0
  38680. }
  38681. function i(e, t) {
  38682. var i, n, o;
  38683. return t ? (e >>>= 0,
  38684. (o = 0 <= e && e < 256) && (n = l[e]) ? n : (i = r(e, (0 | e) < 0 ? -1 : 0, !0),
  38685. o && (l[e] = i),
  38686. i)) : (e |= 0,
  38687. (o = -128 <= e && e < 128) && (n = s[e]) ? n : (i = r(e, e < 0 ? -1 : 0, !1),
  38688. o && (s[e] = i),
  38689. i))
  38690. }
  38691. function n(e, t) {
  38692. if (isNaN(e) || !isFinite(e))
  38693. return t ? m : g;
  38694. if (t) {
  38695. if (e < 0)
  38696. return m;
  38697. if (e >= d)
  38698. return I
  38699. } else {
  38700. if (e <= -p)
  38701. return E;
  38702. if (e + 1 >= p)
  38703. return C
  38704. }
  38705. return e < 0 ? n(-e, t).neg() : r(e % u | 0, e / u | 0, t)
  38706. }
  38707. function r(t, i, n) {
  38708. return new e(t,i,n)
  38709. }
  38710. function o(e, t, i) {
  38711. if (0 === e.length)
  38712. throw Error("empty string");
  38713. if ("NaN" === e || "Infinity" === e || "+Infinity" === e || "-Infinity" === e)
  38714. return g;
  38715. if ("number" == typeof t ? (i = t,
  38716. t = !1) : t = !!t,
  38717. i = i || 10,
  38718. i < 2 || 36 < i)
  38719. throw RangeError("radix");
  38720. var r;
  38721. if ((r = e.indexOf("-")) > 0)
  38722. throw Error("interior hyphen");
  38723. if (0 === r)
  38724. return o(e.substring(1), t, i).neg();
  38725. for (var a = n(c(i, 8)), s = g, l = 0; l < e.length; l += 8) {
  38726. var h = Math.min(8, e.length - l)
  38727. , u = parseInt(e.substring(l, l + h), i);
  38728. if (h < 8) {
  38729. var d = n(c(i, h));
  38730. s = s.mul(d).add(n(u))
  38731. } else
  38732. s = s.mul(a),
  38733. s = s.add(n(u))
  38734. }
  38735. return s.unsigned = t,
  38736. s
  38737. }
  38738. function a(t) {
  38739. return t instanceof e ? t : "number" == typeof t ? n(t) : "string" == typeof t ? o(t) : r(t.low, t.high, t.unsigned)
  38740. }
  38741. e.prototype.__isLong__,
  38742. Object.defineProperty(e.prototype, "__isLong__", {
  38743. value: !0,
  38744. enumerable: !1,
  38745. configurable: !1
  38746. }),
  38747. e.isLong = t;
  38748. var s = {}
  38749. , l = {};
  38750. e.fromInt = i,
  38751. e.fromNumber = n,
  38752. e.fromBits = r;
  38753. var c = Math.pow;
  38754. e.fromString = o,
  38755. e.fromValue = a;
  38756. var h = 1 << 24
  38757. , u = 4294967296
  38758. , d = 0x10000000000000000
  38759. , p = d / 2
  38760. , f = i(h)
  38761. , g = i(0);
  38762. e.ZERO = g;
  38763. var m = i(0, !0);
  38764. e.UZERO = m;
  38765. var v = i(1);
  38766. e.ONE = v;
  38767. var A = i(1, !0);
  38768. e.UONE = A;
  38769. var y = i(-1);
  38770. e.NEG_ONE = y;
  38771. var C = r(-1, 2147483647, !1);
  38772. e.MAX_VALUE = C;
  38773. var I = r(-1, -1, !0);
  38774. e.MAX_UNSIGNED_VALUE = I;
  38775. var E = r(0, -2147483648, !1);
  38776. e.MIN_VALUE = E;
  38777. var b = e.prototype;
  38778. return b.toInt = function() {
  38779. return this.unsigned ? this.low >>> 0 : this.low
  38780. }
  38781. ,
  38782. b.toNumber = function() {
  38783. return this.unsigned ? (this.high >>> 0) * u + (this.low >>> 0) : this.high * u + (this.low >>> 0)
  38784. }
  38785. ,
  38786. b.toString = function(e) {
  38787. if (e = e || 10,
  38788. e < 2 || 36 < e)
  38789. throw RangeError("radix");
  38790. if (this.isZero())
  38791. return "0";
  38792. if (this.isNegative()) {
  38793. if (this.eq(E)) {
  38794. var t = n(e)
  38795. , i = this.div(t)
  38796. , r = i.mul(t).sub(this);
  38797. return i.toString(e) + r.toInt().toString(e)
  38798. }
  38799. return "-" + this.neg().toString(e)
  38800. }
  38801. for (var o = n(c(e, 6), this.unsigned), a = this, s = ""; ; ) {
  38802. var l = a.div(o)
  38803. , h = a.sub(l.mul(o)).toInt() >>> 0
  38804. , u = h.toString(e);
  38805. if (a = l,
  38806. a.isZero())
  38807. return u + s;
  38808. for (; u.length < 6; )
  38809. u = "0" + u;
  38810. s = "" + u + s
  38811. }
  38812. }
  38813. ,
  38814. b.getHighBits = function() {
  38815. return this.high
  38816. }
  38817. ,
  38818. b.getHighBitsUnsigned = function() {
  38819. return this.high >>> 0
  38820. }
  38821. ,
  38822. b.getLowBits = function() {
  38823. return this.low
  38824. }
  38825. ,
  38826. b.getLowBitsUnsigned = function() {
  38827. return this.low >>> 0
  38828. }
  38829. ,
  38830. b.getNumBitsAbs = function() {
  38831. if (this.isNegative())
  38832. return this.eq(E) ? 64 : this.neg().getNumBitsAbs();
  38833. for (var e = 0 != this.high ? this.high : this.low, t = 31; t > 0 && 0 == (e & 1 << t); t--)
  38834. ;
  38835. return 0 != this.high ? t + 33 : t + 1
  38836. }
  38837. ,
  38838. b.isZero = function() {
  38839. return 0 === this.high && 0 === this.low
  38840. }
  38841. ,
  38842. b.isNegative = function() {
  38843. return !this.unsigned && this.high < 0
  38844. }
  38845. ,
  38846. b.isPositive = function() {
  38847. return this.unsigned || this.high >= 0
  38848. }
  38849. ,
  38850. b.isOdd = function() {
  38851. return 1 === (1 & this.low)
  38852. }
  38853. ,
  38854. b.isEven = function() {
  38855. return 0 === (1 & this.low)
  38856. }
  38857. ,
  38858. b.equals = function(e) {
  38859. return t(e) || (e = a(e)),
  38860. (this.unsigned === e.unsigned || this.high >>> 31 !== 1 || e.high >>> 31 !== 1) && (this.high === e.high && this.low === e.low)
  38861. }
  38862. ,
  38863. b.eq = b.equals,
  38864. b.notEquals = function(e) {
  38865. return !this.eq(e)
  38866. }
  38867. ,
  38868. b.neq = b.notEquals,
  38869. b.lessThan = function(e) {
  38870. return this.comp(e) < 0
  38871. }
  38872. ,
  38873. b.lt = b.lessThan,
  38874. b.lessThanOrEqual = function(e) {
  38875. return this.comp(e) <= 0
  38876. }
  38877. ,
  38878. b.lte = b.lessThanOrEqual,
  38879. b.greaterThan = function(e) {
  38880. return this.comp(e) > 0
  38881. }
  38882. ,
  38883. b.gt = b.greaterThan,
  38884. b.greaterThanOrEqual = function(e) {
  38885. return this.comp(e) >= 0
  38886. }
  38887. ,
  38888. b.gte = b.greaterThanOrEqual,
  38889. b.compare = function(e) {
  38890. if (t(e) || (e = a(e)),
  38891. this.eq(e))
  38892. return 0;
  38893. var i = this.isNegative()
  38894. , n = e.isNegative();
  38895. 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
  38896. }
  38897. ,
  38898. b.comp = b.compare,
  38899. b.negate = function() {
  38900. return !this.unsigned && this.eq(E) ? E : this.not().add(v)
  38901. }
  38902. ,
  38903. b.neg = b.negate,
  38904. b.add = function(e) {
  38905. t(e) || (e = a(e));
  38906. var i = this.high >>> 16
  38907. , n = 65535 & this.high
  38908. , o = this.low >>> 16
  38909. , s = 65535 & this.low
  38910. , l = e.high >>> 16
  38911. , c = 65535 & e.high
  38912. , h = e.low >>> 16
  38913. , u = 65535 & e.low
  38914. , d = 0
  38915. , p = 0
  38916. , f = 0
  38917. , g = 0;
  38918. return g += s + u,
  38919. f += g >>> 16,
  38920. g &= 65535,
  38921. f += o + h,
  38922. p += f >>> 16,
  38923. f &= 65535,
  38924. p += n + c,
  38925. d += p >>> 16,
  38926. p &= 65535,
  38927. d += i + l,
  38928. d &= 65535,
  38929. r(f << 16 | g, d << 16 | p, this.unsigned)
  38930. }
  38931. ,
  38932. b.subtract = function(e) {
  38933. return t(e) || (e = a(e)),
  38934. this.add(e.neg())
  38935. }
  38936. ,
  38937. b.sub = b.subtract,
  38938. b.multiply = function(e) {
  38939. if (this.isZero())
  38940. return g;
  38941. if (t(e) || (e = a(e)),
  38942. e.isZero())
  38943. return g;
  38944. if (this.eq(E))
  38945. return e.isOdd() ? E : g;
  38946. if (e.eq(E))
  38947. return this.isOdd() ? E : g;
  38948. if (this.isNegative())
  38949. return e.isNegative() ? this.neg().mul(e.neg()) : this.neg().mul(e).neg();
  38950. if (e.isNegative())
  38951. return this.mul(e.neg()).neg();
  38952. if (this.lt(f) && e.lt(f))
  38953. return n(this.toNumber() * e.toNumber(), this.unsigned);
  38954. var i = this.high >>> 16
  38955. , o = 65535 & this.high
  38956. , s = this.low >>> 16
  38957. , l = 65535 & this.low
  38958. , c = e.high >>> 16
  38959. , h = 65535 & e.high
  38960. , u = e.low >>> 16
  38961. , d = 65535 & e.low
  38962. , p = 0
  38963. , m = 0
  38964. , v = 0
  38965. , A = 0;
  38966. return A += l * d,
  38967. v += A >>> 16,
  38968. A &= 65535,
  38969. v += s * d,
  38970. m += v >>> 16,
  38971. v &= 65535,
  38972. v += l * u,
  38973. m += v >>> 16,
  38974. v &= 65535,
  38975. m += o * d,
  38976. p += m >>> 16,
  38977. m &= 65535,
  38978. m += s * u,
  38979. p += m >>> 16,
  38980. m &= 65535,
  38981. m += l * h,
  38982. p += m >>> 16,
  38983. m &= 65535,
  38984. p += i * d + o * u + s * h + l * c,
  38985. p &= 65535,
  38986. r(v << 16 | A, p << 16 | m, this.unsigned)
  38987. }
  38988. ,
  38989. b.mul = b.multiply,
  38990. b.divide = function(e) {
  38991. if (t(e) || (e = a(e)),
  38992. e.isZero())
  38993. throw Error("division by zero");
  38994. if (this.isZero())
  38995. return this.unsigned ? m : g;
  38996. var i, r, o;
  38997. if (this.unsigned) {
  38998. if (e.unsigned || (e = e.toUnsigned()),
  38999. e.gt(this))
  39000. return m;
  39001. if (e.gt(this.shru(1)))
  39002. return A;
  39003. o = m
  39004. } else {
  39005. if (this.eq(E)) {
  39006. if (e.eq(v) || e.eq(y))
  39007. return E;
  39008. if (e.eq(E))
  39009. return v;
  39010. var s = this.shr(1);
  39011. return i = s.div(e).shl(1),
  39012. i.eq(g) ? e.isNegative() ? v : y : (r = this.sub(e.mul(i)),
  39013. o = i.add(r.div(e)))
  39014. }
  39015. if (e.eq(E))
  39016. return this.unsigned ? m : g;
  39017. if (this.isNegative())
  39018. return e.isNegative() ? this.neg().div(e.neg()) : this.neg().div(e).neg();
  39019. if (e.isNegative())
  39020. return this.div(e.neg()).neg();
  39021. o = g
  39022. }
  39023. for (r = this; r.gte(e); ) {
  39024. i = Math.max(1, Math.floor(r.toNumber() / e.toNumber()));
  39025. 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); )
  39026. i -= h,
  39027. u = n(i, this.unsigned),
  39028. d = u.mul(e);
  39029. u.isZero() && (u = v),
  39030. o = o.add(u),
  39031. r = r.sub(d)
  39032. }
  39033. return o
  39034. }
  39035. ,
  39036. b.div = b.divide,
  39037. b.modulo = function(e) {
  39038. return t(e) || (e = a(e)),
  39039. this.sub(this.div(e).mul(e))
  39040. }
  39041. ,
  39042. b.mod = b.modulo,
  39043. b.not = function() {
  39044. return r(~this.low, ~this.high, this.unsigned)
  39045. }
  39046. ,
  39047. b.and = function(e) {
  39048. return t(e) || (e = a(e)),
  39049. r(this.low & e.low, this.high & e.high, this.unsigned)
  39050. }
  39051. ,
  39052. b.or = function(e) {
  39053. return t(e) || (e = a(e)),
  39054. r(this.low | e.low, this.high | e.high, this.unsigned)
  39055. }
  39056. ,
  39057. b.xor = function(e) {
  39058. return t(e) || (e = a(e)),
  39059. r(this.low ^ e.low, this.high ^ e.high, this.unsigned)
  39060. }
  39061. ,
  39062. b.shiftLeft = function(e) {
  39063. return t(e) && (e = e.toInt()),
  39064. 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)
  39065. }
  39066. ,
  39067. b.shl = b.shiftLeft,
  39068. b.shiftRight = function(e) {
  39069. return t(e) && (e = e.toInt()),
  39070. 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)
  39071. }
  39072. ,
  39073. b.shr = b.shiftRight,
  39074. b.shiftRightUnsigned = function(e) {
  39075. if (t(e) && (e = e.toInt()),
  39076. e &= 63,
  39077. 0 === e)
  39078. return this;
  39079. var i = this.high;
  39080. if (e < 32) {
  39081. var n = this.low;
  39082. return r(n >>> e | i << 32 - e, i >>> e, this.unsigned)
  39083. }
  39084. return 32 === e ? r(i, 0, this.unsigned) : r(i >>> e - 32, 0, this.unsigned)
  39085. }
  39086. ,
  39087. b.shru = b.shiftRightUnsigned,
  39088. b.toSigned = function() {
  39089. return this.unsigned ? r(this.low, this.high, !1) : this
  39090. }
  39091. ,
  39092. b.toUnsigned = function() {
  39093. return this.unsigned ? this : r(this.low, this.high, !0)
  39094. }
  39095. ,
  39096. b.toBytes = function(e) {
  39097. return e ? this.toBytesLE() : this.toBytesBE()
  39098. }
  39099. ,
  39100. b.toBytesLE = function() {
  39101. var e = this.high
  39102. , t = this.low;
  39103. return [255 & t, t >>> 8 & 255, t >>> 16 & 255, t >>> 24 & 255, 255 & e, e >>> 8 & 255, e >>> 16 & 255, e >>> 24 & 255]
  39104. }
  39105. ,
  39106. b.toBytesBE = function() {
  39107. var e = this.high
  39108. , t = this.low;
  39109. return [e >>> 24 & 255, e >>> 16 & 255, e >>> 8 & 255, 255 & e, t >>> 24 & 255, t >>> 16 & 255, t >>> 8 & 255, 255 & t]
  39110. }
  39111. ,
  39112. e
  39113. })
  39114. }
  39115. , {}],
  39116. 217: [function(e, t, i) {
  39117. var n = {
  39118. REVISION: "75"
  39119. };
  39120. "function" == typeof define && define.amd ? define("three", n) : "undefined" != typeof i && "undefined" != typeof t && (t.exports = n),
  39121. void 0 === Number.EPSILON && (Number.EPSILON = Math.pow(2, -52)),
  39122. void 0 === Math.sign && (Math.sign = function(e) {
  39123. return e < 0 ? -1 : e > 0 ? 1 : +e
  39124. }
  39125. ),
  39126. void 0 === Function.prototype.name && void 0 !== Object.defineProperty && Object.defineProperty(Function.prototype, "name", {
  39127. get: function() {
  39128. return this.toString().match(/^\s*function\s*(\S*)\s*\(/)[1]
  39129. }
  39130. }),
  39131. void 0 === Object.assign && Object.defineProperty(Object, "assign", {
  39132. writable: !0,
  39133. configurable: !0,
  39134. value: function(e) {
  39135. "use strict";
  39136. if (void 0 === e || null === e)
  39137. throw new TypeError("Cannot convert first argument to object");
  39138. for (var t = Object(e), i = 1, n = arguments.length; i !== n; ++i) {
  39139. var r = arguments[i];
  39140. if (void 0 !== r && null !== r) {
  39141. r = Object(r);
  39142. for (var o = Object.keys(r), a = 0, s = o.length; a !== s; ++a) {
  39143. var l = o[a]
  39144. , c = Object.getOwnPropertyDescriptor(r, l);
  39145. void 0 !== c && c.enumerable && (t[l] = r[l])
  39146. }
  39147. }
  39148. }
  39149. return t
  39150. }
  39151. }),
  39152. n.MOUSE = {
  39153. LEFT: 0,
  39154. MIDDLE: 1,
  39155. RIGHT: 2
  39156. },
  39157. n.CullFaceNone = 0,
  39158. n.CullFaceBack = 1,
  39159. n.CullFaceFront = 2,
  39160. n.CullFaceFrontBack = 3,
  39161. n.FrontFaceDirectionCW = 0,
  39162. n.FrontFaceDirectionCCW = 1,
  39163. n.BasicShadowMap = 0,
  39164. n.PCFShadowMap = 1,
  39165. n.PCFSoftShadowMap = 2,
  39166. n.FrontSide = 0,
  39167. n.BackSide = 1,
  39168. n.DoubleSide = 2,
  39169. n.FlatShading = 1,
  39170. n.SmoothShading = 2,
  39171. n.NoColors = 0,
  39172. n.FaceColors = 1,
  39173. n.VertexColors = 2,
  39174. n.NoBlending = 0,
  39175. n.NormalBlending = 1,
  39176. n.AdditiveBlending = 2,
  39177. n.SubtractiveBlending = 3,
  39178. n.MultiplyBlending = 4,
  39179. n.CustomBlending = 5,
  39180. n.AddEquation = 100,
  39181. n.SubtractEquation = 101,
  39182. n.ReverseSubtractEquation = 102,
  39183. n.MinEquation = 103,
  39184. n.MaxEquation = 104,
  39185. n.ZeroFactor = 200,
  39186. n.OneFactor = 201,
  39187. n.SrcColorFactor = 202,
  39188. n.OneMinusSrcColorFactor = 203,
  39189. n.SrcAlphaFactor = 204,
  39190. n.OneMinusSrcAlphaFactor = 205,
  39191. n.DstAlphaFactor = 206,
  39192. n.OneMinusDstAlphaFactor = 207,
  39193. n.DstColorFactor = 208,
  39194. n.OneMinusDstColorFactor = 209,
  39195. n.SrcAlphaSaturateFactor = 210,
  39196. n.NeverDepth = 0,
  39197. n.AlwaysDepth = 1,
  39198. n.LessDepth = 2,
  39199. n.LessEqualDepth = 3,
  39200. n.EqualDepth = 4,
  39201. n.GreaterEqualDepth = 5,
  39202. n.GreaterDepth = 6,
  39203. n.NotEqualDepth = 7,
  39204. n.MultiplyOperation = 0,
  39205. n.MixOperation = 1,
  39206. n.AddOperation = 2,
  39207. n.NoToneMapping = 0,
  39208. n.LinearToneMapping = 1,
  39209. n.ReinhardToneMapping = 2,
  39210. n.Uncharted2ToneMapping = 3,
  39211. n.CineonToneMapping = 4,
  39212. n.UVMapping = 300,
  39213. n.CubeReflectionMapping = 301,
  39214. n.CubeRefractionMapping = 302,
  39215. n.EquirectangularReflectionMapping = 303,
  39216. n.EquirectangularRefractionMapping = 304,
  39217. n.SphericalReflectionMapping = 305,
  39218. n.CubeUVReflectionMapping = 306,
  39219. n.CubeUVRefractionMapping = 307,
  39220. n.RepeatWrapping = 1e3,
  39221. n.ClampToEdgeWrapping = 1001,
  39222. n.MirroredRepeatWrapping = 1002,
  39223. n.NearestFilter = 1003,
  39224. n.NearestMipMapNearestFilter = 1004,
  39225. n.NearestMipMapLinearFilter = 1005,
  39226. n.LinearFilter = 1006,
  39227. n.LinearMipMapNearestFilter = 1007,
  39228. n.LinearMipMapLinearFilter = 1008,
  39229. n.UnsignedByteType = 1009,
  39230. n.ByteType = 1010,
  39231. n.ShortType = 1011,
  39232. n.UnsignedShortType = 1012,
  39233. n.IntType = 1013,
  39234. n.UnsignedIntType = 1014,
  39235. n.FloatType = 1015,
  39236. n.HalfFloatType = 1025,
  39237. n.UnsignedShort4444Type = 1016,
  39238. n.UnsignedShort5551Type = 1017,
  39239. n.UnsignedShort565Type = 1018,
  39240. n.AlphaFormat = 1019,
  39241. n.RGBFormat = 1020,
  39242. n.RGBAFormat = 1021,
  39243. n.LuminanceFormat = 1022,
  39244. n.LuminanceAlphaFormat = 1023,
  39245. n.RGBEFormat = n.RGBAFormat,
  39246. n.RGB_S3TC_DXT1_Format = 2001,
  39247. n.RGBA_S3TC_DXT1_Format = 2002,
  39248. n.RGBA_S3TC_DXT3_Format = 2003,
  39249. n.RGBA_S3TC_DXT5_Format = 2004,
  39250. n.RGB_PVRTC_4BPPV1_Format = 2100,
  39251. n.RGB_PVRTC_2BPPV1_Format = 2101,
  39252. n.RGBA_PVRTC_4BPPV1_Format = 2102,
  39253. n.RGBA_PVRTC_2BPPV1_Format = 2103,
  39254. n.RGB_ETC1_Format = 2151,
  39255. n.LoopOnce = 2200,
  39256. n.LoopRepeat = 2201,
  39257. n.LoopPingPong = 2202,
  39258. n.InterpolateDiscrete = 2300,
  39259. n.InterpolateLinear = 2301,
  39260. n.InterpolateSmooth = 2302,
  39261. n.ZeroCurvatureEnding = 2400,
  39262. n.ZeroSlopeEnding = 2401,
  39263. n.WrapAroundEnding = 2402,
  39264. n.TrianglesDrawMode = 0,
  39265. n.TriangleStripDrawMode = 1,
  39266. n.TriangleFanDrawMode = 2,
  39267. n.LinearEncoding = 3e3,
  39268. n.sRGBEncoding = 3001,
  39269. n.GammaEncoding = 3007,
  39270. n.RGBEEncoding = 3002,
  39271. n.LogLuvEncoding = 3003,
  39272. n.RGBM7Encoding = 3004,
  39273. n.RGBM16Encoding = 3005,
  39274. n.RGBDEncoding = 3006,
  39275. n.Color = function(e) {
  39276. return 3 === arguments.length ? this.fromArray(arguments) : this.set(e)
  39277. }
  39278. ,
  39279. n.Color.prototype = {
  39280. constructor: n.Color,
  39281. r: 1,
  39282. g: 1,
  39283. b: 1,
  39284. set: function(e) {
  39285. return e instanceof n.Color ? this.copy(e) : "number" == typeof e ? this.setHex(e) : "string" == typeof e && this.setStyle(e),
  39286. this
  39287. },
  39288. setScalar: function(e) {
  39289. this.r = e,
  39290. this.g = e,
  39291. this.b = e
  39292. },
  39293. setHex: function(e) {
  39294. return e = Math.floor(e),
  39295. this.r = (e >> 16 & 255) / 255,
  39296. this.g = (e >> 8 & 255) / 255,
  39297. this.b = (255 & e) / 255,
  39298. this
  39299. },
  39300. setRGB: function(e, t, i) {
  39301. return this.r = e,
  39302. this.g = t,
  39303. this.b = i,
  39304. this
  39305. },
  39306. setHSL: function() {
  39307. function e(e, t, i) {
  39308. return i < 0 && (i += 1),
  39309. i > 1 && (i -= 1),
  39310. i < 1 / 6 ? e + 6 * (t - e) * i : i < .5 ? t : i < 2 / 3 ? e + 6 * (t - e) * (2 / 3 - i) : e
  39311. }
  39312. return function(t, i, r) {
  39313. if (t = n.Math.euclideanModulo(t, 1),
  39314. i = n.Math.clamp(i, 0, 1),
  39315. r = n.Math.clamp(r, 0, 1),
  39316. 0 === i)
  39317. this.r = this.g = this.b = r;
  39318. else {
  39319. var o = r <= .5 ? r * (1 + i) : r + i - r * i
  39320. , a = 2 * r - o;
  39321. this.r = e(a, o, t + 1 / 3),
  39322. this.g = e(a, o, t),
  39323. this.b = e(a, o, t - 1 / 3)
  39324. }
  39325. return this
  39326. }
  39327. }(),
  39328. setStyle: function(e) {
  39329. function t(t) {
  39330. void 0 !== t && parseFloat(t) < 1 && console.warn("THREE.Color: Alpha component of " + e + " will be ignored.")
  39331. }
  39332. var i;
  39333. if (i = /^((?:rgb|hsl)a?)\(\s*([^\)]*)\)/.exec(e)) {
  39334. var r, o = i[1], a = i[2];
  39335. switch (o) {
  39336. case "rgb":
  39337. case "rgba":
  39338. if (r = /^(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(a))
  39339. return this.r = Math.min(255, parseInt(r[1], 10)) / 255,
  39340. this.g = Math.min(255, parseInt(r[2], 10)) / 255,
  39341. this.b = Math.min(255, parseInt(r[3], 10)) / 255,
  39342. t(r[5]),
  39343. this;
  39344. if (r = /^(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(a))
  39345. return this.r = Math.min(100, parseInt(r[1], 10)) / 100,
  39346. this.g = Math.min(100, parseInt(r[2], 10)) / 100,
  39347. this.b = Math.min(100, parseInt(r[3], 10)) / 100,
  39348. t(r[5]),
  39349. this;
  39350. break;
  39351. case "hsl":
  39352. case "hsla":
  39353. if (r = /^([0-9]*\.?[0-9]+)\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(a)) {
  39354. var s = parseFloat(r[1]) / 360
  39355. , l = parseInt(r[2], 10) / 100
  39356. , c = parseInt(r[3], 10) / 100;
  39357. return t(r[5]),
  39358. this.setHSL(s, l, c)
  39359. }
  39360. }
  39361. } else if (i = /^\#([A-Fa-f0-9]+)$/.exec(e)) {
  39362. var h = i[1]
  39363. , u = h.length;
  39364. if (3 === u)
  39365. return this.r = parseInt(h.charAt(0) + h.charAt(0), 16) / 255,
  39366. this.g = parseInt(h.charAt(1) + h.charAt(1), 16) / 255,
  39367. this.b = parseInt(h.charAt(2) + h.charAt(2), 16) / 255,
  39368. this;
  39369. if (6 === u)
  39370. return this.r = parseInt(h.charAt(0) + h.charAt(1), 16) / 255,
  39371. this.g = parseInt(h.charAt(2) + h.charAt(3), 16) / 255,
  39372. this.b = parseInt(h.charAt(4) + h.charAt(5), 16) / 255,
  39373. this
  39374. }
  39375. if (e && e.length > 0) {
  39376. var h = n.ColorKeywords[e];
  39377. void 0 !== h ? this.setHex(h) : console.warn("THREE.Color: Unknown color " + e)
  39378. }
  39379. return this
  39380. },
  39381. clone: function() {
  39382. return new this.constructor(this.r,this.g,this.b)
  39383. },
  39384. copy: function(e) {
  39385. return this.r = e.r,
  39386. this.g = e.g,
  39387. this.b = e.b,
  39388. this
  39389. },
  39390. copyGammaToLinear: function(e, t) {
  39391. return void 0 === t && (t = 2),
  39392. this.r = Math.pow(e.r, t),
  39393. this.g = Math.pow(e.g, t),
  39394. this.b = Math.pow(e.b, t),
  39395. this
  39396. },
  39397. copyLinearToGamma: function(e, t) {
  39398. void 0 === t && (t = 2);
  39399. var i = t > 0 ? 1 / t : 1;
  39400. return this.r = Math.pow(e.r, i),
  39401. this.g = Math.pow(e.g, i),
  39402. this.b = Math.pow(e.b, i),
  39403. this
  39404. },
  39405. convertGammaToLinear: function() {
  39406. var e = this.r
  39407. , t = this.g
  39408. , i = this.b;
  39409. return this.r = e * e,
  39410. this.g = t * t,
  39411. this.b = i * i,
  39412. this
  39413. },
  39414. convertLinearToGamma: function() {
  39415. return this.r = Math.sqrt(this.r),
  39416. this.g = Math.sqrt(this.g),
  39417. this.b = Math.sqrt(this.b),
  39418. this
  39419. },
  39420. getHex: function() {
  39421. return 255 * this.r << 16 ^ 255 * this.g << 8 ^ 255 * this.b << 0
  39422. },
  39423. getHexString: function() {
  39424. return ("000000" + this.getHex().toString(16)).slice(-6)
  39425. },
  39426. getHSL: function(e) {
  39427. var t, i, n = e || {
  39428. h: 0,
  39429. s: 0,
  39430. l: 0
  39431. }, 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;
  39432. if (l === s)
  39433. t = 0,
  39434. i = 0;
  39435. else {
  39436. var h = s - l;
  39437. switch (i = c <= .5 ? h / (s + l) : h / (2 - s - l),
  39438. s) {
  39439. case r:
  39440. t = (o - a) / h + (o < a ? 6 : 0);
  39441. break;
  39442. case o:
  39443. t = (a - r) / h + 2;
  39444. break;
  39445. case a:
  39446. t = (r - o) / h + 4
  39447. }
  39448. t /= 6
  39449. }
  39450. return n.h = t,
  39451. n.s = i,
  39452. n.l = c,
  39453. n
  39454. },
  39455. getStyle: function() {
  39456. return "rgb(" + (255 * this.r | 0) + "," + (255 * this.g | 0) + "," + (255 * this.b | 0) + ")"
  39457. },
  39458. offsetHSL: function(e, t, i) {
  39459. var n = this.getHSL();
  39460. return n.h += e,
  39461. n.s += t,
  39462. n.l += i,
  39463. this.setHSL(n.h, n.s, n.l),
  39464. this
  39465. },
  39466. add: function(e) {
  39467. return this.r += e.r,
  39468. this.g += e.g,
  39469. this.b += e.b,
  39470. this
  39471. },
  39472. addColors: function(e, t) {
  39473. return this.r = e.r + t.r,
  39474. this.g = e.g + t.g,
  39475. this.b = e.b + t.b,
  39476. this
  39477. },
  39478. addScalar: function(e) {
  39479. return this.r += e,
  39480. this.g += e,
  39481. this.b += e,
  39482. this
  39483. },
  39484. multiply: function(e) {
  39485. return this.r *= e.r,
  39486. this.g *= e.g,
  39487. this.b *= e.b,
  39488. this
  39489. },
  39490. multiplyScalar: function(e) {
  39491. return this.r *= e,
  39492. this.g *= e,
  39493. this.b *= e,
  39494. this
  39495. },
  39496. lerp: function(e, t) {
  39497. return this.r += (e.r - this.r) * t,
  39498. this.g += (e.g - this.g) * t,
  39499. this.b += (e.b - this.b) * t,
  39500. this
  39501. },
  39502. equals: function(e) {
  39503. return e.r === this.r && e.g === this.g && e.b === this.b
  39504. },
  39505. fromArray: function(e, t) {
  39506. return void 0 === t && (t = 0),
  39507. this.r = e[t],
  39508. this.g = e[t + 1],
  39509. this.b = e[t + 2],
  39510. this
  39511. },
  39512. toArray: function(e, t) {
  39513. return void 0 === e && (e = []),
  39514. void 0 === t && (t = 0),
  39515. e[t] = this.r,
  39516. e[t + 1] = this.g,
  39517. e[t + 2] = this.b,
  39518. e
  39519. }
  39520. },
  39521. n.ColorKeywords = {
  39522. aliceblue: 15792383,
  39523. antiquewhite: 16444375,
  39524. aqua: 65535,
  39525. aquamarine: 8388564,
  39526. azure: 15794175,
  39527. beige: 16119260,
  39528. bisque: 16770244,
  39529. black: 0,
  39530. blanchedalmond: 16772045,
  39531. blue: 255,
  39532. blueviolet: 9055202,
  39533. brown: 10824234,
  39534. burlywood: 14596231,
  39535. cadetblue: 6266528,
  39536. chartreuse: 8388352,
  39537. chocolate: 13789470,
  39538. coral: 16744272,
  39539. cornflowerblue: 6591981,
  39540. cornsilk: 16775388,
  39541. crimson: 14423100,
  39542. cyan: 65535,
  39543. darkblue: 139,
  39544. darkcyan: 35723,
  39545. darkgoldenrod: 12092939,
  39546. darkgray: 11119017,
  39547. darkgreen: 25600,
  39548. darkgrey: 11119017,
  39549. darkkhaki: 12433259,
  39550. darkmagenta: 9109643,
  39551. darkolivegreen: 5597999,
  39552. darkorange: 16747520,
  39553. darkorchid: 10040012,
  39554. darkred: 9109504,
  39555. darksalmon: 15308410,
  39556. darkseagreen: 9419919,
  39557. darkslateblue: 4734347,
  39558. darkslategray: 3100495,
  39559. darkslategrey: 3100495,
  39560. darkturquoise: 52945,
  39561. darkviolet: 9699539,
  39562. deeppink: 16716947,
  39563. deepskyblue: 49151,
  39564. dimgray: 6908265,
  39565. dimgrey: 6908265,
  39566. dodgerblue: 2003199,
  39567. firebrick: 11674146,
  39568. floralwhite: 16775920,
  39569. forestgreen: 2263842,
  39570. fuchsia: 16711935,
  39571. gainsboro: 14474460,
  39572. ghostwhite: 16316671,
  39573. gold: 16766720,
  39574. goldenrod: 14329120,
  39575. gray: 8421504,
  39576. green: 32768,
  39577. greenyellow: 11403055,
  39578. grey: 8421504,
  39579. honeydew: 15794160,
  39580. hotpink: 16738740,
  39581. indianred: 13458524,
  39582. indigo: 4915330,
  39583. ivory: 16777200,
  39584. khaki: 15787660,
  39585. lavender: 15132410,
  39586. lavenderblush: 16773365,
  39587. lawngreen: 8190976,
  39588. lemonchiffon: 16775885,
  39589. lightblue: 11393254,
  39590. lightcoral: 15761536,
  39591. lightcyan: 14745599,
  39592. lightgoldenrodyellow: 16448210,
  39593. lightgray: 13882323,
  39594. lightgreen: 9498256,
  39595. lightgrey: 13882323,
  39596. lightpink: 16758465,
  39597. lightsalmon: 16752762,
  39598. lightseagreen: 2142890,
  39599. lightskyblue: 8900346,
  39600. lightslategray: 7833753,
  39601. lightslategrey: 7833753,
  39602. lightsteelblue: 11584734,
  39603. lightyellow: 16777184,
  39604. lime: 65280,
  39605. limegreen: 3329330,
  39606. linen: 16445670,
  39607. magenta: 16711935,
  39608. maroon: 8388608,
  39609. mediumaquamarine: 6737322,
  39610. mediumblue: 205,
  39611. mediumorchid: 12211667,
  39612. mediumpurple: 9662683,
  39613. mediumseagreen: 3978097,
  39614. mediumslateblue: 8087790,
  39615. mediumspringgreen: 64154,
  39616. mediumturquoise: 4772300,
  39617. mediumvioletred: 13047173,
  39618. midnightblue: 1644912,
  39619. mintcream: 16121850,
  39620. mistyrose: 16770273,
  39621. moccasin: 16770229,
  39622. navajowhite: 16768685,
  39623. navy: 128,
  39624. oldlace: 16643558,
  39625. olive: 8421376,
  39626. olivedrab: 7048739,
  39627. orange: 16753920,
  39628. orangered: 16729344,
  39629. orchid: 14315734,
  39630. palegoldenrod: 15657130,
  39631. palegreen: 10025880,
  39632. paleturquoise: 11529966,
  39633. palevioletred: 14381203,
  39634. papayawhip: 16773077,
  39635. peachpuff: 16767673,
  39636. peru: 13468991,
  39637. pink: 16761035,
  39638. plum: 14524637,
  39639. powderblue: 11591910,
  39640. purple: 8388736,
  39641. red: 16711680,
  39642. rosybrown: 12357519,
  39643. royalblue: 4286945,
  39644. saddlebrown: 9127187,
  39645. salmon: 16416882,
  39646. sandybrown: 16032864,
  39647. seagreen: 3050327,
  39648. seashell: 16774638,
  39649. sienna: 10506797,
  39650. silver: 12632256,
  39651. skyblue: 8900331,
  39652. slateblue: 6970061,
  39653. slategray: 7372944,
  39654. slategrey: 7372944,
  39655. snow: 16775930,
  39656. springgreen: 65407,
  39657. steelblue: 4620980,
  39658. tan: 13808780,
  39659. teal: 32896,
  39660. thistle: 14204888,
  39661. tomato: 16737095,
  39662. turquoise: 4251856,
  39663. violet: 15631086,
  39664. wheat: 16113331,
  39665. white: 16777215,
  39666. whitesmoke: 16119285,
  39667. yellow: 16776960,
  39668. yellowgreen: 10145074
  39669. },
  39670. n.Quaternion = function(e, t, i, n) {
  39671. this._x = e || 0,
  39672. this._y = t || 0,
  39673. this._z = i || 0,
  39674. this._w = void 0 !== n ? n : 1
  39675. }
  39676. ,
  39677. n.Quaternion.prototype = {
  39678. constructor: n.Quaternion,
  39679. get x() {
  39680. return this._x
  39681. },
  39682. set x(e) {
  39683. this._x = e,
  39684. this.onChangeCallback()
  39685. },
  39686. get y() {
  39687. return this._y
  39688. },
  39689. set y(e) {
  39690. this._y = e,
  39691. this.onChangeCallback()
  39692. },
  39693. get z() {
  39694. return this._z
  39695. },
  39696. set z(e) {
  39697. this._z = e,
  39698. this.onChangeCallback()
  39699. },
  39700. get w() {
  39701. return this._w
  39702. },
  39703. set w(e) {
  39704. this._w = e,
  39705. this.onChangeCallback()
  39706. },
  39707. set: function(e, t, i, n) {
  39708. return this._x = e,
  39709. this._y = t,
  39710. this._z = i,
  39711. this._w = n,
  39712. this.onChangeCallback(),
  39713. this
  39714. },
  39715. clone: function() {
  39716. return new this.constructor(this._x,this._y,this._z,this._w)
  39717. },
  39718. copy: function(e) {
  39719. return this._x = e.x,
  39720. this._y = e.y,
  39721. this._z = e.z,
  39722. this._w = e.w,
  39723. this.onChangeCallback(),
  39724. this
  39725. },
  39726. setFromEuler: function(e, t) {
  39727. if (e instanceof n.Euler == !1)
  39728. throw new Error("THREE.Quaternion: .setFromEuler() now expects a Euler rotation rather than a Vector3 and order.");
  39729. var i = Math.cos(e._x / 2)
  39730. , r = Math.cos(e._y / 2)
  39731. , o = Math.cos(e._z / 2)
  39732. , a = Math.sin(e._x / 2)
  39733. , s = Math.sin(e._y / 2)
  39734. , l = Math.sin(e._z / 2)
  39735. , c = e.order;
  39736. return "XYZ" === c ? (this._x = a * r * o + i * s * l,
  39737. this._y = i * s * o - a * r * l,
  39738. this._z = i * r * l + a * s * o,
  39739. this._w = i * r * o - a * s * l) : "YXZ" === c ? (this._x = a * r * o + i * s * l,
  39740. this._y = i * s * o - a * r * l,
  39741. this._z = i * r * l - a * s * o,
  39742. this._w = i * r * o + a * s * l) : "ZXY" === c ? (this._x = a * r * o - i * s * l,
  39743. this._y = i * s * o + a * r * l,
  39744. this._z = i * r * l + a * s * o,
  39745. this._w = i * r * o - a * s * l) : "ZYX" === c ? (this._x = a * r * o - i * s * l,
  39746. this._y = i * s * o + a * r * l,
  39747. this._z = i * r * l - a * s * o,
  39748. this._w = i * r * o + a * s * l) : "YZX" === c ? (this._x = a * r * o + i * s * l,
  39749. this._y = i * s * o + a * r * l,
  39750. this._z = i * r * l - a * s * o,
  39751. this._w = i * r * o - a * s * l) : "XZY" === c && (this._x = a * r * o - i * s * l,
  39752. this._y = i * s * o - a * r * l,
  39753. this._z = i * r * l + a * s * o,
  39754. this._w = i * r * o + a * s * l),
  39755. t !== !1 && this.onChangeCallback(),
  39756. this
  39757. },
  39758. setFromAxisAngle: function(e, t) {
  39759. var i = t / 2
  39760. , n = Math.sin(i);
  39761. return this._x = e.x * n,
  39762. this._y = e.y * n,
  39763. this._z = e.z * n,
  39764. this._w = Math.cos(i),
  39765. this.onChangeCallback(),
  39766. this
  39767. },
  39768. setFromRotationMatrix: function(e) {
  39769. 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;
  39770. return d > 0 ? (t = .5 / Math.sqrt(d + 1),
  39771. this._w = .25 / t,
  39772. this._x = (h - l) * t,
  39773. this._y = (o - c) * t,
  39774. this._z = (a - r) * t) : n > s && n > u ? (t = 2 * Math.sqrt(1 + n - s - u),
  39775. this._w = (h - l) / t,
  39776. this._x = .25 * t,
  39777. this._y = (r + a) / t,
  39778. this._z = (o + c) / t) : s > u ? (t = 2 * Math.sqrt(1 + s - n - u),
  39779. this._w = (o - c) / t,
  39780. this._x = (r + a) / t,
  39781. this._y = .25 * t,
  39782. this._z = (l + h) / t) : (t = 2 * Math.sqrt(1 + u - n - s),
  39783. this._w = (a - r) / t,
  39784. this._x = (o + c) / t,
  39785. this._y = (l + h) / t,
  39786. this._z = .25 * t),
  39787. this.onChangeCallback(),
  39788. this
  39789. },
  39790. setFromUnitVectors: function() {
  39791. var e, t, i = 1e-6;
  39792. return function(r, o) {
  39793. return void 0 === e && (e = new n.Vector3),
  39794. t = r.dot(o) + 1,
  39795. t < i ? (t = 0,
  39796. 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),
  39797. this._x = e.x,
  39798. this._y = e.y,
  39799. this._z = e.z,
  39800. this._w = t,
  39801. this.normalize(),
  39802. this
  39803. }
  39804. }(),
  39805. inverse: function() {
  39806. return this.conjugate().normalize(),
  39807. this
  39808. },
  39809. conjugate: function() {
  39810. return this._x *= -1,
  39811. this._y *= -1,
  39812. this._z *= -1,
  39813. this.onChangeCallback(),
  39814. this
  39815. },
  39816. dot: function(e) {
  39817. return this._x * e._x + this._y * e._y + this._z * e._z + this._w * e._w
  39818. },
  39819. lengthSq: function() {
  39820. return this._x * this._x + this._y * this._y + this._z * this._z + this._w * this._w
  39821. },
  39822. length: function() {
  39823. return Math.sqrt(this._x * this._x + this._y * this._y + this._z * this._z + this._w * this._w)
  39824. },
  39825. normalize: function() {
  39826. var e = this.length();
  39827. return 0 === e ? (this._x = 0,
  39828. this._y = 0,
  39829. this._z = 0,
  39830. this._w = 1) : (e = 1 / e,
  39831. this._x = this._x * e,
  39832. this._y = this._y * e,
  39833. this._z = this._z * e,
  39834. this._w = this._w * e),
  39835. this.onChangeCallback(),
  39836. this
  39837. },
  39838. multiply: function(e, t) {
  39839. return void 0 !== t ? (console.warn("THREE.Quaternion: .multiply() now only accepts one argument. Use .multiplyQuaternions( a, b ) instead."),
  39840. this.multiplyQuaternions(e, t)) : this.multiplyQuaternions(this, e)
  39841. },
  39842. multiplyQuaternions: function(e, t) {
  39843. var i = e._x
  39844. , n = e._y
  39845. , r = e._z
  39846. , o = e._w
  39847. , a = t._x
  39848. , s = t._y
  39849. , l = t._z
  39850. , c = t._w;
  39851. return this._x = i * c + o * a + n * l - r * s,
  39852. this._y = n * c + o * s + r * a - i * l,
  39853. this._z = r * c + o * l + i * s - n * a,
  39854. this._w = o * c - i * a - n * s - r * l,
  39855. this.onChangeCallback(),
  39856. this
  39857. },
  39858. slerp: function(e, t) {
  39859. if (0 === t)
  39860. return this;
  39861. if (1 === t)
  39862. return this.copy(e);
  39863. var i = this._x
  39864. , n = this._y
  39865. , r = this._z
  39866. , o = this._w
  39867. , a = o * e._w + i * e._x + n * e._y + r * e._z;
  39868. if (a < 0 ? (this._w = -e._w,
  39869. this._x = -e._x,
  39870. this._y = -e._y,
  39871. this._z = -e._z,
  39872. a = -a) : this.copy(e),
  39873. a >= 1)
  39874. return this._w = o,
  39875. this._x = i,
  39876. this._y = n,
  39877. this._z = r,
  39878. this;
  39879. var s = Math.sqrt(1 - a * a);
  39880. if (Math.abs(s) < .001)
  39881. return this._w = .5 * (o + this._w),
  39882. this._x = .5 * (i + this._x),
  39883. this._y = .5 * (n + this._y),
  39884. this._z = .5 * (r + this._z),
  39885. this;
  39886. var l = Math.atan2(s, a)
  39887. , c = Math.sin((1 - t) * l) / s
  39888. , h = Math.sin(t * l) / s;
  39889. return this._w = o * c + this._w * h,
  39890. this._x = i * c + this._x * h,
  39891. this._y = n * c + this._y * h,
  39892. this._z = r * c + this._z * h,
  39893. this.onChangeCallback(),
  39894. this
  39895. },
  39896. equals: function(e) {
  39897. return e._x === this._x && e._y === this._y && e._z === this._z && e._w === this._w
  39898. },
  39899. fromArray: function(e, t) {
  39900. return void 0 === t && (t = 0),
  39901. this._x = e[t],
  39902. this._y = e[t + 1],
  39903. this._z = e[t + 2],
  39904. this._w = e[t + 3],
  39905. this.onChangeCallback(),
  39906. this
  39907. },
  39908. toArray: function(e, t) {
  39909. return void 0 === e && (e = []),
  39910. void 0 === t && (t = 0),
  39911. e[t] = this._x,
  39912. e[t + 1] = this._y,
  39913. e[t + 2] = this._z,
  39914. e[t + 3] = this._w,
  39915. e
  39916. },
  39917. onChange: function(e) {
  39918. return this.onChangeCallback = e,
  39919. this
  39920. },
  39921. onChangeCallback: function() {}
  39922. },
  39923. Object.assign(n.Quaternion, {
  39924. slerp: function(e, t, i, n) {
  39925. return i.copy(e).slerp(t, n)
  39926. },
  39927. slerpFlat: function(e, t, i, n, r, o, a) {
  39928. var s = i[n + 0]
  39929. , l = i[n + 1]
  39930. , c = i[n + 2]
  39931. , h = i[n + 3]
  39932. , u = r[o + 0]
  39933. , d = r[o + 1]
  39934. , p = r[o + 2]
  39935. , f = r[o + 3];
  39936. if (h !== f || s !== u || l !== d || c !== p) {
  39937. var g = 1 - a
  39938. , m = s * u + l * d + c * p + h * f
  39939. , v = m >= 0 ? 1 : -1
  39940. , A = 1 - m * m;
  39941. if (A > Number.EPSILON) {
  39942. var y = Math.sqrt(A)
  39943. , C = Math.atan2(y, m * v);
  39944. g = Math.sin(g * C) / y,
  39945. a = Math.sin(a * C) / y
  39946. }
  39947. var I = a * v;
  39948. if (s = s * g + u * I,
  39949. l = l * g + d * I,
  39950. c = c * g + p * I,
  39951. h = h * g + f * I,
  39952. g === 1 - a) {
  39953. var E = 1 / Math.sqrt(s * s + l * l + c * c + h * h);
  39954. s *= E,
  39955. l *= E,
  39956. c *= E,
  39957. h *= E
  39958. }
  39959. }
  39960. e[t] = s,
  39961. e[t + 1] = l,
  39962. e[t + 2] = c,
  39963. e[t + 3] = h
  39964. }
  39965. }),
  39966. n.Vector2 = function(e, t) {
  39967. this.x = e || 0,
  39968. this.y = t || 0
  39969. }
  39970. ,
  39971. n.Vector2.prototype = {
  39972. constructor: n.Vector2,
  39973. get width() {
  39974. return this.x
  39975. },
  39976. set width(e) {
  39977. this.x = e
  39978. },
  39979. get height() {
  39980. return this.y
  39981. },
  39982. set height(e) {
  39983. this.y = e
  39984. },
  39985. set: function(e, t) {
  39986. return this.x = e,
  39987. this.y = t,
  39988. this
  39989. },
  39990. setScalar: function(e) {
  39991. return this.x = e,
  39992. this.y = e,
  39993. this
  39994. },
  39995. setX: function(e) {
  39996. return this.x = e,
  39997. this
  39998. },
  39999. setY: function(e) {
  40000. return this.y = e,
  40001. this
  40002. },
  40003. setComponent: function(e, t) {
  40004. switch (e) {
  40005. case 0:
  40006. this.x = t;
  40007. break;
  40008. case 1:
  40009. this.y = t;
  40010. break;
  40011. default:
  40012. throw new Error("index is out of range: " + e)
  40013. }
  40014. },
  40015. getComponent: function(e) {
  40016. switch (e) {
  40017. case 0:
  40018. return this.x;
  40019. case 1:
  40020. return this.y;
  40021. default:
  40022. throw new Error("index is out of range: " + e)
  40023. }
  40024. },
  40025. clone: function() {
  40026. return new this.constructor(this.x,this.y)
  40027. },
  40028. copy: function(e) {
  40029. return this.x = e.x,
  40030. this.y = e.y,
  40031. this
  40032. },
  40033. add: function(e, t) {
  40034. return void 0 !== t ? (console.warn("THREE.Vector2: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),
  40035. this.addVectors(e, t)) : (this.x += e.x,
  40036. this.y += e.y,
  40037. this)
  40038. },
  40039. addScalar: function(e) {
  40040. return this.x += e,
  40041. this.y += e,
  40042. this
  40043. },
  40044. addVectors: function(e, t) {
  40045. return this.x = e.x + t.x,
  40046. this.y = e.y + t.y,
  40047. this
  40048. },
  40049. addScaledVector: function(e, t) {
  40050. return this.x += e.x * t,
  40051. this.y += e.y * t,
  40052. this
  40053. },
  40054. sub: function(e, t) {
  40055. return void 0 !== t ? (console.warn("THREE.Vector2: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),
  40056. this.subVectors(e, t)) : (this.x -= e.x,
  40057. this.y -= e.y,
  40058. this)
  40059. },
  40060. subScalar: function(e) {
  40061. return this.x -= e,
  40062. this.y -= e,
  40063. this
  40064. },
  40065. subVectors: function(e, t) {
  40066. return this.x = e.x - t.x,
  40067. this.y = e.y - t.y,
  40068. this
  40069. },
  40070. multiply: function(e) {
  40071. return this.x *= e.x,
  40072. this.y *= e.y,
  40073. this
  40074. },
  40075. multiplyScalar: function(e) {
  40076. return isFinite(e) ? (this.x *= e,
  40077. this.y *= e) : (this.x = 0,
  40078. this.y = 0),
  40079. this
  40080. },
  40081. divide: function(e) {
  40082. return this.x /= e.x,
  40083. this.y /= e.y,
  40084. this
  40085. },
  40086. divideScalar: function(e) {
  40087. return this.multiplyScalar(1 / e)
  40088. },
  40089. min: function(e) {
  40090. return this.x = Math.min(this.x, e.x),
  40091. this.y = Math.min(this.y, e.y),
  40092. this
  40093. },
  40094. max: function(e) {
  40095. return this.x = Math.max(this.x, e.x),
  40096. this.y = Math.max(this.y, e.y),
  40097. this
  40098. },
  40099. clamp: function(e, t) {
  40100. return this.x = Math.max(e.x, Math.min(t.x, this.x)),
  40101. this.y = Math.max(e.y, Math.min(t.y, this.y)),
  40102. this
  40103. },
  40104. clampScalar: function() {
  40105. var e, t;
  40106. return function(i, r) {
  40107. return void 0 === e && (e = new n.Vector2,
  40108. t = new n.Vector2),
  40109. e.set(i, i),
  40110. t.set(r, r),
  40111. this.clamp(e, t)
  40112. }
  40113. }(),
  40114. clampLength: function(e, t) {
  40115. var i = this.length();
  40116. return this.multiplyScalar(Math.max(e, Math.min(t, i)) / i),
  40117. this
  40118. },
  40119. floor: function() {
  40120. return this.x = Math.floor(this.x),
  40121. this.y = Math.floor(this.y),
  40122. this
  40123. },
  40124. ceil: function() {
  40125. return this.x = Math.ceil(this.x),
  40126. this.y = Math.ceil(this.y),
  40127. this
  40128. },
  40129. round: function() {
  40130. return this.x = Math.round(this.x),
  40131. this.y = Math.round(this.y),
  40132. this
  40133. },
  40134. roundToZero: function() {
  40135. return this.x = this.x < 0 ? Math.ceil(this.x) : Math.floor(this.x),
  40136. this.y = this.y < 0 ? Math.ceil(this.y) : Math.floor(this.y),
  40137. this
  40138. },
  40139. negate: function() {
  40140. return this.x = -this.x,
  40141. this.y = -this.y,
  40142. this
  40143. },
  40144. dot: function(e) {
  40145. return this.x * e.x + this.y * e.y
  40146. },
  40147. lengthSq: function() {
  40148. return this.x * this.x + this.y * this.y
  40149. },
  40150. length: function() {
  40151. return Math.sqrt(this.x * this.x + this.y * this.y)
  40152. },
  40153. lengthManhattan: function() {
  40154. return Math.abs(this.x) + Math.abs(this.y)
  40155. },
  40156. normalize: function() {
  40157. return this.divideScalar(this.length())
  40158. },
  40159. angle: function() {
  40160. var e = Math.atan2(this.y, this.x);
  40161. return e < 0 && (e += 2 * Math.PI),
  40162. e
  40163. },
  40164. distanceTo: function(e) {
  40165. return Math.sqrt(this.distanceToSquared(e))
  40166. },
  40167. distanceToSquared: function(e) {
  40168. var t = this.x - e.x
  40169. , i = this.y - e.y;
  40170. return t * t + i * i
  40171. },
  40172. setLength: function(e) {
  40173. return this.multiplyScalar(e / this.length())
  40174. },
  40175. lerp: function(e, t) {
  40176. return this.x += (e.x - this.x) * t,
  40177. this.y += (e.y - this.y) * t,
  40178. this
  40179. },
  40180. lerpVectors: function(e, t, i) {
  40181. return this.subVectors(t, e).multiplyScalar(i).add(e),
  40182. this
  40183. },
  40184. equals: function(e) {
  40185. return e.x === this.x && e.y === this.y
  40186. },
  40187. fromArray: function(e, t) {
  40188. return void 0 === t && (t = 0),
  40189. this.x = e[t],
  40190. this.y = e[t + 1],
  40191. this
  40192. },
  40193. toArray: function(e, t) {
  40194. return void 0 === e && (e = []),
  40195. void 0 === t && (t = 0),
  40196. e[t] = this.x,
  40197. e[t + 1] = this.y,
  40198. e
  40199. },
  40200. fromAttribute: function(e, t, i) {
  40201. return void 0 === i && (i = 0),
  40202. t = t * e.itemSize + i,
  40203. this.x = e.array[t],
  40204. this.y = e.array[t + 1],
  40205. this
  40206. },
  40207. rotateAround: function(e, t) {
  40208. var i = Math.cos(t)
  40209. , n = Math.sin(t)
  40210. , r = this.x - e.x
  40211. , o = this.y - e.y;
  40212. return this.x = r * i - o * n + e.x,
  40213. this.y = r * n + o * i + e.y,
  40214. this
  40215. }
  40216. },
  40217. n.Vector3 = function(e, t, i) {
  40218. this.x = e || 0,
  40219. this.y = t || 0,
  40220. this.z = i || 0
  40221. }
  40222. ,
  40223. n.Vector3.prototype = {
  40224. constructor: n.Vector3,
  40225. set: function(e, t, i) {
  40226. return this.x = e,
  40227. this.y = t,
  40228. this.z = i,
  40229. this
  40230. },
  40231. setScalar: function(e) {
  40232. return this.x = e,
  40233. this.y = e,
  40234. this.z = e,
  40235. this
  40236. },
  40237. setX: function(e) {
  40238. return this.x = e,
  40239. this
  40240. },
  40241. setY: function(e) {
  40242. return this.y = e,
  40243. this
  40244. },
  40245. setZ: function(e) {
  40246. return this.z = e,
  40247. this
  40248. },
  40249. setComponent: function(e, t) {
  40250. switch (e) {
  40251. case 0:
  40252. this.x = t;
  40253. break;
  40254. case 1:
  40255. this.y = t;
  40256. break;
  40257. case 2:
  40258. this.z = t;
  40259. break;
  40260. default:
  40261. throw new Error("index is out of range: " + e)
  40262. }
  40263. },
  40264. getComponent: function(e) {
  40265. switch (e) {
  40266. case 0:
  40267. return this.x;
  40268. case 1:
  40269. return this.y;
  40270. case 2:
  40271. return this.z;
  40272. default:
  40273. throw new Error("index is out of range: " + e)
  40274. }
  40275. },
  40276. clone: function() {
  40277. return new this.constructor(this.x,this.y,this.z)
  40278. },
  40279. copy: function(e) {
  40280. return this.x = e.x,
  40281. this.y = e.y,
  40282. this.z = e.z,
  40283. this
  40284. },
  40285. add: function(e, t) {
  40286. return void 0 !== t ? (console.warn("THREE.Vector3: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),
  40287. this.addVectors(e, t)) : (this.x += e.x,
  40288. this.y += e.y,
  40289. this.z += e.z,
  40290. this)
  40291. },
  40292. addScalar: function(e) {
  40293. return this.x += e,
  40294. this.y += e,
  40295. this.z += e,
  40296. this
  40297. },
  40298. addVectors: function(e, t) {
  40299. return this.x = e.x + t.x,
  40300. this.y = e.y + t.y,
  40301. this.z = e.z + t.z,
  40302. this
  40303. },
  40304. addScaledVector: function(e, t) {
  40305. return this.x += e.x * t,
  40306. this.y += e.y * t,
  40307. this.z += e.z * t,
  40308. this
  40309. },
  40310. sub: function(e, t) {
  40311. return void 0 !== t ? (console.warn("THREE.Vector3: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),
  40312. this.subVectors(e, t)) : (this.x -= e.x,
  40313. this.y -= e.y,
  40314. this.z -= e.z,
  40315. this)
  40316. },
  40317. subScalar: function(e) {
  40318. return this.x -= e,
  40319. this.y -= e,
  40320. this.z -= e,
  40321. this
  40322. },
  40323. subVectors: function(e, t) {
  40324. return this.x = e.x - t.x,
  40325. this.y = e.y - t.y,
  40326. this.z = e.z - t.z,
  40327. this
  40328. },
  40329. multiply: function(e, t) {
  40330. return void 0 !== t ? (console.warn("THREE.Vector3: .multiply() now only accepts one argument. Use .multiplyVectors( a, b ) instead."),
  40331. this.multiplyVectors(e, t)) : (this.x *= e.x,
  40332. this.y *= e.y,
  40333. this.z *= e.z,
  40334. this)
  40335. },
  40336. multiplyScalar: function(e) {
  40337. return isFinite(e) ? (this.x *= e,
  40338. this.y *= e,
  40339. this.z *= e) : (this.x = 0,
  40340. this.y = 0,
  40341. this.z = 0),
  40342. this
  40343. },
  40344. multiplyVectors: function(e, t) {
  40345. return this.x = e.x * t.x,
  40346. this.y = e.y * t.y,
  40347. this.z = e.z * t.z,
  40348. this
  40349. },
  40350. applyEuler: function() {
  40351. var e;
  40352. return function(t) {
  40353. return t instanceof n.Euler == !1 && console.error("THREE.Vector3: .applyEuler() now expects an Euler rotation rather than a Vector3 and order."),
  40354. void 0 === e && (e = new n.Quaternion),
  40355. this.applyQuaternion(e.setFromEuler(t)),
  40356. this
  40357. }
  40358. }(),
  40359. applyAxisAngle: function() {
  40360. var e;
  40361. return function(t, i) {
  40362. return void 0 === e && (e = new n.Quaternion),
  40363. this.applyQuaternion(e.setFromAxisAngle(t, i)),
  40364. this
  40365. }
  40366. }(),
  40367. applyMatrix3: function(e) {
  40368. var t = this.x
  40369. , i = this.y
  40370. , n = this.z
  40371. , r = e.elements;
  40372. return this.x = r[0] * t + r[3] * i + r[6] * n,
  40373. this.y = r[1] * t + r[4] * i + r[7] * n,
  40374. this.z = r[2] * t + r[5] * i + r[8] * n,
  40375. this
  40376. },
  40377. applyMatrix4: function(e) {
  40378. var t = this.x
  40379. , i = this.y
  40380. , n = this.z
  40381. , r = e.elements;
  40382. return this.x = r[0] * t + r[4] * i + r[8] * n + r[12],
  40383. this.y = r[1] * t + r[5] * i + r[9] * n + r[13],
  40384. this.z = r[2] * t + r[6] * i + r[10] * n + r[14],
  40385. this
  40386. },
  40387. applyProjection: function(e) {
  40388. var t = this.x
  40389. , i = this.y
  40390. , n = this.z
  40391. , r = e.elements
  40392. , o = 1 / (r[3] * t + r[7] * i + r[11] * n + r[15]);
  40393. return this.x = (r[0] * t + r[4] * i + r[8] * n + r[12]) * o,
  40394. this.y = (r[1] * t + r[5] * i + r[9] * n + r[13]) * o,
  40395. this.z = (r[2] * t + r[6] * i + r[10] * n + r[14]) * o,
  40396. this
  40397. },
  40398. applyQuaternion: function(e) {
  40399. var t = this.x
  40400. , i = this.y
  40401. , n = this.z
  40402. , r = e.x
  40403. , o = e.y
  40404. , a = e.z
  40405. , s = e.w
  40406. , l = s * t + o * n - a * i
  40407. , c = s * i + a * t - r * n
  40408. , h = s * n + r * i - o * t
  40409. , u = -r * t - o * i - a * n;
  40410. return this.x = l * s + u * -r + c * -a - h * -o,
  40411. this.y = c * s + u * -o + h * -r - l * -a,
  40412. this.z = h * s + u * -a + l * -o - c * -r,
  40413. this
  40414. },
  40415. project: function() {
  40416. var e;
  40417. return function(t) {
  40418. return void 0 === e && (e = new n.Matrix4),
  40419. e.multiplyMatrices(t.projectionMatrix, e.getInverse(t.matrixWorld)),
  40420. this.applyProjection(e)
  40421. }
  40422. }(),
  40423. unproject: function() {
  40424. var e;
  40425. return function(t) {
  40426. return void 0 === e && (e = new n.Matrix4),
  40427. e.multiplyMatrices(t.matrixWorld, e.getInverse(t.projectionMatrix)),
  40428. this.applyProjection(e)
  40429. }
  40430. }(),
  40431. transformDirection: function(e) {
  40432. var t = this.x
  40433. , i = this.y
  40434. , n = this.z
  40435. , r = e.elements;
  40436. return this.x = r[0] * t + r[4] * i + r[8] * n,
  40437. this.y = r[1] * t + r[5] * i + r[9] * n,
  40438. this.z = r[2] * t + r[6] * i + r[10] * n,
  40439. this.normalize(),
  40440. this
  40441. },
  40442. divide: function(e) {
  40443. return this.x /= e.x,
  40444. this.y /= e.y,
  40445. this.z /= e.z,
  40446. this
  40447. },
  40448. divideScalar: function(e) {
  40449. return this.multiplyScalar(1 / e)
  40450. },
  40451. min: function(e) {
  40452. return this.x = Math.min(this.x, e.x),
  40453. this.y = Math.min(this.y, e.y),
  40454. this.z = Math.min(this.z, e.z),
  40455. this
  40456. },
  40457. max: function(e) {
  40458. return this.x = Math.max(this.x, e.x),
  40459. this.y = Math.max(this.y, e.y),
  40460. this.z = Math.max(this.z, e.z),
  40461. this
  40462. },
  40463. clamp: function(e, t) {
  40464. return this.x = Math.max(e.x, Math.min(t.x, this.x)),
  40465. this.y = Math.max(e.y, Math.min(t.y, this.y)),
  40466. this.z = Math.max(e.z, Math.min(t.z, this.z)),
  40467. this
  40468. },
  40469. clampScalar: function() {
  40470. var e, t;
  40471. return function(i, r) {
  40472. return void 0 === e && (e = new n.Vector3,
  40473. t = new n.Vector3),
  40474. e.set(i, i, i),
  40475. t.set(r, r, r),
  40476. this.clamp(e, t)
  40477. }
  40478. }(),
  40479. clampLength: function(e, t) {
  40480. var i = this.length();
  40481. return this.multiplyScalar(Math.max(e, Math.min(t, i)) / i),
  40482. this
  40483. },
  40484. floor: function() {
  40485. return this.x = Math.floor(this.x),
  40486. this.y = Math.floor(this.y),
  40487. this.z = Math.floor(this.z),
  40488. this
  40489. },
  40490. ceil: function() {
  40491. return this.x = Math.ceil(this.x),
  40492. this.y = Math.ceil(this.y),
  40493. this.z = Math.ceil(this.z),
  40494. this
  40495. },
  40496. round: function() {
  40497. return this.x = Math.round(this.x),
  40498. this.y = Math.round(this.y),
  40499. this.z = Math.round(this.z),
  40500. this
  40501. },
  40502. roundToZero: function() {
  40503. return this.x = this.x < 0 ? Math.ceil(this.x) : Math.floor(this.x),
  40504. this.y = this.y < 0 ? Math.ceil(this.y) : Math.floor(this.y),
  40505. this.z = this.z < 0 ? Math.ceil(this.z) : Math.floor(this.z),
  40506. this
  40507. },
  40508. negate: function() {
  40509. return this.x = -this.x,
  40510. this.y = -this.y,
  40511. this.z = -this.z,
  40512. this
  40513. },
  40514. dot: function(e) {
  40515. return this.x * e.x + this.y * e.y + this.z * e.z
  40516. },
  40517. lengthSq: function() {
  40518. return this.x * this.x + this.y * this.y + this.z * this.z
  40519. },
  40520. length: function() {
  40521. return Math.sqrt(this.x * this.x + this.y * this.y + this.z * this.z)
  40522. },
  40523. lengthManhattan: function() {
  40524. return Math.abs(this.x) + Math.abs(this.y) + Math.abs(this.z)
  40525. },
  40526. normalize: function() {
  40527. return this.divideScalar(this.length())
  40528. },
  40529. setLength: function(e) {
  40530. return this.multiplyScalar(e / this.length())
  40531. },
  40532. lerp: function(e, t) {
  40533. return this.x += (e.x - this.x) * t,
  40534. this.y += (e.y - this.y) * t,
  40535. this.z += (e.z - this.z) * t,
  40536. this
  40537. },
  40538. lerpVectors: function(e, t, i) {
  40539. return this.subVectors(t, e).multiplyScalar(i).add(e),
  40540. this
  40541. },
  40542. cross: function(e, t) {
  40543. if (void 0 !== t)
  40544. return console.warn("THREE.Vector3: .cross() now only accepts one argument. Use .crossVectors( a, b ) instead."),
  40545. this.crossVectors(e, t);
  40546. var i = this.x
  40547. , n = this.y
  40548. , r = this.z;
  40549. return this.x = n * e.z - r * e.y,
  40550. this.y = r * e.x - i * e.z,
  40551. this.z = i * e.y - n * e.x,
  40552. this
  40553. },
  40554. crossVectors: function(e, t) {
  40555. var i = e.x
  40556. , n = e.y
  40557. , r = e.z
  40558. , o = t.x
  40559. , a = t.y
  40560. , s = t.z;
  40561. return this.x = n * s - r * a,
  40562. this.y = r * o - i * s,
  40563. this.z = i * a - n * o,
  40564. this
  40565. },
  40566. projectOnVector: function() {
  40567. var e, t;
  40568. return function(i) {
  40569. return void 0 === e && (e = new n.Vector3),
  40570. e.copy(i).normalize(),
  40571. t = this.dot(e),
  40572. this.copy(e).multiplyScalar(t)
  40573. }
  40574. }(),
  40575. projectOnPlane: function() {
  40576. var e;
  40577. return function(t) {
  40578. return void 0 === e && (e = new n.Vector3),
  40579. e.copy(this).projectOnVector(t),
  40580. this.sub(e)
  40581. }
  40582. }(),
  40583. reflect: function() {
  40584. var e;
  40585. return function(t) {
  40586. return void 0 === e && (e = new n.Vector3),
  40587. this.sub(e.copy(t).multiplyScalar(2 * this.dot(t)))
  40588. }
  40589. }(),
  40590. angleTo: function(e) {
  40591. var t = this.dot(e) / Math.sqrt(this.lengthSq() * e.lengthSq());
  40592. return Math.acos(n.Math.clamp(t, -1, 1))
  40593. },
  40594. distanceTo: function(e) {
  40595. return Math.sqrt(this.distanceToSquared(e))
  40596. },
  40597. distanceToSquared: function(e) {
  40598. var t = this.x - e.x
  40599. , i = this.y - e.y
  40600. , n = this.z - e.z;
  40601. return t * t + i * i + n * n
  40602. },
  40603. setFromSpherical: function(e) {
  40604. var t = Math.sin(e.phi) * e.radius;
  40605. return this.x = t * Math.sin(e.theta),
  40606. this.y = Math.cos(e.phi) * e.radius,
  40607. this.z = t * Math.cos(e.theta),
  40608. this
  40609. },
  40610. setFromMatrixPosition: function(e) {
  40611. return this.setFromMatrixColumn(e, 3)
  40612. },
  40613. setFromMatrixScale: function(e) {
  40614. var t = this.setFromMatrixColumn(e, 0).length()
  40615. , i = this.setFromMatrixColumn(e, 1).length()
  40616. , n = this.setFromMatrixColumn(e, 2).length();
  40617. return this.x = t,
  40618. this.y = i,
  40619. this.z = n,
  40620. this
  40621. },
  40622. setFromMatrixColumn: function(e, t) {
  40623. return "number" == typeof e && (console.warn("THREE.Vector3: setFromMatrixColumn now expects ( matrix, index )."),
  40624. e = arguments[1],
  40625. t = arguments[0]),
  40626. this.fromArray(e.elements, 4 * t)
  40627. },
  40628. equals: function(e) {
  40629. return e.x === this.x && e.y === this.y && e.z === this.z
  40630. },
  40631. fromArray: function(e, t) {
  40632. return void 0 === t && (t = 0),
  40633. this.x = e[t],
  40634. this.y = e[t + 1],
  40635. this.z = e[t + 2],
  40636. this
  40637. },
  40638. toArray: function(e, t) {
  40639. return void 0 === e && (e = []),
  40640. void 0 === t && (t = 0),
  40641. e[t] = this.x,
  40642. e[t + 1] = this.y,
  40643. e[t + 2] = this.z,
  40644. e
  40645. },
  40646. fromAttribute: function(e, t, i) {
  40647. return void 0 === i && (i = 0),
  40648. t = t * e.itemSize + i,
  40649. this.x = e.array[t],
  40650. this.y = e.array[t + 1],
  40651. this.z = e.array[t + 2],
  40652. this
  40653. }
  40654. },
  40655. n.Vector4 = function(e, t, i, n) {
  40656. this.x = e || 0,
  40657. this.y = t || 0,
  40658. this.z = i || 0,
  40659. this.w = void 0 !== n ? n : 1
  40660. }
  40661. ,
  40662. n.Vector4.prototype = {
  40663. constructor: n.Vector4,
  40664. set: function(e, t, i, n) {
  40665. return this.x = e,
  40666. this.y = t,
  40667. this.z = i,
  40668. this.w = n,
  40669. this
  40670. },
  40671. setScalar: function(e) {
  40672. return this.x = e,
  40673. this.y = e,
  40674. this.z = e,
  40675. this.w = e,
  40676. this
  40677. },
  40678. setX: function(e) {
  40679. return this.x = e,
  40680. this
  40681. },
  40682. setY: function(e) {
  40683. return this.y = e,
  40684. this
  40685. },
  40686. setZ: function(e) {
  40687. return this.z = e,
  40688. this
  40689. },
  40690. setW: function(e) {
  40691. return this.w = e,
  40692. this
  40693. },
  40694. setComponent: function(e, t) {
  40695. switch (e) {
  40696. case 0:
  40697. this.x = t;
  40698. break;
  40699. case 1:
  40700. this.y = t;
  40701. break;
  40702. case 2:
  40703. this.z = t;
  40704. break;
  40705. case 3:
  40706. this.w = t;
  40707. break;
  40708. default:
  40709. throw new Error("index is out of range: " + e)
  40710. }
  40711. },
  40712. getComponent: function(e) {
  40713. switch (e) {
  40714. case 0:
  40715. return this.x;
  40716. case 1:
  40717. return this.y;
  40718. case 2:
  40719. return this.z;
  40720. case 3:
  40721. return this.w;
  40722. default:
  40723. throw new Error("index is out of range: " + e)
  40724. }
  40725. },
  40726. clone: function() {
  40727. return new this.constructor(this.x,this.y,this.z,this.w)
  40728. },
  40729. copy: function(e) {
  40730. return this.x = e.x,
  40731. this.y = e.y,
  40732. this.z = e.z,
  40733. this.w = void 0 !== e.w ? e.w : 1,
  40734. this
  40735. },
  40736. add: function(e, t) {
  40737. return void 0 !== t ? (console.warn("THREE.Vector4: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),
  40738. this.addVectors(e, t)) : (this.x += e.x,
  40739. this.y += e.y,
  40740. this.z += e.z,
  40741. this.w += e.w,
  40742. this)
  40743. },
  40744. addScalar: function(e) {
  40745. return this.x += e,
  40746. this.y += e,
  40747. this.z += e,
  40748. this.w += e,
  40749. this
  40750. },
  40751. addVectors: function(e, t) {
  40752. return this.x = e.x + t.x,
  40753. this.y = e.y + t.y,
  40754. this.z = e.z + t.z,
  40755. this.w = e.w + t.w,
  40756. this
  40757. },
  40758. addScaledVector: function(e, t) {
  40759. return this.x += e.x * t,
  40760. this.y += e.y * t,
  40761. this.z += e.z * t,
  40762. this.w += e.w * t,
  40763. this
  40764. },
  40765. sub: function(e, t) {
  40766. return void 0 !== t ? (console.warn("THREE.Vector4: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),
  40767. this.subVectors(e, t)) : (this.x -= e.x,
  40768. this.y -= e.y,
  40769. this.z -= e.z,
  40770. this.w -= e.w,
  40771. this)
  40772. },
  40773. subScalar: function(e) {
  40774. return this.x -= e,
  40775. this.y -= e,
  40776. this.z -= e,
  40777. this.w -= e,
  40778. this
  40779. },
  40780. subVectors: function(e, t) {
  40781. return this.x = e.x - t.x,
  40782. this.y = e.y - t.y,
  40783. this.z = e.z - t.z,
  40784. this.w = e.w - t.w,
  40785. this
  40786. },
  40787. multiplyScalar: function(e) {
  40788. return isFinite(e) ? (this.x *= e,
  40789. this.y *= e,
  40790. this.z *= e,
  40791. this.w *= e) : (this.x = 0,
  40792. this.y = 0,
  40793. this.z = 0,
  40794. this.w = 0),
  40795. this
  40796. },
  40797. applyMatrix4: function(e) {
  40798. var t = this.x
  40799. , i = this.y
  40800. , n = this.z
  40801. , r = this.w
  40802. , o = e.elements;
  40803. return this.x = o[0] * t + o[4] * i + o[8] * n + o[12] * r,
  40804. this.y = o[1] * t + o[5] * i + o[9] * n + o[13] * r,
  40805. this.z = o[2] * t + o[6] * i + o[10] * n + o[14] * r,
  40806. this.w = o[3] * t + o[7] * i + o[11] * n + o[15] * r,
  40807. this
  40808. },
  40809. divideScalar: function(e) {
  40810. return this.multiplyScalar(1 / e)
  40811. },
  40812. setAxisAngleFromQuaternion: function(e) {
  40813. this.w = 2 * Math.acos(e.w);
  40814. var t = Math.sqrt(1 - e.w * e.w);
  40815. return t < 1e-4 ? (this.x = 1,
  40816. this.y = 0,
  40817. this.z = 0) : (this.x = e.x / t,
  40818. this.y = e.y / t,
  40819. this.z = e.z / t),
  40820. this
  40821. },
  40822. setAxisAngleFromRotationMatrix: function(e) {
  40823. 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];
  40824. if (Math.abs(c - u) < o && Math.abs(h - f) < o && Math.abs(p - g) < o) {
  40825. if (Math.abs(c + u) < a && Math.abs(h + f) < a && Math.abs(p + g) < a && Math.abs(l + d + m - 3) < a)
  40826. return this.set(1, 0, 0, 0),
  40827. this;
  40828. t = Math.PI;
  40829. var v = (l + 1) / 2
  40830. , A = (d + 1) / 2
  40831. , y = (m + 1) / 2
  40832. , C = (c + u) / 4
  40833. , I = (h + f) / 4
  40834. , E = (p + g) / 4;
  40835. return v > A && v > y ? v < o ? (i = 0,
  40836. n = .707106781,
  40837. r = .707106781) : (i = Math.sqrt(v),
  40838. n = C / i,
  40839. r = I / i) : A > y ? A < o ? (i = .707106781,
  40840. n = 0,
  40841. r = .707106781) : (n = Math.sqrt(A),
  40842. i = C / n,
  40843. r = E / n) : y < o ? (i = .707106781,
  40844. n = .707106781,
  40845. r = 0) : (r = Math.sqrt(y),
  40846. i = I / r,
  40847. n = E / r),
  40848. this.set(i, n, r, t),
  40849. this
  40850. }
  40851. var b = Math.sqrt((g - p) * (g - p) + (h - f) * (h - f) + (u - c) * (u - c));
  40852. return Math.abs(b) < .001 && (b = 1),
  40853. this.x = (g - p) / b,
  40854. this.y = (h - f) / b,
  40855. this.z = (u - c) / b,
  40856. this.w = Math.acos((l + d + m - 1) / 2),
  40857. this
  40858. },
  40859. min: function(e) {
  40860. return this.x = Math.min(this.x, e.x),
  40861. this.y = Math.min(this.y, e.y),
  40862. this.z = Math.min(this.z, e.z),
  40863. this.w = Math.min(this.w, e.w),
  40864. this
  40865. },
  40866. max: function(e) {
  40867. return this.x = Math.max(this.x, e.x),
  40868. this.y = Math.max(this.y, e.y),
  40869. this.z = Math.max(this.z, e.z),
  40870. this.w = Math.max(this.w, e.w),
  40871. this
  40872. },
  40873. clamp: function(e, t) {
  40874. return this.x = Math.max(e.x, Math.min(t.x, this.x)),
  40875. this.y = Math.max(e.y, Math.min(t.y, this.y)),
  40876. this.z = Math.max(e.z, Math.min(t.z, this.z)),
  40877. this.w = Math.max(e.w, Math.min(t.w, this.w)),
  40878. this
  40879. },
  40880. clampScalar: function() {
  40881. var e, t;
  40882. return function(i, r) {
  40883. return void 0 === e && (e = new n.Vector4,
  40884. t = new n.Vector4),
  40885. e.set(i, i, i, i),
  40886. t.set(r, r, r, r),
  40887. this.clamp(e, t)
  40888. }
  40889. }(),
  40890. floor: function() {
  40891. return this.x = Math.floor(this.x),
  40892. this.y = Math.floor(this.y),
  40893. this.z = Math.floor(this.z),
  40894. this.w = Math.floor(this.w),
  40895. this
  40896. },
  40897. ceil: function() {
  40898. return this.x = Math.ceil(this.x),
  40899. this.y = Math.ceil(this.y),
  40900. this.z = Math.ceil(this.z),
  40901. this.w = Math.ceil(this.w),
  40902. this
  40903. },
  40904. round: function() {
  40905. return this.x = Math.round(this.x),
  40906. this.y = Math.round(this.y),
  40907. this.z = Math.round(this.z),
  40908. this.w = Math.round(this.w),
  40909. this
  40910. },
  40911. roundToZero: function() {
  40912. return this.x = this.x < 0 ? Math.ceil(this.x) : Math.floor(this.x),
  40913. this.y = this.y < 0 ? Math.ceil(this.y) : Math.floor(this.y),
  40914. this.z = this.z < 0 ? Math.ceil(this.z) : Math.floor(this.z),
  40915. this.w = this.w < 0 ? Math.ceil(this.w) : Math.floor(this.w),
  40916. this
  40917. },
  40918. negate: function() {
  40919. return this.x = -this.x,
  40920. this.y = -this.y,
  40921. this.z = -this.z,
  40922. this.w = -this.w,
  40923. this
  40924. },
  40925. dot: function(e) {
  40926. return this.x * e.x + this.y * e.y + this.z * e.z + this.w * e.w
  40927. },
  40928. lengthSq: function() {
  40929. return this.x * this.x + this.y * this.y + this.z * this.z + this.w * this.w
  40930. },
  40931. length: function() {
  40932. return Math.sqrt(this.x * this.x + this.y * this.y + this.z * this.z + this.w * this.w)
  40933. },
  40934. lengthManhattan: function() {
  40935. return Math.abs(this.x) + Math.abs(this.y) + Math.abs(this.z) + Math.abs(this.w)
  40936. },
  40937. normalize: function() {
  40938. return this.divideScalar(this.length())
  40939. },
  40940. setLength: function(e) {
  40941. return this.multiplyScalar(e / this.length())
  40942. },
  40943. lerp: function(e, t) {
  40944. return this.x += (e.x - this.x) * t,
  40945. this.y += (e.y - this.y) * t,
  40946. this.z += (e.z - this.z) * t,
  40947. this.w += (e.w - this.w) * t,
  40948. this
  40949. },
  40950. lerpVectors: function(e, t, i) {
  40951. return this.subVectors(t, e).multiplyScalar(i).add(e),
  40952. this
  40953. },
  40954. equals: function(e) {
  40955. return e.x === this.x && e.y === this.y && e.z === this.z && e.w === this.w
  40956. },
  40957. fromArray: function(e, t) {
  40958. return void 0 === t && (t = 0),
  40959. this.x = e[t],
  40960. this.y = e[t + 1],
  40961. this.z = e[t + 2],
  40962. this.w = e[t + 3],
  40963. this
  40964. },
  40965. toArray: function(e, t) {
  40966. return void 0 === e && (e = []),
  40967. void 0 === t && (t = 0),
  40968. e[t] = this.x,
  40969. e[t + 1] = this.y,
  40970. e[t + 2] = this.z,
  40971. e[t + 3] = this.w,
  40972. e
  40973. },
  40974. fromAttribute: function(e, t, i) {
  40975. return void 0 === i && (i = 0),
  40976. t = t * e.itemSize + i,
  40977. this.x = e.array[t],
  40978. this.y = e.array[t + 1],
  40979. this.z = e.array[t + 2],
  40980. this.w = e.array[t + 3],
  40981. this
  40982. }
  40983. },
  40984. n.Euler = function(e, t, i, r) {
  40985. this._x = e || 0,
  40986. this._y = t || 0,
  40987. this._z = i || 0,
  40988. this._order = r || n.Euler.DefaultOrder
  40989. }
  40990. ,
  40991. n.Euler.RotationOrders = ["XYZ", "YZX", "ZXY", "XZY", "YXZ", "ZYX"],
  40992. n.Euler.DefaultOrder = "XYZ",
  40993. n.Euler.prototype = {
  40994. constructor: n.Euler,
  40995. get x() {
  40996. return this._x
  40997. },
  40998. set x(e) {
  40999. this._x = e,
  41000. this.onChangeCallback()
  41001. },
  41002. get y() {
  41003. return this._y
  41004. },
  41005. set y(e) {
  41006. this._y = e,
  41007. this.onChangeCallback()
  41008. },
  41009. get z() {
  41010. return this._z
  41011. },
  41012. set z(e) {
  41013. this._z = e,
  41014. this.onChangeCallback()
  41015. },
  41016. get order() {
  41017. return this._order
  41018. },
  41019. set order(e) {
  41020. this._order = e,
  41021. this.onChangeCallback()
  41022. },
  41023. set: function(e, t, i, n) {
  41024. return this._x = e,
  41025. this._y = t,
  41026. this._z = i,
  41027. this._order = n || this._order,
  41028. this.onChangeCallback(),
  41029. this
  41030. },
  41031. clone: function() {
  41032. return new this.constructor(this._x,this._y,this._z,this._order)
  41033. },
  41034. copy: function(e) {
  41035. return this._x = e._x,
  41036. this._y = e._y,
  41037. this._z = e._z,
  41038. this._order = e._order,
  41039. this.onChangeCallback(),
  41040. this
  41041. },
  41042. setFromRotationMatrix: function(e, t, i) {
  41043. var r = n.Math.clamp
  41044. , o = e.elements
  41045. , a = o[0]
  41046. , s = o[4]
  41047. , l = o[8]
  41048. , c = o[1]
  41049. , h = o[5]
  41050. , u = o[9]
  41051. , d = o[2]
  41052. , p = o[6]
  41053. , f = o[10];
  41054. return t = t || this._order,
  41055. "XYZ" === t ? (this._y = Math.asin(r(l, -1, 1)),
  41056. Math.abs(l) < .99999 ? (this._x = Math.atan2(-u, f),
  41057. this._z = Math.atan2(-s, a)) : (this._x = Math.atan2(p, h),
  41058. this._z = 0)) : "YXZ" === t ? (this._x = Math.asin(-r(u, -1, 1)),
  41059. Math.abs(u) < .99999 ? (this._y = Math.atan2(l, f),
  41060. this._z = Math.atan2(c, h)) : (this._y = Math.atan2(-d, a),
  41061. this._z = 0)) : "ZXY" === t ? (this._x = Math.asin(r(p, -1, 1)),
  41062. Math.abs(p) < .99999 ? (this._y = Math.atan2(-d, f),
  41063. this._z = Math.atan2(-s, h)) : (this._y = 0,
  41064. this._z = Math.atan2(c, a))) : "ZYX" === t ? (this._y = Math.asin(-r(d, -1, 1)),
  41065. Math.abs(d) < .99999 ? (this._x = Math.atan2(p, f),
  41066. this._z = Math.atan2(c, a)) : (this._x = 0,
  41067. this._z = Math.atan2(-s, h))) : "YZX" === t ? (this._z = Math.asin(r(c, -1, 1)),
  41068. Math.abs(c) < .99999 ? (this._x = Math.atan2(-u, h),
  41069. this._y = Math.atan2(-d, a)) : (this._x = 0,
  41070. this._y = Math.atan2(l, f))) : "XZY" === t ? (this._z = Math.asin(-r(s, -1, 1)),
  41071. Math.abs(s) < .99999 ? (this._x = Math.atan2(p, h),
  41072. this._y = Math.atan2(l, a)) : (this._x = Math.atan2(-u, f),
  41073. this._y = 0)) : console.warn("THREE.Euler: .setFromRotationMatrix() given unsupported order: " + t),
  41074. this._order = t,
  41075. i !== !1 && this.onChangeCallback(),
  41076. this
  41077. },
  41078. setFromQuaternion: function() {
  41079. var e;
  41080. return function(t, i, r) {
  41081. return void 0 === e && (e = new n.Matrix4),
  41082. e.makeRotationFromQuaternion(t),
  41083. this.setFromRotationMatrix(e, i, r),
  41084. this
  41085. }
  41086. }(),
  41087. setFromVector3: function(e, t) {
  41088. return this.set(e.x, e.y, e.z, t || this._order)
  41089. },
  41090. reorder: function() {
  41091. var e = new n.Quaternion;
  41092. return function(t) {
  41093. e.setFromEuler(this),
  41094. this.setFromQuaternion(e, t)
  41095. }
  41096. }(),
  41097. equals: function(e) {
  41098. return e._x === this._x && e._y === this._y && e._z === this._z && e._order === this._order
  41099. },
  41100. fromArray: function(e) {
  41101. return this._x = e[0],
  41102. this._y = e[1],
  41103. this._z = e[2],
  41104. void 0 !== e[3] && (this._order = e[3]),
  41105. this.onChangeCallback(),
  41106. this
  41107. },
  41108. toArray: function(e, t) {
  41109. return void 0 === e && (e = []),
  41110. void 0 === t && (t = 0),
  41111. e[t] = this._x,
  41112. e[t + 1] = this._y,
  41113. e[t + 2] = this._z,
  41114. e[t + 3] = this._order,
  41115. e
  41116. },
  41117. toVector3: function(e) {
  41118. return e ? e.set(this._x, this._y, this._z) : new n.Vector3(this._x,this._y,this._z)
  41119. },
  41120. onChange: function(e) {
  41121. return this.onChangeCallback = e,
  41122. this
  41123. },
  41124. onChangeCallback: function() {}
  41125. },
  41126. n.Line3 = function(e, t) {
  41127. this.start = void 0 !== e ? e : new n.Vector3,
  41128. this.end = void 0 !== t ? t : new n.Vector3
  41129. }
  41130. ,
  41131. n.Line3.prototype = {
  41132. constructor: n.Line3,
  41133. set: function(e, t) {
  41134. return this.start.copy(e),
  41135. this.end.copy(t),
  41136. this
  41137. },
  41138. clone: function() {
  41139. return (new this.constructor).copy(this)
  41140. },
  41141. copy: function(e) {
  41142. return this.start.copy(e.start),
  41143. this.end.copy(e.end),
  41144. this
  41145. },
  41146. center: function(e) {
  41147. var t = e || new n.Vector3;
  41148. return t.addVectors(this.start, this.end).multiplyScalar(.5)
  41149. },
  41150. delta: function(e) {
  41151. var t = e || new n.Vector3;
  41152. return t.subVectors(this.end, this.start)
  41153. },
  41154. distanceSq: function() {
  41155. return this.start.distanceToSquared(this.end)
  41156. },
  41157. distance: function() {
  41158. return this.start.distanceTo(this.end)
  41159. },
  41160. at: function(e, t) {
  41161. var i = t || new n.Vector3;
  41162. return this.delta(i).multiplyScalar(e).add(this.start)
  41163. },
  41164. closestPointToPointParameter: function() {
  41165. var e = new n.Vector3
  41166. , t = new n.Vector3;
  41167. return function(i, r) {
  41168. e.subVectors(i, this.start),
  41169. t.subVectors(this.end, this.start);
  41170. var o = t.dot(t)
  41171. , a = t.dot(e)
  41172. , s = a / o;
  41173. return r && (s = n.Math.clamp(s, 0, 1)),
  41174. s
  41175. }
  41176. }(),
  41177. closestPointToPoint: function(e, t, i) {
  41178. var r = this.closestPointToPointParameter(e, t)
  41179. , o = i || new n.Vector3;
  41180. return this.delta(o).multiplyScalar(r).add(this.start)
  41181. },
  41182. applyMatrix4: function(e) {
  41183. return this.start.applyMatrix4(e),
  41184. this.end.applyMatrix4(e),
  41185. this
  41186. },
  41187. equals: function(e) {
  41188. return e.start.equals(this.start) && e.end.equals(this.end)
  41189. }
  41190. },
  41191. n.Box2 = function(e, t) {
  41192. this.min = void 0 !== e ? e : new n.Vector2(+(1 / 0),+(1 / 0)),
  41193. this.max = void 0 !== t ? t : new n.Vector2(-(1 / 0),-(1 / 0))
  41194. }
  41195. ,
  41196. n.Box2.prototype = {
  41197. constructor: n.Box2,
  41198. set: function(e, t) {
  41199. return this.min.copy(e),
  41200. this.max.copy(t),
  41201. this
  41202. },
  41203. setFromPoints: function(e) {
  41204. this.makeEmpty();
  41205. for (var t = 0, i = e.length; t < i; t++)
  41206. this.expandByPoint(e[t]);
  41207. return this
  41208. },
  41209. setFromCenterAndSize: function() {
  41210. var e = new n.Vector2;
  41211. return function(t, i) {
  41212. var n = e.copy(i).multiplyScalar(.5);
  41213. return this.min.copy(t).sub(n),
  41214. this.max.copy(t).add(n),
  41215. this
  41216. }
  41217. }(),
  41218. clone: function() {
  41219. return (new this.constructor).copy(this)
  41220. },
  41221. copy: function(e) {
  41222. return this.min.copy(e.min),
  41223. this.max.copy(e.max),
  41224. this
  41225. },
  41226. makeEmpty: function() {
  41227. return this.min.x = this.min.y = +(1 / 0),
  41228. this.max.x = this.max.y = -(1 / 0),
  41229. this
  41230. },
  41231. isEmpty: function() {
  41232. return this.max.x < this.min.x || this.max.y < this.min.y
  41233. },
  41234. center: function(e) {
  41235. var t = e || new n.Vector2;
  41236. return t.addVectors(this.min, this.max).multiplyScalar(.5)
  41237. },
  41238. size: function(e) {
  41239. var t = e || new n.Vector2;
  41240. return t.subVectors(this.max, this.min)
  41241. },
  41242. expandByPoint: function(e) {
  41243. return this.min.min(e),
  41244. this.max.max(e),
  41245. this
  41246. },
  41247. expandByVector: function(e) {
  41248. return this.min.sub(e),
  41249. this.max.add(e),
  41250. this
  41251. },
  41252. expandByScalar: function(e) {
  41253. return this.min.addScalar(-e),
  41254. this.max.addScalar(e),
  41255. this
  41256. },
  41257. containsPoint: function(e) {
  41258. return !(e.x < this.min.x || e.x > this.max.x || e.y < this.min.y || e.y > this.max.y)
  41259. },
  41260. containsBox: function(e) {
  41261. 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
  41262. },
  41263. getParameter: function(e, t) {
  41264. var i = t || new n.Vector2;
  41265. 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))
  41266. },
  41267. intersectsBox: function(e) {
  41268. 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)
  41269. },
  41270. clampPoint: function(e, t) {
  41271. var i = t || new n.Vector2;
  41272. return i.copy(e).clamp(this.min, this.max)
  41273. },
  41274. distanceToPoint: function() {
  41275. var e = new n.Vector2;
  41276. return function(t) {
  41277. var i = e.copy(t).clamp(this.min, this.max);
  41278. return i.sub(t).length()
  41279. }
  41280. }(),
  41281. intersect: function(e) {
  41282. return this.min.max(e.min),
  41283. this.max.min(e.max),
  41284. this
  41285. },
  41286. union: function(e) {
  41287. return this.min.min(e.min),
  41288. this.max.max(e.max),
  41289. this
  41290. },
  41291. translate: function(e) {
  41292. return this.min.add(e),
  41293. this.max.add(e),
  41294. this
  41295. },
  41296. equals: function(e) {
  41297. return e.min.equals(this.min) && e.max.equals(this.max)
  41298. }
  41299. },
  41300. n.Box3 = function(e, t) {
  41301. this.min = void 0 !== e ? e : new n.Vector3(+(1 / 0),+(1 / 0),+(1 / 0)),
  41302. this.max = void 0 !== t ? t : new n.Vector3(-(1 / 0),-(1 / 0),-(1 / 0))
  41303. }
  41304. ,
  41305. n.Box3.prototype = {
  41306. constructor: n.Box3,
  41307. set: function(e, t) {
  41308. return this.min.copy(e),
  41309. this.max.copy(t),
  41310. this
  41311. },
  41312. setFromArray: function(e) {
  41313. this.makeEmpty();
  41314. 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) {
  41315. var c = e[s]
  41316. , h = e[s + 1]
  41317. , u = e[s + 2];
  41318. c < t && (t = c),
  41319. h < i && (i = h),
  41320. u < n && (n = u),
  41321. c > r && (r = c),
  41322. h > o && (o = h),
  41323. u > a && (a = u)
  41324. }
  41325. this.min.set(t, i, n),
  41326. this.max.set(r, o, a)
  41327. },
  41328. setFromPoints: function(e) {
  41329. this.makeEmpty();
  41330. for (var t = 0, i = e.length; t < i; t++)
  41331. this.expandByPoint(e[t]);
  41332. return this
  41333. },
  41334. setFromCenterAndSize: function() {
  41335. var e = new n.Vector3;
  41336. return function(t, i) {
  41337. var n = e.copy(i).multiplyScalar(.5);
  41338. return this.min.copy(t).sub(n),
  41339. this.max.copy(t).add(n),
  41340. this
  41341. }
  41342. }(),
  41343. setFromObject: function() {
  41344. var e;
  41345. return function(t) {
  41346. void 0 === e && (e = new n.Box3);
  41347. var i = this;
  41348. return this.makeEmpty(),
  41349. t.updateMatrixWorld(!0),
  41350. t.traverse(function(t) {
  41351. var n = t.geometry;
  41352. void 0 !== n && (null === n.boundingBox && n.computeBoundingBox(),
  41353. n.boundingBox.isEmpty() === !1 && (e.copy(n.boundingBox),
  41354. e.applyMatrix4(t.matrixWorld),
  41355. i.union(e)))
  41356. }),
  41357. this
  41358. }
  41359. }(),
  41360. clone: function() {
  41361. return (new this.constructor).copy(this)
  41362. },
  41363. copy: function(e) {
  41364. return this.min.copy(e.min),
  41365. this.max.copy(e.max),
  41366. this
  41367. },
  41368. makeEmpty: function() {
  41369. return this.min.x = this.min.y = this.min.z = +(1 / 0),
  41370. this.max.x = this.max.y = this.max.z = -(1 / 0),
  41371. this
  41372. },
  41373. isEmpty: function() {
  41374. return this.max.x < this.min.x || this.max.y < this.min.y || this.max.z < this.min.z
  41375. },
  41376. center: function(e) {
  41377. var t = e || new n.Vector3;
  41378. return t.addVectors(this.min, this.max).multiplyScalar(.5)
  41379. },
  41380. size: function(e) {
  41381. var t = e || new n.Vector3;
  41382. return t.subVectors(this.max, this.min)
  41383. },
  41384. expandByPoint: function(e) {
  41385. return this.min.min(e),
  41386. this.max.max(e),
  41387. this
  41388. },
  41389. expandByVector: function(e) {
  41390. return this.min.sub(e),
  41391. this.max.add(e),
  41392. this
  41393. },
  41394. expandByScalar: function(e) {
  41395. return this.min.addScalar(-e),
  41396. this.max.addScalar(e),
  41397. this
  41398. },
  41399. containsPoint: function(e) {
  41400. 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)
  41401. },
  41402. containsBox: function(e) {
  41403. 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
  41404. },
  41405. getParameter: function(e, t) {
  41406. var i = t || new n.Vector3;
  41407. 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))
  41408. },
  41409. intersectsBox: function(e) {
  41410. 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)
  41411. },
  41412. intersectsSphere: function() {
  41413. var e;
  41414. return function(t) {
  41415. return void 0 === e && (e = new n.Vector3),
  41416. this.clampPoint(t.center, e),
  41417. e.distanceToSquared(t.center) <= t.radius * t.radius
  41418. }
  41419. }(),
  41420. intersectsPlane: function(e) {
  41421. var t, i;
  41422. return e.normal.x > 0 ? (t = e.normal.x * this.min.x,
  41423. i = e.normal.x * this.max.x) : (t = e.normal.x * this.max.x,
  41424. i = e.normal.x * this.min.x),
  41425. e.normal.y > 0 ? (t += e.normal.y * this.min.y,
  41426. i += e.normal.y * this.max.y) : (t += e.normal.y * this.max.y,
  41427. i += e.normal.y * this.min.y),
  41428. e.normal.z > 0 ? (t += e.normal.z * this.min.z,
  41429. i += e.normal.z * this.max.z) : (t += e.normal.z * this.max.z,
  41430. i += e.normal.z * this.min.z),
  41431. t <= e.constant && i >= e.constant
  41432. },
  41433. clampPoint: function(e, t) {
  41434. var i = t || new n.Vector3;
  41435. return i.copy(e).clamp(this.min, this.max)
  41436. },
  41437. distanceToPoint: function() {
  41438. var e = new n.Vector3;
  41439. return function(t) {
  41440. var i = e.copy(t).clamp(this.min, this.max);
  41441. return i.sub(t).length()
  41442. }
  41443. }(),
  41444. getBoundingSphere: function() {
  41445. var e = new n.Vector3;
  41446. return function(t) {
  41447. var i = t || new n.Sphere;
  41448. return i.center = this.center(),
  41449. i.radius = .5 * this.size(e).length(),
  41450. i
  41451. }
  41452. }(),
  41453. intersect: function(e) {
  41454. return this.min.max(e.min),
  41455. this.max.min(e.max),
  41456. this
  41457. },
  41458. union: function(e) {
  41459. return this.min.min(e.min),
  41460. this.max.max(e.max),
  41461. this
  41462. },
  41463. applyMatrix4: function() {
  41464. 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];
  41465. return function(t) {
  41466. return e[0].set(this.min.x, this.min.y, this.min.z).applyMatrix4(t),
  41467. e[1].set(this.min.x, this.min.y, this.max.z).applyMatrix4(t),
  41468. e[2].set(this.min.x, this.max.y, this.min.z).applyMatrix4(t),
  41469. e[3].set(this.min.x, this.max.y, this.max.z).applyMatrix4(t),
  41470. e[4].set(this.max.x, this.min.y, this.min.z).applyMatrix4(t),
  41471. e[5].set(this.max.x, this.min.y, this.max.z).applyMatrix4(t),
  41472. e[6].set(this.max.x, this.max.y, this.min.z).applyMatrix4(t),
  41473. e[7].set(this.max.x, this.max.y, this.max.z).applyMatrix4(t),
  41474. this.makeEmpty(),
  41475. this.setFromPoints(e),
  41476. this
  41477. }
  41478. }(),
  41479. translate: function(e) {
  41480. return this.min.add(e),
  41481. this.max.add(e),
  41482. this
  41483. },
  41484. equals: function(e) {
  41485. return e.min.equals(this.min) && e.max.equals(this.max)
  41486. }
  41487. },
  41488. n.Matrix3 = function() {
  41489. this.elements = new Float32Array([1, 0, 0, 0, 1, 0, 0, 0, 1]),
  41490. arguments.length > 0 && console.error("THREE.Matrix3: the constructor no longer reads arguments. use .set() instead.")
  41491. }
  41492. ,
  41493. n.Matrix3.prototype = {
  41494. constructor: n.Matrix3,
  41495. set: function(e, t, i, n, r, o, a, s, l) {
  41496. var c = this.elements;
  41497. return c[0] = e,
  41498. c[1] = n,
  41499. c[2] = a,
  41500. c[3] = t,
  41501. c[4] = r,
  41502. c[5] = s,
  41503. c[6] = i,
  41504. c[7] = o,
  41505. c[8] = l,
  41506. this
  41507. },
  41508. identity: function() {
  41509. return this.set(1, 0, 0, 0, 1, 0, 0, 0, 1),
  41510. this
  41511. },
  41512. clone: function() {
  41513. return (new this.constructor).fromArray(this.elements)
  41514. },
  41515. copy: function(e) {
  41516. var t = e.elements;
  41517. return this.set(t[0], t[3], t[6], t[1], t[4], t[7], t[2], t[5], t[8]),
  41518. this
  41519. },
  41520. setFromMatrix4: function(e) {
  41521. var t = e.elements;
  41522. return this.set(t[0], t[4], t[8], t[1], t[5], t[9], t[2], t[6], t[10]),
  41523. this
  41524. },
  41525. applyToVector3Array: function() {
  41526. var e;
  41527. return function(t, i, r) {
  41528. void 0 === e && (e = new n.Vector3),
  41529. void 0 === i && (i = 0),
  41530. void 0 === r && (r = t.length);
  41531. for (var o = 0, a = i; o < r; o += 3,
  41532. a += 3)
  41533. e.fromArray(t, a),
  41534. e.applyMatrix3(this),
  41535. e.toArray(t, a);
  41536. return t
  41537. }
  41538. }(),
  41539. applyToBuffer: function() {
  41540. var e;
  41541. return function(t, i, r) {
  41542. void 0 === e && (e = new n.Vector3),
  41543. void 0 === i && (i = 0),
  41544. void 0 === r && (r = t.length / t.itemSize);
  41545. for (var o = 0, a = i; o < r; o++,
  41546. a++)
  41547. e.x = t.getX(a),
  41548. e.y = t.getY(a),
  41549. e.z = t.getZ(a),
  41550. e.applyMatrix3(this),
  41551. t.setXYZ(e.x, e.y, e.z);
  41552. return t
  41553. }
  41554. }(),
  41555. multiplyScalar: function(e) {
  41556. var t = this.elements;
  41557. return t[0] *= e,
  41558. t[3] *= e,
  41559. t[6] *= e,
  41560. t[1] *= e,
  41561. t[4] *= e,
  41562. t[7] *= e,
  41563. t[2] *= e,
  41564. t[5] *= e,
  41565. t[8] *= e,
  41566. this
  41567. },
  41568. determinant: function() {
  41569. var e = this.elements
  41570. , t = e[0]
  41571. , i = e[1]
  41572. , n = e[2]
  41573. , r = e[3]
  41574. , o = e[4]
  41575. , a = e[5]
  41576. , s = e[6]
  41577. , l = e[7]
  41578. , c = e[8];
  41579. return t * o * c - t * a * l - i * r * c + i * a * s + n * r * l - n * o * s
  41580. },
  41581. getInverse: function(e, t) {
  41582. e instanceof n.Matrix4 && console.warn("THREE.Matrix3.getInverse no longer takes a Matrix4 argument.");
  41583. var i = e.elements
  41584. , r = this.elements
  41585. , o = i[0]
  41586. , a = i[1]
  41587. , s = i[2]
  41588. , l = i[3]
  41589. , c = i[4]
  41590. , h = i[5]
  41591. , u = i[6]
  41592. , d = i[7]
  41593. , p = i[8]
  41594. , f = p * c - h * d
  41595. , g = h * u - p * l
  41596. , m = d * l - c * u
  41597. , v = o * f + a * g + s * m;
  41598. if (0 === v) {
  41599. var A = "THREE.Matrix3.getInverse(): can't invert matrix, determinant is 0";
  41600. if (t)
  41601. throw new Error(A);
  41602. return console.warn(A),
  41603. this.identity()
  41604. }
  41605. return r[0] = f,
  41606. r[1] = s * d - p * a,
  41607. r[2] = h * a - s * c,
  41608. r[3] = g,
  41609. r[4] = p * o - s * u,
  41610. r[5] = s * l - h * o,
  41611. r[6] = m,
  41612. r[7] = a * u - d * o,
  41613. r[8] = c * o - a * l,
  41614. this.multiplyScalar(1 / v)
  41615. },
  41616. transpose: function() {
  41617. var e, t = this.elements;
  41618. return e = t[1],
  41619. t[1] = t[3],
  41620. t[3] = e,
  41621. e = t[2],
  41622. t[2] = t[6],
  41623. t[6] = e,
  41624. e = t[5],
  41625. t[5] = t[7],
  41626. t[7] = e,
  41627. this
  41628. },
  41629. flattenToArrayOffset: function(e, t) {
  41630. var i = this.elements;
  41631. return e[t] = i[0],
  41632. e[t + 1] = i[1],
  41633. e[t + 2] = i[2],
  41634. e[t + 3] = i[3],
  41635. e[t + 4] = i[4],
  41636. e[t + 5] = i[5],
  41637. e[t + 6] = i[6],
  41638. e[t + 7] = i[7],
  41639. e[t + 8] = i[8],
  41640. e
  41641. },
  41642. getNormalMatrix: function(e) {
  41643. return this.setFromMatrix4(e).getInverse(this).transpose()
  41644. },
  41645. transposeIntoArray: function(e) {
  41646. var t = this.elements;
  41647. return e[0] = t[0],
  41648. e[1] = t[3],
  41649. e[2] = t[6],
  41650. e[3] = t[1],
  41651. e[4] = t[4],
  41652. e[5] = t[7],
  41653. e[6] = t[2],
  41654. e[7] = t[5],
  41655. e[8] = t[8],
  41656. this
  41657. },
  41658. fromArray: function(e) {
  41659. return this.elements.set(e),
  41660. this
  41661. },
  41662. toArray: function() {
  41663. var e = this.elements;
  41664. return [e[0], e[1], e[2], e[3], e[4], e[5], e[6], e[7], e[8]]
  41665. }
  41666. },
  41667. n.Matrix4 = function() {
  41668. this.elements = new Float32Array([1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1]),
  41669. arguments.length > 0 && console.error("THREE.Matrix4: the constructor no longer reads arguments. use .set() instead.")
  41670. }
  41671. ,
  41672. n.Matrix4.prototype = {
  41673. constructor: n.Matrix4,
  41674. set: function(e, t, i, n, r, o, a, s, l, c, h, u, d, p, f, g) {
  41675. var m = this.elements;
  41676. return m[0] = e,
  41677. m[4] = t,
  41678. m[8] = i,
  41679. m[12] = n,
  41680. m[1] = r,
  41681. m[5] = o,
  41682. m[9] = a,
  41683. m[13] = s,
  41684. m[2] = l,
  41685. m[6] = c,
  41686. m[10] = h,
  41687. m[14] = u,
  41688. m[3] = d,
  41689. m[7] = p,
  41690. m[11] = f,
  41691. m[15] = g,
  41692. this
  41693. },
  41694. identity: function() {
  41695. return this.set(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1),
  41696. this
  41697. },
  41698. clone: function() {
  41699. return (new n.Matrix4).fromArray(this.elements)
  41700. },
  41701. copy: function(e) {
  41702. return this.elements.set(e.elements),
  41703. this
  41704. },
  41705. copyPosition: function(e) {
  41706. var t = this.elements
  41707. , i = e.elements;
  41708. return t[12] = i[12],
  41709. t[13] = i[13],
  41710. t[14] = i[14],
  41711. this
  41712. },
  41713. extractBasis: function(e, t, i) {
  41714. return e.setFromMatrixColumn(this, 0),
  41715. t.setFromMatrixColumn(this, 1),
  41716. i.setFromMatrixColumn(this, 2),
  41717. this
  41718. },
  41719. makeBasis: function(e, t, i) {
  41720. 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),
  41721. this
  41722. },
  41723. extractRotation: function() {
  41724. var e;
  41725. return function(t) {
  41726. void 0 === e && (e = new n.Vector3);
  41727. var i = this.elements
  41728. , r = t.elements
  41729. , o = 1 / e.setFromMatrixColumn(t, 0).length()
  41730. , a = 1 / e.setFromMatrixColumn(t, 1).length()
  41731. , s = 1 / e.setFromMatrixColumn(t, 2).length();
  41732. return i[0] = r[0] * o,
  41733. i[1] = r[1] * o,
  41734. i[2] = r[2] * o,
  41735. i[4] = r[4] * a,
  41736. i[5] = r[5] * a,
  41737. i[6] = r[6] * a,
  41738. i[8] = r[8] * s,
  41739. i[9] = r[9] * s,
  41740. i[10] = r[10] * s,
  41741. this
  41742. }
  41743. }(),
  41744. makeRotationFromEuler: function(e) {
  41745. e instanceof n.Euler == !1 && console.error("THREE.Matrix: .makeRotationFromEuler() now expects a Euler rotation rather than a Vector3 and order.");
  41746. var t = this.elements
  41747. , i = e.x
  41748. , r = e.y
  41749. , o = e.z
  41750. , a = Math.cos(i)
  41751. , s = Math.sin(i)
  41752. , l = Math.cos(r)
  41753. , c = Math.sin(r)
  41754. , h = Math.cos(o)
  41755. , u = Math.sin(o);
  41756. if ("XYZ" === e.order) {
  41757. var d = a * h
  41758. , p = a * u
  41759. , f = s * h
  41760. , g = s * u;
  41761. t[0] = l * h,
  41762. t[4] = -l * u,
  41763. t[8] = c,
  41764. t[1] = p + f * c,
  41765. t[5] = d - g * c,
  41766. t[9] = -s * l,
  41767. t[2] = g - d * c,
  41768. t[6] = f + p * c,
  41769. t[10] = a * l
  41770. } else if ("YXZ" === e.order) {
  41771. var m = l * h
  41772. , v = l * u
  41773. , A = c * h
  41774. , y = c * u;
  41775. t[0] = m + y * s,
  41776. t[4] = A * s - v,
  41777. t[8] = a * c,
  41778. t[1] = a * u,
  41779. t[5] = a * h,
  41780. t[9] = -s,
  41781. t[2] = v * s - A,
  41782. t[6] = y + m * s,
  41783. t[10] = a * l
  41784. } else if ("ZXY" === e.order) {
  41785. var m = l * h
  41786. , v = l * u
  41787. , A = c * h
  41788. , y = c * u;
  41789. t[0] = m - y * s,
  41790. t[4] = -a * u,
  41791. t[8] = A + v * s,
  41792. t[1] = v + A * s,
  41793. t[5] = a * h,
  41794. t[9] = y - m * s,
  41795. t[2] = -a * c,
  41796. t[6] = s,
  41797. t[10] = a * l
  41798. } else if ("ZYX" === e.order) {
  41799. var d = a * h
  41800. , p = a * u
  41801. , f = s * h
  41802. , g = s * u;
  41803. t[0] = l * h,
  41804. t[4] = f * c - p,
  41805. t[8] = d * c + g,
  41806. t[1] = l * u,
  41807. t[5] = g * c + d,
  41808. t[9] = p * c - f,
  41809. t[2] = -c,
  41810. t[6] = s * l,
  41811. t[10] = a * l
  41812. } else if ("YZX" === e.order) {
  41813. var C = a * l
  41814. , I = a * c
  41815. , E = s * l
  41816. , b = s * c;
  41817. t[0] = l * h,
  41818. t[4] = b - C * u,
  41819. t[8] = E * u + I,
  41820. t[1] = u,
  41821. t[5] = a * h,
  41822. t[9] = -s * h,
  41823. t[2] = -c * h,
  41824. t[6] = I * u + E,
  41825. t[10] = C - b * u
  41826. } else if ("XZY" === e.order) {
  41827. var C = a * l
  41828. , I = a * c
  41829. , E = s * l
  41830. , b = s * c;
  41831. t[0] = l * h,
  41832. t[4] = -u,
  41833. t[8] = c * h,
  41834. t[1] = C * u + b,
  41835. t[5] = a * h,
  41836. t[9] = I * u - E,
  41837. t[2] = E * u - I,
  41838. t[6] = s * h,
  41839. t[10] = b * u + C
  41840. }
  41841. return t[3] = 0,
  41842. t[7] = 0,
  41843. t[11] = 0,
  41844. t[12] = 0,
  41845. t[13] = 0,
  41846. t[14] = 0,
  41847. t[15] = 1,
  41848. this
  41849. },
  41850. makeRotationFromQuaternion: function(e) {
  41851. var t = this.elements
  41852. , i = e.x
  41853. , n = e.y
  41854. , r = e.z
  41855. , o = e.w
  41856. , a = i + i
  41857. , s = n + n
  41858. , l = r + r
  41859. , c = i * a
  41860. , h = i * s
  41861. , u = i * l
  41862. , d = n * s
  41863. , p = n * l
  41864. , f = r * l
  41865. , g = o * a
  41866. , m = o * s
  41867. , v = o * l;
  41868. return t[0] = 1 - (d + f),
  41869. t[4] = h - v,
  41870. t[8] = u + m,
  41871. t[1] = h + v,
  41872. t[5] = 1 - (c + f),
  41873. t[9] = p - g,
  41874. t[2] = u - m,
  41875. t[6] = p + g,
  41876. t[10] = 1 - (c + d),
  41877. t[3] = 0,
  41878. t[7] = 0,
  41879. t[11] = 0,
  41880. t[12] = 0,
  41881. t[13] = 0,
  41882. t[14] = 0,
  41883. t[15] = 1,
  41884. this
  41885. },
  41886. lookAt: function() {
  41887. var e, t, i;
  41888. return function(r, o, a) {
  41889. void 0 === e && (e = new n.Vector3),
  41890. void 0 === t && (t = new n.Vector3),
  41891. void 0 === i && (i = new n.Vector3);
  41892. var s = this.elements;
  41893. return i.subVectors(r, o).normalize(),
  41894. 0 === i.lengthSq() && (i.z = 1),
  41895. e.crossVectors(a, i).normalize(),
  41896. 0 === e.lengthSq() && (i.x += 1e-4,
  41897. e.crossVectors(a, i).normalize()),
  41898. t.crossVectors(i, e),
  41899. s[0] = e.x,
  41900. s[4] = t.x,
  41901. s[8] = i.x,
  41902. s[1] = e.y,
  41903. s[5] = t.y,
  41904. s[9] = i.y,
  41905. s[2] = e.z,
  41906. s[6] = t.z,
  41907. s[10] = i.z,
  41908. this
  41909. }
  41910. }(),
  41911. multiply: function(e, t) {
  41912. return void 0 !== t ? (console.warn("THREE.Matrix4: .multiply() now only accepts one argument. Use .multiplyMatrices( a, b ) instead."),
  41913. this.multiplyMatrices(e, t)) : this.multiplyMatrices(this, e)
  41914. },
  41915. multiplyMatrices: function(e, t) {
  41916. var i = e.elements
  41917. , n = t.elements
  41918. , r = this.elements
  41919. , o = i[0]
  41920. , a = i[4]
  41921. , s = i[8]
  41922. , l = i[12]
  41923. , c = i[1]
  41924. , h = i[5]
  41925. , u = i[9]
  41926. , d = i[13]
  41927. , p = i[2]
  41928. , f = i[6]
  41929. , g = i[10]
  41930. , m = i[14]
  41931. , v = i[3]
  41932. , A = i[7]
  41933. , y = i[11]
  41934. , C = i[15]
  41935. , I = n[0]
  41936. , E = n[4]
  41937. , b = n[8]
  41938. , w = n[12]
  41939. , _ = n[1]
  41940. , T = n[5]
  41941. , x = n[9]
  41942. , S = n[13]
  41943. , M = n[2]
  41944. , R = n[6]
  41945. , P = n[10]
  41946. , O = n[14]
  41947. , L = n[3]
  41948. , D = n[7]
  41949. , N = n[11]
  41950. , B = n[15];
  41951. return r[0] = o * I + a * _ + s * M + l * L,
  41952. r[4] = o * E + a * T + s * R + l * D,
  41953. r[8] = o * b + a * x + s * P + l * N,
  41954. r[12] = o * w + a * S + s * O + l * B,
  41955. r[1] = c * I + h * _ + u * M + d * L,
  41956. r[5] = c * E + h * T + u * R + d * D,
  41957. r[9] = c * b + h * x + u * P + d * N,
  41958. r[13] = c * w + h * S + u * O + d * B,
  41959. r[2] = p * I + f * _ + g * M + m * L,
  41960. r[6] = p * E + f * T + g * R + m * D,
  41961. r[10] = p * b + f * x + g * P + m * N,
  41962. r[14] = p * w + f * S + g * O + m * B,
  41963. r[3] = v * I + A * _ + y * M + C * L,
  41964. r[7] = v * E + A * T + y * R + C * D,
  41965. r[11] = v * b + A * x + y * P + C * N,
  41966. r[15] = v * w + A * S + y * O + C * B,
  41967. this
  41968. },
  41969. multiplyToArray: function(e, t, i) {
  41970. var n = this.elements;
  41971. return this.multiplyMatrices(e, t),
  41972. i[0] = n[0],
  41973. i[1] = n[1],
  41974. i[2] = n[2],
  41975. i[3] = n[3],
  41976. i[4] = n[4],
  41977. i[5] = n[5],
  41978. i[6] = n[6],
  41979. i[7] = n[7],
  41980. i[8] = n[8],
  41981. i[9] = n[9],
  41982. i[10] = n[10],
  41983. i[11] = n[11],
  41984. i[12] = n[12],
  41985. i[13] = n[13],
  41986. i[14] = n[14],
  41987. i[15] = n[15],
  41988. this
  41989. },
  41990. multiplyScalar: function(e) {
  41991. var t = this.elements;
  41992. return t[0] *= e,
  41993. t[4] *= e,
  41994. t[8] *= e,
  41995. t[12] *= e,
  41996. t[1] *= e,
  41997. t[5] *= e,
  41998. t[9] *= e,
  41999. t[13] *= e,
  42000. t[2] *= e,
  42001. t[6] *= e,
  42002. t[10] *= e,
  42003. t[14] *= e,
  42004. t[3] *= e,
  42005. t[7] *= e,
  42006. t[11] *= e,
  42007. t[15] *= e,
  42008. this
  42009. },
  42010. applyToVector3Array: function() {
  42011. var e;
  42012. return function(t, i, r) {
  42013. void 0 === e && (e = new n.Vector3),
  42014. void 0 === i && (i = 0),
  42015. void 0 === r && (r = t.length);
  42016. for (var o = 0, a = i; o < r; o += 3,
  42017. a += 3)
  42018. e.fromArray(t, a),
  42019. e.applyMatrix4(this),
  42020. e.toArray(t, a);
  42021. return t
  42022. }
  42023. }(),
  42024. applyToBuffer: function() {
  42025. var e;
  42026. return function(t, i, r) {
  42027. void 0 === e && (e = new n.Vector3),
  42028. void 0 === i && (i = 0),
  42029. void 0 === r && (r = t.length / t.itemSize);
  42030. for (var o = 0, a = i; o < r; o++,
  42031. a++)
  42032. e.x = t.getX(a),
  42033. e.y = t.getY(a),
  42034. e.z = t.getZ(a),
  42035. e.applyMatrix4(this),
  42036. t.setXYZ(e.x, e.y, e.z);
  42037. return t
  42038. }
  42039. }(),
  42040. determinant: function() {
  42041. var e = this.elements
  42042. , t = e[0]
  42043. , i = e[4]
  42044. , n = e[8]
  42045. , r = e[12]
  42046. , o = e[1]
  42047. , a = e[5]
  42048. , s = e[9]
  42049. , l = e[13]
  42050. , c = e[2]
  42051. , h = e[6]
  42052. , u = e[10]
  42053. , d = e[14]
  42054. , p = e[3]
  42055. , f = e[7]
  42056. , g = e[11]
  42057. , m = e[15];
  42058. 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)
  42059. },
  42060. transpose: function() {
  42061. var e, t = this.elements;
  42062. return e = t[1],
  42063. t[1] = t[4],
  42064. t[4] = e,
  42065. e = t[2],
  42066. t[2] = t[8],
  42067. t[8] = e,
  42068. e = t[6],
  42069. t[6] = t[9],
  42070. t[9] = e,
  42071. e = t[3],
  42072. t[3] = t[12],
  42073. t[12] = e,
  42074. e = t[7],
  42075. t[7] = t[13],
  42076. t[13] = e,
  42077. e = t[11],
  42078. t[11] = t[14],
  42079. t[14] = e,
  42080. this
  42081. },
  42082. flattenToArrayOffset: function(e, t) {
  42083. var i = this.elements;
  42084. return e[t] = i[0],
  42085. e[t + 1] = i[1],
  42086. e[t + 2] = i[2],
  42087. e[t + 3] = i[3],
  42088. e[t + 4] = i[4],
  42089. e[t + 5] = i[5],
  42090. e[t + 6] = i[6],
  42091. e[t + 7] = i[7],
  42092. e[t + 8] = i[8],
  42093. e[t + 9] = i[9],
  42094. e[t + 10] = i[10],
  42095. e[t + 11] = i[11],
  42096. e[t + 12] = i[12],
  42097. e[t + 13] = i[13],
  42098. e[t + 14] = i[14],
  42099. e[t + 15] = i[15],
  42100. e
  42101. },
  42102. getPosition: function() {
  42103. var e;
  42104. return function() {
  42105. return void 0 === e && (e = new n.Vector3),
  42106. console.warn("THREE.Matrix4: .getPosition() has been removed. Use Vector3.setFromMatrixPosition( matrix ) instead."),
  42107. e.setFromMatrixColumn(this, 3)
  42108. }
  42109. }(),
  42110. setPosition: function(e) {
  42111. var t = this.elements;
  42112. return t[12] = e.x,
  42113. t[13] = e.y,
  42114. t[14] = e.z,
  42115. this
  42116. },
  42117. getInverse: function(e, t) {
  42118. var i = this.elements
  42119. , n = e.elements
  42120. , r = n[0]
  42121. , o = n[1]
  42122. , a = n[2]
  42123. , s = n[3]
  42124. , l = n[4]
  42125. , c = n[5]
  42126. , h = n[6]
  42127. , u = n[7]
  42128. , d = n[8]
  42129. , p = n[9]
  42130. , f = n[10]
  42131. , g = n[11]
  42132. , m = n[12]
  42133. , v = n[13]
  42134. , A = n[14]
  42135. , y = n[15]
  42136. , C = p * A * u - v * f * u + v * h * g - c * A * g - p * h * y + c * f * y
  42137. , I = m * f * u - d * A * u - m * h * g + l * A * g + d * h * y - l * f * y
  42138. , E = d * v * u - m * p * u + m * c * g - l * v * g - d * c * y + l * p * y
  42139. , b = m * p * h - d * v * h - m * c * f + l * v * f + d * c * A - l * p * A
  42140. , w = r * C + o * I + a * E + s * b;
  42141. if (0 === w) {
  42142. var _ = "THREE.Matrix4.getInverse(): can't invert matrix, determinant is 0";
  42143. if (t)
  42144. throw new Error(_);
  42145. return console.warn(_),
  42146. this.identity()
  42147. }
  42148. return i[0] = C,
  42149. i[1] = v * f * s - p * A * s - v * a * g + o * A * g + p * a * y - o * f * y,
  42150. i[2] = c * A * s - v * h * s + v * a * u - o * A * u - c * a * y + o * h * y,
  42151. i[3] = p * h * s - c * f * s - p * a * u + o * f * u + c * a * g - o * h * g,
  42152. i[4] = I,
  42153. i[5] = d * A * s - m * f * s + m * a * g - r * A * g - d * a * y + r * f * y,
  42154. i[6] = m * h * s - l * A * s - m * a * u + r * A * u + l * a * y - r * h * y,
  42155. i[7] = l * f * s - d * h * s + d * a * u - r * f * u - l * a * g + r * h * g,
  42156. i[8] = E,
  42157. i[9] = m * p * s - d * v * s - m * o * g + r * v * g + d * o * y - r * p * y,
  42158. i[10] = l * v * s - m * c * s + m * o * u - r * v * u - l * o * y + r * c * y,
  42159. i[11] = d * c * s - l * p * s - d * o * u + r * p * u + l * o * g - r * c * g,
  42160. i[12] = b,
  42161. i[13] = d * v * a - m * p * a + m * o * f - r * v * f - d * o * A + r * p * A,
  42162. i[14] = m * c * a - l * v * a - m * o * h + r * v * h + l * o * A - r * c * A,
  42163. i[15] = l * p * a - d * c * a + d * o * h - r * p * h - l * o * f + r * c * f,
  42164. this.multiplyScalar(1 / w)
  42165. },
  42166. scale: function(e) {
  42167. var t = this.elements
  42168. , i = e.x
  42169. , n = e.y
  42170. , r = e.z;
  42171. return t[0] *= i,
  42172. t[4] *= n,
  42173. t[8] *= r,
  42174. t[1] *= i,
  42175. t[5] *= n,
  42176. t[9] *= r,
  42177. t[2] *= i,
  42178. t[6] *= n,
  42179. t[10] *= r,
  42180. t[3] *= i,
  42181. t[7] *= n,
  42182. t[11] *= r,
  42183. this
  42184. },
  42185. getMaxScaleOnAxis: function() {
  42186. var e = this.elements
  42187. , t = e[0] * e[0] + e[1] * e[1] + e[2] * e[2]
  42188. , i = e[4] * e[4] + e[5] * e[5] + e[6] * e[6]
  42189. , n = e[8] * e[8] + e[9] * e[9] + e[10] * e[10];
  42190. return Math.sqrt(Math.max(t, i, n))
  42191. },
  42192. makeTranslation: function(e, t, i) {
  42193. return this.set(1, 0, 0, e, 0, 1, 0, t, 0, 0, 1, i, 0, 0, 0, 1),
  42194. this
  42195. },
  42196. makeRotationX: function(e) {
  42197. var t = Math.cos(e)
  42198. , i = Math.sin(e);
  42199. return this.set(1, 0, 0, 0, 0, t, -i, 0, 0, i, t, 0, 0, 0, 0, 1),
  42200. this
  42201. },
  42202. makeRotationY: function(e) {
  42203. var t = Math.cos(e)
  42204. , i = Math.sin(e);
  42205. return this.set(t, 0, i, 0, 0, 1, 0, 0, -i, 0, t, 0, 0, 0, 0, 1),
  42206. this
  42207. },
  42208. makeRotationZ: function(e) {
  42209. var t = Math.cos(e)
  42210. , i = Math.sin(e);
  42211. return this.set(t, -i, 0, 0, i, t, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1),
  42212. this
  42213. },
  42214. makeRotationAxis: function(e, t) {
  42215. var i = Math.cos(t)
  42216. , n = Math.sin(t)
  42217. , r = 1 - i
  42218. , o = e.x
  42219. , a = e.y
  42220. , s = e.z
  42221. , l = r * o
  42222. , c = r * a;
  42223. 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),
  42224. this
  42225. },
  42226. makeScale: function(e, t, i) {
  42227. return this.set(e, 0, 0, 0, 0, t, 0, 0, 0, 0, i, 0, 0, 0, 0, 1),
  42228. this
  42229. },
  42230. compose: function(e, t, i) {
  42231. return this.makeRotationFromQuaternion(t),
  42232. this.scale(i),
  42233. this.setPosition(e),
  42234. this
  42235. },
  42236. decompose: function() {
  42237. var e, t;
  42238. return function(i, r, o) {
  42239. void 0 === e && (e = new n.Vector3),
  42240. void 0 === t && (t = new n.Matrix4);
  42241. var a = this.elements
  42242. , s = e.set(a[0], a[1], a[2]).length()
  42243. , l = e.set(a[4], a[5], a[6]).length()
  42244. , c = e.set(a[8], a[9], a[10]).length()
  42245. , h = this.determinant();
  42246. h < 0 && (s = -s),
  42247. i.x = a[12],
  42248. i.y = a[13],
  42249. i.z = a[14],
  42250. t.elements.set(this.elements);
  42251. var u = 1 / s
  42252. , d = 1 / l
  42253. , p = 1 / c;
  42254. return t.elements[0] *= u,
  42255. t.elements[1] *= u,
  42256. t.elements[2] *= u,
  42257. t.elements[4] *= d,
  42258. t.elements[5] *= d,
  42259. t.elements[6] *= d,
  42260. t.elements[8] *= p,
  42261. t.elements[9] *= p,
  42262. t.elements[10] *= p,
  42263. r.setFromRotationMatrix(t),
  42264. o.x = s,
  42265. o.y = l,
  42266. o.z = c,
  42267. this
  42268. }
  42269. }(),
  42270. makeFrustum: function(e, t, i, n, r, o) {
  42271. var a = this.elements
  42272. , s = 2 * r / (t - e)
  42273. , l = 2 * r / (n - i)
  42274. , c = (t + e) / (t - e)
  42275. , h = (n + i) / (n - i)
  42276. , u = -(o + r) / (o - r)
  42277. , d = -2 * o * r / (o - r);
  42278. return a[0] = s,
  42279. a[4] = 0,
  42280. a[8] = c,
  42281. a[12] = 0,
  42282. a[1] = 0,
  42283. a[5] = l,
  42284. a[9] = h,
  42285. a[13] = 0,
  42286. a[2] = 0,
  42287. a[6] = 0,
  42288. a[10] = u,
  42289. a[14] = d,
  42290. a[3] = 0,
  42291. a[7] = 0,
  42292. a[11] = -1,
  42293. a[15] = 0,
  42294. this
  42295. },
  42296. makePerspective: function(e, t, i, r) {
  42297. var o = i * Math.tan(n.Math.degToRad(.5 * e))
  42298. , a = -o
  42299. , s = a * t
  42300. , l = o * t;
  42301. return this.makeFrustum(s, l, a, o, i, r)
  42302. },
  42303. makeOrthographic: function(e, t, i, n, r, o) {
  42304. var a = this.elements
  42305. , s = 1 / (t - e)
  42306. , l = 1 / (i - n)
  42307. , c = 1 / (o - r)
  42308. , h = (t + e) * s
  42309. , u = (i + n) * l
  42310. , d = (o + r) * c;
  42311. return a[0] = 2 * s,
  42312. a[4] = 0,
  42313. a[8] = 0,
  42314. a[12] = -h,
  42315. a[1] = 0,
  42316. a[5] = 2 * l,
  42317. a[9] = 0,
  42318. a[13] = -u,
  42319. a[2] = 0,
  42320. a[6] = 0,
  42321. a[10] = -2 * c,
  42322. a[14] = -d,
  42323. a[3] = 0,
  42324. a[7] = 0,
  42325. a[11] = 0,
  42326. a[15] = 1,
  42327. this
  42328. },
  42329. equals: function(e) {
  42330. for (var t = this.elements, i = e.elements, n = 0; n < 16; n++)
  42331. if (t[n] !== i[n])
  42332. return !1;
  42333. return !0
  42334. },
  42335. fromArray: function(e) {
  42336. return this.elements.set(e),
  42337. this
  42338. },
  42339. toArray: function() {
  42340. var e = this.elements;
  42341. 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]]
  42342. }
  42343. },
  42344. n.Ray = function(e, t) {
  42345. this.origin = void 0 !== e ? e : new n.Vector3,
  42346. this.direction = void 0 !== t ? t : new n.Vector3
  42347. }
  42348. ,
  42349. n.Ray.prototype = {
  42350. constructor: n.Ray,
  42351. set: function(e, t) {
  42352. return this.origin.copy(e),
  42353. this.direction.copy(t),
  42354. this
  42355. },
  42356. clone: function() {
  42357. return (new this.constructor).copy(this)
  42358. },
  42359. copy: function(e) {
  42360. return this.origin.copy(e.origin),
  42361. this.direction.copy(e.direction),
  42362. this
  42363. },
  42364. at: function(e, t) {
  42365. var i = t || new n.Vector3;
  42366. return i.copy(this.direction).multiplyScalar(e).add(this.origin)
  42367. },
  42368. lookAt: function(e) {
  42369. this.direction.copy(e).sub(this.origin).normalize()
  42370. },
  42371. recast: function() {
  42372. var e = new n.Vector3;
  42373. return function(t) {
  42374. return this.origin.copy(this.at(t, e)),
  42375. this
  42376. }
  42377. }(),
  42378. closestPointToPoint: function(e, t) {
  42379. var i = t || new n.Vector3;
  42380. i.subVectors(e, this.origin);
  42381. var r = i.dot(this.direction);
  42382. return r < 0 ? i.copy(this.origin) : i.copy(this.direction).multiplyScalar(r).add(this.origin)
  42383. },
  42384. distanceToPoint: function(e) {
  42385. return Math.sqrt(this.distanceSqToPoint(e))
  42386. },
  42387. distanceSqToPoint: function() {
  42388. var e = new n.Vector3;
  42389. return function(t) {
  42390. var i = e.subVectors(t, this.origin).dot(this.direction);
  42391. return i < 0 ? this.origin.distanceToSquared(t) : (e.copy(this.direction).multiplyScalar(i).add(this.origin),
  42392. e.distanceToSquared(t))
  42393. }
  42394. }(),
  42395. distanceSqToSegment: function() {
  42396. var e = new n.Vector3
  42397. , t = new n.Vector3
  42398. , i = new n.Vector3;
  42399. return function(n, r, o, a) {
  42400. e.copy(n).add(r).multiplyScalar(.5),
  42401. t.copy(r).sub(n).normalize(),
  42402. i.copy(this.origin).sub(e);
  42403. 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);
  42404. if (m > 0)
  42405. if (s = d * f - p,
  42406. l = d * p - f,
  42407. h = u * m,
  42408. s >= 0)
  42409. if (l >= -h)
  42410. if (l <= h) {
  42411. var v = 1 / m;
  42412. s *= v,
  42413. l *= v,
  42414. c = s * (s + d * l + 2 * p) + l * (d * s + l + 2 * f) + g
  42415. } else
  42416. l = u,
  42417. s = Math.max(0, -(d * l + p)),
  42418. c = -s * s + l * (l + 2 * f) + g;
  42419. else
  42420. l = -u,
  42421. s = Math.max(0, -(d * l + p)),
  42422. c = -s * s + l * (l + 2 * f) + g;
  42423. else
  42424. l <= -h ? (s = Math.max(0, -(-d * u + p)),
  42425. l = s > 0 ? -u : Math.min(Math.max(-u, -f), u),
  42426. c = -s * s + l * (l + 2 * f) + g) : l <= h ? (s = 0,
  42427. l = Math.min(Math.max(-u, -f), u),
  42428. c = l * (l + 2 * f) + g) : (s = Math.max(0, -(d * u + p)),
  42429. l = s > 0 ? u : Math.min(Math.max(-u, -f), u),
  42430. c = -s * s + l * (l + 2 * f) + g);
  42431. else
  42432. l = d > 0 ? -u : u,
  42433. s = Math.max(0, -(d * l + p)),
  42434. c = -s * s + l * (l + 2 * f) + g;
  42435. return o && o.copy(this.direction).multiplyScalar(s).add(this.origin),
  42436. a && a.copy(t).multiplyScalar(l).add(e),
  42437. c
  42438. }
  42439. }(),
  42440. intersectSphere: function() {
  42441. var e = new n.Vector3;
  42442. return function(t, i) {
  42443. e.subVectors(t.center, this.origin);
  42444. var n = e.dot(this.direction)
  42445. , r = e.dot(e) - n * n
  42446. , o = t.radius * t.radius;
  42447. if (r > o)
  42448. return null;
  42449. var a = Math.sqrt(o - r)
  42450. , s = n - a
  42451. , l = n + a;
  42452. return s < 0 && l < 0 ? null : s < 0 ? this.at(l, i) : this.at(s, i)
  42453. }
  42454. }(),
  42455. intersectsSphere: function(e) {
  42456. return this.distanceToPoint(e.center) <= e.radius
  42457. },
  42458. distanceToPlane: function(e) {
  42459. var t = e.normal.dot(this.direction);
  42460. if (0 === t)
  42461. return 0 === e.distanceToPoint(this.origin) ? 0 : null;
  42462. var i = -(this.origin.dot(e.normal) + e.constant) / t;
  42463. return i >= 0 ? i : null
  42464. },
  42465. intersectPlane: function(e, t) {
  42466. var i = this.distanceToPlane(e);
  42467. return null === i ? null : this.at(i, t)
  42468. },
  42469. intersectsPlane: function(e) {
  42470. var t = e.distanceToPoint(this.origin);
  42471. if (0 === t)
  42472. return !0;
  42473. var i = e.normal.dot(this.direction);
  42474. return i * t < 0
  42475. },
  42476. intersectBox: function(e, t) {
  42477. 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;
  42478. return l >= 0 ? (i = (e.min.x - u.x) * l,
  42479. n = (e.max.x - u.x) * l) : (i = (e.max.x - u.x) * l,
  42480. n = (e.min.x - u.x) * l),
  42481. c >= 0 ? (r = (e.min.y - u.y) * c,
  42482. o = (e.max.y - u.y) * c) : (r = (e.max.y - u.y) * c,
  42483. o = (e.min.y - u.y) * c),
  42484. i > o || r > n ? null : ((r > i || i !== i) && (i = r),
  42485. (o < n || n !== n) && (n = o),
  42486. h >= 0 ? (a = (e.min.z - u.z) * h,
  42487. s = (e.max.z - u.z) * h) : (a = (e.max.z - u.z) * h,
  42488. s = (e.min.z - u.z) * h),
  42489. i > s || a > n ? null : ((a > i || i !== i) && (i = a),
  42490. (s < n || n !== n) && (n = s),
  42491. n < 0 ? null : this.at(i >= 0 ? i : n, t)))
  42492. },
  42493. intersectsBox: function() {
  42494. var e = new n.Vector3;
  42495. return function(t) {
  42496. return null !== this.intersectBox(t, e)
  42497. }
  42498. }(),
  42499. intersectTriangle: function() {
  42500. var e = new n.Vector3
  42501. , t = new n.Vector3
  42502. , i = new n.Vector3
  42503. , r = new n.Vector3;
  42504. return function(n, o, a, s, l) {
  42505. t.subVectors(o, n),
  42506. i.subVectors(a, n),
  42507. r.crossVectors(t, i);
  42508. var c, h = this.direction.dot(r);
  42509. if (h > 0) {
  42510. if (s)
  42511. return null;
  42512. c = 1
  42513. } else {
  42514. if (!(h < 0))
  42515. return null;
  42516. c = -1,
  42517. h = -h
  42518. }
  42519. e.subVectors(this.origin, n);
  42520. var u = c * this.direction.dot(i.crossVectors(e, i));
  42521. if (u < 0)
  42522. return null;
  42523. var d = c * this.direction.dot(t.cross(e));
  42524. if (d < 0)
  42525. return null;
  42526. if (u + d > h)
  42527. return null;
  42528. var p = -c * e.dot(r);
  42529. return p < 0 ? null : this.at(p / h, l)
  42530. }
  42531. }(),
  42532. applyMatrix4: function(e) {
  42533. return this.direction.add(this.origin).applyMatrix4(e),
  42534. this.origin.applyMatrix4(e),
  42535. this.direction.sub(this.origin),
  42536. this.direction.normalize(),
  42537. this
  42538. },
  42539. equals: function(e) {
  42540. return e.origin.equals(this.origin) && e.direction.equals(this.direction)
  42541. }
  42542. },
  42543. n.Sphere = function(e, t) {
  42544. this.center = void 0 !== e ? e : new n.Vector3,
  42545. this.radius = void 0 !== t ? t : 0
  42546. }
  42547. ,
  42548. n.Sphere.prototype = {
  42549. constructor: n.Sphere,
  42550. set: function(e, t) {
  42551. return this.center.copy(e),
  42552. this.radius = t,
  42553. this
  42554. },
  42555. setFromPoints: function() {
  42556. var e = new n.Box3;
  42557. return function(t, i) {
  42558. var n = this.center;
  42559. void 0 !== i ? n.copy(i) : e.setFromPoints(t).center(n);
  42560. for (var r = 0, o = 0, a = t.length; o < a; o++)
  42561. r = Math.max(r, n.distanceToSquared(t[o]));
  42562. return this.radius = Math.sqrt(r),
  42563. this
  42564. }
  42565. }(),
  42566. clone: function() {
  42567. return (new this.constructor).copy(this)
  42568. },
  42569. copy: function(e) {
  42570. return this.center.copy(e.center),
  42571. this.radius = e.radius,
  42572. this
  42573. },
  42574. empty: function() {
  42575. return this.radius <= 0
  42576. },
  42577. containsPoint: function(e) {
  42578. return e.distanceToSquared(this.center) <= this.radius * this.radius
  42579. },
  42580. distanceToPoint: function(e) {
  42581. return e.distanceTo(this.center) - this.radius
  42582. },
  42583. intersectsSphere: function(e) {
  42584. var t = this.radius + e.radius;
  42585. return e.center.distanceToSquared(this.center) <= t * t
  42586. },
  42587. intersectsBox: function(e) {
  42588. return e.intersectsSphere(this)
  42589. },
  42590. intersectsPlane: function(e) {
  42591. return Math.abs(this.center.dot(e.normal) - e.constant) <= this.radius
  42592. },
  42593. clampPoint: function(e, t) {
  42594. var i = this.center.distanceToSquared(e)
  42595. , r = t || new n.Vector3;
  42596. return r.copy(e),
  42597. i > this.radius * this.radius && (r.sub(this.center).normalize(),
  42598. r.multiplyScalar(this.radius).add(this.center)),
  42599. r
  42600. },
  42601. getBoundingBox: function(e) {
  42602. var t = e || new n.Box3;
  42603. return t.set(this.center, this.center),
  42604. t.expandByScalar(this.radius),
  42605. t
  42606. },
  42607. applyMatrix4: function(e) {
  42608. return this.center.applyMatrix4(e),
  42609. this.radius = this.radius * e.getMaxScaleOnAxis(),
  42610. this
  42611. },
  42612. translate: function(e) {
  42613. return this.center.add(e),
  42614. this
  42615. },
  42616. equals: function(e) {
  42617. return e.center.equals(this.center) && e.radius === this.radius
  42618. }
  42619. },
  42620. n.Frustum = function(e, t, i, r, o, a) {
  42621. 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]
  42622. }
  42623. ,
  42624. n.Frustum.prototype = {
  42625. constructor: n.Frustum,
  42626. set: function(e, t, i, n, r, o) {
  42627. var a = this.planes;
  42628. return a[0].copy(e),
  42629. a[1].copy(t),
  42630. a[2].copy(i),
  42631. a[3].copy(n),
  42632. a[4].copy(r),
  42633. a[5].copy(o),
  42634. this
  42635. },
  42636. clone: function() {
  42637. return (new this.constructor).copy(this)
  42638. },
  42639. copy: function(e) {
  42640. for (var t = this.planes, i = 0; i < 6; i++)
  42641. t[i].copy(e.planes[i]);
  42642. return this
  42643. },
  42644. setFromMatrix: function(e) {
  42645. var t = this.planes
  42646. , i = e.elements
  42647. , n = i[0]
  42648. , r = i[1]
  42649. , o = i[2]
  42650. , a = i[3]
  42651. , s = i[4]
  42652. , l = i[5]
  42653. , c = i[6]
  42654. , h = i[7]
  42655. , u = i[8]
  42656. , d = i[9]
  42657. , p = i[10]
  42658. , f = i[11]
  42659. , g = i[12]
  42660. , m = i[13]
  42661. , v = i[14]
  42662. , A = i[15];
  42663. return t[0].setComponents(a - n, h - s, f - u, A - g).normalize(),
  42664. t[1].setComponents(a + n, h + s, f + u, A + g).normalize(),
  42665. t[2].setComponents(a + r, h + l, f + d, A + m).normalize(),
  42666. t[3].setComponents(a - r, h - l, f - d, A - m).normalize(),
  42667. t[4].setComponents(a - o, h - c, f - p, A - v).normalize(),
  42668. t[5].setComponents(a + o, h + c, f + p, A + v).normalize(),
  42669. this
  42670. },
  42671. intersectsObject: function() {
  42672. var e = new n.Sphere;
  42673. return function(t) {
  42674. var i = t.geometry;
  42675. return null === i.boundingSphere && i.computeBoundingSphere(),
  42676. e.copy(i.boundingSphere),
  42677. e.applyMatrix4(t.matrixWorld),
  42678. this.intersectsSphere(e)
  42679. }
  42680. }(),
  42681. intersectsSphere: function(e) {
  42682. for (var t = this.planes, i = e.center, n = -e.radius, r = 0; r < 6; r++) {
  42683. var o = t[r].distanceToPoint(i);
  42684. if (o < n)
  42685. return !1
  42686. }
  42687. return !0
  42688. },
  42689. intersectsBox: function() {
  42690. var e = new n.Vector3
  42691. , t = new n.Vector3;
  42692. return function(i) {
  42693. for (var n = this.planes, r = 0; r < 6; r++) {
  42694. var o = n[r];
  42695. e.x = o.normal.x > 0 ? i.min.x : i.max.x,
  42696. t.x = o.normal.x > 0 ? i.max.x : i.min.x,
  42697. e.y = o.normal.y > 0 ? i.min.y : i.max.y,
  42698. t.y = o.normal.y > 0 ? i.max.y : i.min.y,
  42699. e.z = o.normal.z > 0 ? i.min.z : i.max.z,
  42700. t.z = o.normal.z > 0 ? i.max.z : i.min.z;
  42701. var a = o.distanceToPoint(e)
  42702. , s = o.distanceToPoint(t);
  42703. if (a < 0 && s < 0)
  42704. return !1
  42705. }
  42706. return !0
  42707. }
  42708. }(),
  42709. containsPoint: function(e) {
  42710. for (var t = this.planes, i = 0; i < 6; i++)
  42711. if (t[i].distanceToPoint(e) < 0)
  42712. return !1;
  42713. return !0
  42714. }
  42715. },
  42716. n.Plane = function(e, t) {
  42717. this.normal = void 0 !== e ? e : new n.Vector3(1,0,0),
  42718. this.constant = void 0 !== t ? t : 0
  42719. }
  42720. ,
  42721. n.Plane.prototype = {
  42722. constructor: n.Plane,
  42723. set: function(e, t) {
  42724. return this.normal.copy(e),
  42725. this.constant = t,
  42726. this
  42727. },
  42728. setComponents: function(e, t, i, n) {
  42729. return this.normal.set(e, t, i),
  42730. this.constant = n,
  42731. this
  42732. },
  42733. setFromNormalAndCoplanarPoint: function(e, t) {
  42734. return this.normal.copy(e),
  42735. this.constant = -t.dot(this.normal),
  42736. this
  42737. },
  42738. setFromCoplanarPoints: function() {
  42739. var e = new n.Vector3
  42740. , t = new n.Vector3;
  42741. return function(i, n, r) {
  42742. var o = e.subVectors(r, n).cross(t.subVectors(i, n)).normalize();
  42743. return this.setFromNormalAndCoplanarPoint(o, i),
  42744. this
  42745. }
  42746. }(),
  42747. clone: function() {
  42748. return (new this.constructor).copy(this)
  42749. },
  42750. copy: function(e) {
  42751. return this.normal.copy(e.normal),
  42752. this.constant = e.constant,
  42753. this
  42754. },
  42755. normalize: function() {
  42756. var e = 1 / this.normal.length();
  42757. return this.normal.multiplyScalar(e),
  42758. this.constant *= e,
  42759. this
  42760. },
  42761. negate: function() {
  42762. return this.constant *= -1,
  42763. this.normal.negate(),
  42764. this
  42765. },
  42766. distanceToPoint: function(e) {
  42767. return this.normal.dot(e) + this.constant
  42768. },
  42769. distanceToSphere: function(e) {
  42770. return this.distanceToPoint(e.center) - e.radius
  42771. },
  42772. projectPoint: function(e, t) {
  42773. return this.orthoPoint(e, t).sub(e).negate()
  42774. },
  42775. orthoPoint: function(e, t) {
  42776. var i = this.distanceToPoint(e)
  42777. , r = t || new n.Vector3;
  42778. return r.copy(this.normal).multiplyScalar(i)
  42779. },
  42780. intersectLine: function() {
  42781. var e = new n.Vector3;
  42782. return function(t, i) {
  42783. var r = i || new n.Vector3
  42784. , o = t.delta(e)
  42785. , a = this.normal.dot(o);
  42786. if (0 !== a) {
  42787. var s = -(t.start.dot(this.normal) + this.constant) / a;
  42788. if (!(s < 0 || s > 1))
  42789. return r.copy(o).multiplyScalar(s).add(t.start)
  42790. } else if (0 === this.distanceToPoint(t.start))
  42791. return r.copy(t.start)
  42792. }
  42793. }(),
  42794. intersectsLine: function(e) {
  42795. var t = this.distanceToPoint(e.start)
  42796. , i = this.distanceToPoint(e.end);
  42797. return t < 0 && i > 0 || i < 0 && t > 0
  42798. },
  42799. intersectsBox: function(e) {
  42800. return e.intersectsPlane(this)
  42801. },
  42802. intersectsSphere: function(e) {
  42803. return e.intersectsPlane(this)
  42804. },
  42805. coplanarPoint: function(e) {
  42806. var t = e || new n.Vector3;
  42807. return t.copy(this.normal).multiplyScalar(-this.constant)
  42808. },
  42809. applyMatrix4: function() {
  42810. var e = new n.Vector3
  42811. , t = new n.Vector3
  42812. , i = new n.Matrix3;
  42813. return function(n, r) {
  42814. var o = r || i.getNormalMatrix(n)
  42815. , a = e.copy(this.normal).applyMatrix3(o)
  42816. , s = this.coplanarPoint(t);
  42817. return s.applyMatrix4(n),
  42818. this.setFromNormalAndCoplanarPoint(a, s),
  42819. this
  42820. }
  42821. }(),
  42822. translate: function(e) {
  42823. return this.constant = this.constant - e.dot(this.normal),
  42824. this
  42825. },
  42826. equals: function(e) {
  42827. return e.normal.equals(this.normal) && e.constant === this.constant
  42828. }
  42829. },
  42830. n.Spherical = function(e, t, i) {
  42831. return this.radius = void 0 !== e ? e : 1,
  42832. this.phi = void 0 !== t ? t : 0,
  42833. this.theta = void 0 !== i ? i : 0,
  42834. this
  42835. }
  42836. ,
  42837. n.Spherical.prototype = {
  42838. constructor: n.Spherical,
  42839. set: function(e, t, i) {
  42840. this.radius = e,
  42841. this.phi = t,
  42842. this.theta = i
  42843. },
  42844. clone: function() {
  42845. return (new this.constructor).copy(this)
  42846. },
  42847. copy: function(e) {
  42848. return this.radius.copy(e.radius),
  42849. this.phi.copy(e.phi),
  42850. this.theta.copy(e.theta),
  42851. this
  42852. },
  42853. makeSafe: function() {
  42854. var e = 1e-6;
  42855. this.phi = Math.max(e, Math.min(Math.PI - e, this.phi))
  42856. },
  42857. setFromVector3: function(e) {
  42858. return this.radius = e.length(),
  42859. 0 === this.radius ? (this.theta = 0,
  42860. this.phi = 0) : (this.theta = Math.atan2(e.x, e.z),
  42861. this.phi = Math.acos(n.Math.clamp(e.y / this.radius, -1, 1))),
  42862. this
  42863. }
  42864. },
  42865. n.Math = {
  42866. generateUUID: function() {
  42867. var e, t = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split(""), i = new Array(36), n = 0;
  42868. return function() {
  42869. for (var r = 0; r < 36; r++)
  42870. 8 === r || 13 === r || 18 === r || 23 === r ? i[r] = "-" : 14 === r ? i[r] = "4" : (n <= 2 && (n = 33554432 + 16777216 * Math.random() | 0),
  42871. e = 15 & n,
  42872. n >>= 4,
  42873. i[r] = t[19 === r ? 3 & e | 8 : e]);
  42874. return i.join("")
  42875. }
  42876. }(),
  42877. clamp: function(e, t, i) {
  42878. return Math.max(t, Math.min(i, e))
  42879. },
  42880. euclideanModulo: function(e, t) {
  42881. return (e % t + t) % t
  42882. },
  42883. mapLinear: function(e, t, i, n, r) {
  42884. return n + (e - t) * (r - n) / (i - t)
  42885. },
  42886. smoothstep: function(e, t, i) {
  42887. return e <= t ? 0 : e >= i ? 1 : (e = (e - t) / (i - t),
  42888. e * e * (3 - 2 * e))
  42889. },
  42890. smootherstep: function(e, t, i) {
  42891. return e <= t ? 0 : e >= i ? 1 : (e = (e - t) / (i - t),
  42892. e * e * e * (e * (6 * e - 15) + 10))
  42893. },
  42894. random16: function() {
  42895. return console.warn("THREE.Math.random16() has been deprecated. Use Math.random() instead."),
  42896. Math.random()
  42897. },
  42898. randInt: function(e, t) {
  42899. return e + Math.floor(Math.random() * (t - e + 1))
  42900. },
  42901. randFloat: function(e, t) {
  42902. return e + Math.random() * (t - e)
  42903. },
  42904. randFloatSpread: function(e) {
  42905. return e * (.5 - Math.random())
  42906. },
  42907. degToRad: function() {
  42908. var e = Math.PI / 180;
  42909. return function(t) {
  42910. return t * e
  42911. }
  42912. }(),
  42913. radToDeg: function() {
  42914. var e = 180 / Math.PI;
  42915. return function(t) {
  42916. return t * e
  42917. }
  42918. }(),
  42919. isPowerOfTwo: function(e) {
  42920. return 0 === (e & e - 1) && 0 !== e
  42921. },
  42922. nearestPowerOfTwo: function(e) {
  42923. return Math.pow(2, Math.round(Math.log(e) / Math.LN2))
  42924. },
  42925. nextPowerOfTwo: function(e) {
  42926. return e--,
  42927. e |= e >> 1,
  42928. e |= e >> 2,
  42929. e |= e >> 4,
  42930. e |= e >> 8,
  42931. e |= e >> 16,
  42932. e++,
  42933. e
  42934. }
  42935. },
  42936. n.Spline = function(e) {
  42937. function t(e, t, i, n, r, o, a) {
  42938. var s = .5 * (i - e)
  42939. , l = .5 * (n - t);
  42940. return (2 * (t - i) + s + l) * a + (-3 * (t - i) - 2 * s - l) * o + s * r + t
  42941. }
  42942. this.points = e;
  42943. var i, r, o, a, s, l, c, h, u, d = [], p = {
  42944. x: 0,
  42945. y: 0,
  42946. z: 0
  42947. };
  42948. this.initFromArray = function(e) {
  42949. this.points = [];
  42950. for (var t = 0; t < e.length; t++)
  42951. this.points[t] = {
  42952. x: e[t][0],
  42953. y: e[t][1],
  42954. z: e[t][2]
  42955. }
  42956. }
  42957. ,
  42958. this.getPoint = function(e) {
  42959. return i = (this.points.length - 1) * e,
  42960. r = Math.floor(i),
  42961. o = i - r,
  42962. d[0] = 0 === r ? r : r - 1,
  42963. d[1] = r,
  42964. d[2] = r > this.points.length - 2 ? this.points.length - 1 : r + 1,
  42965. d[3] = r > this.points.length - 3 ? this.points.length - 1 : r + 2,
  42966. l = this.points[d[0]],
  42967. c = this.points[d[1]],
  42968. h = this.points[d[2]],
  42969. u = this.points[d[3]],
  42970. a = o * o,
  42971. s = o * a,
  42972. p.x = t(l.x, c.x, h.x, u.x, o, a, s),
  42973. p.y = t(l.y, c.y, h.y, u.y, o, a, s),
  42974. p.z = t(l.z, c.z, h.z, u.z, o, a, s),
  42975. p
  42976. }
  42977. ,
  42978. this.getControlPointsArray = function() {
  42979. var e, t, i = this.points.length, n = [];
  42980. for (e = 0; e < i; e++)
  42981. t = this.points[e],
  42982. n[e] = [t.x, t.y, t.z];
  42983. return n
  42984. }
  42985. ,
  42986. this.getLength = function(e) {
  42987. var t, i, r, o, a = 0, s = 0, l = 0, c = new n.Vector3, h = new n.Vector3, u = [], d = 0;
  42988. for (u[0] = 0,
  42989. e || (e = 100),
  42990. r = this.points.length * e,
  42991. c.copy(this.points[0]),
  42992. t = 1; t < r; t++)
  42993. i = t / r,
  42994. o = this.getPoint(i),
  42995. h.copy(o),
  42996. d += h.distanceTo(c),
  42997. c.copy(o),
  42998. a = (this.points.length - 1) * i,
  42999. s = Math.floor(a),
  43000. s !== l && (u[s] = d,
  43001. l = s);
  43002. return u[u.length] = d,
  43003. {
  43004. chunks: u,
  43005. total: d
  43006. }
  43007. }
  43008. ,
  43009. this.reparametrizeByArcLength = function(e) {
  43010. var t, i, r, o, a, s, l, c, h = [], u = new n.Vector3, d = this.getLength();
  43011. for (h.push(u.copy(this.points[0]).clone()),
  43012. t = 1; t < this.points.length; t++) {
  43013. for (s = d.chunks[t] - d.chunks[t - 1],
  43014. l = Math.ceil(e * s / d.total),
  43015. o = (t - 1) / (this.points.length - 1),
  43016. a = t / (this.points.length - 1),
  43017. i = 1; i < l - 1; i++)
  43018. r = o + i * (1 / l) * (a - o),
  43019. c = this.getPoint(r),
  43020. h.push(u.copy(c).clone());
  43021. h.push(u.copy(this.points[t]).clone())
  43022. }
  43023. this.points = h
  43024. }
  43025. }
  43026. ,
  43027. n.Triangle = function(e, t, i) {
  43028. this.a = void 0 !== e ? e : new n.Vector3,
  43029. this.b = void 0 !== t ? t : new n.Vector3,
  43030. this.c = void 0 !== i ? i : new n.Vector3
  43031. }
  43032. ,
  43033. n.Triangle.normal = function() {
  43034. var e = new n.Vector3;
  43035. return function(t, i, r, o) {
  43036. var a = o || new n.Vector3;
  43037. a.subVectors(r, i),
  43038. e.subVectors(t, i),
  43039. a.cross(e);
  43040. var s = a.lengthSq();
  43041. return s > 0 ? a.multiplyScalar(1 / Math.sqrt(s)) : a.set(0, 0, 0)
  43042. }
  43043. }(),
  43044. n.Triangle.barycoordFromPoint = function() {
  43045. var e = new n.Vector3
  43046. , t = new n.Vector3
  43047. , i = new n.Vector3;
  43048. return function(r, o, a, s, l) {
  43049. e.subVectors(s, o),
  43050. t.subVectors(a, o),
  43051. i.subVectors(r, o);
  43052. var c = e.dot(e)
  43053. , h = e.dot(t)
  43054. , u = e.dot(i)
  43055. , d = t.dot(t)
  43056. , p = t.dot(i)
  43057. , f = c * d - h * h
  43058. , g = l || new n.Vector3;
  43059. if (0 === f)
  43060. return g.set(-2, -1, -1);
  43061. var m = 1 / f
  43062. , v = (d * u - h * p) * m
  43063. , A = (c * p - h * u) * m;
  43064. return g.set(1 - v - A, A, v)
  43065. }
  43066. }(),
  43067. n.Triangle.containsPoint = function() {
  43068. var e = new n.Vector3;
  43069. return function(t, i, r, o) {
  43070. var a = n.Triangle.barycoordFromPoint(t, i, r, o, e);
  43071. return a.x >= 0 && a.y >= 0 && a.x + a.y <= 1
  43072. }
  43073. }(),
  43074. n.Triangle.prototype = {
  43075. constructor: n.Triangle,
  43076. set: function(e, t, i) {
  43077. return this.a.copy(e),
  43078. this.b.copy(t),
  43079. this.c.copy(i),
  43080. this
  43081. },
  43082. setFromPointsAndIndices: function(e, t, i, n) {
  43083. return this.a.copy(e[t]),
  43084. this.b.copy(e[i]),
  43085. this.c.copy(e[n]),
  43086. this
  43087. },
  43088. clone: function() {
  43089. return (new this.constructor).copy(this)
  43090. },
  43091. copy: function(e) {
  43092. return this.a.copy(e.a),
  43093. this.b.copy(e.b),
  43094. this.c.copy(e.c),
  43095. this
  43096. },
  43097. area: function() {
  43098. var e = new n.Vector3
  43099. , t = new n.Vector3;
  43100. return function() {
  43101. return e.subVectors(this.c, this.b),
  43102. t.subVectors(this.a, this.b),
  43103. .5 * e.cross(t).length()
  43104. }
  43105. }(),
  43106. midpoint: function(e) {
  43107. var t = e || new n.Vector3;
  43108. return t.addVectors(this.a, this.b).add(this.c).multiplyScalar(1 / 3)
  43109. },
  43110. normal: function(e) {
  43111. return n.Triangle.normal(this.a, this.b, this.c, e)
  43112. },
  43113. plane: function(e) {
  43114. var t = e || new n.Plane;
  43115. return t.setFromCoplanarPoints(this.a, this.b, this.c)
  43116. },
  43117. barycoordFromPoint: function(e, t) {
  43118. return n.Triangle.barycoordFromPoint(e, this.a, this.b, this.c, t)
  43119. },
  43120. containsPoint: function(e) {
  43121. return n.Triangle.containsPoint(e, this.a, this.b, this.c)
  43122. },
  43123. equals: function(e) {
  43124. return e.a.equals(this.a) && e.b.equals(this.b) && e.c.equals(this.c)
  43125. }
  43126. },
  43127. n.Interpolant = function(e, t, i, n) {
  43128. this.parameterPositions = e,
  43129. this._cachedIndex = 0,
  43130. this.resultBuffer = void 0 !== n ? n : new t.constructor(i),
  43131. this.sampleValues = t,
  43132. this.valueSize = i
  43133. }
  43134. ,
  43135. n.Interpolant.prototype = {
  43136. constructor: n.Interpolant,
  43137. evaluate: function(e) {
  43138. var t = this.parameterPositions
  43139. , i = this._cachedIndex
  43140. , n = t[i]
  43141. , r = t[i - 1];
  43142. e: {
  43143. t: {
  43144. var o;
  43145. i: {
  43146. n: if (!(e < n)) {
  43147. for (var a = i + 2; ; ) {
  43148. if (void 0 === n) {
  43149. if (e < r)
  43150. break n;
  43151. return i = t.length,
  43152. this._cachedIndex = i,
  43153. this.afterEnd_(i - 1, e, r)
  43154. }
  43155. if (i === a)
  43156. break;
  43157. if (r = n,
  43158. n = t[++i],
  43159. e < n)
  43160. break t
  43161. }
  43162. o = t.length;
  43163. break i
  43164. }
  43165. {
  43166. if (e >= r)
  43167. break e;
  43168. var s = t[1];
  43169. e < s && (i = 2,
  43170. r = s);
  43171. for (var a = i - 2; ; ) {
  43172. if (void 0 === r)
  43173. return this._cachedIndex = 0,
  43174. this.beforeStart_(0, e, n);
  43175. if (i === a)
  43176. break;
  43177. if (n = r,
  43178. r = t[--i - 1],
  43179. e >= r)
  43180. break t
  43181. }
  43182. o = i,
  43183. i = 0
  43184. }
  43185. }
  43186. for (; i < o; ) {
  43187. var l = i + o >>> 1;
  43188. e < t[l] ? o = l : i = l + 1
  43189. }
  43190. if (n = t[i],
  43191. r = t[i - 1],
  43192. void 0 === r)
  43193. return this._cachedIndex = 0,
  43194. this.beforeStart_(0, e, n);
  43195. if (void 0 === n)
  43196. return i = t.length,
  43197. this._cachedIndex = i,
  43198. this.afterEnd_(i - 1, r, e)
  43199. }
  43200. this._cachedIndex = i,
  43201. this.intervalChanged_(i, r, n)
  43202. }
  43203. return this.interpolate_(i, r, e, n)
  43204. },
  43205. settings: null,
  43206. DefaultSettings_: {},
  43207. getSettings_: function() {
  43208. return this.settings || this.DefaultSettings_
  43209. },
  43210. copySampleValue_: function(e) {
  43211. for (var t = this.resultBuffer, i = this.sampleValues, n = this.valueSize, r = e * n, o = 0; o !== n; ++o)
  43212. t[o] = i[r + o];
  43213. return t
  43214. },
  43215. interpolate_: function(e, t, i, n) {
  43216. throw new Error("call to abstract method")
  43217. },
  43218. intervalChanged_: function(e, t, i) {}
  43219. },
  43220. Object.assign(n.Interpolant.prototype, {
  43221. beforeStart_: n.Interpolant.prototype.copySampleValue_,
  43222. afterEnd_: n.Interpolant.prototype.copySampleValue_
  43223. }),
  43224. n.CubicInterpolant = function(e, t, i, r) {
  43225. n.Interpolant.call(this, e, t, i, r),
  43226. this._weightPrev = -0,
  43227. this._offsetPrev = -0,
  43228. this._weightNext = -0,
  43229. this._offsetNext = -0
  43230. }
  43231. ,
  43232. n.CubicInterpolant.prototype = Object.assign(Object.create(n.Interpolant.prototype), {
  43233. constructor: n.CubicInterpolant,
  43234. DefaultSettings_: {
  43235. endingStart: n.ZeroCurvatureEnding,
  43236. endingEnd: n.ZeroCurvatureEnding
  43237. },
  43238. intervalChanged_: function(e, t, i) {
  43239. var r = this.parameterPositions
  43240. , o = e - 2
  43241. , a = e + 1
  43242. , s = r[o]
  43243. , l = r[a];
  43244. if (void 0 === s)
  43245. switch (this.getSettings_().endingStart) {
  43246. case n.ZeroSlopeEnding:
  43247. o = e,
  43248. s = 2 * t - i;
  43249. break;
  43250. case n.WrapAroundEnding:
  43251. o = r.length - 2,
  43252. s = t + r[o] - r[o + 1];
  43253. break;
  43254. default:
  43255. o = e,
  43256. s = i
  43257. }
  43258. if (void 0 === l)
  43259. switch (this.getSettings_().endingEnd) {
  43260. case n.ZeroSlopeEnding:
  43261. a = e,
  43262. l = 2 * i - t;
  43263. break;
  43264. case n.WrapAroundEnding:
  43265. a = 1,
  43266. l = i + r[1] - r[0];
  43267. break;
  43268. default:
  43269. a = e - 1,
  43270. l = t
  43271. }
  43272. var c = .5 * (i - t)
  43273. , h = this.valueSize;
  43274. this._weightPrev = c / (t - s),
  43275. this._weightNext = c / (l - i),
  43276. this._offsetPrev = o * h,
  43277. this._offsetNext = a * h
  43278. },
  43279. interpolate_: function(e, t, i, n) {
  43280. 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)
  43281. r[C] = m * o[c + C] + v * o[l + C] + A * o[s + C] + y * o[h + C];
  43282. return r
  43283. }
  43284. }),
  43285. n.DiscreteInterpolant = function(e, t, i, r) {
  43286. n.Interpolant.call(this, e, t, i, r)
  43287. }
  43288. ,
  43289. n.DiscreteInterpolant.prototype = Object.assign(Object.create(n.Interpolant.prototype), {
  43290. constructor: n.DiscreteInterpolant,
  43291. interpolate_: function(e, t, i, n) {
  43292. return this.copySampleValue_(e - 1)
  43293. }
  43294. }),
  43295. n.LinearInterpolant = function(e, t, i, r) {
  43296. n.Interpolant.call(this, e, t, i, r)
  43297. }
  43298. ,
  43299. n.LinearInterpolant.prototype = Object.assign(Object.create(n.Interpolant.prototype), {
  43300. constructor: n.LinearInterpolant,
  43301. interpolate_: function(e, t, i, n) {
  43302. 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)
  43303. r[u] = o[l + u] * h + o[s + u] * c;
  43304. return r
  43305. }
  43306. }),
  43307. n.QuaternionLinearInterpolant = function(e, t, i, r) {
  43308. n.Interpolant.call(this, e, t, i, r)
  43309. }
  43310. ,
  43311. n.QuaternionLinearInterpolant.prototype = Object.assign(Object.create(n.Interpolant.prototype), {
  43312. constructor: n.QuaternionLinearInterpolant,
  43313. interpolate_: function(e, t, i, r) {
  43314. 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)
  43315. n.Quaternion.slerpFlat(o, 0, a, l - s, a, l, c);
  43316. return o
  43317. }
  43318. }),
  43319. n.Clock = function(e) {
  43320. this.autoStart = void 0 === e || e,
  43321. this.startTime = 0,
  43322. this.oldTime = 0,
  43323. this.elapsedTime = 0,
  43324. this.running = !1
  43325. }
  43326. ,
  43327. n.Clock.prototype = {
  43328. constructor: n.Clock,
  43329. start: function() {
  43330. this.startTime = performance.now(),
  43331. this.oldTime = this.startTime,
  43332. this.running = !0
  43333. },
  43334. stop: function() {
  43335. this.getElapsedTime(),
  43336. this.running = !1
  43337. },
  43338. getElapsedTime: function() {
  43339. return this.getDelta(),
  43340. this.elapsedTime
  43341. },
  43342. getDelta: function() {
  43343. var e = 0;
  43344. if (this.autoStart && !this.running && this.start(),
  43345. this.running) {
  43346. var t = performance.now();
  43347. e = .001 * (t - this.oldTime),
  43348. this.oldTime = t,
  43349. this.elapsedTime += e
  43350. }
  43351. return e
  43352. }
  43353. },
  43354. n.EventDispatcher = function() {}
  43355. ,
  43356. n.EventDispatcher.prototype = {
  43357. constructor: n.EventDispatcher,
  43358. apply: function(e) {
  43359. e.addEventListener = n.EventDispatcher.prototype.addEventListener,
  43360. e.hasEventListener = n.EventDispatcher.prototype.hasEventListener,
  43361. e.removeEventListener = n.EventDispatcher.prototype.removeEventListener,
  43362. e.dispatchEvent = n.EventDispatcher.prototype.dispatchEvent
  43363. },
  43364. addEventListener: function(e, t) {
  43365. void 0 === this._listeners && (this._listeners = {});
  43366. var i = this._listeners;
  43367. void 0 === i[e] && (i[e] = []),
  43368. i[e].indexOf(t) === -1 && i[e].push(t)
  43369. },
  43370. hasEventListener: function(e, t) {
  43371. if (void 0 === this._listeners)
  43372. return !1;
  43373. var i = this._listeners;
  43374. return void 0 !== i[e] && i[e].indexOf(t) !== -1
  43375. },
  43376. removeEventListener: function(e, t) {
  43377. if (void 0 !== this._listeners) {
  43378. var i = this._listeners
  43379. , n = i[e];
  43380. if (void 0 !== n) {
  43381. var r = n.indexOf(t);
  43382. r !== -1 && n.splice(r, 1)
  43383. }
  43384. }
  43385. },
  43386. dispatchEvent: function(e) {
  43387. if (void 0 !== this._listeners) {
  43388. var t = this._listeners
  43389. , i = t[e.type];
  43390. if (void 0 !== i) {
  43391. e.target = this;
  43392. for (var n = [], r = i.length, o = 0; o < r; o++)
  43393. n[o] = i[o];
  43394. for (var o = 0; o < r; o++)
  43395. n[o].call(this, e)
  43396. }
  43397. }
  43398. }
  43399. },
  43400. n.Layers = function() {
  43401. this.mask = 1
  43402. }
  43403. ,
  43404. n.Layers.prototype = {
  43405. constructor: n.Layers,
  43406. set: function(e) {
  43407. this.mask = 1 << e
  43408. },
  43409. enable: function(e) {
  43410. this.mask |= 1 << e
  43411. },
  43412. toggle: function(e) {
  43413. this.mask ^= 1 << e
  43414. },
  43415. disable: function(e) {
  43416. this.mask &= ~(1 << e)
  43417. },
  43418. test: function(e) {
  43419. return 0 !== (this.mask & e.mask)
  43420. }
  43421. },
  43422. function(e) {
  43423. function t(e, t) {
  43424. return e.distance - t.distance
  43425. }
  43426. function i(e, t, n, r) {
  43427. if (e.visible !== !1 && (e.raycast(t, n),
  43428. r === !0))
  43429. for (var o = e.children, a = 0, s = o.length; a < s; a++)
  43430. i(o[a], t, n, !0)
  43431. }
  43432. e.Raycaster = function(t, i, n, r) {
  43433. this.ray = new e.Ray(t,i),
  43434. this.near = n || 0,
  43435. this.far = r || 1 / 0,
  43436. this.params = {
  43437. Mesh: {},
  43438. Line: {},
  43439. LOD: {},
  43440. Points: {
  43441. threshold: 1
  43442. },
  43443. Sprite: {}
  43444. },
  43445. Object.defineProperties(this.params, {
  43446. PointCloud: {
  43447. get: function() {
  43448. return console.warn("THREE.Raycaster: params.PointCloud has been renamed to params.Points."),
  43449. this.Points
  43450. }
  43451. }
  43452. })
  43453. }
  43454. ,
  43455. e.Raycaster.prototype = {
  43456. constructor: e.Raycaster,
  43457. linePrecision: 1,
  43458. set: function(e, t) {
  43459. this.ray.set(e, t)
  43460. },
  43461. setFromCamera: function(t, i) {
  43462. i instanceof e.PerspectiveCamera ? (this.ray.origin.setFromMatrixPosition(i.matrixWorld),
  43463. 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),
  43464. this.ray.direction.set(0, 0, -1).transformDirection(i.matrixWorld)) : console.error("THREE.Raycaster: Unsupported camera type.")
  43465. },
  43466. intersectObject: function(e, n) {
  43467. var r = [];
  43468. return i(e, this, r, n),
  43469. r.sort(t),
  43470. r
  43471. },
  43472. intersectObjects: function(e, n) {
  43473. var r = [];
  43474. if (Array.isArray(e) === !1)
  43475. return console.warn("THREE.Raycaster.intersectObjects: objects is not an Array."),
  43476. r;
  43477. for (var o = 0, a = e.length; o < a; o++)
  43478. i(e[o], this, r, n);
  43479. return r.sort(t),
  43480. r
  43481. }
  43482. }
  43483. }(n),
  43484. n.Object3D = function() {
  43485. function e() {
  43486. o.setFromEuler(r, !1)
  43487. }
  43488. function t() {
  43489. r.setFromQuaternion(o, void 0, !1)
  43490. }
  43491. Object.defineProperty(this, "id", {
  43492. value: n.Object3DIdCount++
  43493. }),
  43494. this.uuid = n.Math.generateUUID(),
  43495. this.name = "",
  43496. this.type = "Object3D",
  43497. this.parent = null,
  43498. this.children = [],
  43499. this.up = n.Object3D.DefaultUp.clone();
  43500. var i = new n.Vector3
  43501. , r = new n.Euler
  43502. , o = new n.Quaternion
  43503. , a = new n.Vector3(1,1,1);
  43504. r.onChange(e),
  43505. o.onChange(t),
  43506. Object.defineProperties(this, {
  43507. position: {
  43508. enumerable: !0,
  43509. value: i
  43510. },
  43511. rotation: {
  43512. enumerable: !0,
  43513. value: r
  43514. },
  43515. quaternion: {
  43516. enumerable: !0,
  43517. value: o
  43518. },
  43519. scale: {
  43520. enumerable: !0,
  43521. value: a
  43522. },
  43523. modelViewMatrix: {
  43524. value: new n.Matrix4
  43525. },
  43526. normalMatrix: {
  43527. value: new n.Matrix3
  43528. }
  43529. }),
  43530. this.rotationAutoUpdate = !0,
  43531. this.matrix = new n.Matrix4,
  43532. this.matrixWorld = new n.Matrix4,
  43533. this.matrixAutoUpdate = n.Object3D.DefaultMatrixAutoUpdate,
  43534. this.matrixWorldNeedsUpdate = !1,
  43535. this.layers = new n.Layers,
  43536. this.visible = !0,
  43537. this.castShadow = !1,
  43538. this.receiveShadow = !1,
  43539. this.frustumCulled = !0,
  43540. this.renderOrder = 0,
  43541. this.userData = {}
  43542. }
  43543. ,
  43544. n.Object3D.DefaultUp = new n.Vector3(0,1,0),
  43545. n.Object3D.DefaultMatrixAutoUpdate = !0,
  43546. n.Object3D.prototype = {
  43547. constructor: n.Object3D,
  43548. applyMatrix: function(e) {
  43549. this.matrix.multiplyMatrices(e, this.matrix),
  43550. this.matrix.decompose(this.position, this.quaternion, this.scale)
  43551. },
  43552. setRotationFromAxisAngle: function(e, t) {
  43553. this.quaternion.setFromAxisAngle(e, t)
  43554. },
  43555. setRotationFromEuler: function(e) {
  43556. this.quaternion.setFromEuler(e, !0)
  43557. },
  43558. setRotationFromMatrix: function(e) {
  43559. this.quaternion.setFromRotationMatrix(e)
  43560. },
  43561. setRotationFromQuaternion: function(e) {
  43562. this.quaternion.copy(e)
  43563. },
  43564. rotateOnAxis: function() {
  43565. var e = new n.Quaternion;
  43566. return function(t, i) {
  43567. return e.setFromAxisAngle(t, i),
  43568. this.quaternion.multiply(e),
  43569. this
  43570. }
  43571. }(),
  43572. rotateX: function() {
  43573. var e = new n.Vector3(1,0,0);
  43574. return function(t) {
  43575. return this.rotateOnAxis(e, t)
  43576. }
  43577. }(),
  43578. rotateY: function() {
  43579. var e = new n.Vector3(0,1,0);
  43580. return function(t) {
  43581. return this.rotateOnAxis(e, t)
  43582. }
  43583. }(),
  43584. rotateZ: function() {
  43585. var e = new n.Vector3(0,0,1);
  43586. return function(t) {
  43587. return this.rotateOnAxis(e, t)
  43588. }
  43589. }(),
  43590. translateOnAxis: function() {
  43591. var e = new n.Vector3;
  43592. return function(t, i) {
  43593. return e.copy(t).applyQuaternion(this.quaternion),
  43594. this.position.add(e.multiplyScalar(i)),
  43595. this
  43596. }
  43597. }(),
  43598. translateX: function() {
  43599. var e = new n.Vector3(1,0,0);
  43600. return function(t) {
  43601. return this.translateOnAxis(e, t)
  43602. }
  43603. }(),
  43604. translateY: function() {
  43605. var e = new n.Vector3(0,1,0);
  43606. return function(t) {
  43607. return this.translateOnAxis(e, t)
  43608. }
  43609. }(),
  43610. translateZ: function() {
  43611. var e = new n.Vector3(0,0,1);
  43612. return function(t) {
  43613. return this.translateOnAxis(e, t)
  43614. }
  43615. }(),
  43616. localToWorld: function(e) {
  43617. return e.applyMatrix4(this.matrixWorld)
  43618. },
  43619. worldToLocal: function() {
  43620. var e = new n.Matrix4;
  43621. return function(t) {
  43622. return t.applyMatrix4(e.getInverse(this.matrixWorld))
  43623. }
  43624. }(),
  43625. lookAt: function() {
  43626. var e = new n.Matrix4;
  43627. return function(t) {
  43628. e.lookAt(t, this.position, this.up),
  43629. this.quaternion.setFromRotationMatrix(e)
  43630. }
  43631. }(),
  43632. add: function(e) {
  43633. if (arguments.length > 1) {
  43634. for (var t = 0; t < arguments.length; t++)
  43635. this.add(arguments[t]);
  43636. return this
  43637. }
  43638. return e === this ? (console.error("THREE.Object3D.add: object can't be added as a child of itself.", e),
  43639. this) : (e instanceof n.Object3D ? (null !== e.parent && e.parent.remove(e),
  43640. e.parent = this,
  43641. e.dispatchEvent({
  43642. type: "added"
  43643. }),
  43644. this.children.push(e)) : console.error("THREE.Object3D.add: object not an instance of THREE.Object3D.", e),
  43645. this)
  43646. },
  43647. remove: function(e) {
  43648. if (arguments.length > 1)
  43649. for (var t = 0; t < arguments.length; t++)
  43650. this.remove(arguments[t]);
  43651. var i = this.children.indexOf(e);
  43652. i !== -1 && (e.parent = null,
  43653. e.dispatchEvent({
  43654. type: "removed"
  43655. }),
  43656. this.children.splice(i, 1))
  43657. },
  43658. getObjectById: function(e) {
  43659. return this.getObjectByProperty("id", e)
  43660. },
  43661. getObjectByName: function(e) {
  43662. return this.getObjectByProperty("name", e)
  43663. },
  43664. getObjectByProperty: function(e, t) {
  43665. if (this[e] === t)
  43666. return this;
  43667. for (var i = 0, n = this.children.length; i < n; i++) {
  43668. var r = this.children[i]
  43669. , o = r.getObjectByProperty(e, t);
  43670. if (void 0 !== o)
  43671. return o
  43672. }
  43673. },
  43674. getWorldPosition: function(e) {
  43675. var t = e || new n.Vector3;
  43676. return this.updateMatrixWorld(!0),
  43677. t.setFromMatrixPosition(this.matrixWorld)
  43678. },
  43679. getWorldQuaternion: function() {
  43680. var e = new n.Vector3
  43681. , t = new n.Vector3;
  43682. return function(i) {
  43683. var r = i || new n.Quaternion;
  43684. return this.updateMatrixWorld(!0),
  43685. this.matrixWorld.decompose(e, r, t),
  43686. r
  43687. }
  43688. }(),
  43689. getWorldRotation: function() {
  43690. var e = new n.Quaternion;
  43691. return function(t) {
  43692. var i = t || new n.Euler;
  43693. return this.getWorldQuaternion(e),
  43694. i.setFromQuaternion(e, this.rotation.order, !1)
  43695. }
  43696. }(),
  43697. getWorldScale: function() {
  43698. var e = new n.Vector3
  43699. , t = new n.Quaternion;
  43700. return function(i) {
  43701. var r = i || new n.Vector3;
  43702. return this.updateMatrixWorld(!0),
  43703. this.matrixWorld.decompose(e, t, r),
  43704. r
  43705. }
  43706. }(),
  43707. getWorldDirection: function() {
  43708. var e = new n.Quaternion;
  43709. return function(t) {
  43710. var i = t || new n.Vector3;
  43711. return this.getWorldQuaternion(e),
  43712. i.set(0, 0, 1).applyQuaternion(e)
  43713. }
  43714. }(),
  43715. raycast: function() {},
  43716. traverse: function(e) {
  43717. e(this);
  43718. for (var t = this.children, i = 0, n = t.length; i < n; i++)
  43719. t[i].traverse(e)
  43720. },
  43721. traverseVisible: function(e) {
  43722. if (this.visible !== !1) {
  43723. e(this);
  43724. for (var t = this.children, i = 0, n = t.length; i < n; i++)
  43725. t[i].traverseVisible(e)
  43726. }
  43727. },
  43728. traverseAncestors: function(e) {
  43729. var t = this.parent;
  43730. null !== t && (e(t),
  43731. t.traverseAncestors(e))
  43732. },
  43733. updateMatrix: function() {
  43734. this.matrix.compose(this.position, this.quaternion, this.scale),
  43735. this.matrixWorldNeedsUpdate = !0
  43736. },
  43737. updateMatrixWorld: function(e) {
  43738. this.matrixAutoUpdate === !0 && this.updateMatrix(),
  43739. this.matrixWorldNeedsUpdate !== !0 && e !== !0 || (null === this.parent ? this.matrixWorld.copy(this.matrix) : this.matrixWorld.multiplyMatrices(this.parent.matrixWorld, this.matrix),
  43740. this.matrixWorldNeedsUpdate = !1,
  43741. e = !0);
  43742. for (var t = 0, i = this.children.length; t < i; t++)
  43743. this.children[t].updateMatrixWorld(e)
  43744. },
  43745. toJSON: function(e) {
  43746. function t(e) {
  43747. var t = [];
  43748. for (var i in e) {
  43749. var n = e[i];
  43750. delete n.metadata,
  43751. t.push(n)
  43752. }
  43753. return t
  43754. }
  43755. var i = void 0 === e
  43756. , n = {};
  43757. i && (e = {
  43758. geometries: {},
  43759. materials: {},
  43760. textures: {},
  43761. images: {}
  43762. },
  43763. n.metadata = {
  43764. version: 4.4,
  43765. type: "Object",
  43766. generator: "Object3D.toJSON"
  43767. });
  43768. var r = {};
  43769. if (r.uuid = this.uuid,
  43770. r.type = this.type,
  43771. "" !== this.name && (r.name = this.name),
  43772. "{}" !== JSON.stringify(this.userData) && (r.userData = this.userData),
  43773. this.castShadow === !0 && (r.castShadow = !0),
  43774. this.receiveShadow === !0 && (r.receiveShadow = !0),
  43775. this.visible === !1 && (r.visible = !1),
  43776. r.matrix = this.matrix.toArray(),
  43777. void 0 !== this.geometry && (void 0 === e.geometries[this.geometry.uuid] && (e.geometries[this.geometry.uuid] = this.geometry.toJSON(e)),
  43778. r.geometry = this.geometry.uuid),
  43779. void 0 !== this.material && (void 0 === e.materials[this.material.uuid] && (e.materials[this.material.uuid] = this.material.toJSON(e)),
  43780. r.material = this.material.uuid),
  43781. this.children.length > 0) {
  43782. r.children = [];
  43783. for (var o = 0; o < this.children.length; o++)
  43784. r.children.push(this.children[o].toJSON(e).object)
  43785. }
  43786. if (i) {
  43787. var a = t(e.geometries)
  43788. , s = t(e.materials)
  43789. , l = t(e.textures)
  43790. , c = t(e.images);
  43791. a.length > 0 && (n.geometries = a),
  43792. s.length > 0 && (n.materials = s),
  43793. l.length > 0 && (n.textures = l),
  43794. c.length > 0 && (n.images = c)
  43795. }
  43796. return n.object = r,
  43797. n
  43798. },
  43799. clone: function(e) {
  43800. return (new this.constructor).copy(this, e)
  43801. },
  43802. copy: function(e, t) {
  43803. if (void 0 === t && (t = !0),
  43804. this.name = e.name,
  43805. this.up.copy(e.up),
  43806. this.position.copy(e.position),
  43807. this.quaternion.copy(e.quaternion),
  43808. this.scale.copy(e.scale),
  43809. this.rotationAutoUpdate = e.rotationAutoUpdate,
  43810. this.matrix.copy(e.matrix),
  43811. this.matrixWorld.copy(e.matrixWorld),
  43812. this.matrixAutoUpdate = e.matrixAutoUpdate,
  43813. this.matrixWorldNeedsUpdate = e.matrixWorldNeedsUpdate,
  43814. this.visible = e.visible,
  43815. this.castShadow = e.castShadow,
  43816. this.receiveShadow = e.receiveShadow,
  43817. this.frustumCulled = e.frustumCulled,
  43818. this.renderOrder = e.renderOrder,
  43819. this.userData = JSON.parse(JSON.stringify(e.userData)),
  43820. t === !0)
  43821. for (var i = 0; i < e.children.length; i++) {
  43822. var n = e.children[i];
  43823. this.add(n.clone())
  43824. }
  43825. return this
  43826. }
  43827. },
  43828. n.EventDispatcher.prototype.apply(n.Object3D.prototype),
  43829. n.Object3DIdCount = 0,
  43830. n.Face3 = function(e, t, i, r, o, a) {
  43831. this.a = e,
  43832. this.b = t,
  43833. this.c = i,
  43834. this.normal = r instanceof n.Vector3 ? r : new n.Vector3,
  43835. this.vertexNormals = Array.isArray(r) ? r : [],
  43836. this.color = o instanceof n.Color ? o : new n.Color,
  43837. this.vertexColors = Array.isArray(o) ? o : [],
  43838. this.materialIndex = void 0 !== a ? a : 0
  43839. }
  43840. ,
  43841. n.Face3.prototype = {
  43842. constructor: n.Face3,
  43843. clone: function() {
  43844. return (new this.constructor).copy(this)
  43845. },
  43846. copy: function(e) {
  43847. this.a = e.a,
  43848. this.b = e.b,
  43849. this.c = e.c,
  43850. this.normal.copy(e.normal),
  43851. this.color.copy(e.color),
  43852. this.materialIndex = e.materialIndex;
  43853. for (var t = 0, i = e.vertexNormals.length; t < i; t++)
  43854. this.vertexNormals[t] = e.vertexNormals[t].clone();
  43855. for (var t = 0, i = e.vertexColors.length; t < i; t++)
  43856. this.vertexColors[t] = e.vertexColors[t].clone();
  43857. return this
  43858. }
  43859. },
  43860. n.BufferAttribute = function(e, t) {
  43861. this.uuid = n.Math.generateUUID(),
  43862. this.array = e,
  43863. this.itemSize = t,
  43864. this.dynamic = !1,
  43865. this.updateRange = {
  43866. offset: 0,
  43867. count: -1
  43868. },
  43869. this.version = 0
  43870. }
  43871. ,
  43872. n.BufferAttribute.prototype = {
  43873. constructor: n.BufferAttribute,
  43874. get count() {
  43875. return this.array.length / this.itemSize
  43876. },
  43877. set needsUpdate(e) {
  43878. e === !0 && this.version++
  43879. },
  43880. setDynamic: function(e) {
  43881. return this.dynamic = e,
  43882. this
  43883. },
  43884. copy: function(e) {
  43885. return this.array = new e.array.constructor(e.array),
  43886. this.itemSize = e.itemSize,
  43887. this.dynamic = e.dynamic,
  43888. this
  43889. },
  43890. copyAt: function(e, t, i) {
  43891. e *= this.itemSize,
  43892. i *= t.itemSize;
  43893. for (var n = 0, r = this.itemSize; n < r; n++)
  43894. this.array[e + n] = t.array[i + n];
  43895. return this
  43896. },
  43897. copyArray: function(e) {
  43898. return this.array.set(e),
  43899. this
  43900. },
  43901. copyColorsArray: function(e) {
  43902. for (var t = this.array, i = 0, r = 0, o = e.length; r < o; r++) {
  43903. var a = e[r];
  43904. void 0 === a && (console.warn("THREE.BufferAttribute.copyColorsArray(): color is undefined", r),
  43905. a = new n.Color),
  43906. t[i++] = a.r,
  43907. t[i++] = a.g,
  43908. t[i++] = a.b
  43909. }
  43910. return this
  43911. },
  43912. copyIndicesArray: function(e) {
  43913. for (var t = this.array, i = 0, n = 0, r = e.length; n < r; n++) {
  43914. var o = e[n];
  43915. t[i++] = o.a,
  43916. t[i++] = o.b,
  43917. t[i++] = o.c
  43918. }
  43919. return this
  43920. },
  43921. copyVector2sArray: function(e) {
  43922. for (var t = this.array, i = 0, r = 0, o = e.length; r < o; r++) {
  43923. var a = e[r];
  43924. void 0 === a && (console.warn("THREE.BufferAttribute.copyVector2sArray(): vector is undefined", r),
  43925. a = new n.Vector2),
  43926. t[i++] = a.x,
  43927. t[i++] = a.y
  43928. }
  43929. return this
  43930. },
  43931. copyVector3sArray: function(e) {
  43932. for (var t = this.array, i = 0, r = 0, o = e.length; r < o; r++) {
  43933. var a = e[r];
  43934. void 0 === a && (console.warn("THREE.BufferAttribute.copyVector3sArray(): vector is undefined", r),
  43935. a = new n.Vector3),
  43936. t[i++] = a.x,
  43937. t[i++] = a.y,
  43938. t[i++] = a.z
  43939. }
  43940. return this
  43941. },
  43942. copyVector4sArray: function(e) {
  43943. for (var t = this.array, i = 0, r = 0, o = e.length; r < o; r++) {
  43944. var a = e[r];
  43945. void 0 === a && (console.warn("THREE.BufferAttribute.copyVector4sArray(): vector is undefined", r),
  43946. a = new n.Vector4),
  43947. t[i++] = a.x,
  43948. t[i++] = a.y,
  43949. t[i++] = a.z,
  43950. t[i++] = a.w
  43951. }
  43952. return this
  43953. },
  43954. set: function(e, t) {
  43955. return void 0 === t && (t = 0),
  43956. this.array.set(e, t),
  43957. this
  43958. },
  43959. getX: function(e) {
  43960. return this.array[e * this.itemSize]
  43961. },
  43962. setX: function(e, t) {
  43963. return this.array[e * this.itemSize] = t,
  43964. this
  43965. },
  43966. getY: function(e) {
  43967. return this.array[e * this.itemSize + 1]
  43968. },
  43969. setY: function(e, t) {
  43970. return this.array[e * this.itemSize + 1] = t,
  43971. this
  43972. },
  43973. getZ: function(e) {
  43974. return this.array[e * this.itemSize + 2]
  43975. },
  43976. setZ: function(e, t) {
  43977. return this.array[e * this.itemSize + 2] = t,
  43978. this
  43979. },
  43980. getW: function(e) {
  43981. return this.array[e * this.itemSize + 3]
  43982. },
  43983. setW: function(e, t) {
  43984. return this.array[e * this.itemSize + 3] = t,
  43985. this
  43986. },
  43987. setXY: function(e, t, i) {
  43988. return e *= this.itemSize,
  43989. this.array[e + 0] = t,
  43990. this.array[e + 1] = i,
  43991. this
  43992. },
  43993. setXYZ: function(e, t, i, n) {
  43994. return e *= this.itemSize,
  43995. this.array[e + 0] = t,
  43996. this.array[e + 1] = i,
  43997. this.array[e + 2] = n,
  43998. this
  43999. },
  44000. setXYZW: function(e, t, i, n, r) {
  44001. return e *= this.itemSize,
  44002. this.array[e + 0] = t,
  44003. this.array[e + 1] = i,
  44004. this.array[e + 2] = n,
  44005. this.array[e + 3] = r,
  44006. this
  44007. },
  44008. clone: function() {
  44009. return (new this.constructor).copy(this)
  44010. }
  44011. },
  44012. n.Int8Attribute = function(e, t) {
  44013. return new n.BufferAttribute(new Int8Array(e),t)
  44014. }
  44015. ,
  44016. n.Uint8Attribute = function(e, t) {
  44017. return new n.BufferAttribute(new Uint8Array(e),t)
  44018. }
  44019. ,
  44020. n.Uint8ClampedAttribute = function(e, t) {
  44021. return new n.BufferAttribute(new Uint8ClampedArray(e),t)
  44022. }
  44023. ,
  44024. n.Int16Attribute = function(e, t) {
  44025. return new n.BufferAttribute(new Int16Array(e),t)
  44026. }
  44027. ,
  44028. n.Uint16Attribute = function(e, t) {
  44029. return new n.BufferAttribute(new Uint16Array(e),t)
  44030. }
  44031. ;
  44032. n.Int32Attribute = function(e, t) {
  44033. return new n.BufferAttribute(new Int32Array(e),t)
  44034. }
  44035. ;
  44036. n.Uint32Attribute = function(e, t) {
  44037. return new n.BufferAttribute(new Uint32Array(e),t)
  44038. }
  44039. ,
  44040. n.Float32Attribute = function(e, t) {
  44041. return new n.BufferAttribute(new Float32Array(e),t)
  44042. }
  44043. ,
  44044. n.Float64Attribute = function(e, t) {
  44045. return new n.BufferAttribute(new Float64Array(e),t)
  44046. }
  44047. ,
  44048. n.DynamicBufferAttribute = function(e, t) {
  44049. return console.warn("THREE.DynamicBufferAttribute has been removed. Use new THREE.BufferAttribute().setDynamic( true ) instead."),
  44050. new n.BufferAttribute(e,t).setDynamic(!0)
  44051. }
  44052. ,
  44053. n.InstancedBufferAttribute = function(e, t, i) {
  44054. n.BufferAttribute.call(this, e, t),
  44055. this.meshPerAttribute = i || 1
  44056. }
  44057. ,
  44058. n.InstancedBufferAttribute.prototype = Object.create(n.BufferAttribute.prototype),
  44059. n.InstancedBufferAttribute.prototype.constructor = n.InstancedBufferAttribute,
  44060. n.InstancedBufferAttribute.prototype.copy = function(e) {
  44061. return n.BufferAttribute.prototype.copy.call(this, e),
  44062. this.meshPerAttribute = e.meshPerAttribute,
  44063. this
  44064. }
  44065. ,
  44066. n.InterleavedBuffer = function(e, t) {
  44067. this.uuid = n.Math.generateUUID(),
  44068. this.array = e,
  44069. this.stride = t,
  44070. this.dynamic = !1,
  44071. this.updateRange = {
  44072. offset: 0,
  44073. count: -1
  44074. },
  44075. this.version = 0
  44076. }
  44077. ,
  44078. n.InterleavedBuffer.prototype = {
  44079. constructor: n.InterleavedBuffer,
  44080. get length() {
  44081. return this.array.length
  44082. },
  44083. get count() {
  44084. return this.array.length / this.stride
  44085. },
  44086. set needsUpdate(e) {
  44087. e === !0 && this.version++
  44088. },
  44089. setDynamic: function(e) {
  44090. return this.dynamic = e,
  44091. this
  44092. },
  44093. copy: function(e) {
  44094. return this.array = new e.array.constructor(e.array),
  44095. this.stride = e.stride,
  44096. this.dynamic = e.dynamic,
  44097. this
  44098. },
  44099. copyAt: function(e, t, i) {
  44100. e *= this.stride,
  44101. i *= t.stride;
  44102. for (var n = 0, r = this.stride; n < r; n++)
  44103. this.array[e + n] = t.array[i + n];
  44104. return this
  44105. },
  44106. set: function(e, t) {
  44107. return void 0 === t && (t = 0),
  44108. this.array.set(e, t),
  44109. this
  44110. },
  44111. clone: function() {
  44112. return (new this.constructor).copy(this)
  44113. }
  44114. },
  44115. n.InstancedInterleavedBuffer = function(e, t, i) {
  44116. n.InterleavedBuffer.call(this, e, t),
  44117. this.meshPerAttribute = i || 1
  44118. }
  44119. ,
  44120. n.InstancedInterleavedBuffer.prototype = Object.create(n.InterleavedBuffer.prototype),
  44121. n.InstancedInterleavedBuffer.prototype.constructor = n.InstancedInterleavedBuffer,
  44122. n.InstancedInterleavedBuffer.prototype.copy = function(e) {
  44123. return n.InterleavedBuffer.prototype.copy.call(this, e),
  44124. this.meshPerAttribute = e.meshPerAttribute,
  44125. this
  44126. }
  44127. ,
  44128. n.InterleavedBufferAttribute = function(e, t, i) {
  44129. this.uuid = n.Math.generateUUID(),
  44130. this.data = e,
  44131. this.itemSize = t,
  44132. this.offset = i
  44133. }
  44134. ,
  44135. n.InterleavedBufferAttribute.prototype = {
  44136. constructor: n.InterleavedBufferAttribute,
  44137. get length() {
  44138. return console.warn("THREE.BufferAttribute: .length has been deprecated. Please use .count."),
  44139. this.array.length
  44140. },
  44141. get count() {
  44142. return this.data.count
  44143. },
  44144. setX: function(e, t) {
  44145. return this.data.array[e * this.data.stride + this.offset] = t,
  44146. this
  44147. },
  44148. setY: function(e, t) {
  44149. return this.data.array[e * this.data.stride + this.offset + 1] = t,
  44150. this
  44151. },
  44152. setZ: function(e, t) {
  44153. return this.data.array[e * this.data.stride + this.offset + 2] = t,
  44154. this
  44155. },
  44156. setW: function(e, t) {
  44157. return this.data.array[e * this.data.stride + this.offset + 3] = t,
  44158. this
  44159. },
  44160. getX: function(e) {
  44161. return this.data.array[e * this.data.stride + this.offset]
  44162. },
  44163. getY: function(e) {
  44164. return this.data.array[e * this.data.stride + this.offset + 1]
  44165. },
  44166. getZ: function(e) {
  44167. return this.data.array[e * this.data.stride + this.offset + 2]
  44168. },
  44169. getW: function(e) {
  44170. return this.data.array[e * this.data.stride + this.offset + 3]
  44171. },
  44172. setXY: function(e, t, i) {
  44173. return e = e * this.data.stride + this.offset,
  44174. this.data.array[e + 0] = t,
  44175. this.data.array[e + 1] = i,
  44176. this
  44177. },
  44178. setXYZ: function(e, t, i, n) {
  44179. return e = e * this.data.stride + this.offset,
  44180. this.data.array[e + 0] = t,
  44181. this.data.array[e + 1] = i,
  44182. this.data.array[e + 2] = n,
  44183. this
  44184. },
  44185. setXYZW: function(e, t, i, n, r) {
  44186. return e = e * this.data.stride + this.offset,
  44187. this.data.array[e + 0] = t,
  44188. this.data.array[e + 1] = i,
  44189. this.data.array[e + 2] = n,
  44190. this.data.array[e + 3] = r,
  44191. this
  44192. }
  44193. },
  44194. n.Geometry = function() {
  44195. Object.defineProperty(this, "id", {
  44196. value: n.GeometryIdCount++
  44197. }),
  44198. this.uuid = n.Math.generateUUID(),
  44199. this.name = "",
  44200. this.type = "Geometry",
  44201. this.vertices = [],
  44202. this.colors = [],
  44203. this.faces = [],
  44204. this.faceVertexUvs = [[]],
  44205. this.morphTargets = [],
  44206. this.morphNormals = [],
  44207. this.skinWeights = [],
  44208. this.skinIndices = [],
  44209. this.lineDistances = [],
  44210. this.boundingBox = null,
  44211. this.boundingSphere = null,
  44212. this.verticesNeedUpdate = !1,
  44213. this.elementsNeedUpdate = !1,
  44214. this.uvsNeedUpdate = !1,
  44215. this.normalsNeedUpdate = !1,
  44216. this.colorsNeedUpdate = !1,
  44217. this.lineDistancesNeedUpdate = !1,
  44218. this.groupsNeedUpdate = !1
  44219. }
  44220. ,
  44221. n.Geometry.prototype = {
  44222. constructor: n.Geometry,
  44223. applyMatrix: function(e) {
  44224. for (var t = (new n.Matrix3).getNormalMatrix(e), i = 0, r = this.vertices.length; i < r; i++) {
  44225. var o = this.vertices[i];
  44226. o.applyMatrix4(e)
  44227. }
  44228. for (var i = 0, r = this.faces.length; i < r; i++) {
  44229. var a = this.faces[i];
  44230. a.normal.applyMatrix3(t).normalize();
  44231. for (var s = 0, l = a.vertexNormals.length; s < l; s++)
  44232. a.vertexNormals[s].applyMatrix3(t).normalize()
  44233. }
  44234. return null !== this.boundingBox && this.computeBoundingBox(),
  44235. null !== this.boundingSphere && this.computeBoundingSphere(),
  44236. this.verticesNeedUpdate = !0,
  44237. this.normalsNeedUpdate = !0,
  44238. this
  44239. },
  44240. rotateX: function() {
  44241. var e;
  44242. return function(t) {
  44243. return void 0 === e && (e = new n.Matrix4),
  44244. e.makeRotationX(t),
  44245. this.applyMatrix(e),
  44246. this
  44247. }
  44248. }(),
  44249. rotateY: function() {
  44250. var e;
  44251. return function(t) {
  44252. return void 0 === e && (e = new n.Matrix4),
  44253. e.makeRotationY(t),
  44254. this.applyMatrix(e),
  44255. this
  44256. }
  44257. }(),
  44258. rotateZ: function() {
  44259. var e;
  44260. return function(t) {
  44261. return void 0 === e && (e = new n.Matrix4),
  44262. e.makeRotationZ(t),
  44263. this.applyMatrix(e),
  44264. this
  44265. }
  44266. }(),
  44267. translate: function() {
  44268. var e;
  44269. return function(t, i, r) {
  44270. return void 0 === e && (e = new n.Matrix4),
  44271. e.makeTranslation(t, i, r),
  44272. this.applyMatrix(e),
  44273. this
  44274. }
  44275. }(),
  44276. scale: function() {
  44277. var e;
  44278. return function(t, i, r) {
  44279. return void 0 === e && (e = new n.Matrix4),
  44280. e.makeScale(t, i, r),
  44281. this.applyMatrix(e),
  44282. this
  44283. }
  44284. }(),
  44285. lookAt: function() {
  44286. var e;
  44287. return function(t) {
  44288. void 0 === e && (e = new n.Object3D),
  44289. e.lookAt(t),
  44290. e.updateMatrix(),
  44291. this.applyMatrix(e.matrix)
  44292. }
  44293. }(),
  44294. fromBufferGeometry: function(e) {
  44295. function t(e, t, r, o) {
  44296. var a = void 0 !== s ? [u[e].clone(), u[t].clone(), u[r].clone()] : []
  44297. , f = void 0 !== l ? [i.colors[e].clone(), i.colors[t].clone(), i.colors[r].clone()] : []
  44298. , g = new n.Face3(e,t,r,a,f,o);
  44299. i.faces.push(g),
  44300. void 0 !== c && i.faceVertexUvs[0].push([d[e].clone(), d[t].clone(), d[r].clone()]),
  44301. void 0 !== h && i.faceVertexUvs[1].push([p[e].clone(), p[t].clone(), p[r].clone()])
  44302. }
  44303. var i = this
  44304. , r = null !== e.index ? e.index.array : void 0
  44305. , o = e.attributes
  44306. , a = o.position.array
  44307. , s = void 0 !== o.normal ? o.normal.array : void 0
  44308. , l = void 0 !== o.color ? o.color.array : void 0
  44309. , c = void 0 !== o.uv ? o.uv.array : void 0
  44310. , h = void 0 !== o.uv2 ? o.uv2.array : void 0;
  44311. void 0 !== h && (this.faceVertexUvs[1] = []);
  44312. for (var u = [], d = [], p = [], f = 0, g = 0; f < a.length; f += 3,
  44313. g += 2)
  44314. i.vertices.push(new n.Vector3(a[f],a[f + 1],a[f + 2])),
  44315. void 0 !== s && u.push(new n.Vector3(s[f],s[f + 1],s[f + 2])),
  44316. void 0 !== l && i.colors.push(new n.Color(l[f],l[f + 1],l[f + 2])),
  44317. void 0 !== c && d.push(new n.Vector2(c[g],c[g + 1])),
  44318. void 0 !== h && p.push(new n.Vector2(h[g],h[g + 1]));
  44319. if (void 0 !== r) {
  44320. var m = e.groups;
  44321. if (m.length > 0)
  44322. for (var f = 0; f < m.length; f++)
  44323. for (var v = m[f], A = v.start, y = v.count, g = A, C = A + y; g < C; g += 3)
  44324. t(r[g], r[g + 1], r[g + 2], v.materialIndex);
  44325. else
  44326. for (var f = 0; f < r.length; f += 3)
  44327. t(r[f], r[f + 1], r[f + 2])
  44328. } else
  44329. for (var f = 0; f < a.length / 3; f += 3)
  44330. t(f, f + 1, f + 2);
  44331. return this.computeFaceNormals(),
  44332. null !== e.boundingBox && (this.boundingBox = e.boundingBox.clone()),
  44333. null !== e.boundingSphere && (this.boundingSphere = e.boundingSphere.clone()),
  44334. this
  44335. },
  44336. center: function() {
  44337. this.computeBoundingBox();
  44338. var e = this.boundingBox.center().negate();
  44339. return this.translate(e.x, e.y, e.z),
  44340. e
  44341. },
  44342. normalize: function() {
  44343. this.computeBoundingSphere();
  44344. var e = this.boundingSphere.center
  44345. , t = this.boundingSphere.radius
  44346. , i = 0 === t ? 1 : 1 / t
  44347. , r = new n.Matrix4;
  44348. 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),
  44349. this.applyMatrix(r),
  44350. this
  44351. },
  44352. computeFaceNormals: function() {
  44353. for (var e = new n.Vector3, t = new n.Vector3, i = 0, r = this.faces.length; i < r; i++) {
  44354. var o = this.faces[i]
  44355. , a = this.vertices[o.a]
  44356. , s = this.vertices[o.b]
  44357. , l = this.vertices[o.c];
  44358. e.subVectors(l, s),
  44359. t.subVectors(a, s),
  44360. e.cross(t),
  44361. e.normalize(),
  44362. o.normal.copy(e)
  44363. }
  44364. },
  44365. computeVertexNormals: function(e) {
  44366. void 0 === e && (e = !0);
  44367. var t, i, r, o, a, s;
  44368. for (s = new Array(this.vertices.length),
  44369. t = 0,
  44370. i = this.vertices.length; t < i; t++)
  44371. s[t] = new n.Vector3;
  44372. if (e) {
  44373. var l, c, h, u = new n.Vector3, d = new n.Vector3;
  44374. for (r = 0,
  44375. o = this.faces.length; r < o; r++)
  44376. a = this.faces[r],
  44377. l = this.vertices[a.a],
  44378. c = this.vertices[a.b],
  44379. h = this.vertices[a.c],
  44380. u.subVectors(h, c),
  44381. d.subVectors(l, c),
  44382. u.cross(d),
  44383. s[a.a].add(u),
  44384. s[a.b].add(u),
  44385. s[a.c].add(u)
  44386. } else
  44387. for (r = 0,
  44388. o = this.faces.length; r < o; r++)
  44389. a = this.faces[r],
  44390. s[a.a].add(a.normal),
  44391. s[a.b].add(a.normal),
  44392. s[a.c].add(a.normal);
  44393. for (t = 0,
  44394. i = this.vertices.length; t < i; t++)
  44395. s[t].normalize();
  44396. for (r = 0,
  44397. o = this.faces.length; r < o; r++) {
  44398. a = this.faces[r];
  44399. var p = a.vertexNormals;
  44400. 3 === p.length ? (p[0].copy(s[a.a]),
  44401. p[1].copy(s[a.b]),
  44402. p[2].copy(s[a.c])) : (p[0] = s[a.a].clone(),
  44403. p[1] = s[a.b].clone(),
  44404. p[2] = s[a.c].clone())
  44405. }
  44406. this.faces.length > 0 && (this.normalsNeedUpdate = !0)
  44407. },
  44408. computeMorphNormals: function() {
  44409. var e, t, i, r, o;
  44410. for (i = 0,
  44411. r = this.faces.length; i < r; i++)
  44412. for (o = this.faces[i],
  44413. o.__originalFaceNormal ? o.__originalFaceNormal.copy(o.normal) : o.__originalFaceNormal = o.normal.clone(),
  44414. o.__originalVertexNormals || (o.__originalVertexNormals = []),
  44415. e = 0,
  44416. t = o.vertexNormals.length; e < t; e++)
  44417. o.__originalVertexNormals[e] ? o.__originalVertexNormals[e].copy(o.vertexNormals[e]) : o.__originalVertexNormals[e] = o.vertexNormals[e].clone();
  44418. var a = new n.Geometry;
  44419. for (a.faces = this.faces,
  44420. e = 0,
  44421. t = this.morphTargets.length; e < t; e++) {
  44422. if (!this.morphNormals[e]) {
  44423. this.morphNormals[e] = {},
  44424. this.morphNormals[e].faceNormals = [],
  44425. this.morphNormals[e].vertexNormals = [];
  44426. var s, l, c = this.morphNormals[e].faceNormals, h = this.morphNormals[e].vertexNormals;
  44427. for (i = 0,
  44428. r = this.faces.length; i < r; i++)
  44429. s = new n.Vector3,
  44430. l = {
  44431. a: new n.Vector3,
  44432. b: new n.Vector3,
  44433. c: new n.Vector3
  44434. },
  44435. c.push(s),
  44436. h.push(l)
  44437. }
  44438. var u = this.morphNormals[e];
  44439. a.vertices = this.morphTargets[e].vertices,
  44440. a.computeFaceNormals(),
  44441. a.computeVertexNormals();
  44442. var s, l;
  44443. for (i = 0,
  44444. r = this.faces.length; i < r; i++)
  44445. o = this.faces[i],
  44446. s = u.faceNormals[i],
  44447. l = u.vertexNormals[i],
  44448. s.copy(o.normal),
  44449. l.a.copy(o.vertexNormals[0]),
  44450. l.b.copy(o.vertexNormals[1]),
  44451. l.c.copy(o.vertexNormals[2])
  44452. }
  44453. for (i = 0,
  44454. r = this.faces.length; i < r; i++)
  44455. o = this.faces[i],
  44456. o.normal = o.__originalFaceNormal,
  44457. o.vertexNormals = o.__originalVertexNormals
  44458. },
  44459. computeTangents: function() {
  44460. console.warn("THREE.Geometry: .computeTangents() has been removed.")
  44461. },
  44462. computeLineDistances: function() {
  44463. for (var e = 0, t = this.vertices, i = 0, n = t.length; i < n; i++)
  44464. i > 0 && (e += t[i].distanceTo(t[i - 1])),
  44465. this.lineDistances[i] = e
  44466. },
  44467. computeBoundingBox: function() {
  44468. null === this.boundingBox && (this.boundingBox = new n.Box3),
  44469. this.boundingBox.setFromPoints(this.vertices)
  44470. },
  44471. computeBoundingSphere: function() {
  44472. null === this.boundingSphere && (this.boundingSphere = new n.Sphere),
  44473. this.boundingSphere.setFromPoints(this.vertices)
  44474. },
  44475. merge: function(e, t, i) {
  44476. if (e instanceof n.Geometry == !1)
  44477. return void console.error("THREE.Geometry.merge(): geometry not an instance of THREE.Geometry.", e);
  44478. 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];
  44479. void 0 === i && (i = 0),
  44480. void 0 !== t && (r = (new n.Matrix3).getNormalMatrix(t));
  44481. for (var d = 0, p = s.length; d < p; d++) {
  44482. var f = s[d]
  44483. , g = f.clone();
  44484. void 0 !== t && g.applyMatrix4(t),
  44485. a.push(g)
  44486. }
  44487. for (d = 0,
  44488. p = c.length; d < p; d++) {
  44489. var m, v, A, y = c[d], C = y.vertexNormals, I = y.vertexColors;
  44490. m = new n.Face3(y.a + o,y.b + o,y.c + o),
  44491. m.normal.copy(y.normal),
  44492. void 0 !== r && m.normal.applyMatrix3(r).normalize();
  44493. for (var E = 0, b = C.length; E < b; E++)
  44494. v = C[E].clone(),
  44495. void 0 !== r && v.applyMatrix3(r).normalize(),
  44496. m.vertexNormals.push(v);
  44497. m.color.copy(y.color);
  44498. for (var E = 0, b = I.length; E < b; E++)
  44499. A = I[E],
  44500. m.vertexColors.push(A.clone());
  44501. m.materialIndex = y.materialIndex + i,
  44502. l.push(m)
  44503. }
  44504. for (d = 0,
  44505. p = u.length; d < p; d++) {
  44506. var w = u[d]
  44507. , _ = [];
  44508. if (void 0 !== w) {
  44509. for (var E = 0, b = w.length; E < b; E++)
  44510. _.push(w[E].clone());
  44511. h.push(_)
  44512. }
  44513. }
  44514. },
  44515. mergeMesh: function(e) {
  44516. return e instanceof n.Mesh == !1 ? void console.error("THREE.Geometry.mergeMesh(): mesh not an instance of THREE.Mesh.", e) : (e.matrixAutoUpdate && e.updateMatrix(),
  44517. void this.merge(e.geometry, e.matrix))
  44518. },
  44519. mergeVertices: function() {
  44520. var e, t, i, n, r, o, a, s, l = {}, c = [], h = [], u = 4, d = Math.pow(10, u);
  44521. for (i = 0,
  44522. n = this.vertices.length; i < n; i++)
  44523. e = this.vertices[i],
  44524. t = Math.round(e.x * d) + "_" + Math.round(e.y * d) + "_" + Math.round(e.z * d),
  44525. void 0 === l[t] ? (l[t] = i,
  44526. c.push(this.vertices[i]),
  44527. h[i] = c.length - 1) : h[i] = h[l[t]];
  44528. var p = [];
  44529. for (i = 0,
  44530. n = this.faces.length; i < n; i++) {
  44531. r = this.faces[i],
  44532. r.a = h[r.a],
  44533. r.b = h[r.b],
  44534. r.c = h[r.c],
  44535. o = [r.a, r.b, r.c];
  44536. for (var f = -1, g = 0; g < 3; g++)
  44537. if (o[g] === o[(g + 1) % 3]) {
  44538. f = g,
  44539. p.push(i);
  44540. break
  44541. }
  44542. }
  44543. for (i = p.length - 1; i >= 0; i--) {
  44544. var m = p[i];
  44545. for (this.faces.splice(m, 1),
  44546. a = 0,
  44547. s = this.faceVertexUvs.length; a < s; a++)
  44548. this.faceVertexUvs[a].splice(m, 1)
  44549. }
  44550. var v = this.vertices.length - c.length;
  44551. return this.vertices = c,
  44552. v
  44553. },
  44554. sortFacesByMaterialIndex: function() {
  44555. function e(e, t) {
  44556. return e.materialIndex - t.materialIndex
  44557. }
  44558. for (var t = this.faces, i = t.length, n = 0; n < i; n++)
  44559. t[n]._id = n;
  44560. t.sort(e);
  44561. var r, o, a = this.faceVertexUvs[0], s = this.faceVertexUvs[1];
  44562. a && a.length === i && (r = []),
  44563. s && s.length === i && (o = []);
  44564. for (var n = 0; n < i; n++) {
  44565. var l = t[n]._id;
  44566. r && r.push(a[l]),
  44567. o && o.push(s[l])
  44568. }
  44569. r && (this.faceVertexUvs[0] = r),
  44570. o && (this.faceVertexUvs[1] = o)
  44571. },
  44572. toJSON: function() {
  44573. function e(e, t, i) {
  44574. return i ? e | 1 << t : e & ~(1 << t)
  44575. }
  44576. function t(e) {
  44577. var t = e.x.toString() + e.y.toString() + e.z.toString();
  44578. return void 0 !== d[t] ? d[t] : (d[t] = u.length / 3,
  44579. u.push(e.x, e.y, e.z),
  44580. d[t])
  44581. }
  44582. function i(e) {
  44583. var t = e.r.toString() + e.g.toString() + e.b.toString();
  44584. return void 0 !== f[t] ? f[t] : (f[t] = p.length,
  44585. p.push(e.getHex()),
  44586. f[t])
  44587. }
  44588. function n(e) {
  44589. var t = e.x.toString() + e.y.toString();
  44590. return void 0 !== m[t] ? m[t] : (m[t] = g.length / 2,
  44591. g.push(e.x, e.y),
  44592. m[t])
  44593. }
  44594. var r = {
  44595. metadata: {
  44596. version: 4.4,
  44597. type: "Geometry",
  44598. generator: "Geometry.toJSON"
  44599. }
  44600. };
  44601. if (r.uuid = this.uuid,
  44602. r.type = this.type,
  44603. "" !== this.name && (r.name = this.name),
  44604. void 0 !== this.parameters) {
  44605. var o = this.parameters;
  44606. for (var a in o)
  44607. void 0 !== o[a] && (r[a] = o[a]);
  44608. return r
  44609. }
  44610. for (var s = [], l = 0; l < this.vertices.length; l++) {
  44611. var c = this.vertices[l];
  44612. s.push(c.x, c.y, c.z)
  44613. }
  44614. for (var h = [], u = [], d = {}, p = [], f = {}, g = [], m = {}, l = 0; l < this.faces.length; l++) {
  44615. var v = this.faces[l]
  44616. , A = !0
  44617. , y = !1
  44618. , C = void 0 !== this.faceVertexUvs[0][l]
  44619. , I = v.normal.length() > 0
  44620. , E = v.vertexNormals.length > 0
  44621. , b = 1 !== v.color.r || 1 !== v.color.g || 1 !== v.color.b
  44622. , w = v.vertexColors.length > 0
  44623. , _ = 0;
  44624. if (_ = e(_, 0, 0),
  44625. _ = e(_, 1, A),
  44626. _ = e(_, 2, y),
  44627. _ = e(_, 3, C),
  44628. _ = e(_, 4, I),
  44629. _ = e(_, 5, E),
  44630. _ = e(_, 6, b),
  44631. _ = e(_, 7, w),
  44632. h.push(_),
  44633. h.push(v.a, v.b, v.c),
  44634. h.push(v.materialIndex),
  44635. C) {
  44636. var T = this.faceVertexUvs[0][l];
  44637. h.push(n(T[0]), n(T[1]), n(T[2]))
  44638. }
  44639. if (I && h.push(t(v.normal)),
  44640. E) {
  44641. var x = v.vertexNormals;
  44642. h.push(t(x[0]), t(x[1]), t(x[2]))
  44643. }
  44644. if (b && h.push(i(v.color)),
  44645. w) {
  44646. var S = v.vertexColors;
  44647. h.push(i(S[0]), i(S[1]), i(S[2]))
  44648. }
  44649. }
  44650. return r.data = {},
  44651. r.data.vertices = s,
  44652. r.data.normals = u,
  44653. p.length > 0 && (r.data.colors = p),
  44654. g.length > 0 && (r.data.uvs = [g]),
  44655. r.data.faces = h,
  44656. r
  44657. },
  44658. clone: function() {
  44659. return (new n.Geometry).copy(this)
  44660. },
  44661. copy: function(e) {
  44662. this.vertices = [],
  44663. this.faces = [],
  44664. this.faceVertexUvs = [[]];
  44665. for (var t = e.vertices, i = 0, n = t.length; i < n; i++)
  44666. this.vertices.push(t[i].clone());
  44667. for (var r = e.faces, i = 0, n = r.length; i < n; i++)
  44668. this.faces.push(r[i].clone());
  44669. for (var i = 0, n = e.faceVertexUvs.length; i < n; i++) {
  44670. var o = e.faceVertexUvs[i];
  44671. void 0 === this.faceVertexUvs[i] && (this.faceVertexUvs[i] = []);
  44672. for (var a = 0, s = o.length; a < s; a++) {
  44673. for (var l = o[a], c = [], h = 0, u = l.length; h < u; h++) {
  44674. var d = l[h];
  44675. c.push(d.clone())
  44676. }
  44677. this.faceVertexUvs[i].push(c)
  44678. }
  44679. }
  44680. return this
  44681. },
  44682. dispose: function() {
  44683. this.dispatchEvent({
  44684. type: "dispose"
  44685. })
  44686. }
  44687. },
  44688. n.EventDispatcher.prototype.apply(n.Geometry.prototype),
  44689. n.GeometryIdCount = 0,
  44690. n.DirectGeometry = function() {
  44691. Object.defineProperty(this, "id", {
  44692. value: n.GeometryIdCount++
  44693. }),
  44694. this.uuid = n.Math.generateUUID(),
  44695. this.name = "",
  44696. this.type = "DirectGeometry",
  44697. this.indices = [],
  44698. this.vertices = [],
  44699. this.normals = [],
  44700. this.colors = [],
  44701. this.uvs = [],
  44702. this.uvs2 = [],
  44703. this.groups = [],
  44704. this.morphTargets = {},
  44705. this.skinWeights = [],
  44706. this.skinIndices = [],
  44707. this.boundingBox = null,
  44708. this.boundingSphere = null,
  44709. this.verticesNeedUpdate = !1,
  44710. this.normalsNeedUpdate = !1,
  44711. this.colorsNeedUpdate = !1,
  44712. this.uvsNeedUpdate = !1,
  44713. this.groupsNeedUpdate = !1
  44714. }
  44715. ,
  44716. n.DirectGeometry.prototype = {
  44717. constructor: n.DirectGeometry,
  44718. computeBoundingBox: n.Geometry.prototype.computeBoundingBox,
  44719. computeBoundingSphere: n.Geometry.prototype.computeBoundingSphere,
  44720. computeFaceNormals: function() {
  44721. console.warn("THREE.DirectGeometry: computeFaceNormals() is not a method of this type of geometry.")
  44722. },
  44723. computeVertexNormals: function() {
  44724. console.warn("THREE.DirectGeometry: computeVertexNormals() is not a method of this type of geometry.")
  44725. },
  44726. computeGroups: function(e) {
  44727. for (var t, i, n = [], r = e.faces, o = 0; o < r.length; o++) {
  44728. var a = r[o];
  44729. a.materialIndex !== i && (i = a.materialIndex,
  44730. void 0 !== t && (t.count = 3 * o - t.start,
  44731. n.push(t)),
  44732. t = {
  44733. start: 3 * o,
  44734. materialIndex: i
  44735. })
  44736. }
  44737. void 0 !== t && (t.count = 3 * o - t.start,
  44738. n.push(t)),
  44739. this.groups = n
  44740. },
  44741. fromGeometry: function(e) {
  44742. 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;
  44743. if (c > 0) {
  44744. t = [];
  44745. for (var h = 0; h < c; h++)
  44746. t[h] = [];
  44747. this.morphTargets.position = t
  44748. }
  44749. var u, d = e.morphNormals, p = d.length;
  44750. if (p > 0) {
  44751. u = [];
  44752. for (var h = 0; h < p; h++)
  44753. u[h] = [];
  44754. this.morphTargets.normal = u
  44755. }
  44756. for (var f = e.skinIndices, g = e.skinWeights, m = f.length === r.length, v = g.length === r.length, h = 0; h < i.length; h++) {
  44757. var A = i[h];
  44758. this.vertices.push(r[A.a], r[A.b], r[A.c]);
  44759. var y = A.vertexNormals;
  44760. if (3 === y.length)
  44761. this.normals.push(y[0], y[1], y[2]);
  44762. else {
  44763. var C = A.normal;
  44764. this.normals.push(C, C, C)
  44765. }
  44766. var I = A.vertexColors;
  44767. if (3 === I.length)
  44768. this.colors.push(I[0], I[1], I[2]);
  44769. else {
  44770. var E = A.color;
  44771. this.colors.push(E, E, E)
  44772. }
  44773. if (a === !0) {
  44774. var b = o[0][h];
  44775. void 0 !== b ? this.uvs.push(b[0], b[1], b[2]) : (console.warn("THREE.DirectGeometry.fromGeometry(): Undefined vertexUv ", h),
  44776. this.uvs.push(new n.Vector2, new n.Vector2, new n.Vector2))
  44777. }
  44778. if (s === !0) {
  44779. var b = o[1][h];
  44780. void 0 !== b ? this.uvs2.push(b[0], b[1], b[2]) : (console.warn("THREE.DirectGeometry.fromGeometry(): Undefined vertexUv2 ", h),
  44781. this.uvs2.push(new n.Vector2, new n.Vector2, new n.Vector2))
  44782. }
  44783. for (var w = 0; w < c; w++) {
  44784. var _ = l[w].vertices;
  44785. t[w].push(_[A.a], _[A.b], _[A.c])
  44786. }
  44787. for (var w = 0; w < p; w++) {
  44788. var T = d[w].vertexNormals[h];
  44789. u[w].push(T.a, T.b, T.c)
  44790. }
  44791. m && this.skinIndices.push(f[A.a], f[A.b], f[A.c]),
  44792. v && this.skinWeights.push(g[A.a], g[A.b], g[A.c])
  44793. }
  44794. return this.computeGroups(e),
  44795. this.verticesNeedUpdate = e.verticesNeedUpdate,
  44796. this.normalsNeedUpdate = e.normalsNeedUpdate,
  44797. this.colorsNeedUpdate = e.colorsNeedUpdate,
  44798. this.uvsNeedUpdate = e.uvsNeedUpdate,
  44799. this.groupsNeedUpdate = e.groupsNeedUpdate,
  44800. this
  44801. },
  44802. dispose: function() {
  44803. this.dispatchEvent({
  44804. type: "dispose"
  44805. })
  44806. }
  44807. },
  44808. n.EventDispatcher.prototype.apply(n.DirectGeometry.prototype),
  44809. n.BufferGeometry = function() {
  44810. Object.defineProperty(this, "id", {
  44811. value: n.GeometryIdCount++
  44812. }),
  44813. this.uuid = n.Math.generateUUID(),
  44814. this.name = "",
  44815. this.type = "BufferGeometry",
  44816. this.index = null,
  44817. this.attributes = {},
  44818. this.morphAttributes = {},
  44819. this.groups = [],
  44820. this.boundingBox = null,
  44821. this.boundingSphere = null,
  44822. this.drawRange = {
  44823. start: 0,
  44824. count: 1 / 0
  44825. }
  44826. }
  44827. ,
  44828. n.BufferGeometry.prototype = {
  44829. constructor: n.BufferGeometry,
  44830. getIndex: function() {
  44831. return this.index
  44832. },
  44833. setIndex: function(e) {
  44834. this.index = e
  44835. },
  44836. addAttribute: function(e, t) {
  44837. return t instanceof n.BufferAttribute == !1 && t instanceof n.InterleavedBufferAttribute == !1 ? (console.warn("THREE.BufferGeometry: .addAttribute() now expects ( name, attribute )."),
  44838. void this.addAttribute(e, new n.BufferAttribute(arguments[1],arguments[2]))) : "index" === e ? (console.warn("THREE.BufferGeometry.addAttribute: Use .setIndex() for index attribute."),
  44839. void this.setIndex(t)) : (this.attributes[e] = t,
  44840. this)
  44841. },
  44842. getAttribute: function(e) {
  44843. return this.attributes[e]
  44844. },
  44845. removeAttribute: function(e) {
  44846. return delete this.attributes[e],
  44847. this
  44848. },
  44849. addGroup: function(e, t, i) {
  44850. this.groups.push({
  44851. start: e,
  44852. count: t,
  44853. materialIndex: void 0 !== i ? i : 0
  44854. })
  44855. },
  44856. clearGroups: function() {
  44857. this.groups = []
  44858. },
  44859. setDrawRange: function(e, t) {
  44860. this.drawRange.start = e,
  44861. this.drawRange.count = t
  44862. },
  44863. applyMatrix: function(e) {
  44864. var t = this.attributes.position;
  44865. void 0 !== t && (e.applyToVector3Array(t.array),
  44866. t.needsUpdate = !0);
  44867. var i = this.attributes.normal;
  44868. if (void 0 !== i) {
  44869. var r = (new n.Matrix3).getNormalMatrix(e);
  44870. r.applyToVector3Array(i.array),
  44871. i.needsUpdate = !0
  44872. }
  44873. return null !== this.boundingBox && this.computeBoundingBox(),
  44874. null !== this.boundingSphere && this.computeBoundingSphere(),
  44875. this
  44876. },
  44877. rotateX: function() {
  44878. var e;
  44879. return function(t) {
  44880. return void 0 === e && (e = new n.Matrix4),
  44881. e.makeRotationX(t),
  44882. this.applyMatrix(e),
  44883. this
  44884. }
  44885. }(),
  44886. rotateY: function() {
  44887. var e;
  44888. return function(t) {
  44889. return void 0 === e && (e = new n.Matrix4),
  44890. e.makeRotationY(t),
  44891. this.applyMatrix(e),
  44892. this
  44893. }
  44894. }(),
  44895. rotateZ: function() {
  44896. var e;
  44897. return function(t) {
  44898. return void 0 === e && (e = new n.Matrix4),
  44899. e.makeRotationZ(t),
  44900. this.applyMatrix(e),
  44901. this
  44902. }
  44903. }(),
  44904. translate: function() {
  44905. var e;
  44906. return function(t, i, r) {
  44907. return void 0 === e && (e = new n.Matrix4),
  44908. e.makeTranslation(t, i, r),
  44909. this.applyMatrix(e),
  44910. this
  44911. }
  44912. }(),
  44913. scale: function() {
  44914. var e;
  44915. return function(t, i, r) {
  44916. return void 0 === e && (e = new n.Matrix4),
  44917. e.makeScale(t, i, r),
  44918. this.applyMatrix(e),
  44919. this
  44920. }
  44921. }(),
  44922. lookAt: function() {
  44923. var e;
  44924. return function(t) {
  44925. void 0 === e && (e = new n.Object3D),
  44926. e.lookAt(t),
  44927. e.updateMatrix(),
  44928. this.applyMatrix(e.matrix)
  44929. }
  44930. }(),
  44931. center: function() {
  44932. this.computeBoundingBox();
  44933. var e = this.boundingBox.center().negate();
  44934. return this.translate(e.x, e.y, e.z),
  44935. e
  44936. },
  44937. setFromObject: function(e) {
  44938. var t = e.geometry;
  44939. if (e instanceof n.Points || e instanceof n.Line) {
  44940. var i = new n.Float32Attribute(3 * t.vertices.length,3)
  44941. , r = new n.Float32Attribute(3 * t.colors.length,3);
  44942. if (this.addAttribute("position", i.copyVector3sArray(t.vertices)),
  44943. this.addAttribute("color", r.copyColorsArray(t.colors)),
  44944. t.lineDistances && t.lineDistances.length === t.vertices.length) {
  44945. var o = new n.Float32Attribute(t.lineDistances.length,1);
  44946. this.addAttribute("lineDistance", o.copyArray(t.lineDistances))
  44947. }
  44948. null !== t.boundingSphere && (this.boundingSphere = t.boundingSphere.clone()),
  44949. null !== t.boundingBox && (this.boundingBox = t.boundingBox.clone())
  44950. } else
  44951. e instanceof n.Mesh && t instanceof n.Geometry && this.fromGeometry(t);
  44952. return this
  44953. },
  44954. updateFromObject: function(e) {
  44955. var t = e.geometry;
  44956. if (e instanceof n.Mesh) {
  44957. var i = t.__directGeometry;
  44958. if (void 0 === i)
  44959. return this.fromGeometry(t);
  44960. i.verticesNeedUpdate = t.verticesNeedUpdate,
  44961. i.normalsNeedUpdate = t.normalsNeedUpdate,
  44962. i.colorsNeedUpdate = t.colorsNeedUpdate,
  44963. i.uvsNeedUpdate = t.uvsNeedUpdate,
  44964. i.groupsNeedUpdate = t.groupsNeedUpdate,
  44965. t.verticesNeedUpdate = !1,
  44966. t.normalsNeedUpdate = !1,
  44967. t.colorsNeedUpdate = !1,
  44968. t.uvsNeedUpdate = !1,
  44969. t.groupsNeedUpdate = !1,
  44970. t = i
  44971. }
  44972. if (t.verticesNeedUpdate === !0) {
  44973. var r = this.attributes.position;
  44974. void 0 !== r && (r.copyVector3sArray(t.vertices),
  44975. r.needsUpdate = !0),
  44976. t.verticesNeedUpdate = !1
  44977. }
  44978. if (t.normalsNeedUpdate === !0) {
  44979. var r = this.attributes.normal;
  44980. void 0 !== r && (r.copyVector3sArray(t.normals),
  44981. r.needsUpdate = !0),
  44982. t.normalsNeedUpdate = !1
  44983. }
  44984. if (t.colorsNeedUpdate === !0) {
  44985. var r = this.attributes.color;
  44986. void 0 !== r && (r.copyColorsArray(t.colors),
  44987. r.needsUpdate = !0),
  44988. t.colorsNeedUpdate = !1
  44989. }
  44990. if (t.uvsNeedUpdate) {
  44991. var r = this.attributes.uv;
  44992. void 0 !== r && (r.copyVector2sArray(t.uvs),
  44993. r.needsUpdate = !0),
  44994. t.uvsNeedUpdate = !1
  44995. }
  44996. if (t.lineDistancesNeedUpdate) {
  44997. var r = this.attributes.lineDistance;
  44998. void 0 !== r && (r.copyArray(t.lineDistances),
  44999. r.needsUpdate = !0),
  45000. t.lineDistancesNeedUpdate = !1
  45001. }
  45002. return t.groupsNeedUpdate && (t.computeGroups(e.geometry),
  45003. this.groups = t.groups,
  45004. t.groupsNeedUpdate = !1),
  45005. this
  45006. },
  45007. fromGeometry: function(e) {
  45008. return e.__directGeometry = (new n.DirectGeometry).fromGeometry(e),
  45009. this.fromDirectGeometry(e.__directGeometry)
  45010. },
  45011. fromDirectGeometry: function(e) {
  45012. var t = new Float32Array(3 * e.vertices.length);
  45013. if (this.addAttribute("position", new n.BufferAttribute(t,3).copyVector3sArray(e.vertices)),
  45014. e.normals.length > 0) {
  45015. var i = new Float32Array(3 * e.normals.length);
  45016. this.addAttribute("normal", new n.BufferAttribute(i,3).copyVector3sArray(e.normals))
  45017. }
  45018. if (e.colors.length > 0) {
  45019. var r = new Float32Array(3 * e.colors.length);
  45020. this.addAttribute("color", new n.BufferAttribute(r,3).copyColorsArray(e.colors))
  45021. }
  45022. if (e.uvs.length > 0) {
  45023. var o = new Float32Array(2 * e.uvs.length);
  45024. this.addAttribute("uv", new n.BufferAttribute(o,2).copyVector2sArray(e.uvs))
  45025. }
  45026. if (e.uvs2.length > 0) {
  45027. var a = new Float32Array(2 * e.uvs2.length);
  45028. this.addAttribute("uv2", new n.BufferAttribute(a,2).copyVector2sArray(e.uvs2))
  45029. }
  45030. if (e.indices.length > 0) {
  45031. var s = e.vertices.length > 65535 ? Uint32Array : Uint16Array
  45032. , l = new s(3 * e.indices.length);
  45033. this.setIndex(new n.BufferAttribute(l,1).copyIndicesArray(e.indices))
  45034. }
  45035. this.groups = e.groups;
  45036. for (var c in e.morphTargets) {
  45037. for (var h = [], u = e.morphTargets[c], d = 0, p = u.length; d < p; d++) {
  45038. var f = u[d]
  45039. , g = new n.Float32Attribute(3 * f.length,3);
  45040. h.push(g.copyVector3sArray(f))
  45041. }
  45042. this.morphAttributes[c] = h
  45043. }
  45044. if (e.skinIndices.length > 0) {
  45045. var m = new n.Float32Attribute(4 * e.skinIndices.length,4);
  45046. this.addAttribute("skinIndex", m.copyVector4sArray(e.skinIndices))
  45047. }
  45048. if (e.skinWeights.length > 0) {
  45049. var v = new n.Float32Attribute(4 * e.skinWeights.length,4);
  45050. this.addAttribute("skinWeight", v.copyVector4sArray(e.skinWeights))
  45051. }
  45052. return null !== e.boundingSphere && (this.boundingSphere = e.boundingSphere.clone()),
  45053. null !== e.boundingBox && (this.boundingBox = e.boundingBox.clone()),
  45054. this
  45055. },
  45056. computeBoundingBox: function() {
  45057. new n.Vector3;
  45058. return function() {
  45059. null === this.boundingBox && (this.boundingBox = new n.Box3);
  45060. var e = this.attributes.position.array;
  45061. e && this.boundingBox.setFromArray(e),
  45062. void 0 !== e && 0 !== e.length || (this.boundingBox.min.set(0, 0, 0),
  45063. this.boundingBox.max.set(0, 0, 0)),
  45064. (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)
  45065. }
  45066. }(),
  45067. computeBoundingSphere: function() {
  45068. var e = new n.Box3
  45069. , t = new n.Vector3;
  45070. return function() {
  45071. null === this.boundingSphere && (this.boundingSphere = new n.Sphere);
  45072. var i = this.attributes.position.array;
  45073. if (i) {
  45074. var r = this.boundingSphere.center;
  45075. e.setFromArray(i),
  45076. e.center(r);
  45077. for (var o = 0, a = 0, s = i.length; a < s; a += 3)
  45078. t.fromArray(i, a),
  45079. o = Math.max(o, r.distanceToSquared(t));
  45080. this.boundingSphere.radius = Math.sqrt(o),
  45081. isNaN(this.boundingSphere.radius) && console.error('THREE.BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.', this)
  45082. }
  45083. }
  45084. }(),
  45085. computeFaceNormals: function() {},
  45086. computeVertexNormals: function() {
  45087. var e = this.index
  45088. , t = this.attributes
  45089. , i = this.groups;
  45090. if (t.position) {
  45091. var r = t.position.array;
  45092. if (void 0 === t.normal)
  45093. this.addAttribute("normal", new n.BufferAttribute(new Float32Array(r.length),3));
  45094. else
  45095. for (var o = t.normal.array, a = 0, s = o.length; a < s; a++)
  45096. o[a] = 0;
  45097. 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;
  45098. if (e) {
  45099. var v = e.array;
  45100. 0 === i.length && this.addGroup(0, v.length);
  45101. for (var A = 0, y = i.length; A < y; ++A)
  45102. for (var C = i[A], I = C.start, E = C.count, a = I, s = I + E; a < s; a += 3)
  45103. l = 3 * v[a + 0],
  45104. c = 3 * v[a + 1],
  45105. h = 3 * v[a + 2],
  45106. d.fromArray(r, l),
  45107. p.fromArray(r, c),
  45108. f.fromArray(r, h),
  45109. g.subVectors(f, p),
  45110. m.subVectors(d, p),
  45111. g.cross(m),
  45112. u[l] += g.x,
  45113. u[l + 1] += g.y,
  45114. u[l + 2] += g.z,
  45115. u[c] += g.x,
  45116. u[c + 1] += g.y,
  45117. u[c + 2] += g.z,
  45118. u[h] += g.x,
  45119. u[h + 1] += g.y,
  45120. u[h + 2] += g.z
  45121. } else
  45122. for (var a = 0, s = r.length; a < s; a += 9)
  45123. d.fromArray(r, a),
  45124. p.fromArray(r, a + 3),
  45125. f.fromArray(r, a + 6),
  45126. g.subVectors(f, p),
  45127. m.subVectors(d, p),
  45128. g.cross(m),
  45129. u[a] = g.x,
  45130. u[a + 1] = g.y,
  45131. u[a + 2] = g.z,
  45132. u[a + 3] = g.x,
  45133. u[a + 4] = g.y,
  45134. u[a + 5] = g.z,
  45135. u[a + 6] = g.x,
  45136. u[a + 7] = g.y,
  45137. u[a + 8] = g.z;
  45138. this.normalizeNormals(),
  45139. t.normal.needsUpdate = !0
  45140. }
  45141. },
  45142. merge: function(e, t) {
  45143. if (e instanceof n.BufferGeometry == !1)
  45144. return void console.error("THREE.BufferGeometry.merge(): geometry not an instance of THREE.BufferGeometry.", e);
  45145. void 0 === t && (t = 0);
  45146. var i = this.attributes;
  45147. for (var r in i)
  45148. if (void 0 !== e.attributes[r])
  45149. 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++,
  45150. u++)
  45151. a[u] = l[h];
  45152. return this
  45153. },
  45154. normalizeNormals: function() {
  45155. for (var e, t, i, n, r = this.attributes.normal.array, o = 0, a = r.length; o < a; o += 3)
  45156. e = r[o],
  45157. t = r[o + 1],
  45158. i = r[o + 2],
  45159. n = 1 / Math.sqrt(e * e + t * t + i * i),
  45160. r[o] *= n,
  45161. r[o + 1] *= n,
  45162. r[o + 2] *= n
  45163. },
  45164. toNonIndexed: function() {
  45165. if (null === this.index)
  45166. return console.warn("THREE.BufferGeometry.toNonIndexed(): Geometry is already non-indexed."),
  45167. this;
  45168. var e = new n.BufferGeometry
  45169. , t = this.index.array
  45170. , i = this.attributes;
  45171. for (var r in i) {
  45172. 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++) {
  45173. c = t[u] * s;
  45174. for (var p = 0; p < s; p++)
  45175. l[h++] = a[c++]
  45176. }
  45177. e.addAttribute(r, new n.BufferAttribute(l,s))
  45178. }
  45179. return e
  45180. },
  45181. toJSON: function() {
  45182. var e = {
  45183. metadata: {
  45184. version: 4.4,
  45185. type: "BufferGeometry",
  45186. generator: "BufferGeometry.toJSON"
  45187. }
  45188. };
  45189. if (e.uuid = this.uuid,
  45190. e.type = this.type,
  45191. "" !== this.name && (e.name = this.name),
  45192. void 0 !== this.parameters) {
  45193. var t = this.parameters;
  45194. for (var i in t)
  45195. void 0 !== t[i] && (e[i] = t[i]);
  45196. return e
  45197. }
  45198. e.data = {
  45199. attributes: {}
  45200. };
  45201. var n = this.index;
  45202. if (null !== n) {
  45203. var r = Array.prototype.slice.call(n.array);
  45204. e.data.index = {
  45205. type: n.array.constructor.name,
  45206. array: r
  45207. }
  45208. }
  45209. var o = this.attributes;
  45210. for (var i in o) {
  45211. var a = o[i]
  45212. , r = Array.prototype.slice.call(a.array);
  45213. e.data.attributes[i] = {
  45214. itemSize: a.itemSize,
  45215. type: a.array.constructor.name,
  45216. array: r
  45217. }
  45218. }
  45219. var s = this.groups;
  45220. s.length > 0 && (e.data.groups = JSON.parse(JSON.stringify(s)));
  45221. var l = this.boundingSphere;
  45222. return null !== l && (e.data.boundingSphere = {
  45223. center: l.center.toArray(),
  45224. radius: l.radius
  45225. }),
  45226. e
  45227. },
  45228. clone: function() {
  45229. return (new n.BufferGeometry).copy(this)
  45230. },
  45231. copy: function(e) {
  45232. var t = e.index;
  45233. null !== t && this.setIndex(t.clone());
  45234. var i = e.attributes;
  45235. for (var n in i) {
  45236. var r = i[n];
  45237. this.addAttribute(n, r.clone())
  45238. }
  45239. for (var o = e.groups, a = 0, s = o.length; a < s; a++) {
  45240. var l = o[a];
  45241. this.addGroup(l.start, l.count)
  45242. }
  45243. return this
  45244. },
  45245. dispose: function() {
  45246. this.dispatchEvent({
  45247. type: "dispose"
  45248. })
  45249. }
  45250. },
  45251. n.EventDispatcher.prototype.apply(n.BufferGeometry.prototype),
  45252. n.BufferGeometry.MaxIndex = 65535,
  45253. n.InstancedBufferGeometry = function() {
  45254. n.BufferGeometry.call(this),
  45255. this.type = "InstancedBufferGeometry",
  45256. this.maxInstancedCount = void 0
  45257. }
  45258. ,
  45259. n.InstancedBufferGeometry.prototype = Object.create(n.BufferGeometry.prototype),
  45260. n.InstancedBufferGeometry.prototype.constructor = n.InstancedBufferGeometry,
  45261. n.InstancedBufferGeometry.prototype.addGroup = function(e, t, i) {
  45262. this.groups.push({
  45263. start: e,
  45264. count: t,
  45265. instances: i
  45266. })
  45267. }
  45268. ,
  45269. n.InstancedBufferGeometry.prototype.copy = function(e) {
  45270. var t = e.index;
  45271. null !== t && this.setIndex(t.clone());
  45272. var i = e.attributes;
  45273. for (var n in i) {
  45274. var r = i[n];
  45275. this.addAttribute(n, r.clone())
  45276. }
  45277. for (var o = e.groups, a = 0, s = o.length; a < s; a++) {
  45278. var l = o[a];
  45279. this.addGroup(l.start, l.count, l.instances)
  45280. }
  45281. return this
  45282. }
  45283. ,
  45284. n.EventDispatcher.prototype.apply(n.InstancedBufferGeometry.prototype),
  45285. n.Uniform = function(e, t) {
  45286. this.type = e,
  45287. this.value = t,
  45288. this.dynamic = !1
  45289. }
  45290. ,
  45291. n.Uniform.prototype = {
  45292. constructor: n.Uniform,
  45293. onUpdate: function(e) {
  45294. return this.dynamic = !0,
  45295. this.onUpdateCallback = e,
  45296. this
  45297. }
  45298. },
  45299. n.AnimationClip = function(e, t, i) {
  45300. this.name = e || n.Math.generateUUID(),
  45301. this.tracks = i,
  45302. this.duration = void 0 !== t ? t : -1,
  45303. this.duration < 0 && this.resetDuration(),
  45304. this.trim(),
  45305. this.optimize()
  45306. }
  45307. ,
  45308. n.AnimationClip.prototype = {
  45309. constructor: n.AnimationClip,
  45310. resetDuration: function() {
  45311. for (var e = this.tracks, t = 0, i = 0, n = e.length; i !== n; ++i) {
  45312. var r = this.tracks[i];
  45313. t = Math.max(t, r.times[r.times.length - 1])
  45314. }
  45315. this.duration = t
  45316. },
  45317. trim: function() {
  45318. for (var e = 0; e < this.tracks.length; e++)
  45319. this.tracks[e].trim(0, this.duration);
  45320. return this
  45321. },
  45322. optimize: function() {
  45323. for (var e = 0; e < this.tracks.length; e++)
  45324. this.tracks[e].optimize();
  45325. return this
  45326. }
  45327. },
  45328. Object.assign(n.AnimationClip, {
  45329. parse: function(e) {
  45330. for (var t = [], i = e.tracks, r = 1 / (e.fps || 1), o = 0, a = i.length; o !== a; ++o)
  45331. t.push(n.KeyframeTrack.parse(i[o]).scale(r));
  45332. return new n.AnimationClip(e.name,e.duration,t)
  45333. },
  45334. toJSON: function(e) {
  45335. for (var t = [], i = e.tracks, r = {
  45336. name: e.name,
  45337. duration: e.duration,
  45338. tracks: t
  45339. }, o = 0, a = i.length; o !== a; ++o)
  45340. t.push(n.KeyframeTrack.toJSON(i[o]));
  45341. return r
  45342. },
  45343. CreateFromMorphTargetSequence: function(e, t, i) {
  45344. for (var r = t.length, o = [], a = 0; a < r; a++) {
  45345. var s = []
  45346. , l = [];
  45347. s.push((a + r - 1) % r, a, (a + 1) % r),
  45348. l.push(0, 1, 0);
  45349. var c = n.AnimationUtils.getKeyframeOrder(s);
  45350. s = n.AnimationUtils.sortedArray(s, 1, c),
  45351. l = n.AnimationUtils.sortedArray(l, 1, c),
  45352. 0 === s[0] && (s.push(r),
  45353. l.push(l[0])),
  45354. o.push(new n.NumberKeyframeTrack(".morphTargetInfluences[" + t[a].name + "]",s,l).scale(1 / i))
  45355. }
  45356. return new n.AnimationClip(e,-1,o)
  45357. },
  45358. findByName: function(e, t) {
  45359. for (var i = 0; i < e.length; i++)
  45360. if (e[i].name === t)
  45361. return e[i];
  45362. return null
  45363. },
  45364. CreateClipsFromMorphTargetSequences: function(e, t) {
  45365. for (var i = {}, r = /^([\w-]*?)([\d]+)$/, o = 0, a = e.length; o < a; o++) {
  45366. var s = e[o]
  45367. , l = s.name.match(r);
  45368. if (l && l.length > 1) {
  45369. var c = l[1]
  45370. , h = i[c];
  45371. h || (i[c] = h = []),
  45372. h.push(s)
  45373. }
  45374. }
  45375. var u = [];
  45376. for (var c in i)
  45377. u.push(n.AnimationClip.CreateFromMorphTargetSequence(c, i[c], t));
  45378. return u
  45379. },
  45380. parseAnimation: function(e, t, i) {
  45381. if (!e)
  45382. return console.error(" no animation in JSONLoader data"),
  45383. null;
  45384. for (var r = function(e, t, i, r, o) {
  45385. if (0 !== i.length) {
  45386. var a = []
  45387. , s = [];
  45388. n.AnimationUtils.flattenJSON(i, a, s, r),
  45389. 0 !== a.length && o.push(new e(t,a,s))
  45390. }
  45391. }, o = [], a = e.name || "default", s = e.length || -1, l = e.fps || 30, c = e.hierarchy || [], h = 0; h < c.length; h++) {
  45392. var u = c[h].keys;
  45393. if (u && 0 != u.length)
  45394. if (u[0].morphTargets) {
  45395. for (var d = {}, p = 0; p < u.length; p++)
  45396. if (u[p].morphTargets)
  45397. for (var f = 0; f < u[p].morphTargets.length; f++)
  45398. d[u[p].morphTargets[f]] = -1;
  45399. for (var g in d) {
  45400. for (var m = [], v = [], f = 0; f !== u[p].morphTargets.length; ++f) {
  45401. var A = u[p];
  45402. m.push(A.time),
  45403. v.push(A.morphTarget === g ? 1 : 0)
  45404. }
  45405. o.push(new n.NumberKeyframeTrack(".morphTargetInfluence[" + g + "]",m,v))
  45406. }
  45407. s = d.length * (l || 1)
  45408. } else {
  45409. var y = ".bones[" + t[h].name + "]";
  45410. r(n.VectorKeyframeTrack, y + ".position", u, "pos", o),
  45411. r(n.QuaternionKeyframeTrack, y + ".quaternion", u, "rot", o),
  45412. r(n.VectorKeyframeTrack, y + ".scale", u, "scl", o)
  45413. }
  45414. }
  45415. if (0 === o.length)
  45416. return null;
  45417. var C = new n.AnimationClip(a,s,o);
  45418. return C
  45419. }
  45420. }),
  45421. n.AnimationMixer = function(e) {
  45422. this._root = e,
  45423. this._initMemoryManager(),
  45424. this._accuIndex = 0,
  45425. this.time = 0,
  45426. this.timeScale = 1
  45427. }
  45428. ,
  45429. n.AnimationMixer.prototype = {
  45430. constructor: n.AnimationMixer,
  45431. clipAction: function(e, t) {
  45432. 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];
  45433. if (void 0 !== l) {
  45434. var c = l.actionByRoot[o];
  45435. if (void 0 !== c)
  45436. return c;
  45437. if (i = l.knownActions[0],
  45438. s = i._clip,
  45439. e !== a && e !== s)
  45440. throw new Error("Different clips with the same name detected!")
  45441. }
  45442. if (null === s)
  45443. return null;
  45444. var h = new n.AnimationMixer._Action(this,s,t);
  45445. return this._bindAction(h, i),
  45446. this._addInactiveAction(h, a, o),
  45447. h
  45448. },
  45449. existingAction: function(e, t) {
  45450. var i = t || this._root
  45451. , n = i.uuid
  45452. , r = "string" == typeof e ? e : e.name
  45453. , o = this._actionsByClip[r];
  45454. return void 0 !== o ? o.actionByRoot[n] || null : null
  45455. },
  45456. stopAllAction: function() {
  45457. var e = this._actions
  45458. , t = this._nActiveActions
  45459. , i = this._bindings
  45460. , n = this._nActiveBindings;
  45461. this._nActiveActions = 0,
  45462. this._nActiveBindings = 0;
  45463. for (var r = 0; r !== t; ++r)
  45464. e[r].reset();
  45465. for (var r = 0; r !== n; ++r)
  45466. i[r].useCount = 0;
  45467. return this
  45468. },
  45469. update: function(e) {
  45470. e *= this.timeScale;
  45471. 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) {
  45472. var s = t[a];
  45473. s.enabled && s._update(n, e, r, o)
  45474. }
  45475. for (var l = this._bindings, c = this._nActiveBindings, a = 0; a !== c; ++a)
  45476. l[a].apply(o);
  45477. return this
  45478. },
  45479. getRoot: function() {
  45480. return this._root
  45481. },
  45482. uncacheClip: function(e) {
  45483. var t = this._actions
  45484. , i = e.name
  45485. , n = this._actionsByClip
  45486. , r = n[i];
  45487. if (void 0 !== r) {
  45488. for (var o = r.knownActions, a = 0, s = o.length; a !== s; ++a) {
  45489. var l = o[a];
  45490. this._deactivateAction(l);
  45491. var c = l._cacheIndex
  45492. , h = t[t.length - 1];
  45493. l._cacheIndex = null,
  45494. l._byClipCacheIndex = null,
  45495. h._cacheIndex = c,
  45496. t[c] = h,
  45497. t.pop(),
  45498. this._removeInactiveBindingsForAction(l)
  45499. }
  45500. delete n[i]
  45501. }
  45502. },
  45503. uncacheRoot: function(e) {
  45504. var t = e.uuid
  45505. , i = this._actionsByClip;
  45506. for (var n in i) {
  45507. var r = i[n].actionByRoot
  45508. , o = r[t];
  45509. void 0 !== o && (this._deactivateAction(o),
  45510. this._removeInactiveAction(o))
  45511. }
  45512. var a = this._bindingsByRootAndName
  45513. , s = a[t];
  45514. if (void 0 !== s)
  45515. for (var l in s) {
  45516. var c = s[l];
  45517. c.restoreOriginalState(),
  45518. this._removeInactiveBinding(c)
  45519. }
  45520. },
  45521. uncacheAction: function(e, t) {
  45522. var i = this.existingAction(e, t);
  45523. null !== i && (this._deactivateAction(i),
  45524. this._removeInactiveAction(i))
  45525. }
  45526. },
  45527. n.EventDispatcher.prototype.apply(n.AnimationMixer.prototype),
  45528. n.AnimationMixer._Action = function(e, t, i) {
  45529. this._mixer = e,
  45530. this._clip = t,
  45531. this._localRoot = i || null;
  45532. for (var r = t.tracks, o = r.length, a = new Array(o), s = {
  45533. endingStart: n.ZeroCurvatureEnding,
  45534. endingEnd: n.ZeroCurvatureEnding
  45535. }, l = 0; l !== o; ++l) {
  45536. var c = r[l].createInterpolant(null);
  45537. a[l] = c,
  45538. c.settings = s
  45539. }
  45540. this._interpolantSettings = s,
  45541. this._interpolants = a,
  45542. this._propertyBindings = new Array(o),
  45543. this._cacheIndex = null,
  45544. this._byClipCacheIndex = null,
  45545. this._timeScaleInterpolant = null,
  45546. this._weightInterpolant = null,
  45547. this.loop = n.LoopRepeat,
  45548. this._loopCount = -1,
  45549. this._startTime = null,
  45550. this.time = 0,
  45551. this.timeScale = 1,
  45552. this._effectiveTimeScale = 1,
  45553. this.weight = 1,
  45554. this._effectiveWeight = 1,
  45555. this.repetitions = 1 / 0,
  45556. this.paused = !1,
  45557. this.enabled = !0,
  45558. this.clampWhenFinished = !1,
  45559. this.zeroSlopeAtStart = !0,
  45560. this.zeroSlopeAtEnd = !0
  45561. }
  45562. ,
  45563. n.AnimationMixer._Action.prototype = {
  45564. constructor: n.AnimationMixer._Action,
  45565. play: function() {
  45566. return this._mixer._activateAction(this),
  45567. this
  45568. },
  45569. stop: function() {
  45570. return this._mixer._deactivateAction(this),
  45571. this.reset()
  45572. },
  45573. reset: function() {
  45574. return this.paused = !1,
  45575. this.enabled = !0,
  45576. this.time = 0,
  45577. this._loopCount = -1,
  45578. this._startTime = null,
  45579. this.stopFading().stopWarping()
  45580. },
  45581. isRunning: function() {
  45582. this._startTime;
  45583. return this.enabled && !this.paused && 0 !== this.timeScale && null === this._startTime && this._mixer._isActiveAction(this)
  45584. },
  45585. isScheduled: function() {
  45586. return this._mixer._isActiveAction(this)
  45587. },
  45588. startAt: function(e) {
  45589. return this._startTime = e,
  45590. this
  45591. },
  45592. setLoop: function(e, t) {
  45593. return this.loop = e,
  45594. this.repetitions = t,
  45595. this
  45596. },
  45597. setEffectiveWeight: function(e) {
  45598. return this.weight = e,
  45599. this._effectiveWeight = this.enabled ? e : 0,
  45600. this.stopFading()
  45601. },
  45602. getEffectiveWeight: function() {
  45603. return this._effectiveWeight
  45604. },
  45605. fadeIn: function(e) {
  45606. return this._scheduleFading(e, 0, 1)
  45607. },
  45608. fadeOut: function(e) {
  45609. return this._scheduleFading(e, 1, 0)
  45610. },
  45611. crossFadeFrom: function(e, t, i) {
  45612. this._mixer;
  45613. if (e.fadeOut(t),
  45614. this.fadeIn(t),
  45615. i) {
  45616. var n = this._clip.duration
  45617. , r = e._clip.duration
  45618. , o = r / n
  45619. , a = n / r;
  45620. e.warp(1, o, t),
  45621. this.warp(a, 1, t)
  45622. }
  45623. return this
  45624. },
  45625. crossFadeTo: function(e, t, i) {
  45626. return e.crossFadeFrom(this, t, i)
  45627. },
  45628. stopFading: function() {
  45629. var e = this._weightInterpolant;
  45630. return null !== e && (this._weightInterpolant = null,
  45631. this._mixer._takeBackControlInterpolant(e)),
  45632. this
  45633. },
  45634. setEffectiveTimeScale: function(e) {
  45635. return this.timeScale = e,
  45636. this._effectiveTimeScale = this.paused ? 0 : e,
  45637. this.stopWarping()
  45638. },
  45639. getEffectiveTimeScale: function() {
  45640. return this._effectiveTimeScale
  45641. },
  45642. setDuration: function(e) {
  45643. return this.timeScale = this._clip.duration / e,
  45644. this.stopWarping()
  45645. },
  45646. syncWith: function(e) {
  45647. return this.time = e.time,
  45648. this.timeScale = e.timeScale,
  45649. this.stopWarping()
  45650. },
  45651. halt: function(e) {
  45652. return this.warp(this._currentTimeScale, 0, e)
  45653. },
  45654. warp: function(e, t, i) {
  45655. var n = this._mixer
  45656. , r = n.time
  45657. , o = this._timeScaleInterpolant
  45658. , a = this.timeScale;
  45659. null === o && (o = n._lendControlInterpolant(),
  45660. this._timeScaleInterpolant = o);
  45661. var s = o.parameterPositions
  45662. , l = o.sampleValues;
  45663. return s[0] = r,
  45664. s[1] = r + i,
  45665. l[0] = e / a,
  45666. l[1] = t / a,
  45667. this
  45668. },
  45669. stopWarping: function() {
  45670. var e = this._timeScaleInterpolant;
  45671. return null !== e && (this._timeScaleInterpolant = null,
  45672. this._mixer._takeBackControlInterpolant(e)),
  45673. this
  45674. },
  45675. getMixer: function() {
  45676. return this._mixer
  45677. },
  45678. getClip: function() {
  45679. return this._clip
  45680. },
  45681. getRoot: function() {
  45682. return this._localRoot || this._mixer._root
  45683. },
  45684. _update: function(e, t, i, n) {
  45685. var r = this._startTime;
  45686. if (null !== r) {
  45687. var o = (e - r) * i;
  45688. if (o < 0 || 0 === i)
  45689. return;
  45690. this._startTime = null,
  45691. t = i * o
  45692. }
  45693. t *= this._updateTimeScale(e);
  45694. var a = this._updateTime(t)
  45695. , s = this._updateWeight(e);
  45696. if (s > 0)
  45697. for (var l = this._interpolants, c = this._propertyBindings, h = 0, u = l.length; h !== u; ++h)
  45698. l[h].evaluate(a),
  45699. c[h].accumulate(n, s)
  45700. },
  45701. _updateWeight: function(e) {
  45702. var t = 0;
  45703. if (this.enabled) {
  45704. t = this.weight;
  45705. var i = this._weightInterpolant;
  45706. if (null !== i) {
  45707. var n = i.evaluate(e)[0];
  45708. t *= n,
  45709. e > i.parameterPositions[1] && (this.stopFading(),
  45710. 0 === n && (this.enabled = !1))
  45711. }
  45712. }
  45713. return this._effectiveWeight = t,
  45714. t
  45715. },
  45716. _updateTimeScale: function(e) {
  45717. var t = 0;
  45718. if (!this.paused) {
  45719. t = this.timeScale;
  45720. var i = this._timeScaleInterpolant;
  45721. if (null !== i) {
  45722. var n = i.evaluate(e)[0];
  45723. t *= n,
  45724. e > i.parameterPositions[1] && (this.stopWarping(),
  45725. 0 === t ? this.pause = !0 : this.timeScale = t)
  45726. }
  45727. }
  45728. return this._effectiveTimeScale = t,
  45729. t
  45730. },
  45731. _updateTime: function(e) {
  45732. var t = this.time + e;
  45733. if (0 === e)
  45734. return t;
  45735. var i = this._clip.duration
  45736. , r = this.loop
  45737. , o = this._loopCount
  45738. , a = !1;
  45739. switch (r) {
  45740. case n.LoopOnce:
  45741. if (o === -1 && (this.loopCount = 0,
  45742. this._setEndings(!0, !0, !1)),
  45743. t >= i)
  45744. t = i;
  45745. else {
  45746. if (!(t < 0))
  45747. break;
  45748. t = 0
  45749. }
  45750. this.clampWhenFinished ? this.pause = !0 : this.enabled = !1,
  45751. this._mixer.dispatchEvent({
  45752. type: "finished",
  45753. action: this,
  45754. direction: e < 0 ? -1 : 1
  45755. });
  45756. break;
  45757. case n.LoopPingPong:
  45758. a = !0;
  45759. case n.LoopRepeat:
  45760. if (o === -1 && (e > 0 ? (o = 0,
  45761. this._setEndings(!0, 0 === this.repetitions, a)) : this._setEndings(0 === this.repetitions, !0, a)),
  45762. t >= i || t < 0) {
  45763. var s = Math.floor(t / i);
  45764. t -= i * s,
  45765. o += Math.abs(s);
  45766. var l = this.repetitions - o;
  45767. if (l < 0) {
  45768. this.clampWhenFinished ? this.paused = !0 : this.enabled = !1,
  45769. t = e > 0 ? i : 0,
  45770. this._mixer.dispatchEvent({
  45771. type: "finished",
  45772. action: this,
  45773. direction: e > 0 ? 1 : -1
  45774. });
  45775. break
  45776. }
  45777. if (0 === l) {
  45778. var c = e < 0;
  45779. this._setEndings(c, !c, a)
  45780. } else
  45781. this._setEndings(!1, !1, a);
  45782. this._loopCount = o,
  45783. this._mixer.dispatchEvent({
  45784. type: "loop",
  45785. action: this,
  45786. loopDelta: s
  45787. })
  45788. }
  45789. if (r === n.LoopPingPong && 1 === (1 & o))
  45790. return this.time = t,
  45791. i - t
  45792. }
  45793. return this.time = t,
  45794. t
  45795. },
  45796. _setEndings: function(e, t, i) {
  45797. var r = this._interpolantSettings;
  45798. i ? (r.endingStart = n.ZeroSlopeEnding,
  45799. r.endingEnd = n.ZeroSlopeEnding) : (e ? r.endingStart = this.zeroSlopeAtStart ? n.ZeroSlopeEnding : n.ZeroCurvatureEnding : r.endingStart = n.WrapAroundEnding,
  45800. t ? r.endingEnd = this.zeroSlopeAtEnd ? n.ZeroSlopeEnding : n.ZeroCurvatureEnding : r.endingEnd = n.WrapAroundEnding)
  45801. },
  45802. _scheduleFading: function(e, t, i) {
  45803. var n = this._mixer
  45804. , r = n.time
  45805. , o = this._weightInterpolant;
  45806. null === o && (o = n._lendControlInterpolant(),
  45807. this._weightInterpolant = o);
  45808. var a = o.parameterPositions
  45809. , s = o.sampleValues;
  45810. return a[0] = r,
  45811. s[0] = t,
  45812. a[1] = r + e,
  45813. s[1] = i,
  45814. this
  45815. }
  45816. },
  45817. Object.assign(n.AnimationMixer.prototype, {
  45818. _bindAction: function(e, t) {
  45819. var i = e._localRoot || this._root
  45820. , r = e._clip.tracks
  45821. , o = r.length
  45822. , a = e._propertyBindings
  45823. , s = e._interpolants
  45824. , l = i.uuid
  45825. , c = this._bindingsByRootAndName
  45826. , h = c[l];
  45827. void 0 === h && (h = {},
  45828. c[l] = h);
  45829. for (var u = 0; u !== o; ++u) {
  45830. var d = r[u]
  45831. , p = d.name
  45832. , f = h[p];
  45833. if (void 0 !== f)
  45834. a[u] = f;
  45835. else {
  45836. if (f = a[u],
  45837. void 0 !== f) {
  45838. null === f._cacheIndex && (++f.referenceCount,
  45839. this._addInactiveBinding(f, l, p));
  45840. continue
  45841. }
  45842. var g = t && t._propertyBindings[u].binding.parsedPath;
  45843. f = new n.PropertyMixer(n.PropertyBinding.create(i, p, g),d.ValueTypeName,d.getValueSize()),
  45844. ++f.referenceCount,
  45845. this._addInactiveBinding(f, l, p),
  45846. a[u] = f
  45847. }
  45848. s[u].resultBuffer = f.buffer
  45849. }
  45850. },
  45851. _activateAction: function(e) {
  45852. if (!this._isActiveAction(e)) {
  45853. if (null === e._cacheIndex) {
  45854. var t = (e._localRoot || this._root).uuid
  45855. , i = e._clip.name
  45856. , n = this._actionsByClip[i];
  45857. this._bindAction(e, n && n.knownActions[0]),
  45858. this._addInactiveAction(e, i, t)
  45859. }
  45860. for (var r = e._propertyBindings, o = 0, a = r.length; o !== a; ++o) {
  45861. var s = r[o];
  45862. 0 === s.useCount++ && (this._lendBinding(s),
  45863. s.saveOriginalState())
  45864. }
  45865. this._lendAction(e)
  45866. }
  45867. },
  45868. _deactivateAction: function(e) {
  45869. if (this._isActiveAction(e)) {
  45870. for (var t = e._propertyBindings, i = 0, n = t.length; i !== n; ++i) {
  45871. var r = t[i];
  45872. 0 === --r.useCount && (r.restoreOriginalState(),
  45873. this._takeBackBinding(r))
  45874. }
  45875. this._takeBackAction(e)
  45876. }
  45877. },
  45878. _initMemoryManager: function() {
  45879. this._actions = [],
  45880. this._nActiveActions = 0,
  45881. this._actionsByClip = {},
  45882. this._bindings = [],
  45883. this._nActiveBindings = 0,
  45884. this._bindingsByRootAndName = {},
  45885. this._controlInterpolants = [],
  45886. this._nActiveControlInterpolants = 0;
  45887. var e = this;
  45888. this.stats = {
  45889. actions: {
  45890. get total() {
  45891. return e._actions.length
  45892. },
  45893. get inUse() {
  45894. return e._nActiveActions
  45895. }
  45896. },
  45897. bindings: {
  45898. get total() {
  45899. return e._bindings.length
  45900. },
  45901. get inUse() {
  45902. return e._nActiveBindings
  45903. }
  45904. },
  45905. controlInterpolants: {
  45906. get total() {
  45907. return e._controlInterpolants.length
  45908. },
  45909. get inUse() {
  45910. return e._nActiveControlInterpolants
  45911. }
  45912. }
  45913. }
  45914. },
  45915. _isActiveAction: function(e) {
  45916. var t = e._cacheIndex;
  45917. return null !== t && t < this._nActiveActions
  45918. },
  45919. _addInactiveAction: function(e, t, i) {
  45920. var n = this._actions
  45921. , r = this._actionsByClip
  45922. , o = r[t];
  45923. if (void 0 === o)
  45924. o = {
  45925. knownActions: [e],
  45926. actionByRoot: {}
  45927. },
  45928. e._byClipCacheIndex = 0,
  45929. r[t] = o;
  45930. else {
  45931. var a = o.knownActions;
  45932. e._byClipCacheIndex = a.length,
  45933. a.push(e)
  45934. }
  45935. e._cacheIndex = n.length,
  45936. n.push(e),
  45937. o.actionByRoot[i] = e
  45938. },
  45939. _removeInactiveAction: function(e) {
  45940. var t = this._actions
  45941. , i = t[t.length - 1]
  45942. , n = e._cacheIndex;
  45943. i._cacheIndex = n,
  45944. t[n] = i,
  45945. t.pop(),
  45946. e._cacheIndex = null;
  45947. var r = e._clip.name
  45948. , o = this._actionsByClip
  45949. , a = o[r]
  45950. , s = a.knownActions
  45951. , l = s[s.length - 1]
  45952. , c = e._byClipCacheIndex;
  45953. l._byClipCacheIndex = c,
  45954. s[c] = l,
  45955. s.pop(),
  45956. e._byClipCacheIndex = null;
  45957. var h = a.actionByRoot
  45958. , u = (t._localRoot || this._root).uuid;
  45959. delete h[u],
  45960. 0 === s.length && delete o[r],
  45961. this._removeInactiveBindingsForAction(e)
  45962. },
  45963. _removeInactiveBindingsForAction: function(e) {
  45964. for (var t = e._propertyBindings, i = 0, n = t.length; i !== n; ++i) {
  45965. var r = t[i];
  45966. 0 === --r.referenceCount && this._removeInactiveBinding(r)
  45967. }
  45968. },
  45969. _lendAction: function(e) {
  45970. var t = this._actions
  45971. , i = e._cacheIndex
  45972. , n = this._nActiveActions++
  45973. , r = t[n];
  45974. e._cacheIndex = n,
  45975. t[n] = e,
  45976. r._cacheIndex = i,
  45977. t[i] = r
  45978. },
  45979. _takeBackAction: function(e) {
  45980. var t = this._actions
  45981. , i = e._cacheIndex
  45982. , n = --this._nActiveActions
  45983. , r = t[n];
  45984. e._cacheIndex = n,
  45985. t[n] = e,
  45986. r._cacheIndex = i,
  45987. t[i] = r
  45988. },
  45989. _addInactiveBinding: function(e, t, i) {
  45990. var n = this._bindingsByRootAndName
  45991. , r = n[t]
  45992. , o = this._bindings;
  45993. void 0 === r && (r = {},
  45994. n[t] = r),
  45995. r[i] = e,
  45996. e._cacheIndex = o.length,
  45997. o.push(e)
  45998. },
  45999. _removeInactiveBinding: function(e) {
  46000. var t = this._bindings
  46001. , i = e.binding
  46002. , n = i.rootNode.uuid
  46003. , r = i.path
  46004. , o = this._bindingsByRootAndName
  46005. , a = o[n]
  46006. , s = t[t.length - 1]
  46007. , l = e._cacheIndex;
  46008. s._cacheIndex = l,
  46009. t[l] = s,
  46010. t.pop(),
  46011. delete a[r];
  46012. e: {
  46013. for (var c in a)
  46014. break e;
  46015. delete o[n]
  46016. }
  46017. },
  46018. _lendBinding: function(e) {
  46019. var t = this._bindings
  46020. , i = e._cacheIndex
  46021. , n = this._nActiveBindings++
  46022. , r = t[n];
  46023. e._cacheIndex = n,
  46024. t[n] = e,
  46025. r._cacheIndex = i,
  46026. t[i] = r
  46027. },
  46028. _takeBackBinding: function(e) {
  46029. var t = this._bindings
  46030. , i = e._cacheIndex
  46031. , n = --this._nActiveBindings
  46032. , r = t[n];
  46033. e._cacheIndex = n,
  46034. t[n] = e,
  46035. r._cacheIndex = i,
  46036. t[i] = r
  46037. },
  46038. _lendControlInterpolant: function() {
  46039. var e = this._controlInterpolants
  46040. , t = this._nActiveControlInterpolants++
  46041. , i = e[t];
  46042. return void 0 === i && (i = new n.LinearInterpolant(new Float32Array(2),new Float32Array(2),1,this._controlInterpolantsResultBuffer),
  46043. i.__cacheIndex = t,
  46044. e[t] = i),
  46045. i
  46046. },
  46047. _takeBackControlInterpolant: function(e) {
  46048. var t = this._controlInterpolants
  46049. , i = e.__cacheIndex
  46050. , n = --this._nActiveControlInterpolants
  46051. , r = t[n];
  46052. e.__cacheIndex = n,
  46053. t[n] = e,
  46054. r.__cacheIndex = i,
  46055. t[i] = r
  46056. },
  46057. _controlInterpolantsResultBuffer: new Float32Array(1)
  46058. }),
  46059. n.AnimationObjectGroup = function(e) {
  46060. this.uuid = n.Math.generateUUID(),
  46061. this._objects = Array.prototype.slice.call(arguments),
  46062. this.nCachedObjects_ = 0;
  46063. var t = {};
  46064. this._indicesByUUID = t;
  46065. for (var i = 0, r = arguments.length; i !== r; ++i)
  46066. t[arguments[i].uuid] = i;
  46067. this._paths = [],
  46068. this._parsedPaths = [],
  46069. this._bindings = [],
  46070. this._bindingsIndicesByPath = {};
  46071. var o = this;
  46072. this.stats = {
  46073. objects: {
  46074. get total() {
  46075. return o._objects.length
  46076. },
  46077. get inUse() {
  46078. return this.total - o.nCachedObjects_
  46079. }
  46080. },
  46081. get bindingsPerObject() {
  46082. return o._bindings.length
  46083. }
  46084. }
  46085. }
  46086. ,
  46087. n.AnimationObjectGroup.prototype = {
  46088. constructor: n.AnimationObjectGroup,
  46089. add: function(e) {
  46090. 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) {
  46091. var d = arguments[h]
  46092. , p = d.uuid
  46093. , f = o[p];
  46094. if (void 0 === f) {
  46095. f = i++,
  46096. o[p] = f,
  46097. t.push(d);
  46098. for (var g = 0, m = c; g !== m; ++g)
  46099. l[g].push(new n.PropertyBinding(d,a[g],s[g]))
  46100. } else if (f < r) {
  46101. var v = t[f]
  46102. , A = --r
  46103. , y = t[A];
  46104. o[y.uuid] = f,
  46105. t[f] = y,
  46106. o[p] = A,
  46107. t[A] = d;
  46108. for (var g = 0, m = c; g !== m; ++g) {
  46109. var C = l[g]
  46110. , I = C[A]
  46111. , E = C[f];
  46112. C[f] = I,
  46113. void 0 === E && (E = new n.PropertyBinding(d,a[g],s[g])),
  46114. C[A] = E
  46115. }
  46116. } else
  46117. t[f] !== v && console.error("Different objects with the same UUID detected. Clean the caches or recreate your infrastructure when reloading scenes...")
  46118. }
  46119. this.nCachedObjects_ = r
  46120. },
  46121. remove: function(e) {
  46122. for (var t = this._objects, i = (t.length,
  46123. this.nCachedObjects_), n = this._indicesByUUID, r = this._bindings, o = r.length, a = 0, s = arguments.length; a !== s; ++a) {
  46124. var l = arguments[a]
  46125. , c = l.uuid
  46126. , h = n[c];
  46127. if (void 0 !== h && h >= i) {
  46128. var u = i++
  46129. , d = t[u];
  46130. n[d.uuid] = h,
  46131. t[h] = d,
  46132. n[c] = u,
  46133. t[u] = l;
  46134. for (var p = 0, f = o; p !== f; ++p) {
  46135. var g = r[p]
  46136. , m = g[u]
  46137. , v = g[h];
  46138. g[h] = m,
  46139. g[u] = v
  46140. }
  46141. }
  46142. }
  46143. this.nCachedObjects_ = i
  46144. },
  46145. uncache: function(e) {
  46146. 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) {
  46147. var c = arguments[s]
  46148. , h = c.uuid
  46149. , u = r[h];
  46150. if (void 0 !== u)
  46151. if (delete r[h],
  46152. u < n) {
  46153. var d = --n
  46154. , p = t[d]
  46155. , f = --i
  46156. , g = t[f];
  46157. r[p.uuid] = u,
  46158. t[u] = p,
  46159. r[g.uuid] = d,
  46160. t[d] = g,
  46161. t.pop();
  46162. for (var m = 0, v = a; m !== v; ++m) {
  46163. var A = o[m]
  46164. , y = A[d]
  46165. , C = A[f];
  46166. A[u] = y,
  46167. A[d] = C,
  46168. A.pop()
  46169. }
  46170. } else {
  46171. var f = --i
  46172. , g = t[f];
  46173. r[g.uuid] = u,
  46174. t[u] = g,
  46175. t.pop();
  46176. for (var m = 0, v = a; m !== v; ++m) {
  46177. var A = o[m];
  46178. A[u] = A[f],
  46179. A.pop()
  46180. }
  46181. }
  46182. }
  46183. this.nCachedObjects_ = n
  46184. },
  46185. subscribe_: function(e, t) {
  46186. var i = this._bindingsIndicesByPath
  46187. , r = i[e]
  46188. , o = this._bindings;
  46189. if (void 0 !== r)
  46190. return o[r];
  46191. var a = this._paths
  46192. , s = this._parsedPaths
  46193. , l = this._objects
  46194. , c = l.length
  46195. , h = this.nCachedObjects_
  46196. , u = new Array(c);
  46197. r = o.length,
  46198. i[e] = r,
  46199. a.push(e),
  46200. s.push(t),
  46201. o.push(u);
  46202. for (var d = h, p = l.length; d !== p; ++d) {
  46203. var f = l[d];
  46204. u[d] = new n.PropertyBinding(f,e,t)
  46205. }
  46206. return u
  46207. },
  46208. unsubscribe_: function(e) {
  46209. var t = this._bindingsIndicesByPath
  46210. , i = t[e];
  46211. if (void 0 !== i) {
  46212. var n = this._paths
  46213. , r = this._parsedPaths
  46214. , o = this._bindings
  46215. , a = o.length - 1
  46216. , s = o[a]
  46217. , l = e[a];
  46218. t[l] = i,
  46219. o[i] = s,
  46220. o.pop(),
  46221. r[i] = r[a],
  46222. r.pop(),
  46223. n[i] = n[a],
  46224. n.pop()
  46225. }
  46226. }
  46227. },
  46228. n.AnimationUtils = {
  46229. arraySlice: function(e, t, i) {
  46230. return n.AnimationUtils.isTypedArray(e) ? new e.constructor(e.subarray(t, i)) : e.slice(t, i)
  46231. },
  46232. convertArray: function(e, t, i) {
  46233. return !e || !i && e.constructor === t ? e : "number" == typeof t.BYTES_PER_ELEMENT ? new t(e) : Array.prototype.slice.call(e)
  46234. },
  46235. isTypedArray: function(e) {
  46236. return ArrayBuffer.isView(e) && !(e instanceof DataView)
  46237. },
  46238. getKeyframeOrder: function(e) {
  46239. function t(t, i) {
  46240. return e[t] - e[i]
  46241. }
  46242. for (var i = e.length, n = new Array(i), r = 0; r !== i; ++r)
  46243. n[r] = r;
  46244. return n.sort(t),
  46245. n
  46246. },
  46247. sortedArray: function(e, t, i) {
  46248. for (var n = e.length, r = new e.constructor(n), o = 0, a = 0; a !== n; ++o)
  46249. for (var s = i[o] * t, l = 0; l !== t; ++l)
  46250. r[a++] = e[s + l];
  46251. return r
  46252. },
  46253. flattenJSON: function(e, t, i, n) {
  46254. for (var r = 1, o = e[0]; void 0 !== o && void 0 === o[n]; )
  46255. o = e[r++];
  46256. if (void 0 !== o) {
  46257. var a = o[n];
  46258. if (void 0 !== a)
  46259. if (Array.isArray(a)) {
  46260. do
  46261. a = o[n],
  46262. void 0 !== a && (t.push(o.time),
  46263. i.push.apply(i, a)),
  46264. o = e[r++];
  46265. while (void 0 !== o)
  46266. } else if (void 0 !== a.toArray) {
  46267. do
  46268. a = o[n],
  46269. void 0 !== a && (t.push(o.time),
  46270. a.toArray(i, i.length)),
  46271. o = e[r++];
  46272. while (void 0 !== o)
  46273. } else
  46274. do
  46275. a = o[n],
  46276. void 0 !== a && (t.push(o.time),
  46277. i.push(a)),
  46278. o = e[r++];
  46279. while (void 0 !== o)
  46280. }
  46281. }
  46282. },
  46283. n.KeyframeTrack = function(e, t, i, r) {
  46284. if (void 0 === e)
  46285. throw new Error("track name is undefined");
  46286. if (void 0 === t || 0 === t.length)
  46287. throw new Error("no keyframes in track named " + e);
  46288. this.name = e,
  46289. this.times = n.AnimationUtils.convertArray(t, this.TimeBufferType),
  46290. this.values = n.AnimationUtils.convertArray(i, this.ValueBufferType),
  46291. this.setInterpolation(r || this.DefaultInterpolation),
  46292. this.validate(),
  46293. this.optimize()
  46294. }
  46295. ,
  46296. n.KeyframeTrack.prototype = {
  46297. constructor: n.KeyframeTrack,
  46298. TimeBufferType: Float32Array,
  46299. ValueBufferType: Float32Array,
  46300. DefaultInterpolation: n.InterpolateLinear,
  46301. InterpolantFactoryMethodDiscrete: function(e) {
  46302. return new n.DiscreteInterpolant(this.times,this.values,this.getValueSize(),e)
  46303. },
  46304. InterpolantFactoryMethodLinear: function(e) {
  46305. return new n.LinearInterpolant(this.times,this.values,this.getValueSize(),e)
  46306. },
  46307. InterpolantFactoryMethodSmooth: function(e) {
  46308. return new n.CubicInterpolant(this.times,this.values,this.getValueSize(),e)
  46309. },
  46310. setInterpolation: function(e) {
  46311. var t = void 0;
  46312. switch (e) {
  46313. case n.InterpolateDiscrete:
  46314. t = this.InterpolantFactoryMethodDiscrete;
  46315. break;
  46316. case n.InterpolateLinear:
  46317. t = this.InterpolantFactoryMethodLinear;
  46318. break;
  46319. case n.InterpolateSmooth:
  46320. t = this.InterpolantFactoryMethodSmooth
  46321. }
  46322. if (void 0 === t) {
  46323. var i = "unsupported interpolation for " + this.ValueTypeName + " keyframe track named " + this.name;
  46324. if (void 0 === this.createInterpolant) {
  46325. if (e === this.DefaultInterpolation)
  46326. throw new Error(i);
  46327. this.setInterpolation(this.DefaultInterpolation)
  46328. }
  46329. return void console.warn(i)
  46330. }
  46331. this.createInterpolant = t
  46332. },
  46333. getInterpolation: function() {
  46334. switch (this.createInterpolant) {
  46335. case this.InterpolantFactoryMethodDiscrete:
  46336. return n.InterpolateDiscrete;
  46337. case this.InterpolantFactoryMethodLinear:
  46338. return n.InterpolateLinear;
  46339. case this.InterpolantFactoryMethodSmooth:
  46340. return n.InterpolateSmooth
  46341. }
  46342. },
  46343. getValueSize: function() {
  46344. return this.values.length / this.times.length
  46345. },
  46346. shift: function(e) {
  46347. if (0 !== e)
  46348. for (var t = this.times, i = 0, n = t.length; i !== n; ++i)
  46349. t[i] += e;
  46350. return this
  46351. },
  46352. scale: function(e) {
  46353. if (1 !== e)
  46354. for (var t = this.times, i = 0, n = t.length; i !== n; ++i)
  46355. t[i] *= e;
  46356. return this
  46357. },
  46358. trim: function(e, t) {
  46359. for (var i = this.times, r = i.length, o = 0, a = r - 1; o !== r && i[o] < e; )
  46360. ++o;
  46361. for (; a !== -1 && i[a] > t; )
  46362. --a;
  46363. if (++a,
  46364. 0 !== o || a !== r) {
  46365. o >= a && (a = Math.max(a, 1),
  46366. o = a - 1);
  46367. var s = this.getValueSize();
  46368. this.times = n.AnimationUtils.arraySlice(i, o, a),
  46369. this.values = n.AnimationUtils.arraySlice(this.values, o * s, a * s)
  46370. }
  46371. return this
  46372. },
  46373. validate: function() {
  46374. var e = !0
  46375. , t = this.getValueSize();
  46376. t - Math.floor(t) !== 0 && (console.error("invalid value size in track", this),
  46377. e = !1);
  46378. var i = this.times
  46379. , r = this.values
  46380. , o = i.length;
  46381. 0 === o && (console.error("track is empty", this),
  46382. e = !1);
  46383. for (var a = null, s = 0; s !== o; s++) {
  46384. var l = i[s];
  46385. if ("number" == typeof l && isNaN(l)) {
  46386. console.error("time is not a valid number", this, s, l),
  46387. e = !1;
  46388. break
  46389. }
  46390. if (null !== a && a > l) {
  46391. console.error("out of order keys", this, s, l, a),
  46392. e = !1;
  46393. break
  46394. }
  46395. a = l
  46396. }
  46397. if (void 0 !== r && n.AnimationUtils.isTypedArray(r))
  46398. for (var s = 0, c = r.length; s !== c; ++s) {
  46399. var h = r[s];
  46400. if (isNaN(h)) {
  46401. console.error("value is not a valid number", this, s, h),
  46402. e = !1;
  46403. break
  46404. }
  46405. }
  46406. return e
  46407. },
  46408. optimize: function() {
  46409. for (var e = this.times, t = this.values, i = this.getValueSize(), r = 1, o = 1, a = e.length - 1; o <= a; ++o) {
  46410. var s = !1
  46411. , l = e[o]
  46412. , c = e[o + 1];
  46413. if (l !== c && (1 !== o || l !== l[0]))
  46414. for (var h = o * i, u = h - i, d = h + i, p = 0; p !== i; ++p) {
  46415. var f = t[h + p];
  46416. if (f !== t[u + p] || f !== t[d + p]) {
  46417. s = !0;
  46418. break
  46419. }
  46420. }
  46421. if (s) {
  46422. if (o !== r) {
  46423. e[r] = e[o];
  46424. for (var g = o * i, m = r * i, p = 0; p !== i; ++p)
  46425. t[m + p] = t[g + p]
  46426. }
  46427. ++r
  46428. }
  46429. }
  46430. return r !== e.length && (this.times = n.AnimationUtils.arraySlice(e, 0, r),
  46431. this.values = n.AnimationUtils.arraySlice(t, 0, r * i)),
  46432. this
  46433. }
  46434. },
  46435. Object.assign(n.KeyframeTrack, {
  46436. parse: function(e) {
  46437. if (void 0 === e.type)
  46438. throw new Error("track type undefined, can not parse");
  46439. var t = n.KeyframeTrack._getTrackTypeForValueTypeName(e.type);
  46440. if (void 0 === e.times) {
  46441. console.warn("legacy JSON format detected, converting");
  46442. var i = []
  46443. , r = [];
  46444. n.AnimationUtils.flattenJSON(e.keys, i, r, "value"),
  46445. e.times = i,
  46446. e.values = r
  46447. }
  46448. return void 0 !== t.parse ? t.parse(e) : new t(e.name,e.times,e.values,e.interpolation)
  46449. },
  46450. toJSON: function(e) {
  46451. var t, i = e.constructor;
  46452. if (void 0 !== i.toJSON)
  46453. t = i.toJSON(e);
  46454. else {
  46455. t = {
  46456. name: e.name,
  46457. times: n.AnimationUtils.convertArray(e.times, Array),
  46458. values: n.AnimationUtils.convertArray(e.values, Array)
  46459. };
  46460. var r = e.getInterpolation();
  46461. r !== e.DefaultInterpolation && (t.interpolation = r)
  46462. }
  46463. return t.type = e.ValueTypeName,
  46464. t
  46465. },
  46466. _getTrackTypeForValueTypeName: function(e) {
  46467. switch (e.toLowerCase()) {
  46468. case "scalar":
  46469. case "double":
  46470. case "float":
  46471. case "number":
  46472. case "integer":
  46473. return n.NumberKeyframeTrack;
  46474. case "vector":
  46475. case "vector2":
  46476. case "vector3":
  46477. case "vector4":
  46478. return n.VectorKeyframeTrack;
  46479. case "color":
  46480. return n.ColorKeyframeTrack;
  46481. case "quaternion":
  46482. return n.QuaternionKeyframeTrack;
  46483. case "bool":
  46484. case "boolean":
  46485. return n.BooleanKeyframeTrack;
  46486. case "string":
  46487. return n.StringKeyframeTrack
  46488. }
  46489. throw new Error("Unsupported typeName: " + e)
  46490. }
  46491. }),
  46492. n.PropertyBinding = function(e, t, i) {
  46493. this.path = t,
  46494. this.parsedPath = i || n.PropertyBinding.parseTrackName(t),
  46495. this.node = n.PropertyBinding.findNode(e, this.parsedPath.nodeName) || e,
  46496. this.rootNode = e
  46497. }
  46498. ,
  46499. n.PropertyBinding.prototype = {
  46500. constructor: n.PropertyBinding,
  46501. getValue: function(e, t) {
  46502. this.bind(),
  46503. this.getValue(e, t)
  46504. },
  46505. setValue: function(e, t) {
  46506. this.bind(),
  46507. this.setValue(e, t)
  46508. },
  46509. bind: function() {
  46510. var e = this.node
  46511. , t = this.parsedPath
  46512. , i = t.objectName
  46513. , r = t.propertyName
  46514. , o = t.propertyIndex;
  46515. if (e || (e = n.PropertyBinding.findNode(this.rootNode, t.nodeName) || this.rootNode,
  46516. this.node = e),
  46517. this.getValue = this._getValue_unavailable,
  46518. this.setValue = this._setValue_unavailable,
  46519. !e)
  46520. return void console.error(" trying to update node for track: " + this.path + " but it wasn't found.");
  46521. if (i) {
  46522. var a = t.objectIndex;
  46523. switch (i) {
  46524. case "materials":
  46525. if (!e.material)
  46526. return void console.error(" can not bind to material as node does not have a material", this);
  46527. if (!e.material.materials)
  46528. return void console.error(" can not bind to material.materials as node.material does not have a materials array", this);
  46529. e = e.material.materials;
  46530. break;
  46531. case "bones":
  46532. if (!e.skeleton)
  46533. return void console.error(" can not bind to bones as node does not have a skeleton", this);
  46534. e = e.skeleton.bones;
  46535. for (var s = 0; s < e.length; s++)
  46536. if (e[s].name === a) {
  46537. a = s;
  46538. break
  46539. }
  46540. break;
  46541. default:
  46542. if (void 0 === e[i])
  46543. return void console.error(" can not bind to objectName of node, undefined", this);
  46544. e = e[i]
  46545. }
  46546. if (void 0 !== a) {
  46547. if (void 0 === e[a])
  46548. return void console.error(" trying to bind to objectIndex of objectName, but is undefined:", this, e);
  46549. e = e[a]
  46550. }
  46551. }
  46552. var l = e[r];
  46553. if (!l) {
  46554. var c = t.nodeName;
  46555. return void console.error(" trying to update property for track: " + c + "." + r + " but it wasn't found.", e)
  46556. }
  46557. var h = this.Versioning.None;
  46558. void 0 !== e.needsUpdate ? (h = this.Versioning.NeedsUpdate,
  46559. this.targetObject = e) : void 0 !== e.matrixWorldNeedsUpdate && (h = this.Versioning.MatrixWorldNeedsUpdate,
  46560. this.targetObject = e);
  46561. var u = this.BindingType.Direct;
  46562. if (void 0 !== o) {
  46563. if ("morphTargetInfluences" === r) {
  46564. if (!e.geometry)
  46565. return void console.error(" can not bind to morphTargetInfluences becasuse node does not have a geometry", this);
  46566. if (!e.geometry.morphTargets)
  46567. return void console.error(" can not bind to morphTargetInfluences becasuse node does not have a geometry.morphTargets", this);
  46568. for (var s = 0; s < this.node.geometry.morphTargets.length; s++)
  46569. if (e.geometry.morphTargets[s].name === o) {
  46570. o = s;
  46571. break
  46572. }
  46573. }
  46574. u = this.BindingType.ArrayElement,
  46575. this.resolvedProperty = l,
  46576. this.propertyIndex = o
  46577. } else
  46578. void 0 !== l.fromArray && void 0 !== l.toArray ? (u = this.BindingType.HasFromToArray,
  46579. this.resolvedProperty = l) : void 0 !== l.length ? (u = this.BindingType.EntireArray,
  46580. this.resolvedProperty = l) : this.propertyName = r;
  46581. this.getValue = this.GetterByBindingType[u],
  46582. this.setValue = this.SetterByBindingTypeAndVersioning[u][h]
  46583. },
  46584. unbind: function() {
  46585. this.node = null,
  46586. this.getValue = this._getValue_unbound,
  46587. this.setValue = this._setValue_unbound
  46588. }
  46589. },
  46590. Object.assign(n.PropertyBinding.prototype, {
  46591. _getValue_unavailable: function() {},
  46592. _setValue_unavailable: function() {},
  46593. _getValue_unbound: n.PropertyBinding.prototype.getValue,
  46594. _setValue_unbound: n.PropertyBinding.prototype.setValue,
  46595. BindingType: {
  46596. Direct: 0,
  46597. EntireArray: 1,
  46598. ArrayElement: 2,
  46599. HasFromToArray: 3
  46600. },
  46601. Versioning: {
  46602. None: 0,
  46603. NeedsUpdate: 1,
  46604. MatrixWorldNeedsUpdate: 2
  46605. },
  46606. GetterByBindingType: [function(e, t) {
  46607. e[t] = this.node[this.propertyName]
  46608. }
  46609. , function(e, t) {
  46610. for (var i = this.resolvedProperty, n = 0, r = i.length; n !== r; ++n)
  46611. e[t++] = i[n]
  46612. }
  46613. , function(e, t) {
  46614. e[t] = this.resolvedProperty[this.propertyIndex]
  46615. }
  46616. , function(e, t) {
  46617. this.resolvedProperty.toArray(e, t)
  46618. }
  46619. ],
  46620. SetterByBindingTypeAndVersioning: [[function(e, t) {
  46621. this.node[this.propertyName] = e[t]
  46622. }
  46623. , function(e, t) {
  46624. this.node[this.propertyName] = e[t],
  46625. this.targetObject.needsUpdate = !0
  46626. }
  46627. , function(e, t) {
  46628. this.node[this.propertyName] = e[t],
  46629. this.targetObject.matrixWorldNeedsUpdate = !0
  46630. }
  46631. ], [function(e, t) {
  46632. for (var i = this.resolvedProperty, n = 0, r = i.length; n !== r; ++n)
  46633. i[n] = e[t++]
  46634. }
  46635. , function(e, t) {
  46636. for (var i = this.resolvedProperty, n = 0, r = i.length; n !== r; ++n)
  46637. i[n] = e[t++];
  46638. this.targetObject.needsUpdate = !0
  46639. }
  46640. , function(e, t) {
  46641. for (var i = this.resolvedProperty, n = 0, r = i.length; n !== r; ++n)
  46642. i[n] = e[t++];
  46643. this.targetObject.matrixWorldNeedsUpdate = !0
  46644. }
  46645. ], [function(e, t) {
  46646. this.resolvedProperty[this.propertyIndex] = e[t]
  46647. }
  46648. , function(e, t) {
  46649. this.resolvedProperty[this.propertyIndex] = e[t],
  46650. this.targetObject.needsUpdate = !0
  46651. }
  46652. , function(e, t) {
  46653. this.resolvedProperty[this.propertyIndex] = e[t],
  46654. this.targetObject.matrixWorldNeedsUpdate = !0
  46655. }
  46656. ], [function(e, t) {
  46657. this.resolvedProperty.fromArray(e, t)
  46658. }
  46659. , function(e, t) {
  46660. this.resolvedProperty.fromArray(e, t),
  46661. this.targetObject.needsUpdate = !0
  46662. }
  46663. , function(e, t) {
  46664. this.resolvedProperty.fromArray(e, t),
  46665. this.targetObject.matrixWorldNeedsUpdate = !0
  46666. }
  46667. ]]
  46668. }),
  46669. n.PropertyBinding.Composite = function(e, t, i) {
  46670. var r = i || n.PropertyBinding.parseTrackName(t);
  46671. this._targetGroup = e,
  46672. this._bindings = e.subscribe_(t, r)
  46673. }
  46674. ,
  46675. n.PropertyBinding.Composite.prototype = {
  46676. constructor: n.PropertyBinding.Composite,
  46677. getValue: function(e, t) {
  46678. this.bind();
  46679. var i = this._targetGroup.nCachedObjects_
  46680. , n = this._bindings[i];
  46681. void 0 !== n && n.getValue(e, t)
  46682. },
  46683. setValue: function(e, t) {
  46684. for (var i = this._bindings, n = this._targetGroup.nCachedObjects_, r = i.length; n !== r; ++n)
  46685. i[n].setValue(e, t)
  46686. },
  46687. bind: function() {
  46688. for (var e = this._bindings, t = this._targetGroup.nCachedObjects_, i = e.length; t !== i; ++t)
  46689. e[t].bind()
  46690. },
  46691. unbind: function() {
  46692. for (var e = this._bindings, t = this._targetGroup.nCachedObjects_, i = e.length; t !== i; ++t)
  46693. e[t].unbind()
  46694. }
  46695. },
  46696. n.PropertyBinding.create = function(e, t, i) {
  46697. return e instanceof n.AnimationObjectGroup ? new n.PropertyBinding.Composite(e,t,i) : new n.PropertyBinding(e,t,i)
  46698. }
  46699. ,
  46700. n.PropertyBinding.parseTrackName = function(e) {
  46701. var t = /^(([\w]+\/)*)([\w-\d]+)?(\.([\w]+)(\[([\w\d\[\]\_.:\- ]+)\])?)?(\.([\w.]+)(\[([\w\d\[\]\_. ]+)\])?)$/
  46702. , i = t.exec(e);
  46703. if (!i)
  46704. throw new Error("cannot parse trackName at all: " + e);
  46705. i.index === t.lastIndex && t.lastIndex++;
  46706. var n = {
  46707. nodeName: i[3],
  46708. objectName: i[5],
  46709. objectIndex: i[7],
  46710. propertyName: i[9],
  46711. propertyIndex: i[11]
  46712. };
  46713. if (null === n.propertyName || 0 === n.propertyName.length)
  46714. throw new Error("can not parse propertyName from trackName: " + e);
  46715. return n
  46716. }
  46717. ,
  46718. n.PropertyBinding.findNode = function(e, t) {
  46719. if (!t || "" === t || "root" === t || "." === t || t === -1 || t === e.name || t === e.uuid)
  46720. return e;
  46721. if (e.skeleton) {
  46722. var i = function(e) {
  46723. for (var i = 0; i < e.bones.length; i++) {
  46724. var n = e.bones[i];
  46725. if (n.name === t)
  46726. return n
  46727. }
  46728. return null
  46729. }
  46730. , n = i(e.skeleton);
  46731. if (n)
  46732. return n
  46733. }
  46734. if (e.children) {
  46735. var r = function(e) {
  46736. for (var i = 0; i < e.length; i++) {
  46737. var n = e[i];
  46738. if (n.name === t || n.uuid === t)
  46739. return n;
  46740. var o = r(n.children);
  46741. if (o)
  46742. return o
  46743. }
  46744. return null
  46745. }
  46746. , o = r(e.children);
  46747. if (o)
  46748. return o
  46749. }
  46750. return null
  46751. }
  46752. ,
  46753. n.PropertyMixer = function(e, t, i) {
  46754. this.binding = e,
  46755. this.valueSize = i;
  46756. var n, r = Float64Array;
  46757. switch (t) {
  46758. case "quaternion":
  46759. n = this._slerp;
  46760. break;
  46761. case "string":
  46762. case "bool":
  46763. r = Array,
  46764. n = this._select;
  46765. break;
  46766. default:
  46767. n = this._lerp
  46768. }
  46769. this.buffer = new r(4 * i),
  46770. this._mixBufferRegion = n,
  46771. this.cumulativeWeight = 0,
  46772. this.useCount = 0,
  46773. this.referenceCount = 0
  46774. }
  46775. ,
  46776. n.PropertyMixer.prototype = {
  46777. constructor: n.PropertyMixer,
  46778. accumulate: function(e, t) {
  46779. var i = this.buffer
  46780. , n = this.valueSize
  46781. , r = e * n + n
  46782. , o = this.cumulativeWeight;
  46783. if (0 === o) {
  46784. for (var a = 0; a !== n; ++a)
  46785. i[r + a] = i[a];
  46786. o = t
  46787. } else {
  46788. o += t;
  46789. var s = t / o;
  46790. this._mixBufferRegion(i, r, 0, s, n)
  46791. }
  46792. this.cumulativeWeight = o
  46793. },
  46794. apply: function(e) {
  46795. var t = this.valueSize
  46796. , i = this.buffer
  46797. , n = e * t + t
  46798. , r = this.cumulativeWeight
  46799. , o = this.binding;
  46800. if (this.cumulativeWeight = 0,
  46801. r < 1) {
  46802. var a = 3 * t;
  46803. this._mixBufferRegion(i, n, a, 1 - r, t)
  46804. }
  46805. for (var s = t, l = t + t; s !== l; ++s)
  46806. if (i[s] !== i[s + t]) {
  46807. o.setValue(i, n);
  46808. break
  46809. }
  46810. },
  46811. saveOriginalState: function() {
  46812. var e = this.binding
  46813. , t = this.buffer
  46814. , i = this.valueSize
  46815. , n = 3 * i;
  46816. e.getValue(t, n);
  46817. for (var r = i, o = n; r !== o; ++r)
  46818. t[r] = t[n + r % i];
  46819. this.cumulativeWeight = 0
  46820. },
  46821. restoreOriginalState: function() {
  46822. var e = 3 * this.valueSize;
  46823. this.binding.setValue(this.buffer, e)
  46824. },
  46825. _select: function(e, t, i, n, r) {
  46826. if (n >= .5)
  46827. for (var o = 0; o !== r; ++o)
  46828. e[t + o] = e[i + o]
  46829. },
  46830. _slerp: function(e, t, i, r, o) {
  46831. n.Quaternion.slerpFlat(e, t, e, t, e, i, r)
  46832. },
  46833. _lerp: function(e, t, i, n, r) {
  46834. for (var o = 1 - n, a = 0; a !== r; ++a) {
  46835. var s = t + a;
  46836. e[s] = e[s] * o + e[i + a] * n
  46837. }
  46838. }
  46839. },
  46840. n.BooleanKeyframeTrack = function(e, t, i) {
  46841. n.KeyframeTrack.call(this, e, t, i)
  46842. }
  46843. ,
  46844. n.BooleanKeyframeTrack.prototype = Object.assign(Object.create(n.KeyframeTrack.prototype), {
  46845. constructor: n.BooleanKeyframeTrack,
  46846. ValueTypeName: "bool",
  46847. ValueBufferType: Array,
  46848. DefaultInterpolation: n.IntepolateDiscrete,
  46849. InterpolantFactoryMethodLinear: void 0,
  46850. InterpolantFactoryMethodSmooth: void 0
  46851. }),
  46852. n.NumberKeyframeTrack = function(e, t, i, r) {
  46853. n.KeyframeTrack.call(this, e, t, i, r)
  46854. }
  46855. ,
  46856. n.NumberKeyframeTrack.prototype = Object.assign(Object.create(n.KeyframeTrack.prototype), {
  46857. constructor: n.NumberKeyframeTrack,
  46858. ValueTypeName: "number"
  46859. }),
  46860. n.QuaternionKeyframeTrack = function(e, t, i, r) {
  46861. n.KeyframeTrack.call(this, e, t, i, r)
  46862. }
  46863. ,
  46864. n.QuaternionKeyframeTrack.prototype = Object.assign(Object.create(n.KeyframeTrack.prototype), {
  46865. constructor: n.QuaternionKeyframeTrack,
  46866. ValueTypeName: "quaternion",
  46867. DefaultInterpolation: n.InterpolateLinear,
  46868. InterpolantFactoryMethodLinear: function(e) {
  46869. return new n.QuaternionLinearInterpolant(this.times,this.values,this.getValueSize(),e)
  46870. },
  46871. InterpolantFactoryMethodSmooth: void 0
  46872. }),
  46873. n.StringKeyframeTrack = function(e, t, i, r) {
  46874. n.KeyframeTrack.call(this, e, t, i, r)
  46875. }
  46876. ,
  46877. n.StringKeyframeTrack.prototype = Object.assign(Object.create(n.KeyframeTrack.prototype), {
  46878. constructor: n.StringKeyframeTrack,
  46879. ValueTypeName: "string",
  46880. ValueBufferType: Array,
  46881. DefaultInterpolation: n.IntepolateDiscrete,
  46882. InterpolantFactoryMethodLinear: void 0,
  46883. InterpolantFactoryMethodSmooth: void 0
  46884. }),
  46885. n.VectorKeyframeTrack = function(e, t, i, r) {
  46886. n.KeyframeTrack.call(this, e, t, i, r)
  46887. }
  46888. ,
  46889. n.VectorKeyframeTrack.prototype = Object.assign(Object.create(n.KeyframeTrack.prototype), {
  46890. constructor: n.VectorKeyframeTrack,
  46891. ValueTypeName: "vector"
  46892. }),
  46893. n.Audio = function(e) {
  46894. n.Object3D.call(this),
  46895. this.type = "Audio",
  46896. this.context = e.context,
  46897. this.source = this.context.createBufferSource(),
  46898. this.source.onended = this.onEnded.bind(this),
  46899. this.gain = this.context.createGain(),
  46900. this.gain.connect(e.getInput()),
  46901. this.autoplay = !1,
  46902. this.startTime = 0,
  46903. this.playbackRate = 1,
  46904. this.isPlaying = !1,
  46905. this.hasPlaybackControl = !0,
  46906. this.sourceType = "empty",
  46907. this.filter = null
  46908. }
  46909. ,
  46910. n.Audio.prototype = Object.create(n.Object3D.prototype),
  46911. n.Audio.prototype.constructor = n.Audio,
  46912. n.Audio.prototype.getOutput = function() {
  46913. return this.gain
  46914. }
  46915. ,
  46916. n.Audio.prototype.load = function(e) {
  46917. var t = new n.AudioBuffer(this.context);
  46918. return t.load(e),
  46919. this.setBuffer(t),
  46920. this
  46921. }
  46922. ,
  46923. n.Audio.prototype.setNodeSource = function(e) {
  46924. return this.hasPlaybackControl = !1,
  46925. this.sourceType = "audioNode",
  46926. this.source = e,
  46927. this.connect(),
  46928. this
  46929. }
  46930. ,
  46931. n.Audio.prototype.setBuffer = function(e) {
  46932. var t = this;
  46933. return e.onReady(function(e) {
  46934. t.source.buffer = e,
  46935. t.sourceType = "buffer",
  46936. t.autoplay && t.play()
  46937. }),
  46938. this
  46939. }
  46940. ,
  46941. n.Audio.prototype.play = function() {
  46942. if (this.isPlaying === !0)
  46943. return void console.warn("THREE.Audio: Audio is already playing.");
  46944. if (this.hasPlaybackControl === !1)
  46945. return void console.warn("THREE.Audio: this Audio has no playback control.");
  46946. var e = this.context.createBufferSource();
  46947. e.buffer = this.source.buffer,
  46948. e.loop = this.source.loop,
  46949. e.onended = this.source.onended,
  46950. e.start(0, this.startTime),
  46951. e.playbackRate.value = this.playbackRate,
  46952. this.isPlaying = !0,
  46953. this.source = e,
  46954. this.connect()
  46955. }
  46956. ,
  46957. n.Audio.prototype.pause = function() {
  46958. return this.hasPlaybackControl === !1 ? void console.warn("THREE.Audio: this Audio has no playback control.") : (this.source.stop(),
  46959. void (this.startTime = this.context.currentTime))
  46960. }
  46961. ,
  46962. n.Audio.prototype.stop = function() {
  46963. return this.hasPlaybackControl === !1 ? void console.warn("THREE.Audio: this Audio has no playback control.") : (this.source.stop(),
  46964. void (this.startTime = 0))
  46965. }
  46966. ,
  46967. n.Audio.prototype.connect = function() {
  46968. null !== this.filter ? (this.source.connect(this.filter),
  46969. this.filter.connect(this.getOutput())) : this.source.connect(this.getOutput())
  46970. }
  46971. ,
  46972. n.Audio.prototype.disconnect = function() {
  46973. null !== this.filter ? (this.source.disconnect(this.filter),
  46974. this.filter.disconnect(this.getOutput())) : this.source.disconnect(this.getOutput())
  46975. }
  46976. ,
  46977. n.Audio.prototype.getFilter = function() {
  46978. return this.filter
  46979. }
  46980. ,
  46981. n.Audio.prototype.setFilter = function(e) {
  46982. void 0 === e && (e = null),
  46983. this.isPlaying === !0 ? (this.disconnect(),
  46984. this.filter = e,
  46985. this.connect()) : this.filter = e
  46986. }
  46987. ,
  46988. n.Audio.prototype.setPlaybackRate = function(e) {
  46989. return this.hasPlaybackControl === !1 ? void console.warn("THREE.Audio: this Audio has no playback control.") : (this.playbackRate = e,
  46990. void (this.isPlaying === !0 && (this.source.playbackRate.value = this.playbackRate)))
  46991. }
  46992. ,
  46993. n.Audio.prototype.getPlaybackRate = function() {
  46994. return this.playbackRate
  46995. }
  46996. ,
  46997. n.Audio.prototype.onEnded = function() {
  46998. this.isPlaying = !1
  46999. }
  47000. ,
  47001. n.Audio.prototype.setLoop = function(e) {
  47002. return this.hasPlaybackControl === !1 ? void console.warn("THREE.Audio: this Audio has no playback control.") : void (this.source.loop = e)
  47003. }
  47004. ,
  47005. n.Audio.prototype.getLoop = function() {
  47006. return this.hasPlaybackControl === !1 ? (console.warn("THREE.Audio: this Audio has no playback control."),
  47007. !1) : this.source.loop
  47008. }
  47009. ,
  47010. n.Audio.prototype.setVolume = function(e) {
  47011. this.gain.gain.value = e
  47012. }
  47013. ,
  47014. n.Audio.prototype.getVolume = function() {
  47015. return this.gain.gain.value
  47016. }
  47017. ,
  47018. n.AudioAnalyser = function(e, t) {
  47019. this.analyser = e.context.createAnalyser(),
  47020. this.analyser.fftSize = void 0 !== t ? t : 2048,
  47021. this.data = new Uint8Array(this.analyser.frequencyBinCount),
  47022. e.getOutput().connect(this.analyser)
  47023. }
  47024. ,
  47025. n.AudioAnalyser.prototype = {
  47026. constructor: n.AudioAnalyser,
  47027. getData: function() {
  47028. return this.analyser.getByteFrequencyData(this.data),
  47029. this.data
  47030. }
  47031. },
  47032. n.AudioBuffer = function(e) {
  47033. this.context = e,
  47034. this.ready = !1,
  47035. this.readyCallbacks = []
  47036. }
  47037. ,
  47038. n.AudioBuffer.prototype.load = function(e) {
  47039. var t = this
  47040. , i = new XMLHttpRequest;
  47041. return i.open("GET", e, !0),
  47042. i.responseType = "arraybuffer",
  47043. i.onload = function(e) {
  47044. t.context.decodeAudioData(this.response, function(e) {
  47045. t.buffer = e,
  47046. t.ready = !0;
  47047. for (var i = 0; i < t.readyCallbacks.length; i++)
  47048. t.readyCallbacks[i](t.buffer);
  47049. t.readyCallbacks = []
  47050. })
  47051. }
  47052. ,
  47053. i.send(),
  47054. this
  47055. }
  47056. ,
  47057. n.AudioBuffer.prototype.onReady = function(e) {
  47058. this.ready ? e(this.buffer) : this.readyCallbacks.push(e)
  47059. }
  47060. ,
  47061. n.PositionalAudio = function(e) {
  47062. n.Audio.call(this, e),
  47063. this.panner = this.context.createPanner(),
  47064. this.panner.connect(this.gain)
  47065. }
  47066. ,
  47067. n.PositionalAudio.prototype = Object.create(n.Audio.prototype),
  47068. n.PositionalAudio.prototype.constructor = n.PositionalAudio,
  47069. n.PositionalAudio.prototype.getOutput = function() {
  47070. return this.panner
  47071. }
  47072. ,
  47073. n.PositionalAudio.prototype.setRefDistance = function(e) {
  47074. this.panner.refDistance = e
  47075. }
  47076. ,
  47077. n.PositionalAudio.prototype.getRefDistance = function() {
  47078. return this.panner.refDistance
  47079. }
  47080. ,
  47081. n.PositionalAudio.prototype.setRolloffFactor = function(e) {
  47082. this.panner.rolloffFactor = e
  47083. }
  47084. ,
  47085. n.PositionalAudio.prototype.getRolloffFactor = function() {
  47086. return this.panner.rolloffFactor
  47087. }
  47088. ,
  47089. n.PositionalAudio.prototype.setDistanceModel = function(e) {
  47090. this.panner.distanceModel = e
  47091. }
  47092. ,
  47093. n.PositionalAudio.prototype.getDistanceModel = function() {
  47094. return this.panner.distanceModel
  47095. }
  47096. ,
  47097. n.PositionalAudio.prototype.setMaxDistance = function(e) {
  47098. this.panner.maxDistance = e
  47099. }
  47100. ,
  47101. n.PositionalAudio.prototype.getMaxDistance = function() {
  47102. return this.panner.maxDistance
  47103. }
  47104. ,
  47105. n.PositionalAudio.prototype.updateMatrixWorld = function() {
  47106. var e = new n.Vector3;
  47107. return function(t) {
  47108. n.Object3D.prototype.updateMatrixWorld.call(this, t),
  47109. e.setFromMatrixPosition(this.matrixWorld),
  47110. this.panner.setPosition(e.x, e.y, e.z)
  47111. }
  47112. }(),
  47113. n.AudioListener = function() {
  47114. n.Object3D.call(this),
  47115. this.type = "AudioListener",
  47116. this.context = new (window.AudioContext || window.webkitAudioContext),
  47117. this.gain = this.context.createGain(),
  47118. this.gain.connect(this.context.destination),
  47119. this.filter = null
  47120. }
  47121. ,
  47122. n.AudioListener.prototype = Object.create(n.Object3D.prototype),
  47123. n.AudioListener.prototype.constructor = n.AudioListener,
  47124. n.AudioListener.prototype.getInput = function() {
  47125. return this.gain
  47126. }
  47127. ,
  47128. n.AudioListener.prototype.removeFilter = function() {
  47129. null !== this.filter && (this.gain.disconnect(this.filter),
  47130. this.filter.disconnect(this.context.destination),
  47131. this.gain.connect(this.context.destination),
  47132. this.filter = null)
  47133. }
  47134. ,
  47135. n.AudioListener.prototype.setFilter = function(e) {
  47136. null !== this.filter ? (this.gain.disconnect(this.filter),
  47137. this.filter.disconnect(this.context.destination)) : this.gain.disconnect(this.context.destination),
  47138. this.filter = e,
  47139. this.gain.connect(this.filter),
  47140. this.filter.connect(this.context.destination)
  47141. }
  47142. ,
  47143. n.AudioListener.prototype.getFilter = function() {
  47144. return this.filter
  47145. }
  47146. ,
  47147. n.AudioListener.prototype.setMasterVolume = function(e) {
  47148. this.gain.gain.value = e
  47149. }
  47150. ,
  47151. n.AudioListener.prototype.getMasterVolume = function() {
  47152. return this.gain.gain.value
  47153. }
  47154. ,
  47155. n.AudioListener.prototype.updateMatrixWorld = function() {
  47156. var e = new n.Vector3
  47157. , t = new n.Quaternion
  47158. , i = new n.Vector3
  47159. , r = new n.Vector3;
  47160. return function(o) {
  47161. n.Object3D.prototype.updateMatrixWorld.call(this, o);
  47162. var a = this.context.listener
  47163. , s = this.up;
  47164. this.matrixWorld.decompose(e, t, i),
  47165. r.set(0, 0, -1).applyQuaternion(t),
  47166. a.setPosition(e.x, e.y, e.z),
  47167. a.setOrientation(r.x, r.y, r.z, s.x, s.y, s.z)
  47168. }
  47169. }(),
  47170. n.Camera = function() {
  47171. n.Object3D.call(this),
  47172. this.type = "Camera",
  47173. this.matrixWorldInverse = new n.Matrix4,
  47174. this.projectionMatrix = new n.Matrix4
  47175. }
  47176. ,
  47177. n.Camera.prototype = Object.create(n.Object3D.prototype),
  47178. n.Camera.prototype.constructor = n.Camera,
  47179. n.Camera.prototype.getWorldDirection = function() {
  47180. var e = new n.Quaternion;
  47181. return function(t) {
  47182. var i = t || new n.Vector3;
  47183. return this.getWorldQuaternion(e),
  47184. i.set(0, 0, -1).applyQuaternion(e)
  47185. }
  47186. }(),
  47187. n.Camera.prototype.lookAt = function() {
  47188. var e = new n.Matrix4;
  47189. return function(t) {
  47190. e.lookAt(this.position, t, this.up),
  47191. this.quaternion.setFromRotationMatrix(e)
  47192. }
  47193. }(),
  47194. n.Camera.prototype.clone = function() {
  47195. return (new this.constructor).copy(this)
  47196. }
  47197. ,
  47198. n.Camera.prototype.copy = function(e) {
  47199. return n.Object3D.prototype.copy.call(this, e),
  47200. this.matrixWorldInverse.copy(e.matrixWorldInverse),
  47201. this.projectionMatrix.copy(e.projectionMatrix),
  47202. this
  47203. }
  47204. ,
  47205. n.CubeCamera = function(e, t, i) {
  47206. n.Object3D.call(this),
  47207. this.type = "CubeCamera";
  47208. var r = 90
  47209. , o = 1
  47210. , a = new n.PerspectiveCamera(r,o,e,t);
  47211. a.up.set(0, -1, 0),
  47212. a.lookAt(new n.Vector3(1,0,0)),
  47213. this.add(a);
  47214. var s = new n.PerspectiveCamera(r,o,e,t);
  47215. s.up.set(0, -1, 0),
  47216. s.lookAt(new n.Vector3(-1,0,0)),
  47217. this.add(s);
  47218. var l = new n.PerspectiveCamera(r,o,e,t);
  47219. l.up.set(0, 0, 1),
  47220. l.lookAt(new n.Vector3(0,1,0)),
  47221. this.add(l);
  47222. var c = new n.PerspectiveCamera(r,o,e,t);
  47223. c.up.set(0, 0, -1),
  47224. c.lookAt(new n.Vector3(0,-1,0)),
  47225. this.add(c);
  47226. var h = new n.PerspectiveCamera(r,o,e,t);
  47227. h.up.set(0, -1, 0),
  47228. h.lookAt(new n.Vector3(0,0,1)),
  47229. this.add(h);
  47230. var u = new n.PerspectiveCamera(r,o,e,t);
  47231. u.up.set(0, -1, 0),
  47232. u.lookAt(new n.Vector3(0,0,-1)),
  47233. this.add(u);
  47234. var d = {
  47235. format: n.RGBFormat,
  47236. magFilter: n.LinearFilter,
  47237. minFilter: n.LinearFilter
  47238. };
  47239. this.renderTarget = new n.WebGLRenderTargetCube(i,i,d),
  47240. this.updateCubeMap = function(e, t) {
  47241. null === this.parent && this.updateMatrixWorld();
  47242. var i = this.renderTarget
  47243. , n = i.texture.generateMipmaps;
  47244. i.texture.generateMipmaps = !1,
  47245. i.activeCubeFace = 0,
  47246. e.render(t, a, i),
  47247. i.activeCubeFace = 1,
  47248. e.render(t, s, i),
  47249. i.activeCubeFace = 2,
  47250. e.render(t, l, i),
  47251. i.activeCubeFace = 3,
  47252. e.render(t, c, i),
  47253. i.activeCubeFace = 4,
  47254. e.render(t, h, i),
  47255. i.texture.generateMipmaps = n,
  47256. i.activeCubeFace = 5,
  47257. e.render(t, u, i),
  47258. e.setRenderTarget(null)
  47259. }
  47260. }
  47261. ,
  47262. n.CubeCamera.prototype = Object.create(n.Object3D.prototype),
  47263. n.CubeCamera.prototype.constructor = n.CubeCamera,
  47264. n.OrthographicCamera = function(e, t, i, r, o, a) {
  47265. n.Camera.call(this),
  47266. this.type = "OrthographicCamera",
  47267. this.zoom = 1,
  47268. this.left = e,
  47269. this.right = t,
  47270. this.top = i,
  47271. this.bottom = r,
  47272. this.near = void 0 !== o ? o : .1,
  47273. this.far = void 0 !== a ? a : 2e3,
  47274. this.updateProjectionMatrix()
  47275. }
  47276. ,
  47277. n.OrthographicCamera.prototype = Object.create(n.Camera.prototype),
  47278. n.OrthographicCamera.prototype.constructor = n.OrthographicCamera,
  47279. n.OrthographicCamera.prototype.updateProjectionMatrix = function() {
  47280. var e = (this.right - this.left) / (2 * this.zoom)
  47281. , t = (this.top - this.bottom) / (2 * this.zoom)
  47282. , i = (this.right + this.left) / 2
  47283. , n = (this.top + this.bottom) / 2;
  47284. this.projectionMatrix.makeOrthographic(i - e, i + e, n + t, n - t, this.near, this.far)
  47285. }
  47286. ,
  47287. n.OrthographicCamera.prototype.copy = function(e) {
  47288. return n.Camera.prototype.copy.call(this, e),
  47289. this.left = e.left,
  47290. this.right = e.right,
  47291. this.top = e.top,
  47292. this.bottom = e.bottom,
  47293. this.near = e.near,
  47294. this.far = e.far,
  47295. this.zoom = e.zoom,
  47296. this
  47297. }
  47298. ,
  47299. n.OrthographicCamera.prototype.toJSON = function(e) {
  47300. var t = n.Object3D.prototype.toJSON.call(this, e);
  47301. return t.object.zoom = this.zoom,
  47302. t.object.left = this.left,
  47303. t.object.right = this.right,
  47304. t.object.top = this.top,
  47305. t.object.bottom = this.bottom,
  47306. t.object.near = this.near,
  47307. t.object.far = this.far,
  47308. t
  47309. }
  47310. ,
  47311. n.PerspectiveCamera = function(e, t, i, r) {
  47312. n.Camera.call(this),
  47313. this.type = "PerspectiveCamera",
  47314. this.focalLength = 10,
  47315. this.zoom = 1,
  47316. this.fov = void 0 !== e ? e : 50,
  47317. this.aspect = void 0 !== t ? t : 1,
  47318. this.near = void 0 !== i ? i : .1,
  47319. this.far = void 0 !== r ? r : 2e3,
  47320. this.updateProjectionMatrix()
  47321. }
  47322. ,
  47323. n.PerspectiveCamera.prototype = Object.create(n.Camera.prototype),
  47324. n.PerspectiveCamera.prototype.constructor = n.PerspectiveCamera,
  47325. n.PerspectiveCamera.prototype.setLens = function(e, t) {
  47326. void 0 === t && (t = 24),
  47327. this.fov = 2 * n.Math.radToDeg(Math.atan(t / (2 * e))),
  47328. this.updateProjectionMatrix()
  47329. }
  47330. ,
  47331. n.PerspectiveCamera.prototype.setViewOffset = function(e, t, i, n, r, o) {
  47332. this.fullWidth = e,
  47333. this.fullHeight = t,
  47334. this.x = i,
  47335. this.y = n,
  47336. this.width = r,
  47337. this.height = o,
  47338. this.updateProjectionMatrix()
  47339. }
  47340. ,
  47341. n.PerspectiveCamera.prototype.updateProjectionMatrix = function() {
  47342. var e = n.Math.radToDeg(2 * Math.atan(Math.tan(.5 * n.Math.degToRad(this.fov)) / this.zoom));
  47343. if (this.fullWidth) {
  47344. var t = this.fullWidth / this.fullHeight
  47345. , i = Math.tan(n.Math.degToRad(.5 * e)) * this.near
  47346. , r = -i
  47347. , o = t * r
  47348. , a = t * i
  47349. , s = Math.abs(a - o)
  47350. , l = Math.abs(i - r);
  47351. 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)
  47352. } else
  47353. this.projectionMatrix.makePerspective(e, this.aspect, this.near, this.far)
  47354. }
  47355. ,
  47356. n.PerspectiveCamera.prototype.copy = function(e) {
  47357. return n.Camera.prototype.copy.call(this, e),
  47358. this.focalLength = e.focalLength,
  47359. this.zoom = e.zoom,
  47360. this.fov = e.fov,
  47361. this.aspect = e.aspect,
  47362. this.near = e.near,
  47363. this.far = e.far,
  47364. this
  47365. }
  47366. ,
  47367. n.PerspectiveCamera.prototype.toJSON = function(e) {
  47368. var t = n.Object3D.prototype.toJSON.call(this, e);
  47369. return t.object.focalLength = this.focalLength,
  47370. t.object.zoom = this.zoom,
  47371. t.object.fov = this.fov,
  47372. t.object.aspect = this.aspect,
  47373. t.object.near = this.near,
  47374. t.object.far = this.far,
  47375. t
  47376. }
  47377. ,
  47378. n.StereoCamera = function() {
  47379. this.type = "StereoCamera",
  47380. this.aspect = 1,
  47381. this.cameraL = new n.PerspectiveCamera,
  47382. this.cameraL.layers.enable(1),
  47383. this.cameraL.matrixAutoUpdate = !1,
  47384. this.cameraR = new n.PerspectiveCamera,
  47385. this.cameraR.layers.enable(2),
  47386. this.cameraR.matrixAutoUpdate = !1
  47387. }
  47388. ,
  47389. n.StereoCamera.prototype = {
  47390. constructor: n.StereoCamera,
  47391. update: function() {
  47392. var e, t, i, r, o, a = new n.Matrix4, s = new n.Matrix4;
  47393. return function(l) {
  47394. var c = e !== l.focalLength || t !== l.fov || i !== l.aspect * this.aspect || r !== l.near || o !== l.far;
  47395. if (c) {
  47396. e = l.focalLength,
  47397. t = l.fov,
  47398. i = l.aspect * this.aspect,
  47399. r = l.near,
  47400. o = l.far;
  47401. var h, u, d = l.projectionMatrix.clone(), p = .032, f = p * r / e, g = r * Math.tan(n.Math.degToRad(.5 * t));
  47402. s.elements[12] = -p,
  47403. a.elements[12] = p,
  47404. h = -g * i + f,
  47405. u = g * i + f,
  47406. d.elements[0] = 2 * r / (u - h),
  47407. d.elements[8] = (u + h) / (u - h),
  47408. this.cameraL.projectionMatrix.copy(d),
  47409. h = -g * i - f,
  47410. u = g * i - f,
  47411. d.elements[0] = 2 * r / (u - h),
  47412. d.elements[8] = (u + h) / (u - h),
  47413. this.cameraR.projectionMatrix.copy(d)
  47414. }
  47415. this.cameraL.matrixWorld.copy(l.matrixWorld).multiply(s),
  47416. this.cameraR.matrixWorld.copy(l.matrixWorld).multiply(a)
  47417. }
  47418. }()
  47419. },
  47420. n.Light = function(e, t) {
  47421. n.Object3D.call(this),
  47422. this.type = "Light",
  47423. this.color = new n.Color(e),
  47424. this.intensity = void 0 !== t ? t : 1,
  47425. this.receiveShadow = void 0
  47426. }
  47427. ,
  47428. n.Light.prototype = Object.create(n.Object3D.prototype),
  47429. n.Light.prototype.constructor = n.Light,
  47430. n.Light.prototype.copy = function(e) {
  47431. return n.Object3D.prototype.copy.call(this, e),
  47432. this.color.copy(e.color),
  47433. this.intensity = e.intensity,
  47434. this
  47435. }
  47436. ,
  47437. n.Light.prototype.toJSON = function(e) {
  47438. var t = n.Object3D.prototype.toJSON.call(this, e);
  47439. return t.object.color = this.color.getHex(),
  47440. t.object.intensity = this.intensity,
  47441. void 0 !== this.groundColor && (t.object.groundColor = this.groundColor.getHex()),
  47442. void 0 !== this.distance && (t.object.distance = this.distance),
  47443. void 0 !== this.angle && (t.object.angle = this.angle),
  47444. void 0 !== this.decay && (t.object.decay = this.decay),
  47445. void 0 !== this.penumbra && (t.object.penumbra = this.penumbra),
  47446. t
  47447. }
  47448. ,
  47449. n.LightShadow = function(e) {
  47450. this.camera = e,
  47451. this.bias = 0,
  47452. this.radius = 1,
  47453. this.mapSize = new n.Vector2(512,512),
  47454. this.map = null,
  47455. this.matrix = new n.Matrix4
  47456. }
  47457. ,
  47458. n.LightShadow.prototype = {
  47459. constructor: n.LightShadow,
  47460. copy: function(e) {
  47461. return this.camera = e.camera.clone(),
  47462. this.bias = e.bias,
  47463. this.radius = e.radius,
  47464. this.mapSize.copy(e.mapSize),
  47465. this
  47466. },
  47467. clone: function() {
  47468. return (new this.constructor).copy(this)
  47469. }
  47470. },
  47471. n.AmbientLight = function(e, t) {
  47472. n.Light.call(this, e, t),
  47473. this.type = "AmbientLight",
  47474. this.castShadow = void 0
  47475. }
  47476. ,
  47477. n.AmbientLight.prototype = Object.create(n.Light.prototype),
  47478. n.AmbientLight.prototype.constructor = n.AmbientLight,
  47479. n.DirectionalLight = function(e, t) {
  47480. n.Light.call(this, e, t),
  47481. this.type = "DirectionalLight",
  47482. this.position.set(0, 1, 0),
  47483. this.updateMatrix(),
  47484. this.target = new n.Object3D,
  47485. this.shadow = new n.LightShadow(new n.OrthographicCamera(-5,5,5,-5,.5,500))
  47486. }
  47487. ,
  47488. n.DirectionalLight.prototype = Object.create(n.Light.prototype),
  47489. n.DirectionalLight.prototype.constructor = n.DirectionalLight,
  47490. n.DirectionalLight.prototype.copy = function(e) {
  47491. return n.Light.prototype.copy.call(this, e),
  47492. this.target = e.target.clone(),
  47493. this.shadow = e.shadow.clone(),
  47494. this
  47495. }
  47496. ,
  47497. n.HemisphereLight = function(e, t, i) {
  47498. n.Light.call(this, e, i),
  47499. this.type = "HemisphereLight",
  47500. this.castShadow = void 0,
  47501. this.position.set(0, 1, 0),
  47502. this.updateMatrix(),
  47503. this.groundColor = new n.Color(t)
  47504. }
  47505. ,
  47506. n.HemisphereLight.prototype = Object.create(n.Light.prototype),
  47507. n.HemisphereLight.prototype.constructor = n.HemisphereLight,
  47508. n.HemisphereLight.prototype.copy = function(e) {
  47509. return n.Light.prototype.copy.call(this, e),
  47510. this.groundColor.copy(e.groundColor),
  47511. this
  47512. }
  47513. ,
  47514. n.PointLight = function(e, t, i, r) {
  47515. n.Light.call(this, e, t),
  47516. this.type = "PointLight",
  47517. this.distance = void 0 !== i ? i : 0,
  47518. this.decay = void 0 !== r ? r : 1,
  47519. this.shadow = new n.LightShadow(new n.PerspectiveCamera(90,1,.5,500))
  47520. }
  47521. ,
  47522. n.PointLight.prototype = Object.create(n.Light.prototype),
  47523. n.PointLight.prototype.constructor = n.PointLight,
  47524. Object.defineProperty(n.PointLight.prototype, "power", {
  47525. get: function() {
  47526. return 4 * this.intensity * Math.PI
  47527. },
  47528. set: function(e) {
  47529. this.intensity = e / (4 * Math.PI)
  47530. }
  47531. }),
  47532. n.PointLight.prototype.copy = function(e) {
  47533. return n.Light.prototype.copy.call(this, e),
  47534. this.distance = e.distance,
  47535. this.decay = e.decay,
  47536. this.shadow = e.shadow.clone(),
  47537. this
  47538. }
  47539. ,
  47540. n.SpotLight = function(e, t, i, r, o, a) {
  47541. n.Light.call(this, e, t),
  47542. this.type = "SpotLight",
  47543. this.position.set(0, 1, 0),
  47544. this.updateMatrix(),
  47545. this.target = new n.Object3D,
  47546. this.distance = void 0 !== i ? i : 0,
  47547. this.angle = void 0 !== r ? r : Math.PI / 3,
  47548. this.penumbra = void 0 !== o ? o : 0,
  47549. this.decay = void 0 !== a ? a : 1,
  47550. this.shadow = new n.LightShadow(new n.PerspectiveCamera(50,1,.5,500))
  47551. }
  47552. ,
  47553. n.SpotLight.prototype = Object.create(n.Light.prototype),
  47554. n.SpotLight.prototype.constructor = n.SpotLight,
  47555. Object.defineProperty(n.SpotLight.prototype, "power", {
  47556. get: function() {
  47557. return this.intensity * Math.PI
  47558. },
  47559. set: function(e) {
  47560. this.intensity = e / Math.PI
  47561. }
  47562. }),
  47563. n.SpotLight.prototype.copy = function(e) {
  47564. return n.Light.prototype.copy.call(this, e),
  47565. this.distance = e.distance,
  47566. this.angle = e.angle,
  47567. this.penumbra = e.penumbra,
  47568. this.decay = e.decay,
  47569. this.target = e.target.clone(),
  47570. this.shadow = e.shadow.clone(),
  47571. this
  47572. }
  47573. ,
  47574. n.Cache = {
  47575. enabled: !1,
  47576. files: {},
  47577. add: function(e, t) {
  47578. this.enabled !== !1 && (this.files[e] = t)
  47579. },
  47580. get: function(e) {
  47581. if (this.enabled !== !1)
  47582. return this.files[e]
  47583. },
  47584. remove: function(e) {
  47585. delete this.files[e]
  47586. },
  47587. clear: function() {
  47588. this.files = {}
  47589. }
  47590. },
  47591. n.Loader = function() {
  47592. this.onLoadStart = function() {}
  47593. ,
  47594. this.onLoadProgress = function() {}
  47595. ,
  47596. this.onLoadComplete = function() {}
  47597. }
  47598. ,
  47599. n.Loader.prototype = {
  47600. constructor: n.Loader,
  47601. crossOrigin: void 0,
  47602. extractUrlBase: function(e) {
  47603. var t = e.split("/");
  47604. return 1 === t.length ? "./" : (t.pop(),
  47605. t.join("/") + "/")
  47606. },
  47607. initMaterials: function(e, t, i) {
  47608. for (var n = [], r = 0; r < e.length; ++r)
  47609. n[r] = this.createMaterial(e[r], t, i);
  47610. return n
  47611. },
  47612. createMaterial: function() {
  47613. var e, t, i;
  47614. return function(r, o, a) {
  47615. function s(e, i, r, s, c) {
  47616. var h, u = o + e, d = n.Loader.Handlers.get(u);
  47617. null !== d ? h = d.load(u) : (t.setCrossOrigin(a),
  47618. h = t.load(u)),
  47619. void 0 !== i && (h.repeat.fromArray(i),
  47620. 1 !== i[0] && (h.wrapS = n.RepeatWrapping),
  47621. 1 !== i[1] && (h.wrapT = n.RepeatWrapping)),
  47622. void 0 !== r && h.offset.fromArray(r),
  47623. void 0 !== s && ("repeat" === s[0] && (h.wrapS = n.RepeatWrapping),
  47624. "mirror" === s[0] && (h.wrapS = n.MirroredRepeatWrapping),
  47625. "repeat" === s[1] && (h.wrapT = n.RepeatWrapping),
  47626. "mirror" === s[1] && (h.wrapT = n.MirroredRepeatWrapping)),
  47627. void 0 !== c && (h.anisotropy = c);
  47628. var p = n.Math.generateUUID();
  47629. return l[p] = h,
  47630. p
  47631. }
  47632. void 0 === e && (e = new n.Color),
  47633. void 0 === t && (t = new n.TextureLoader),
  47634. void 0 === i && (i = new n.MaterialLoader);
  47635. var l = {}
  47636. , c = {
  47637. uuid: n.Math.generateUUID(),
  47638. type: "MeshLambertMaterial"
  47639. };
  47640. for (var h in r) {
  47641. var u = r[h];
  47642. switch (h) {
  47643. case "DbgColor":
  47644. case "DbgIndex":
  47645. case "opticalDensity":
  47646. case "illumination":
  47647. break;
  47648. case "DbgName":
  47649. c.name = u;
  47650. break;
  47651. case "blending":
  47652. c.blending = n[u];
  47653. break;
  47654. case "colorAmbient":
  47655. case "mapAmbient":
  47656. console.warn("THREE.Loader.createMaterial:", h, "is no longer supported.");
  47657. break;
  47658. case "colorDiffuse":
  47659. c.color = e.fromArray(u).getHex();
  47660. break;
  47661. case "colorSpecular":
  47662. c.specular = e.fromArray(u).getHex();
  47663. break;
  47664. case "colorEmissive":
  47665. c.emissive = e.fromArray(u).getHex();
  47666. break;
  47667. case "specularCoef":
  47668. c.shininess = u;
  47669. break;
  47670. case "shading":
  47671. "basic" === u.toLowerCase() && (c.type = "MeshBasicMaterial"),
  47672. "phong" === u.toLowerCase() && (c.type = "MeshPhongMaterial");
  47673. break;
  47674. case "mapDiffuse":
  47675. c.map = s(u, r.mapDiffuseRepeat, r.mapDiffuseOffset, r.mapDiffuseWrap, r.mapDiffuseAnisotropy);
  47676. break;
  47677. case "mapDiffuseRepeat":
  47678. case "mapDiffuseOffset":
  47679. case "mapDiffuseWrap":
  47680. case "mapDiffuseAnisotropy":
  47681. break;
  47682. case "mapLight":
  47683. c.lightMap = s(u, r.mapLightRepeat, r.mapLightOffset, r.mapLightWrap, r.mapLightAnisotropy);
  47684. break;
  47685. case "mapLightRepeat":
  47686. case "mapLightOffset":
  47687. case "mapLightWrap":
  47688. case "mapLightAnisotropy":
  47689. break;
  47690. case "mapAO":
  47691. c.aoMap = s(u, r.mapAORepeat, r.mapAOOffset, r.mapAOWrap, r.mapAOAnisotropy);
  47692. break;
  47693. case "mapAORepeat":
  47694. case "mapAOOffset":
  47695. case "mapAOWrap":
  47696. case "mapAOAnisotropy":
  47697. break;
  47698. case "mapBump":
  47699. c.bumpMap = s(u, r.mapBumpRepeat, r.mapBumpOffset, r.mapBumpWrap, r.mapBumpAnisotropy);
  47700. break;
  47701. case "mapBumpScale":
  47702. c.bumpScale = u;
  47703. break;
  47704. case "mapBumpRepeat":
  47705. case "mapBumpOffset":
  47706. case "mapBumpWrap":
  47707. case "mapBumpAnisotropy":
  47708. break;
  47709. case "mapNormal":
  47710. c.normalMap = s(u, r.mapNormalRepeat, r.mapNormalOffset, r.mapNormalWrap, r.mapNormalAnisotropy);
  47711. break;
  47712. case "mapNormalFactor":
  47713. c.normalScale = [u, u];
  47714. break;
  47715. case "mapNormalRepeat":
  47716. case "mapNormalOffset":
  47717. case "mapNormalWrap":
  47718. case "mapNormalAnisotropy":
  47719. break;
  47720. case "mapSpecular":
  47721. c.specularMap = s(u, r.mapSpecularRepeat, r.mapSpecularOffset, r.mapSpecularWrap, r.mapSpecularAnisotropy);
  47722. break;
  47723. case "mapSpecularRepeat":
  47724. case "mapSpecularOffset":
  47725. case "mapSpecularWrap":
  47726. case "mapSpecularAnisotropy":
  47727. break;
  47728. case "mapAlpha":
  47729. c.alphaMap = s(u, r.mapAlphaRepeat, r.mapAlphaOffset, r.mapAlphaWrap, r.mapAlphaAnisotropy);
  47730. break;
  47731. case "mapAlphaRepeat":
  47732. case "mapAlphaOffset":
  47733. case "mapAlphaWrap":
  47734. case "mapAlphaAnisotropy":
  47735. break;
  47736. case "flipSided":
  47737. c.side = n.BackSide;
  47738. break;
  47739. case "doubleSided":
  47740. c.side = n.DoubleSide;
  47741. break;
  47742. case "transparency":
  47743. console.warn("THREE.Loader.createMaterial: transparency has been renamed to opacity"),
  47744. c.opacity = u;
  47745. break;
  47746. case "depthTest":
  47747. case "depthWrite":
  47748. case "colorWrite":
  47749. case "opacity":
  47750. case "reflectivity":
  47751. case "transparent":
  47752. case "visible":
  47753. case "wireframe":
  47754. c[h] = u;
  47755. break;
  47756. case "vertexColors":
  47757. u === !0 && (c.vertexColors = n.VertexColors),
  47758. "face" === u && (c.vertexColors = n.FaceColors);
  47759. break;
  47760. default:
  47761. console.error("THREE.Loader.createMaterial: Unsupported", h, u)
  47762. }
  47763. }
  47764. return "MeshBasicMaterial" === c.type && delete c.emissive,
  47765. "MeshPhongMaterial" !== c.type && delete c.specular,
  47766. c.opacity < 1 && (c.transparent = !0),
  47767. i.setTextures(l),
  47768. i.parse(c)
  47769. }
  47770. }()
  47771. },
  47772. n.Loader.Handlers = {
  47773. handlers: [],
  47774. add: function(e, t) {
  47775. this.handlers.push(e, t)
  47776. },
  47777. get: function(e) {
  47778. for (var t = this.handlers, i = 0, n = t.length; i < n; i += 2) {
  47779. var r = t[i]
  47780. , o = t[i + 1];
  47781. if (r.test(e))
  47782. return o
  47783. }
  47784. return null
  47785. }
  47786. },
  47787. n.XHRLoader = function(e) {
  47788. this.manager = void 0 !== e ? e : n.DefaultLoadingManager
  47789. }
  47790. ,
  47791. n.XHRLoader.prototype = {
  47792. constructor: n.XHRLoader,
  47793. load: function(e, t, i, r) {
  47794. void 0 !== this.path && (e = this.path + e);
  47795. var o = this
  47796. , a = n.Cache.get(e);
  47797. if (void 0 !== a)
  47798. return t && setTimeout(function() {
  47799. t(a)
  47800. }, 0),
  47801. a;
  47802. var s = new XMLHttpRequest;
  47803. return s.overrideMimeType("text/plain"),
  47804. s.open("GET", e, !0),
  47805. s.addEventListener("load", function(i) {
  47806. var a = i.target.response;
  47807. n.Cache.add(e, a),
  47808. 200 === this.status ? (t && t(a),
  47809. o.manager.itemEnd(e)) : 0 === this.status ? (console.warn("THREE.XHRLoader: HTTP Status 0 received."),
  47810. t && t(a),
  47811. o.manager.itemEnd(e)) : (r && r(i),
  47812. o.manager.itemError(e))
  47813. }, !1),
  47814. void 0 !== i && s.addEventListener("progress", function(e) {
  47815. i(e)
  47816. }, !1),
  47817. s.addEventListener("error", function(t) {
  47818. r && r(t),
  47819. o.manager.itemError(e)
  47820. }, !1),
  47821. void 0 !== this.responseType && (s.responseType = this.responseType),
  47822. void 0 !== this.withCredentials && (s.withCredentials = this.withCredentials),
  47823. s.send(null),
  47824. o.manager.itemStart(e),
  47825. s
  47826. },
  47827. setPath: function(e) {
  47828. this.path = e
  47829. },
  47830. setResponseType: function(e) {
  47831. this.responseType = e
  47832. },
  47833. setWithCredentials: function(e) {
  47834. this.withCredentials = e
  47835. }
  47836. },
  47837. n.FontLoader = function(e) {
  47838. this.manager = void 0 !== e ? e : n.DefaultLoadingManager
  47839. }
  47840. ,
  47841. n.FontLoader.prototype = {
  47842. constructor: n.FontLoader,
  47843. load: function(e, t, i, r) {
  47844. var o = new n.XHRLoader(this.manager);
  47845. o.load(e, function(e) {
  47846. t(new n.Font(JSON.parse(e.substring(65, e.length - 2))))
  47847. }, i, r)
  47848. }
  47849. },
  47850. n.ImageLoader = function(e) {
  47851. this.manager = void 0 !== e ? e : n.DefaultLoadingManager
  47852. }
  47853. ,
  47854. n.ImageLoader.prototype = {
  47855. constructor: n.ImageLoader,
  47856. load: function(e, t, i, r) {
  47857. void 0 !== this.path && (e = this.path + e);
  47858. var o = this
  47859. , a = n.Cache.get(e);
  47860. if (void 0 !== a)
  47861. return o.manager.itemStart(e),
  47862. t ? setTimeout(function() {
  47863. t(a),
  47864. o.manager.itemEnd(e)
  47865. }, 0) : o.manager.itemEnd(e),
  47866. a;
  47867. var s = document.createElement("img");
  47868. return s.addEventListener("load", function(i) {
  47869. n.Cache.add(e, this),
  47870. t && t(this),
  47871. o.manager.itemEnd(e)
  47872. }, !1),
  47873. void 0 !== i && s.addEventListener("progress", function(e) {
  47874. i(e)
  47875. }, !1),
  47876. s.addEventListener("error", function(t) {
  47877. r && r(t),
  47878. o.manager.itemError(e)
  47879. }, !1),
  47880. void 0 !== this.crossOrigin && (s.crossOrigin = this.crossOrigin),
  47881. o.manager.itemStart(e),
  47882. s.src = e,
  47883. s
  47884. },
  47885. setCrossOrigin: function(e) {
  47886. this.crossOrigin = e
  47887. },
  47888. setPath: function(e) {
  47889. this.path = e
  47890. }
  47891. },
  47892. n.JSONLoader = function(e) {
  47893. "boolean" == typeof e && (console.warn("THREE.JSONLoader: showStatus parameter has been removed from constructor."),
  47894. e = void 0),
  47895. this.manager = void 0 !== e ? e : n.DefaultLoadingManager,
  47896. this.withCredentials = !1
  47897. }
  47898. ,
  47899. n.JSONLoader.prototype = {
  47900. constructor: n.JSONLoader,
  47901. get statusDomElement() {
  47902. return void 0 === this._statusDomElement && (this._statusDomElement = document.createElement("div")),
  47903. console.warn("THREE.JSONLoader: .statusDomElement has been removed."),
  47904. this._statusDomElement
  47905. },
  47906. load: function(e, t, i, r) {
  47907. var o = this
  47908. , a = this.texturePath && "string" == typeof this.texturePath ? this.texturePath : n.Loader.prototype.extractUrlBase(e)
  47909. , s = new n.XHRLoader(this.manager);
  47910. s.setWithCredentials(this.withCredentials),
  47911. s.load(e, function(i) {
  47912. var n = JSON.parse(i)
  47913. , r = n.metadata;
  47914. if (void 0 !== r) {
  47915. var s = r.type;
  47916. if (void 0 !== s) {
  47917. if ("object" === s.toLowerCase())
  47918. return void console.error("THREE.JSONLoader: " + e + " should be loaded with THREE.ObjectLoader instead.");
  47919. if ("scene" === s.toLowerCase())
  47920. return void console.error("THREE.JSONLoader: " + e + " should be loaded with THREE.SceneLoader instead.")
  47921. }
  47922. }
  47923. var l = o.parse(n, a);
  47924. t(l.geometry, l.materials)
  47925. }, i, r)
  47926. },
  47927. setTexturePath: function(e) {
  47928. this.texturePath = e
  47929. },
  47930. parse: function(e, t) {
  47931. function i(t) {
  47932. function i(e, t) {
  47933. return e & 1 << t
  47934. }
  47935. 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;
  47936. if (void 0 !== e.uvs) {
  47937. for (r = 0; r < e.uvs.length; r++)
  47938. e.uvs[r].length && B++;
  47939. for (r = 0; r < B; r++)
  47940. s.faceVertexUvs[r] = []
  47941. }
  47942. for (l = 0,
  47943. c = L.length; l < c; )
  47944. E = new n.Vector3,
  47945. E.x = L[l++] * t,
  47946. E.y = L[l++] * t,
  47947. E.z = L[l++] * t,
  47948. s.vertices.push(E);
  47949. for (l = 0,
  47950. c = O.length; l < c; )
  47951. if (f = O[l++],
  47952. g = i(f, 0),
  47953. m = i(f, 1),
  47954. v = i(f, 3),
  47955. A = i(f, 4),
  47956. y = i(f, 5),
  47957. C = i(f, 6),
  47958. I = i(f, 7),
  47959. g) {
  47960. if (w = new n.Face3,
  47961. w.a = O[l],
  47962. w.b = O[l + 1],
  47963. w.c = O[l + 3],
  47964. _ = new n.Face3,
  47965. _.a = O[l + 1],
  47966. _.b = O[l + 2],
  47967. _.c = O[l + 3],
  47968. l += 4,
  47969. m && (p = O[l++],
  47970. w.materialIndex = p,
  47971. _.materialIndex = p),
  47972. a = s.faces.length,
  47973. v)
  47974. for (r = 0; r < B; r++)
  47975. for (S = e.uvs[r],
  47976. s.faceVertexUvs[r][a] = [],
  47977. s.faceVertexUvs[r][a + 1] = [],
  47978. o = 0; o < 4; o++)
  47979. d = O[l++],
  47980. R = S[2 * d],
  47981. P = S[2 * d + 1],
  47982. M = new n.Vector2(R,P),
  47983. 2 !== o && s.faceVertexUvs[r][a].push(M),
  47984. 0 !== o && s.faceVertexUvs[r][a + 1].push(M);
  47985. if (A && (u = 3 * O[l++],
  47986. w.normal.set(D[u++], D[u++], D[u]),
  47987. _.normal.copy(w.normal)),
  47988. y)
  47989. for (r = 0; r < 4; r++)
  47990. u = 3 * O[l++],
  47991. x = new n.Vector3(D[u++],D[u++],D[u]),
  47992. 2 !== r && w.vertexNormals.push(x),
  47993. 0 !== r && _.vertexNormals.push(x);
  47994. if (C && (h = O[l++],
  47995. T = N[h],
  47996. w.color.setHex(T),
  47997. _.color.setHex(T)),
  47998. I)
  47999. for (r = 0; r < 4; r++)
  48000. h = O[l++],
  48001. T = N[h],
  48002. 2 !== r && w.vertexColors.push(new n.Color(T)),
  48003. 0 !== r && _.vertexColors.push(new n.Color(T));
  48004. s.faces.push(w),
  48005. s.faces.push(_)
  48006. } else {
  48007. if (b = new n.Face3,
  48008. b.a = O[l++],
  48009. b.b = O[l++],
  48010. b.c = O[l++],
  48011. m && (p = O[l++],
  48012. b.materialIndex = p),
  48013. a = s.faces.length,
  48014. v)
  48015. for (r = 0; r < B; r++)
  48016. for (S = e.uvs[r],
  48017. s.faceVertexUvs[r][a] = [],
  48018. o = 0; o < 3; o++)
  48019. d = O[l++],
  48020. R = S[2 * d],
  48021. P = S[2 * d + 1],
  48022. M = new n.Vector2(R,P),
  48023. s.faceVertexUvs[r][a].push(M);
  48024. if (A && (u = 3 * O[l++],
  48025. b.normal.set(D[u++], D[u++], D[u])),
  48026. y)
  48027. for (r = 0; r < 3; r++)
  48028. u = 3 * O[l++],
  48029. x = new n.Vector3(D[u++],D[u++],D[u]),
  48030. b.vertexNormals.push(x);
  48031. if (C && (h = O[l++],
  48032. b.color.setHex(N[h])),
  48033. I)
  48034. for (r = 0; r < 3; r++)
  48035. h = O[l++],
  48036. b.vertexColors.push(new n.Color(N[h]));
  48037. s.faces.push(b)
  48038. }
  48039. }
  48040. function r() {
  48041. var t = void 0 !== e.influencesPerVertex ? e.influencesPerVertex : 2;
  48042. if (e.skinWeights)
  48043. for (var i = 0, r = e.skinWeights.length; i < r; i += t) {
  48044. var o = e.skinWeights[i]
  48045. , a = t > 1 ? e.skinWeights[i + 1] : 0
  48046. , l = t > 2 ? e.skinWeights[i + 2] : 0
  48047. , c = t > 3 ? e.skinWeights[i + 3] : 0;
  48048. s.skinWeights.push(new n.Vector4(o,a,l,c))
  48049. }
  48050. if (e.skinIndices)
  48051. for (var i = 0, r = e.skinIndices.length; i < r; i += t) {
  48052. var h = e.skinIndices[i]
  48053. , u = t > 1 ? e.skinIndices[i + 1] : 0
  48054. , d = t > 2 ? e.skinIndices[i + 2] : 0
  48055. , p = t > 3 ? e.skinIndices[i + 3] : 0;
  48056. s.skinIndices.push(new n.Vector4(h,u,d,p))
  48057. }
  48058. s.bones = e.bones,
  48059. 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.")
  48060. }
  48061. function o(t) {
  48062. if (void 0 !== e.morphTargets)
  48063. for (var i = 0, r = e.morphTargets.length; i < r; i++) {
  48064. s.morphTargets[i] = {},
  48065. s.morphTargets[i].name = e.morphTargets[i].name,
  48066. s.morphTargets[i].vertices = [];
  48067. for (var o = s.morphTargets[i].vertices, a = e.morphTargets[i].vertices, l = 0, c = a.length; l < c; l += 3) {
  48068. var h = new n.Vector3;
  48069. h.x = a[l] * t,
  48070. h.y = a[l + 1] * t,
  48071. h.z = a[l + 2] * t,
  48072. o.push(h)
  48073. }
  48074. }
  48075. if (void 0 !== e.morphColors && e.morphColors.length > 0) {
  48076. console.warn('THREE.JSONLoader: "morphColors" no longer supported. Using them as face colors.');
  48077. for (var u = s.faces, d = e.morphColors[0].colors, i = 0, r = u.length; i < r; i++)
  48078. u[i].color.fromArray(d, 3 * i)
  48079. }
  48080. }
  48081. function a() {
  48082. var t = []
  48083. , i = [];
  48084. void 0 !== e.animation && i.push(e.animation),
  48085. void 0 !== e.animations && (e.animations.length ? i = i.concat(e.animations) : i.push(e.animations));
  48086. for (var r = 0; r < i.length; r++) {
  48087. var o = n.AnimationClip.parseAnimation(i[r], s.bones);
  48088. o && t.push(o)
  48089. }
  48090. if (s.morphTargets) {
  48091. var a = n.AnimationClip.CreateClipsFromMorphTargetSequences(s.morphTargets, 10);
  48092. t = t.concat(a)
  48093. }
  48094. t.length > 0 && (s.animations = t)
  48095. }
  48096. var s = new n.Geometry
  48097. , l = void 0 !== e.scale ? 1 / e.scale : 1;
  48098. if (i(l),
  48099. r(),
  48100. o(l),
  48101. a(),
  48102. s.computeFaceNormals(),
  48103. s.computeBoundingSphere(),
  48104. void 0 === e.materials || 0 === e.materials.length)
  48105. return {
  48106. geometry: s
  48107. };
  48108. var c = n.Loader.prototype.initMaterials(e.materials, t, this.crossOrigin);
  48109. return {
  48110. geometry: s,
  48111. materials: c
  48112. }
  48113. }
  48114. },
  48115. n.LoadingManager = function(e, t, i) {
  48116. var n = this
  48117. , r = !1
  48118. , o = 0
  48119. , a = 0;
  48120. this.onStart = void 0,
  48121. this.onLoad = e,
  48122. this.onProgress = t,
  48123. this.onError = i,
  48124. this.itemStart = function(e) {
  48125. a++,
  48126. r === !1 && void 0 !== n.onStart && n.onStart(e, o, a),
  48127. r = !0
  48128. }
  48129. ,
  48130. this.itemEnd = function(e) {
  48131. o++,
  48132. void 0 !== n.onProgress && n.onProgress(e, o, a),
  48133. o === a && (r = !1,
  48134. void 0 !== n.onLoad && n.onLoad())
  48135. }
  48136. ,
  48137. this.itemError = function(e) {
  48138. void 0 !== n.onError && n.onError(e)
  48139. }
  48140. }
  48141. ,
  48142. n.DefaultLoadingManager = new n.LoadingManager,
  48143. n.BufferGeometryLoader = function(e) {
  48144. this.manager = void 0 !== e ? e : n.DefaultLoadingManager
  48145. }
  48146. ,
  48147. n.BufferGeometryLoader.prototype = {
  48148. constructor: n.BufferGeometryLoader,
  48149. load: function(e, t, i, r) {
  48150. var o = this
  48151. , a = new n.XHRLoader(o.manager);
  48152. a.load(e, function(e) {
  48153. t(o.parse(JSON.parse(e)))
  48154. }, i, r)
  48155. },
  48156. parse: function(e) {
  48157. var t = new n.BufferGeometry
  48158. , i = e.data.index
  48159. , r = {
  48160. Int8Array: Int8Array,
  48161. Uint8Array: Uint8Array,
  48162. Uint8ClampedArray: Uint8ClampedArray,
  48163. Int16Array: Int16Array,
  48164. Uint16Array: Uint16Array,
  48165. Int32Array: Int32Array,
  48166. Uint32Array: Uint32Array,
  48167. Float32Array: Float32Array,
  48168. Float64Array: Float64Array
  48169. };
  48170. if (void 0 !== i) {
  48171. var o = new r[i.type](i.array);
  48172. t.setIndex(new n.BufferAttribute(o,1))
  48173. }
  48174. var a = e.data.attributes;
  48175. for (var s in a) {
  48176. var l = a[s]
  48177. , o = new r[l.type](l.array);
  48178. t.addAttribute(s, new n.BufferAttribute(o,l.itemSize))
  48179. }
  48180. var c = e.data.groups || e.data.drawcalls || e.data.offsets;
  48181. if (void 0 !== c)
  48182. for (var h = 0, u = c.length; h !== u; ++h) {
  48183. var d = c[h];
  48184. t.addGroup(d.start, d.count, d.materialIndex)
  48185. }
  48186. var p = e.data.boundingSphere;
  48187. if (void 0 !== p) {
  48188. var f = new n.Vector3;
  48189. void 0 !== p.center && f.fromArray(p.center),
  48190. t.boundingSphere = new n.Sphere(f,p.radius)
  48191. }
  48192. return t
  48193. }
  48194. },
  48195. n.MaterialLoader = function(e) {
  48196. this.manager = void 0 !== e ? e : n.DefaultLoadingManager,
  48197. this.textures = {}
  48198. }
  48199. ,
  48200. n.MaterialLoader.prototype = {
  48201. constructor: n.MaterialLoader,
  48202. load: function(e, t, i, r) {
  48203. var o = this
  48204. , a = new n.XHRLoader(o.manager);
  48205. a.load(e, function(e) {
  48206. t(o.parse(JSON.parse(e)))
  48207. }, i, r)
  48208. },
  48209. setTextures: function(e) {
  48210. this.textures = e
  48211. },
  48212. getTexture: function(e) {
  48213. var t = this.textures;
  48214. return void 0 === t[e] && console.warn("THREE.MaterialLoader: Undefined texture", e),
  48215. t[e]
  48216. },
  48217. parse: function(e) {
  48218. var t = new n[e.type];
  48219. if (void 0 !== e.uuid && (t.uuid = e.uuid),
  48220. void 0 !== e.name && (t.name = e.name),
  48221. void 0 !== e.color && t.color.setHex(e.color),
  48222. void 0 !== e.roughness && (t.roughness = e.roughness),
  48223. void 0 !== e.metalness && (t.metalness = e.metalness),
  48224. void 0 !== e.emissive && t.emissive.setHex(e.emissive),
  48225. void 0 !== e.specular && t.specular.setHex(e.specular),
  48226. void 0 !== e.shininess && (t.shininess = e.shininess),
  48227. void 0 !== e.uniforms && (t.uniforms = e.uniforms),
  48228. void 0 !== e.vertexShader && (t.vertexShader = e.vertexShader),
  48229. void 0 !== e.fragmentShader && (t.fragmentShader = e.fragmentShader),
  48230. void 0 !== e.vertexColors && (t.vertexColors = e.vertexColors),
  48231. void 0 !== e.shading && (t.shading = e.shading),
  48232. void 0 !== e.blending && (t.blending = e.blending),
  48233. void 0 !== e.side && (t.side = e.side),
  48234. void 0 !== e.opacity && (t.opacity = e.opacity),
  48235. void 0 !== e.transparent && (t.transparent = e.transparent),
  48236. void 0 !== e.alphaTest && (t.alphaTest = e.alphaTest),
  48237. void 0 !== e.depthTest && (t.depthTest = e.depthTest),
  48238. void 0 !== e.depthWrite && (t.depthWrite = e.depthWrite),
  48239. void 0 !== e.colorWrite && (t.colorWrite = e.colorWrite),
  48240. void 0 !== e.wireframe && (t.wireframe = e.wireframe),
  48241. void 0 !== e.wireframeLinewidth && (t.wireframeLinewidth = e.wireframeLinewidth),
  48242. void 0 !== e.size && (t.size = e.size),
  48243. void 0 !== e.sizeAttenuation && (t.sizeAttenuation = e.sizeAttenuation),
  48244. void 0 !== e.map && (t.map = this.getTexture(e.map)),
  48245. void 0 !== e.alphaMap && (t.alphaMap = this.getTexture(e.alphaMap),
  48246. t.transparent = !0),
  48247. void 0 !== e.bumpMap && (t.bumpMap = this.getTexture(e.bumpMap)),
  48248. void 0 !== e.bumpScale && (t.bumpScale = e.bumpScale),
  48249. void 0 !== e.normalMap && (t.normalMap = this.getTexture(e.normalMap)),
  48250. void 0 !== e.normalScale) {
  48251. var i = e.normalScale;
  48252. Array.isArray(i) === !1 && (i = [i, i]),
  48253. t.normalScale = (new n.Vector2).fromArray(i)
  48254. }
  48255. if (void 0 !== e.displacementMap && (t.displacementMap = this.getTexture(e.displacementMap)),
  48256. void 0 !== e.displacementScale && (t.displacementScale = e.displacementScale),
  48257. void 0 !== e.displacementBias && (t.displacementBias = e.displacementBias),
  48258. void 0 !== e.roughnessMap && (t.roughnessMap = this.getTexture(e.roughnessMap)),
  48259. void 0 !== e.metalnessMap && (t.metalnessMap = this.getTexture(e.metalnessMap)),
  48260. void 0 !== e.emissiveMap && (t.emissiveMap = this.getTexture(e.emissiveMap)),
  48261. void 0 !== e.emissiveIntensity && (t.emissiveIntensity = e.emissiveIntensity),
  48262. void 0 !== e.specularMap && (t.specularMap = this.getTexture(e.specularMap)),
  48263. void 0 !== e.envMap && (t.envMap = this.getTexture(e.envMap),
  48264. t.combine = n.MultiplyOperation),
  48265. e.reflectivity && (t.reflectivity = e.reflectivity),
  48266. void 0 !== e.lightMap && (t.lightMap = this.getTexture(e.lightMap)),
  48267. void 0 !== e.lightMapIntensity && (t.lightMapIntensity = e.lightMapIntensity),
  48268. void 0 !== e.aoMap && (t.aoMap = this.getTexture(e.aoMap)),
  48269. void 0 !== e.aoMapIntensity && (t.aoMapIntensity = e.aoMapIntensity),
  48270. void 0 !== e.materials)
  48271. for (var r = 0, o = e.materials.length; r < o; r++)
  48272. t.materials.push(this.parse(e.materials[r]));
  48273. return t
  48274. }
  48275. },
  48276. n.ObjectLoader = function(e) {
  48277. this.manager = void 0 !== e ? e : n.DefaultLoadingManager,
  48278. this.texturePath = ""
  48279. }
  48280. ,
  48281. n.ObjectLoader.prototype = {
  48282. constructor: n.ObjectLoader,
  48283. load: function(e, t, i, r) {
  48284. "" === this.texturePath && (this.texturePath = e.substring(0, e.lastIndexOf("/") + 1));
  48285. var o = this
  48286. , a = new n.XHRLoader(o.manager);
  48287. a.load(e, function(e) {
  48288. o.parse(JSON.parse(e), t)
  48289. }, i, r)
  48290. },
  48291. setTexturePath: function(e) {
  48292. this.texturePath = e
  48293. },
  48294. setCrossOrigin: function(e) {
  48295. this.crossOrigin = e
  48296. },
  48297. parse: function(e, t) {
  48298. var i = this.parseGeometries(e.geometries)
  48299. , n = this.parseImages(e.images, function() {
  48300. void 0 !== t && t(a)
  48301. })
  48302. , r = this.parseTextures(e.textures, n)
  48303. , o = this.parseMaterials(e.materials, r)
  48304. , a = this.parseObject(e.object, i, o);
  48305. return e.animations && (a.animations = this.parseAnimations(e.animations)),
  48306. void 0 !== e.images && 0 !== e.images.length || void 0 !== t && t(a),
  48307. a
  48308. },
  48309. parseGeometries: function(e) {
  48310. var t = {};
  48311. if (void 0 !== e)
  48312. for (var i = new n.JSONLoader, r = new n.BufferGeometryLoader, o = 0, a = e.length; o < a; o++) {
  48313. var s, l = e[o];
  48314. switch (l.type) {
  48315. case "PlaneGeometry":
  48316. case "PlaneBufferGeometry":
  48317. s = new n[l.type](l.width,l.height,l.widthSegments,l.heightSegments);
  48318. break;
  48319. case "BoxGeometry":
  48320. case "BoxBufferGeometry":
  48321. case "CubeGeometry":
  48322. s = new n[l.type](l.width,l.height,l.depth,l.widthSegments,l.heightSegments,l.depthSegments);
  48323. break;
  48324. case "CircleGeometry":
  48325. case "CircleBufferGeometry":
  48326. s = new n[l.type](l.radius,l.segments,l.thetaStart,l.thetaLength);
  48327. break;
  48328. case "CylinderGeometry":
  48329. case "CylinderBufferGeometry":
  48330. s = new n[l.type](l.radiusTop,l.radiusBottom,l.height,l.radialSegments,l.heightSegments,l.openEnded,l.thetaStart,l.thetaLength);
  48331. break;
  48332. case "SphereGeometry":
  48333. case "SphereBufferGeometry":
  48334. s = new n[l.type](l.radius,l.widthSegments,l.heightSegments,l.phiStart,l.phiLength,l.thetaStart,l.thetaLength);
  48335. break;
  48336. case "DodecahedronGeometry":
  48337. s = new n.DodecahedronGeometry(l.radius,l.detail);
  48338. break;
  48339. case "IcosahedronGeometry":
  48340. s = new n.IcosahedronGeometry(l.radius,l.detail);
  48341. break;
  48342. case "OctahedronGeometry":
  48343. s = new n.OctahedronGeometry(l.radius,l.detail);
  48344. break;
  48345. case "TetrahedronGeometry":
  48346. s = new n.TetrahedronGeometry(l.radius,l.detail);
  48347. break;
  48348. case "RingGeometry":
  48349. case "RingBufferGeometry":
  48350. s = new n[l.type](l.innerRadius,l.outerRadius,l.thetaSegments,l.phiSegments,l.thetaStart,l.thetaLength);
  48351. break;
  48352. case "TorusGeometry":
  48353. case "TorusBufferGeometry":
  48354. s = new n[l.type](l.radius,l.tube,l.radialSegments,l.tubularSegments,l.arc);
  48355. break;
  48356. case "TorusKnotGeometry":
  48357. case "TorusKnotBufferGeometry":
  48358. s = new n[l.type](l.radius,l.tube,l.tubularSegments,l.radialSegments,l.p,l.q);
  48359. break;
  48360. case "LatheGeometry":
  48361. s = new n.LatheGeometry(l.points,l.segments,l.phiStart,l.phiLength);
  48362. break;
  48363. case "BufferGeometry":
  48364. s = r.parse(l);
  48365. break;
  48366. case "Geometry":
  48367. s = i.parse(l.data, this.texturePath).geometry;
  48368. break;
  48369. default:
  48370. console.warn('THREE.ObjectLoader: Unsupported geometry type "' + l.type + '"');
  48371. continue
  48372. }
  48373. s.uuid = l.uuid,
  48374. void 0 !== l.name && (s.name = l.name),
  48375. t[l.uuid] = s
  48376. }
  48377. return t
  48378. },
  48379. parseMaterials: function(e, t) {
  48380. var i = {};
  48381. if (void 0 !== e) {
  48382. var r = new n.MaterialLoader;
  48383. r.setTextures(t);
  48384. for (var o = 0, a = e.length; o < a; o++) {
  48385. var s = r.parse(e[o]);
  48386. i[s.uuid] = s
  48387. }
  48388. }
  48389. return i
  48390. },
  48391. parseAnimations: function(e) {
  48392. for (var t = [], i = 0; i < e.length; i++) {
  48393. var r = n.AnimationClip.parse(e[i]);
  48394. t.push(r)
  48395. }
  48396. return t
  48397. },
  48398. parseImages: function(e, t) {
  48399. function i(e) {
  48400. return r.manager.itemStart(e),
  48401. s.load(e, function() {
  48402. r.manager.itemEnd(e)
  48403. })
  48404. }
  48405. var r = this
  48406. , o = {};
  48407. if (void 0 !== e && e.length > 0) {
  48408. var a = new n.LoadingManager(t)
  48409. , s = new n.ImageLoader(a);
  48410. s.setCrossOrigin(this.crossOrigin);
  48411. for (var l = 0, c = e.length; l < c; l++) {
  48412. var h = e[l]
  48413. , u = /^(\/\/)|([a-z]+:(\/\/)?)/i.test(h.url) ? h.url : r.texturePath + h.url;
  48414. o[h.uuid] = i(u)
  48415. }
  48416. }
  48417. return o
  48418. },
  48419. parseTextures: function(e, t) {
  48420. function i(e) {
  48421. return "number" == typeof e ? e : (console.warn("THREE.ObjectLoader.parseTexture: Constant should be in numeric form.", e),
  48422. n[e])
  48423. }
  48424. var r = {};
  48425. if (void 0 !== e)
  48426. for (var o = 0, a = e.length; o < a; o++) {
  48427. var s = e[o];
  48428. void 0 === s.image && console.warn('THREE.ObjectLoader: No "image" specified for', s.uuid),
  48429. void 0 === t[s.image] && console.warn("THREE.ObjectLoader: Undefined image", s.image);
  48430. var l = new n.Texture(t[s.image]);
  48431. l.needsUpdate = !0,
  48432. l.uuid = s.uuid,
  48433. void 0 !== s.name && (l.name = s.name),
  48434. void 0 !== s.mapping && (l.mapping = i(s.mapping)),
  48435. void 0 !== s.offset && (l.offset = new n.Vector2(s.offset[0],s.offset[1])),
  48436. void 0 !== s.repeat && (l.repeat = new n.Vector2(s.repeat[0],s.repeat[1])),
  48437. void 0 !== s.minFilter && (l.minFilter = i(s.minFilter)),
  48438. void 0 !== s.magFilter && (l.magFilter = i(s.magFilter)),
  48439. void 0 !== s.anisotropy && (l.anisotropy = s.anisotropy),
  48440. Array.isArray(s.wrap) && (l.wrapS = i(s.wrap[0]),
  48441. l.wrapT = i(s.wrap[1])),
  48442. r[s.uuid] = l
  48443. }
  48444. return r
  48445. },
  48446. parseObject: function() {
  48447. var e = new n.Matrix4;
  48448. return function(t, i, r) {
  48449. function o(e) {
  48450. return void 0 === i[e] && console.warn("THREE.ObjectLoader: Undefined geometry", e),
  48451. i[e]
  48452. }
  48453. function a(e) {
  48454. if (void 0 !== e)
  48455. return void 0 === r[e] && console.warn("THREE.ObjectLoader: Undefined material", e),
  48456. r[e]
  48457. }
  48458. var s;
  48459. switch (t.type) {
  48460. case "Scene":
  48461. s = new n.Scene;
  48462. break;
  48463. case "PerspectiveCamera":
  48464. s = new n.PerspectiveCamera(t.fov,t.aspect,t.near,t.far);
  48465. break;
  48466. case "OrthographicCamera":
  48467. s = new n.OrthographicCamera(t.left,t.right,t.top,t.bottom,t.near,t.far);
  48468. break;
  48469. case "AmbientLight":
  48470. s = new n.AmbientLight(t.color,t.intensity);
  48471. break;
  48472. case "DirectionalLight":
  48473. s = new n.DirectionalLight(t.color,t.intensity);
  48474. break;
  48475. case "PointLight":
  48476. s = new n.PointLight(t.color,t.intensity,t.distance,t.decay);
  48477. break;
  48478. case "SpotLight":
  48479. s = new n.SpotLight(t.color,t.intensity,t.distance,t.angle,t.penumbra,t.decay);
  48480. break;
  48481. case "HemisphereLight":
  48482. s = new n.HemisphereLight(t.color,t.groundColor,t.intensity);
  48483. break;
  48484. case "Mesh":
  48485. var l = o(t.geometry)
  48486. , c = a(t.material);
  48487. s = l.bones && l.bones.length > 0 ? new n.SkinnedMesh(l,c) : new n.Mesh(l,c);
  48488. break;
  48489. case "LOD":
  48490. s = new n.LOD;
  48491. break;
  48492. case "Line":
  48493. s = new n.Line(o(t.geometry),a(t.material),t.mode);
  48494. break;
  48495. case "PointCloud":
  48496. case "Points":
  48497. s = new n.Points(o(t.geometry),a(t.material));
  48498. break;
  48499. case "Sprite":
  48500. s = new n.Sprite(a(t.material));
  48501. break;
  48502. case "Group":
  48503. s = new n.Group;
  48504. break;
  48505. default:
  48506. s = new n.Object3D
  48507. }
  48508. if (s.uuid = t.uuid,
  48509. void 0 !== t.name && (s.name = t.name),
  48510. void 0 !== t.matrix ? (e.fromArray(t.matrix),
  48511. e.decompose(s.position, s.quaternion, s.scale)) : (void 0 !== t.position && s.position.fromArray(t.position),
  48512. void 0 !== t.rotation && s.rotation.fromArray(t.rotation),
  48513. void 0 !== t.scale && s.scale.fromArray(t.scale)),
  48514. void 0 !== t.castShadow && (s.castShadow = t.castShadow),
  48515. void 0 !== t.receiveShadow && (s.receiveShadow = t.receiveShadow),
  48516. void 0 !== t.visible && (s.visible = t.visible),
  48517. void 0 !== t.userData && (s.userData = t.userData),
  48518. void 0 !== t.children)
  48519. for (var h in t.children)
  48520. s.add(this.parseObject(t.children[h], i, r));
  48521. if ("LOD" === t.type)
  48522. for (var u = t.levels, d = 0; d < u.length; d++) {
  48523. var p = u[d]
  48524. , h = s.getObjectByProperty("uuid", p.object);
  48525. void 0 !== h && s.addLevel(h, p.distance)
  48526. }
  48527. return s
  48528. }
  48529. }()
  48530. },
  48531. n.TextureLoader = function(e) {
  48532. this.manager = void 0 !== e ? e : n.DefaultLoadingManager
  48533. }
  48534. ,
  48535. n.TextureLoader.prototype = {
  48536. constructor: n.TextureLoader,
  48537. load: function(e, t, i, r) {
  48538. var o = new n.Texture
  48539. , a = new n.ImageLoader(this.manager);
  48540. return a.setCrossOrigin(this.crossOrigin),
  48541. a.setPath(this.path),
  48542. a.load(e, function(e) {
  48543. o.image = e,
  48544. o.needsUpdate = !0,
  48545. void 0 !== t && t(o)
  48546. }, i, r),
  48547. o
  48548. },
  48549. setCrossOrigin: function(e) {
  48550. this.crossOrigin = e
  48551. },
  48552. setPath: function(e) {
  48553. this.path = e
  48554. }
  48555. },
  48556. n.CubeTextureLoader = function(e) {
  48557. this.manager = void 0 !== e ? e : n.DefaultLoadingManager
  48558. }
  48559. ,
  48560. n.CubeTextureLoader.prototype = {
  48561. constructor: n.CubeTextureLoader,
  48562. load: function(e, t, i, r) {
  48563. function o(i) {
  48564. s.load(e[i], function(e) {
  48565. a.images[i] = e,
  48566. l++,
  48567. 6 === l && (a.needsUpdate = !0,
  48568. t && t(a))
  48569. }, void 0, r)
  48570. }
  48571. var a = new n.CubeTexture
  48572. , s = new n.ImageLoader(this.manager);
  48573. s.setCrossOrigin(this.crossOrigin),
  48574. s.setPath(this.path);
  48575. for (var l = 0, c = 0; c < e.length; ++c)
  48576. o(c);
  48577. return a
  48578. },
  48579. setCrossOrigin: function(e) {
  48580. this.crossOrigin = e
  48581. },
  48582. setPath: function(e) {
  48583. this.path = e
  48584. }
  48585. },
  48586. n.DataTextureLoader = n.BinaryTextureLoader = function(e) {
  48587. this.manager = void 0 !== e ? e : n.DefaultLoadingManager,
  48588. this._parser = null
  48589. }
  48590. ,
  48591. n.BinaryTextureLoader.prototype = {
  48592. constructor: n.BinaryTextureLoader,
  48593. load: function(e, t, i, r) {
  48594. var o = this
  48595. , a = new n.DataTexture
  48596. , s = new n.XHRLoader(this.manager);
  48597. return s.setResponseType("arraybuffer"),
  48598. s.load(e, function(e) {
  48599. var i = o._parser(e);
  48600. i && (void 0 !== i.image ? a.image = i.image : void 0 !== i.data && (a.image.width = i.width,
  48601. a.image.height = i.height,
  48602. a.image.data = i.data),
  48603. a.wrapS = void 0 !== i.wrapS ? i.wrapS : n.ClampToEdgeWrapping,
  48604. a.wrapT = void 0 !== i.wrapT ? i.wrapT : n.ClampToEdgeWrapping,
  48605. a.magFilter = void 0 !== i.magFilter ? i.magFilter : n.LinearFilter,
  48606. a.minFilter = void 0 !== i.minFilter ? i.minFilter : n.LinearMipMapLinearFilter,
  48607. a.anisotropy = void 0 !== i.anisotropy ? i.anisotropy : 1,
  48608. void 0 !== i.format && (a.format = i.format),
  48609. void 0 !== i.type && (a.type = i.type),
  48610. void 0 !== i.mipmaps && (a.mipmaps = i.mipmaps),
  48611. 1 === i.mipmapCount && (a.minFilter = n.LinearFilter),
  48612. a.needsUpdate = !0,
  48613. t && t(a, i))
  48614. }, i, r),
  48615. a
  48616. }
  48617. },
  48618. n.CompressedTextureLoader = function(e) {
  48619. this.manager = void 0 !== e ? e : n.DefaultLoadingManager,
  48620. this._parser = null
  48621. }
  48622. ;
  48623. n.CompressedTextureLoader.prototype = {
  48624. constructor: n.CompressedTextureLoader,
  48625. load: function(e, t, i, r) {
  48626. function o(o) {
  48627. c.load(e[o], function(e) {
  48628. var i = a._parser(e, !0);
  48629. s[o] = {
  48630. width: i.width,
  48631. height: i.height,
  48632. format: i.format,
  48633. mipmaps: i.mipmaps
  48634. },
  48635. h += 1,
  48636. 6 === h && (1 === i.mipmapCount && (l.minFilter = n.LinearFilter),
  48637. l.format = i.format,
  48638. l.needsUpdate = !0,
  48639. t && t(l))
  48640. }, i, r)
  48641. }
  48642. var a = this
  48643. , s = []
  48644. , l = new n.CompressedTexture;
  48645. l.image = s;
  48646. var c = new n.XHRLoader(this.manager);
  48647. if (c.setPath(this.path),
  48648. c.setResponseType("arraybuffer"),
  48649. Array.isArray(e))
  48650. for (var h = 0, u = 0, d = e.length; u < d; ++u)
  48651. o(u);
  48652. else
  48653. c.load(e, function(e) {
  48654. var i = a._parser(e, !0);
  48655. if (i.isCubemap)
  48656. for (var r = i.mipmaps.length / i.mipmapCount, o = 0; o < r; o++) {
  48657. s[o] = {
  48658. mipmaps: []
  48659. };
  48660. for (var c = 0; c < i.mipmapCount; c++)
  48661. s[o].mipmaps.push(i.mipmaps[o * i.mipmapCount + c]),
  48662. s[o].format = i.format,
  48663. s[o].width = i.width,
  48664. s[o].height = i.height
  48665. }
  48666. else
  48667. l.image.width = i.width,
  48668. l.image.height = i.height,
  48669. l.mipmaps = i.mipmaps;
  48670. 1 === i.mipmapCount && (l.minFilter = n.LinearFilter),
  48671. l.format = i.format,
  48672. l.needsUpdate = !0,
  48673. t && t(l)
  48674. }, i, r);
  48675. return l
  48676. },
  48677. setPath: function(e) {
  48678. this.path = e
  48679. }
  48680. };
  48681. n.Material = function() {
  48682. Object.defineProperty(this, "id", {
  48683. value: n.MaterialIdCount++
  48684. }),
  48685. this.uuid = n.Math.generateUUID(),
  48686. this.name = "",
  48687. this.type = "Material",
  48688. this.side = n.FrontSide,
  48689. this.opacity = 1,
  48690. this.transparent = !1,
  48691. this.blending = n.NormalBlending,
  48692. this.blendSrc = n.SrcAlphaFactor,
  48693. this.blendDst = n.OneMinusSrcAlphaFactor,
  48694. this.blendEquation = n.AddEquation,
  48695. this.blendSrcAlpha = null,
  48696. this.blendDstAlpha = null,
  48697. this.blendEquationAlpha = null,
  48698. this.depthFunc = n.LessEqualDepth,
  48699. this.depthTest = !0,
  48700. this.depthWrite = !0,
  48701. this.colorWrite = !0,
  48702. this.precision = null,
  48703. this.polygonOffset = !1,
  48704. this.polygonOffsetFactor = 0,
  48705. this.polygonOffsetUnits = 0,
  48706. this.alphaTest = 0,
  48707. this.premultipliedAlpha = !1,
  48708. this.overdraw = 0,
  48709. this.visible = !0,
  48710. this._needsUpdate = !0
  48711. }
  48712. ,
  48713. n.Material.prototype = {
  48714. constructor: n.Material,
  48715. get needsUpdate() {
  48716. return this._needsUpdate
  48717. },
  48718. set needsUpdate(e) {
  48719. e === !0 && this.update(),
  48720. this._needsUpdate = e
  48721. },
  48722. setValues: function(e) {
  48723. if (void 0 !== e)
  48724. for (var t in e) {
  48725. var i = e[t];
  48726. if (void 0 !== i) {
  48727. var r = this[t];
  48728. 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.")
  48729. } else
  48730. console.warn("THREE.Material: '" + t + "' parameter is undefined.")
  48731. }
  48732. },
  48733. toJSON: function(e) {
  48734. function t(e) {
  48735. var t = [];
  48736. for (var i in e) {
  48737. var n = e[i];
  48738. delete n.metadata,
  48739. t.push(n)
  48740. }
  48741. return t
  48742. }
  48743. var i = void 0 === e;
  48744. i && (e = {
  48745. textures: {},
  48746. images: {}
  48747. });
  48748. var r = {
  48749. metadata: {
  48750. version: 4.4,
  48751. type: "Material",
  48752. generator: "Material.toJSON"
  48753. }
  48754. };
  48755. if (r.uuid = this.uuid,
  48756. r.type = this.type,
  48757. "" !== this.name && (r.name = this.name),
  48758. this.color instanceof n.Color && (r.color = this.color.getHex()),
  48759. .5 !== this.roughness && (r.roughness = this.roughness),
  48760. .5 !== this.metalness && (r.metalness = this.metalness),
  48761. this.emissive instanceof n.Color && (r.emissive = this.emissive.getHex()),
  48762. this.specular instanceof n.Color && (r.specular = this.specular.getHex()),
  48763. void 0 !== this.shininess && (r.shininess = this.shininess),
  48764. this.map instanceof n.Texture && (r.map = this.map.toJSON(e).uuid),
  48765. this.alphaMap instanceof n.Texture && (r.alphaMap = this.alphaMap.toJSON(e).uuid),
  48766. this.lightMap instanceof n.Texture && (r.lightMap = this.lightMap.toJSON(e).uuid),
  48767. this.bumpMap instanceof n.Texture && (r.bumpMap = this.bumpMap.toJSON(e).uuid,
  48768. r.bumpScale = this.bumpScale),
  48769. this.normalMap instanceof n.Texture && (r.normalMap = this.normalMap.toJSON(e).uuid,
  48770. r.normalScale = this.normalScale.toArray()),
  48771. this.displacementMap instanceof n.Texture && (r.displacementMap = this.displacementMap.toJSON(e).uuid,
  48772. r.displacementScale = this.displacementScale,
  48773. r.displacementBias = this.displacementBias),
  48774. this.roughnessMap instanceof n.Texture && (r.roughnessMap = this.roughnessMap.toJSON(e).uuid),
  48775. this.metalnessMap instanceof n.Texture && (r.metalnessMap = this.metalnessMap.toJSON(e).uuid),
  48776. this.emissiveMap instanceof n.Texture && (r.emissiveMap = this.emissiveMap.toJSON(e).uuid),
  48777. this.specularMap instanceof n.Texture && (r.specularMap = this.specularMap.toJSON(e).uuid),
  48778. this.envMap instanceof n.Texture && (r.envMap = this.envMap.toJSON(e).uuid,
  48779. r.reflectivity = this.reflectivity),
  48780. void 0 !== this.size && (r.size = this.size),
  48781. void 0 !== this.sizeAttenuation && (r.sizeAttenuation = this.sizeAttenuation),
  48782. void 0 !== this.vertexColors && this.vertexColors !== n.NoColors && (r.vertexColors = this.vertexColors),
  48783. void 0 !== this.shading && this.shading !== n.SmoothShading && (r.shading = this.shading),
  48784. void 0 !== this.blending && this.blending !== n.NormalBlending && (r.blending = this.blending),
  48785. void 0 !== this.side && this.side !== n.FrontSide && (r.side = this.side),
  48786. this.opacity < 1 && (r.opacity = this.opacity),
  48787. this.transparent === !0 && (r.transparent = this.transparent),
  48788. this.alphaTest > 0 && (r.alphaTest = this.alphaTest),
  48789. this.premultipliedAlpha === !0 && (r.premultipliedAlpha = this.premultipliedAlpha),
  48790. this.wireframe === !0 && (r.wireframe = this.wireframe),
  48791. this.wireframeLinewidth > 1 && (r.wireframeLinewidth = this.wireframeLinewidth),
  48792. i) {
  48793. var o = t(e.textures)
  48794. , a = t(e.images);
  48795. o.length > 0 && (r.textures = o),
  48796. a.length > 0 && (r.images = a)
  48797. }
  48798. return r
  48799. },
  48800. clone: function() {
  48801. return (new this.constructor).copy(this)
  48802. },
  48803. copy: function(e) {
  48804. return this.name = e.name,
  48805. this.side = e.side,
  48806. this.opacity = e.opacity,
  48807. this.transparent = e.transparent,
  48808. this.blending = e.blending,
  48809. this.blendSrc = e.blendSrc,
  48810. this.blendDst = e.blendDst,
  48811. this.blendEquation = e.blendEquation,
  48812. this.blendSrcAlpha = e.blendSrcAlpha,
  48813. this.blendDstAlpha = e.blendDstAlpha,
  48814. this.blendEquationAlpha = e.blendEquationAlpha,
  48815. this.depthFunc = e.depthFunc,
  48816. this.depthTest = e.depthTest,
  48817. this.depthWrite = e.depthWrite,
  48818. this.colorWrite = e.colorWrite,
  48819. this.precision = e.precision,
  48820. this.polygonOffset = e.polygonOffset,
  48821. this.polygonOffsetFactor = e.polygonOffsetFactor,
  48822. this.polygonOffsetUnits = e.polygonOffsetUnits,
  48823. this.alphaTest = e.alphaTest,
  48824. this.premultipliedAlpha = e.premultipliedAlpha,
  48825. this.overdraw = e.overdraw,
  48826. this.visible = e.visible,
  48827. this
  48828. },
  48829. update: function() {
  48830. this.dispatchEvent({
  48831. type: "update"
  48832. })
  48833. },
  48834. dispose: function() {
  48835. this.dispatchEvent({
  48836. type: "dispose"
  48837. })
  48838. }
  48839. },
  48840. n.EventDispatcher.prototype.apply(n.Material.prototype),
  48841. n.MaterialIdCount = 0,
  48842. n.LineBasicMaterial = function(e) {
  48843. n.Material.call(this),
  48844. this.type = "LineBasicMaterial",
  48845. this.color = new n.Color(16777215),
  48846. this.linewidth = 1,
  48847. this.linecap = "round",
  48848. this.linejoin = "round",
  48849. this.blending = n.NormalBlending,
  48850. this.vertexColors = n.NoColors,
  48851. this.fog = !0,
  48852. this.setValues(e)
  48853. }
  48854. ,
  48855. n.LineBasicMaterial.prototype = Object.create(n.Material.prototype),
  48856. n.LineBasicMaterial.prototype.constructor = n.LineBasicMaterial,
  48857. n.LineBasicMaterial.prototype.copy = function(e) {
  48858. return n.Material.prototype.copy.call(this, e),
  48859. this.color.copy(e.color),
  48860. this.linewidth = e.linewidth,
  48861. this.linecap = e.linecap,
  48862. this.linejoin = e.linejoin,
  48863. this.vertexColors = e.vertexColors,
  48864. this.fog = e.fog,
  48865. this
  48866. }
  48867. ,
  48868. n.LineDashedMaterial = function(e) {
  48869. n.Material.call(this),
  48870. this.type = "LineDashedMaterial",
  48871. this.color = new n.Color(16777215),
  48872. this.linewidth = 1,
  48873. this.scale = 1,
  48874. this.dashSize = 3,
  48875. this.gapSize = 1,
  48876. this.blending = n.NormalBlending,
  48877. this.vertexColors = n.NoColors,
  48878. this.fog = !0,
  48879. this.setValues(e)
  48880. }
  48881. ,
  48882. n.LineDashedMaterial.prototype = Object.create(n.Material.prototype),
  48883. n.LineDashedMaterial.prototype.constructor = n.LineDashedMaterial,
  48884. n.LineDashedMaterial.prototype.copy = function(e) {
  48885. return n.Material.prototype.copy.call(this, e),
  48886. this.color.copy(e.color),
  48887. this.linewidth = e.linewidth,
  48888. this.scale = e.scale,
  48889. this.dashSize = e.dashSize,
  48890. this.gapSize = e.gapSize,
  48891. this.vertexColors = e.vertexColors,
  48892. this.fog = e.fog,
  48893. this
  48894. }
  48895. ,
  48896. n.MeshBasicMaterial = function(e) {
  48897. n.Material.call(this),
  48898. this.type = "MeshBasicMaterial",
  48899. this.color = new n.Color(16777215),
  48900. this.map = null,
  48901. this.aoMap = null,
  48902. this.aoMapIntensity = 1,
  48903. this.specularMap = null,
  48904. this.alphaMap = null,
  48905. this.envMap = null,
  48906. this.combine = n.MultiplyOperation,
  48907. this.reflectivity = 1,
  48908. this.refractionRatio = .98,
  48909. this.fog = !0,
  48910. this.shading = n.SmoothShading,
  48911. this.blending = n.NormalBlending,
  48912. this.wireframe = !1,
  48913. this.wireframeLinewidth = 1,
  48914. this.wireframeLinecap = "round",
  48915. this.wireframeLinejoin = "round",
  48916. this.vertexColors = n.NoColors,
  48917. this.skinning = !1,
  48918. this.morphTargets = !1,
  48919. this.setValues(e)
  48920. }
  48921. ,
  48922. n.MeshBasicMaterial.prototype = Object.create(n.Material.prototype),
  48923. n.MeshBasicMaterial.prototype.constructor = n.MeshBasicMaterial,
  48924. n.MeshBasicMaterial.prototype.copy = function(e) {
  48925. return n.Material.prototype.copy.call(this, e),
  48926. this.color.copy(e.color),
  48927. this.map = e.map,
  48928. this.aoMap = e.aoMap,
  48929. this.aoMapIntensity = e.aoMapIntensity,
  48930. this.specularMap = e.specularMap,
  48931. this.alphaMap = e.alphaMap,
  48932. this.envMap = e.envMap,
  48933. this.combine = e.combine,
  48934. this.reflectivity = e.reflectivity,
  48935. this.refractionRatio = e.refractionRatio,
  48936. this.fog = e.fog,
  48937. this.shading = e.shading,
  48938. this.wireframe = e.wireframe,
  48939. this.wireframeLinewidth = e.wireframeLinewidth,
  48940. this.wireframeLinecap = e.wireframeLinecap,
  48941. this.wireframeLinejoin = e.wireframeLinejoin,
  48942. this.vertexColors = e.vertexColors,
  48943. this.skinning = e.skinning,
  48944. this.morphTargets = e.morphTargets,
  48945. this
  48946. }
  48947. ,
  48948. n.MeshLambertMaterial = function(e) {
  48949. n.Material.call(this),
  48950. this.type = "MeshLambertMaterial",
  48951. this.color = new n.Color(16777215),
  48952. this.map = null,
  48953. this.lightMap = null,
  48954. this.lightMapIntensity = 1,
  48955. this.aoMap = null,
  48956. this.aoMapIntensity = 1,
  48957. this.emissive = new n.Color(0),
  48958. this.emissiveIntensity = 1,
  48959. this.emissiveMap = null,
  48960. this.specularMap = null,
  48961. this.alphaMap = null,
  48962. this.envMap = null,
  48963. this.combine = n.MultiplyOperation,
  48964. this.reflectivity = 1,
  48965. this.refractionRatio = .98,
  48966. this.fog = !0,
  48967. this.blending = n.NormalBlending,
  48968. this.wireframe = !1,
  48969. this.wireframeLinewidth = 1,
  48970. this.wireframeLinecap = "round",
  48971. this.wireframeLinejoin = "round",
  48972. this.vertexColors = n.NoColors,
  48973. this.skinning = !1,
  48974. this.morphTargets = !1,
  48975. this.morphNormals = !1,
  48976. this.setValues(e)
  48977. }
  48978. ,
  48979. n.MeshLambertMaterial.prototype = Object.create(n.Material.prototype),
  48980. n.MeshLambertMaterial.prototype.constructor = n.MeshLambertMaterial,
  48981. n.MeshLambertMaterial.prototype.copy = function(e) {
  48982. return n.Material.prototype.copy.call(this, e),
  48983. this.color.copy(e.color),
  48984. this.map = e.map,
  48985. this.lightMap = e.lightMap,
  48986. this.lightMapIntensity = e.lightMapIntensity,
  48987. this.aoMap = e.aoMap,
  48988. this.aoMapIntensity = e.aoMapIntensity,
  48989. this.emissive.copy(e.emissive),
  48990. this.emissiveMap = e.emissiveMap,
  48991. this.emissiveIntensity = e.emissiveIntensity,
  48992. this.specularMap = e.specularMap,
  48993. this.alphaMap = e.alphaMap,
  48994. this.envMap = e.envMap,
  48995. this.combine = e.combine,
  48996. this.reflectivity = e.reflectivity,
  48997. this.refractionRatio = e.refractionRatio,
  48998. this.fog = e.fog,
  48999. this.wireframe = e.wireframe,
  49000. this.wireframeLinewidth = e.wireframeLinewidth,
  49001. this.wireframeLinecap = e.wireframeLinecap,
  49002. this.wireframeLinejoin = e.wireframeLinejoin,
  49003. this.vertexColors = e.vertexColors,
  49004. this.skinning = e.skinning,
  49005. this.morphTargets = e.morphTargets,
  49006. this.morphNormals = e.morphNormals,
  49007. this
  49008. }
  49009. ,
  49010. n.MeshPhongMaterial = function(e) {
  49011. n.Material.call(this),
  49012. this.type = "MeshPhongMaterial",
  49013. this.color = new n.Color(16777215),
  49014. this.specular = new n.Color(1118481),
  49015. this.shininess = 30,
  49016. this.map = null,
  49017. this.lightMap = null,
  49018. this.lightMapIntensity = 1,
  49019. this.aoMap = null,
  49020. this.aoMapIntensity = 1,
  49021. this.emissive = new n.Color(0),
  49022. this.emissiveIntensity = 1,
  49023. this.emissiveMap = null,
  49024. this.bumpMap = null,
  49025. this.bumpScale = 1,
  49026. this.normalMap = null,
  49027. this.normalScale = new n.Vector2(1,1),
  49028. this.displacementMap = null,
  49029. this.displacementScale = 1,
  49030. this.displacementBias = 0,
  49031. this.specularMap = null,
  49032. this.alphaMap = null,
  49033. this.envMap = null,
  49034. this.combine = n.MultiplyOperation,
  49035. this.reflectivity = 1,
  49036. this.refractionRatio = .98,
  49037. this.fog = !0,
  49038. this.shading = n.SmoothShading,
  49039. this.blending = n.NormalBlending,
  49040. this.wireframe = !1,
  49041. this.wireframeLinewidth = 1,
  49042. this.wireframeLinecap = "round",
  49043. this.wireframeLinejoin = "round",
  49044. this.vertexColors = n.NoColors,
  49045. this.skinning = !1,
  49046. this.morphTargets = !1,
  49047. this.morphNormals = !1,
  49048. this.setValues(e)
  49049. }
  49050. ,
  49051. n.MeshPhongMaterial.prototype = Object.create(n.Material.prototype),
  49052. n.MeshPhongMaterial.prototype.constructor = n.MeshPhongMaterial,
  49053. n.MeshPhongMaterial.prototype.copy = function(e) {
  49054. return n.Material.prototype.copy.call(this, e),
  49055. this.color.copy(e.color),
  49056. this.specular.copy(e.specular),
  49057. this.shininess = e.shininess,
  49058. this.map = e.map,
  49059. this.lightMap = e.lightMap,
  49060. this.lightMapIntensity = e.lightMapIntensity,
  49061. this.aoMap = e.aoMap,
  49062. this.aoMapIntensity = e.aoMapIntensity,
  49063. this.emissive.copy(e.emissive),
  49064. this.emissiveMap = e.emissiveMap,
  49065. this.emissiveIntensity = e.emissiveIntensity,
  49066. this.bumpMap = e.bumpMap,
  49067. this.bumpScale = e.bumpScale,
  49068. this.normalMap = e.normalMap,
  49069. this.normalScale.copy(e.normalScale),
  49070. this.displacementMap = e.displacementMap,
  49071. this.displacementScale = e.displacementScale,
  49072. this.displacementBias = e.displacementBias,
  49073. this.specularMap = e.specularMap,
  49074. this.alphaMap = e.alphaMap,
  49075. this.envMap = e.envMap,
  49076. this.combine = e.combine,
  49077. this.reflectivity = e.reflectivity,
  49078. this.refractionRatio = e.refractionRatio,
  49079. this.fog = e.fog,
  49080. this.shading = e.shading,
  49081. this.wireframe = e.wireframe,
  49082. this.wireframeLinewidth = e.wireframeLinewidth,
  49083. this.wireframeLinecap = e.wireframeLinecap,
  49084. this.wireframeLinejoin = e.wireframeLinejoin,
  49085. this.vertexColors = e.vertexColors,
  49086. this.skinning = e.skinning,
  49087. this.morphTargets = e.morphTargets,
  49088. this.morphNormals = e.morphNormals,
  49089. this
  49090. }
  49091. ,
  49092. n.MeshStandardMaterial = function(e) {
  49093. n.Material.call(this),
  49094. this.type = "MeshStandardMaterial",
  49095. this.color = new n.Color(16777215),
  49096. this.roughness = .5,
  49097. this.metalness = .5,
  49098. this.map = null,
  49099. this.lightMap = null,
  49100. this.lightMapIntensity = 1,
  49101. this.aoMap = null,
  49102. this.aoMapIntensity = 1,
  49103. this.emissive = new n.Color(0),
  49104. this.emissiveIntensity = 1,
  49105. this.emissiveMap = null,
  49106. this.bumpMap = null,
  49107. this.bumpScale = 1,
  49108. this.normalMap = null,
  49109. this.normalScale = new n.Vector2(1,1),
  49110. this.displacementMap = null,
  49111. this.displacementScale = 1,
  49112. this.displacementBias = 0,
  49113. this.roughnessMap = null,
  49114. this.metalnessMap = null,
  49115. this.alphaMap = null,
  49116. this.envMap = null,
  49117. this.envMapIntensity = 1,
  49118. this.refractionRatio = .98,
  49119. this.fog = !0,
  49120. this.shading = n.SmoothShading,
  49121. this.blending = n.NormalBlending,
  49122. this.wireframe = !1,
  49123. this.wireframeLinewidth = 1,
  49124. this.wireframeLinecap = "round",
  49125. this.wireframeLinejoin = "round",
  49126. this.vertexColors = n.NoColors,
  49127. this.skinning = !1,
  49128. this.morphTargets = !1,
  49129. this.morphNormals = !1,
  49130. this.setValues(e)
  49131. }
  49132. ,
  49133. n.MeshStandardMaterial.prototype = Object.create(n.Material.prototype),
  49134. n.MeshStandardMaterial.prototype.constructor = n.MeshStandardMaterial,
  49135. n.MeshStandardMaterial.prototype.copy = function(e) {
  49136. return n.Material.prototype.copy.call(this, e),
  49137. this.color.copy(e.color),
  49138. this.roughness = e.roughness,
  49139. this.metalness = e.metalness,
  49140. this.map = e.map,
  49141. this.lightMap = e.lightMap,
  49142. this.lightMapIntensity = e.lightMapIntensity,
  49143. this.aoMap = e.aoMap,
  49144. this.aoMapIntensity = e.aoMapIntensity,
  49145. this.emissive.copy(e.emissive),
  49146. this.emissiveMap = e.emissiveMap,
  49147. this.emissiveIntensity = e.emissiveIntensity,
  49148. this.bumpMap = e.bumpMap,
  49149. this.bumpScale = e.bumpScale,
  49150. this.normalMap = e.normalMap,
  49151. this.normalScale.copy(e.normalScale),
  49152. this.displacementMap = e.displacementMap,
  49153. this.displacementScale = e.displacementScale,
  49154. this.displacementBias = e.displacementBias,
  49155. this.roughnessMap = e.roughnessMap,
  49156. this.metalnessMap = e.metalnessMap,
  49157. this.alphaMap = e.alphaMap,
  49158. this.envMap = e.envMap,
  49159. this.envMapIntensity = e.envMapIntensity,
  49160. this.refractionRatio = e.refractionRatio,
  49161. this.fog = e.fog,
  49162. this.shading = e.shading,
  49163. this.wireframe = e.wireframe,
  49164. this.wireframeLinewidth = e.wireframeLinewidth,
  49165. this.wireframeLinecap = e.wireframeLinecap,
  49166. this.wireframeLinejoin = e.wireframeLinejoin,
  49167. this.vertexColors = e.vertexColors,
  49168. this.skinning = e.skinning,
  49169. this.morphTargets = e.morphTargets,
  49170. this.morphNormals = e.morphNormals,
  49171. this
  49172. }
  49173. ,
  49174. n.MeshDepthMaterial = function(e) {
  49175. n.Material.call(this),
  49176. this.type = "MeshDepthMaterial",
  49177. this.morphTargets = !1,
  49178. this.wireframe = !1,
  49179. this.wireframeLinewidth = 1,
  49180. this.setValues(e)
  49181. }
  49182. ,
  49183. n.MeshDepthMaterial.prototype = Object.create(n.Material.prototype),
  49184. n.MeshDepthMaterial.prototype.constructor = n.MeshDepthMaterial,
  49185. n.MeshDepthMaterial.prototype.copy = function(e) {
  49186. return n.Material.prototype.copy.call(this, e),
  49187. this.wireframe = e.wireframe,
  49188. this.wireframeLinewidth = e.wireframeLinewidth,
  49189. this
  49190. }
  49191. ,
  49192. n.MeshNormalMaterial = function(e) {
  49193. n.Material.call(this, e),
  49194. this.type = "MeshNormalMaterial",
  49195. this.wireframe = !1,
  49196. this.wireframeLinewidth = 1,
  49197. this.morphTargets = !1,
  49198. this.setValues(e)
  49199. }
  49200. ,
  49201. n.MeshNormalMaterial.prototype = Object.create(n.Material.prototype),
  49202. n.MeshNormalMaterial.prototype.constructor = n.MeshNormalMaterial,
  49203. n.MeshNormalMaterial.prototype.copy = function(e) {
  49204. return n.Material.prototype.copy.call(this, e),
  49205. this.wireframe = e.wireframe,
  49206. this.wireframeLinewidth = e.wireframeLinewidth,
  49207. this
  49208. }
  49209. ,
  49210. n.MultiMaterial = function(e) {
  49211. this.uuid = n.Math.generateUUID(),
  49212. this.type = "MultiMaterial",
  49213. this.materials = e instanceof Array ? e : [],
  49214. this.visible = !0
  49215. }
  49216. ,
  49217. n.MultiMaterial.prototype = {
  49218. constructor: n.MultiMaterial,
  49219. toJSON: function(e) {
  49220. for (var t = {
  49221. metadata: {
  49222. version: 4.2,
  49223. type: "material",
  49224. generator: "MaterialExporter"
  49225. },
  49226. uuid: this.uuid,
  49227. type: this.type,
  49228. materials: []
  49229. }, i = this.materials, n = 0, r = i.length; n < r; n++) {
  49230. var o = i[n].toJSON(e);
  49231. delete o.metadata,
  49232. t.materials.push(o)
  49233. }
  49234. return t.visible = this.visible,
  49235. t
  49236. },
  49237. clone: function() {
  49238. for (var e = new this.constructor, t = 0; t < this.materials.length; t++)
  49239. e.materials.push(this.materials[t].clone());
  49240. return e.visible = this.visible,
  49241. e
  49242. }
  49243. },
  49244. n.PointsMaterial = function(e) {
  49245. n.Material.call(this),
  49246. this.type = "PointsMaterial",
  49247. this.color = new n.Color(16777215),
  49248. this.map = null,
  49249. this.size = 1,
  49250. this.sizeAttenuation = !0,
  49251. this.blending = n.NormalBlending,
  49252. this.vertexColors = n.NoColors,
  49253. this.fog = !0,
  49254. this.setValues(e)
  49255. }
  49256. ,
  49257. n.PointsMaterial.prototype = Object.create(n.Material.prototype),
  49258. n.PointsMaterial.prototype.constructor = n.PointsMaterial,
  49259. n.PointsMaterial.prototype.copy = function(e) {
  49260. return n.Material.prototype.copy.call(this, e),
  49261. this.color.copy(e.color),
  49262. this.map = e.map,
  49263. this.size = e.size,
  49264. this.sizeAttenuation = e.sizeAttenuation,
  49265. this.vertexColors = e.vertexColors,
  49266. this.fog = e.fog,
  49267. this
  49268. }
  49269. ,
  49270. n.ShaderMaterial = function(e) {
  49271. n.Material.call(this),
  49272. this.type = "ShaderMaterial",
  49273. this.defines = {},
  49274. this.uniforms = {},
  49275. this.vertexShader = "void main() {\n\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}",
  49276. this.fragmentShader = "void main() {\n\tgl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );\n}",
  49277. this.shading = n.SmoothShading,
  49278. this.linewidth = 1,
  49279. this.wireframe = !1,
  49280. this.wireframeLinewidth = 1,
  49281. this.fog = !1,
  49282. this.lights = !1,
  49283. this.vertexColors = n.NoColors,
  49284. this.skinning = !1,
  49285. this.morphTargets = !1,
  49286. this.morphNormals = !1,
  49287. this.extensions = {
  49288. derivatives: !1,
  49289. fragDepth: !1,
  49290. drawBuffers: !1,
  49291. shaderTextureLOD: !1
  49292. },
  49293. this.defaultAttributeValues = {
  49294. color: [1, 1, 1],
  49295. uv: [0, 0],
  49296. uv2: [0, 0]
  49297. },
  49298. this.index0AttributeName = void 0,
  49299. void 0 !== e && (void 0 !== e.attributes && console.error("THREE.ShaderMaterial: attributes should now be defined in THREE.BufferGeometry instead."),
  49300. this.setValues(e))
  49301. }
  49302. ,
  49303. n.ShaderMaterial.prototype = Object.create(n.Material.prototype),
  49304. n.ShaderMaterial.prototype.constructor = n.ShaderMaterial,
  49305. n.ShaderMaterial.prototype.copy = function(e) {
  49306. return n.Material.prototype.copy.call(this, e),
  49307. this.fragmentShader = e.fragmentShader,
  49308. this.vertexShader = e.vertexShader,
  49309. this.uniforms = n.UniformsUtils.clone(e.uniforms),
  49310. this.defines = e.defines,
  49311. this.shading = e.shading,
  49312. this.wireframe = e.wireframe,
  49313. this.wireframeLinewidth = e.wireframeLinewidth,
  49314. this.fog = e.fog,
  49315. this.lights = e.lights,
  49316. this.vertexColors = e.vertexColors,
  49317. this.skinning = e.skinning,
  49318. this.morphTargets = e.morphTargets,
  49319. this.morphNormals = e.morphNormals,
  49320. this.extensions = e.extensions,
  49321. this
  49322. }
  49323. ,
  49324. n.ShaderMaterial.prototype.toJSON = function(e) {
  49325. var t = n.Material.prototype.toJSON.call(this, e);
  49326. return t.uniforms = this.uniforms,
  49327. t.vertexShader = this.vertexShader,
  49328. t.fragmentShader = this.fragmentShader,
  49329. t
  49330. }
  49331. ,
  49332. n.RawShaderMaterial = function(e) {
  49333. n.ShaderMaterial.call(this, e),
  49334. this.type = "RawShaderMaterial"
  49335. }
  49336. ,
  49337. n.RawShaderMaterial.prototype = Object.create(n.ShaderMaterial.prototype),
  49338. n.RawShaderMaterial.prototype.constructor = n.RawShaderMaterial,
  49339. n.SpriteMaterial = function(e) {
  49340. n.Material.call(this),
  49341. this.type = "SpriteMaterial",
  49342. this.color = new n.Color(16777215),
  49343. this.map = null,
  49344. this.rotation = 0,
  49345. this.fog = !1,
  49346. this.setValues(e)
  49347. }
  49348. ,
  49349. n.SpriteMaterial.prototype = Object.create(n.Material.prototype),
  49350. n.SpriteMaterial.prototype.constructor = n.SpriteMaterial,
  49351. n.SpriteMaterial.prototype.copy = function(e) {
  49352. return n.Material.prototype.copy.call(this, e),
  49353. this.color.copy(e.color),
  49354. this.map = e.map,
  49355. this.rotation = e.rotation,
  49356. this.fog = e.fog,
  49357. this
  49358. }
  49359. ,
  49360. n.Texture = function(e, t, i, r, o, a, s, l, c) {
  49361. Object.defineProperty(this, "id", {
  49362. value: n.TextureIdCount++
  49363. }),
  49364. this.uuid = n.Math.generateUUID(),
  49365. this.name = "",
  49366. this.sourceFile = "",
  49367. this.image = void 0 !== e ? e : n.Texture.DEFAULT_IMAGE,
  49368. this.mipmaps = [],
  49369. this.mapping = void 0 !== t ? t : n.Texture.DEFAULT_MAPPING,
  49370. this.wrapS = void 0 !== i ? i : n.ClampToEdgeWrapping,
  49371. this.wrapT = void 0 !== r ? r : n.ClampToEdgeWrapping,
  49372. this.magFilter = void 0 !== o ? o : n.LinearFilter,
  49373. this.minFilter = void 0 !== a ? a : n.LinearMipMapLinearFilter,
  49374. this.anisotropy = void 0 !== c ? c : 1,
  49375. this.format = void 0 !== s ? s : n.RGBAFormat,
  49376. this.type = void 0 !== l ? l : n.UnsignedByteType,
  49377. this.offset = new n.Vector2(0,0),
  49378. this.repeat = new n.Vector2(1,1),
  49379. this.generateMipmaps = !0,
  49380. this.premultiplyAlpha = !1,
  49381. this.flipY = !0,
  49382. this.unpackAlignment = 4,
  49383. this.encoding = n.LinearEncoding,
  49384. this.version = 0,
  49385. this.onUpdate = null
  49386. }
  49387. ,
  49388. n.Texture.DEFAULT_IMAGE = void 0,
  49389. n.Texture.DEFAULT_MAPPING = n.UVMapping,
  49390. n.Texture.prototype = {
  49391. constructor: n.Texture,
  49392. set needsUpdate(e) {
  49393. e === !0 && this.version++
  49394. },
  49395. clone: function() {
  49396. return (new this.constructor).copy(this)
  49397. },
  49398. copy: function(e) {
  49399. return this.image = e.image,
  49400. this.mipmaps = e.mipmaps.slice(0),
  49401. this.mapping = e.mapping,
  49402. this.wrapS = e.wrapS,
  49403. this.wrapT = e.wrapT,
  49404. this.magFilter = e.magFilter,
  49405. this.minFilter = e.minFilter,
  49406. this.anisotropy = e.anisotropy,
  49407. this.format = e.format,
  49408. this.type = e.type,
  49409. this.offset.copy(e.offset),
  49410. this.repeat.copy(e.repeat),
  49411. this.generateMipmaps = e.generateMipmaps,
  49412. this.premultiplyAlpha = e.premultiplyAlpha,
  49413. this.flipY = e.flipY,
  49414. this.unpackAlignment = e.unpackAlignment,
  49415. this.encoding = e.encoding,
  49416. this
  49417. },
  49418. toJSON: function(e) {
  49419. function t(e) {
  49420. var t;
  49421. return void 0 !== e.toDataURL ? t = e : (t = document.createElement("canvas"),
  49422. t.width = e.width,
  49423. t.height = e.height,
  49424. t.getContext("2d").drawImage(e, 0, 0, e.width, e.height)),
  49425. t.width > 2048 || t.height > 2048 ? t.toDataURL("image/jpeg", .6) : t.toDataURL("image/png")
  49426. }
  49427. if (void 0 !== e.textures[this.uuid])
  49428. return e.textures[this.uuid];
  49429. var i = {
  49430. metadata: {
  49431. version: 4.4,
  49432. type: "Texture",
  49433. generator: "Texture.toJSON"
  49434. },
  49435. uuid: this.uuid,
  49436. name: this.name,
  49437. mapping: this.mapping,
  49438. repeat: [this.repeat.x, this.repeat.y],
  49439. offset: [this.offset.x, this.offset.y],
  49440. wrap: [this.wrapS, this.wrapT],
  49441. minFilter: this.minFilter,
  49442. magFilter: this.magFilter,
  49443. anisotropy: this.anisotropy
  49444. };
  49445. if (void 0 !== this.image) {
  49446. var r = this.image;
  49447. void 0 === r.uuid && (r.uuid = n.Math.generateUUID()),
  49448. void 0 === e.images[r.uuid] && (e.images[r.uuid] = {
  49449. uuid: r.uuid,
  49450. url: t(r)
  49451. }),
  49452. i.image = r.uuid
  49453. }
  49454. return e.textures[this.uuid] = i,
  49455. i
  49456. },
  49457. dispose: function() {
  49458. this.dispatchEvent({
  49459. type: "dispose"
  49460. })
  49461. },
  49462. transformUv: function(e) {
  49463. if (this.mapping === n.UVMapping) {
  49464. if (e.multiply(this.repeat),
  49465. e.add(this.offset),
  49466. e.x < 0 || e.x > 1)
  49467. switch (this.wrapS) {
  49468. case n.RepeatWrapping:
  49469. e.x = e.x - Math.floor(e.x);
  49470. break;
  49471. case n.ClampToEdgeWrapping:
  49472. e.x = e.x < 0 ? 0 : 1;
  49473. break;
  49474. case n.MirroredRepeatWrapping:
  49475. 1 === Math.abs(Math.floor(e.x) % 2) ? e.x = Math.ceil(e.x) - e.x : e.x = e.x - Math.floor(e.x)
  49476. }
  49477. if (e.y < 0 || e.y > 1)
  49478. switch (this.wrapT) {
  49479. case n.RepeatWrapping:
  49480. e.y = e.y - Math.floor(e.y);
  49481. break;
  49482. case n.ClampToEdgeWrapping:
  49483. e.y = e.y < 0 ? 0 : 1;
  49484. break;
  49485. case n.MirroredRepeatWrapping:
  49486. 1 === Math.abs(Math.floor(e.y) % 2) ? e.y = Math.ceil(e.y) - e.y : e.y = e.y - Math.floor(e.y)
  49487. }
  49488. this.flipY && (e.y = 1 - e.y)
  49489. }
  49490. }
  49491. },
  49492. n.EventDispatcher.prototype.apply(n.Texture.prototype),
  49493. n.TextureIdCount = 0,
  49494. n.CanvasTexture = function(e, t, i, r, o, a, s, l, c) {
  49495. n.Texture.call(this, e, t, i, r, o, a, s, l, c),
  49496. this.needsUpdate = !0
  49497. }
  49498. ,
  49499. n.CanvasTexture.prototype = Object.create(n.Texture.prototype),
  49500. n.CanvasTexture.prototype.constructor = n.CanvasTexture,
  49501. n.CubeTexture = function(e, t, i, r, o, a, s, l, c) {
  49502. e = void 0 !== e ? e : [],
  49503. t = void 0 !== t ? t : n.CubeReflectionMapping,
  49504. n.Texture.call(this, e, t, i, r, o, a, s, l, c),
  49505. this.flipY = !1
  49506. }
  49507. ,
  49508. n.CubeTexture.prototype = Object.create(n.Texture.prototype),
  49509. n.CubeTexture.prototype.constructor = n.CubeTexture,
  49510. Object.defineProperty(n.CubeTexture.prototype, "images", {
  49511. get: function() {
  49512. return this.image
  49513. },
  49514. set: function(e) {
  49515. this.image = e
  49516. }
  49517. }),
  49518. n.CompressedTexture = function(e, t, i, r, o, a, s, l, c, h, u) {
  49519. n.Texture.call(this, null, a, s, l, c, h, r, o, u),
  49520. this.image = {
  49521. width: t,
  49522. height: i
  49523. },
  49524. this.mipmaps = e,
  49525. this.flipY = !1,
  49526. this.generateMipmaps = !1
  49527. }
  49528. ,
  49529. n.CompressedTexture.prototype = Object.create(n.Texture.prototype),
  49530. n.CompressedTexture.prototype.constructor = n.CompressedTexture,
  49531. n.DataTexture = function(e, t, i, r, o, a, s, l, c, h, u) {
  49532. n.Texture.call(this, null, a, s, l, c, h, r, o, u),
  49533. this.image = {
  49534. data: e,
  49535. width: t,
  49536. height: i
  49537. },
  49538. this.magFilter = void 0 !== c ? c : n.NearestFilter,
  49539. this.minFilter = void 0 !== h ? h : n.NearestFilter,
  49540. this.flipY = !1,
  49541. this.generateMipmaps = !1
  49542. }
  49543. ,
  49544. n.DataTexture.prototype = Object.create(n.Texture.prototype),
  49545. n.DataTexture.prototype.constructor = n.DataTexture,
  49546. n.VideoTexture = function(e, t, i, r, o, a, s, l, c) {
  49547. function h() {
  49548. requestAnimationFrame(h)
  49549. if( !e.paused && e.readyState === e.HAVE_ENOUGH_DATA){//改 add !e.paused
  49550. u.needsUpdate = !0
  49551. }
  49552. }
  49553. n.Texture.call(this, e, t, i, r, o, a, s, l, c),
  49554. this.generateMipmaps = !1;
  49555. var u = this;
  49556. h()
  49557. }
  49558. ,
  49559. n.VideoTexture.prototype = Object.create(n.Texture.prototype),
  49560. n.VideoTexture.prototype.constructor = n.VideoTexture,
  49561. n.Group = function() {
  49562. n.Object3D.call(this),
  49563. this.type = "Group"
  49564. }
  49565. ,
  49566. n.Group.prototype = Object.create(n.Object3D.prototype),
  49567. n.Group.prototype.constructor = n.Group,
  49568. n.Points = function(e, t) {
  49569. n.Object3D.call(this),
  49570. this.type = "Points",
  49571. this.geometry = void 0 !== e ? e : new n.Geometry,
  49572. this.material = void 0 !== t ? t : new n.PointsMaterial({
  49573. color: 16777215 * Math.random()
  49574. })
  49575. }
  49576. ,
  49577. n.Points.prototype = Object.create(n.Object3D.prototype),
  49578. n.Points.prototype.constructor = n.Points,
  49579. n.Points.prototype.raycast = function() {
  49580. var e = new n.Matrix4
  49581. , t = new n.Ray
  49582. , i = new n.Sphere;
  49583. return function(r, o) {
  49584. function a(e, i) {
  49585. var n = t.distanceSqToPoint(e);
  49586. if (n < d) {
  49587. var a = t.closestPointToPoint(e);
  49588. a.applyMatrix4(c);
  49589. var l = r.ray.origin.distanceTo(a);
  49590. if (l < r.near || l > r.far)
  49591. return;
  49592. o.push({
  49593. distance: l,
  49594. distanceToRay: Math.sqrt(n),
  49595. point: a.clone(),
  49596. index: i,
  49597. face: null,
  49598. object: s
  49599. })
  49600. }
  49601. }
  49602. var s = this
  49603. , l = this.geometry
  49604. , c = this.matrixWorld
  49605. , h = r.params.Points.threshold;
  49606. if (null === l.boundingSphere && l.computeBoundingSphere(),
  49607. i.copy(l.boundingSphere),
  49608. i.applyMatrix4(c),
  49609. r.ray.intersectsSphere(i) !== !1) {
  49610. e.getInverse(c),
  49611. t.copy(r.ray).applyMatrix4(e);
  49612. var u = h / ((this.scale.x + this.scale.y + this.scale.z) / 3)
  49613. , d = u * u
  49614. , p = new n.Vector3;
  49615. if (l instanceof n.BufferGeometry) {
  49616. var f = l.index
  49617. , g = l.attributes
  49618. , m = g.position.array;
  49619. if (null !== f)
  49620. for (var v = f.array, A = 0, y = v.length; A < y; A++) {
  49621. var C = v[A];
  49622. p.fromArray(m, 3 * C),
  49623. a(p, C)
  49624. }
  49625. else
  49626. for (var A = 0, I = m.length / 3; A < I; A++)
  49627. p.fromArray(m, 3 * A),
  49628. a(p, A)
  49629. } else
  49630. for (var E = l.vertices, A = 0, I = E.length; A < I; A++)
  49631. a(E[A], A)
  49632. }
  49633. }
  49634. }(),
  49635. n.Points.prototype.clone = function() {
  49636. return new this.constructor(this.geometry,this.material).copy(this)
  49637. }
  49638. ,
  49639. n.Line = function(e, t, i) {
  49640. return 1 === i ? (console.warn("THREE.Line: parameter THREE.LinePieces no longer supported. Created THREE.LineSegments instead."),
  49641. new n.LineSegments(e,t)) : (n.Object3D.call(this),
  49642. this.type = "Line",
  49643. this.geometry = void 0 !== e ? e : new n.Geometry,
  49644. void (this.material = void 0 !== t ? t : new n.LineBasicMaterial({
  49645. color: 16777215 * Math.random()
  49646. })))
  49647. }
  49648. ,
  49649. n.Line.prototype = Object.create(n.Object3D.prototype),
  49650. n.Line.prototype.constructor = n.Line,
  49651. n.Line.prototype.raycast = function() {
  49652. var e = new n.Matrix4
  49653. , t = new n.Ray
  49654. , i = new n.Sphere;
  49655. return function(r, o) {
  49656. var a = r.linePrecision
  49657. , s = a * a
  49658. , l = this.geometry
  49659. , c = this.matrixWorld;
  49660. if (null === l.boundingSphere && l.computeBoundingSphere(),
  49661. i.copy(l.boundingSphere),
  49662. i.applyMatrix4(c),
  49663. r.ray.intersectsSphere(i) !== !1) {
  49664. e.getInverse(c),
  49665. t.copy(r.ray).applyMatrix4(e);
  49666. var h = new n.Vector3
  49667. , u = new n.Vector3
  49668. , d = new n.Vector3
  49669. , p = new n.Vector3
  49670. , f = this instanceof n.LineSegments ? 2 : 1;
  49671. if (l instanceof n.BufferGeometry) {
  49672. var g = l.index
  49673. , m = l.attributes
  49674. , v = m.position.array;
  49675. if (null !== g)
  49676. for (var A = g.array, y = 0, C = A.length - 1; y < C; y += f) {
  49677. var I = A[y]
  49678. , E = A[y + 1];
  49679. h.fromArray(v, 3 * I),
  49680. u.fromArray(v, 3 * E);
  49681. var b = t.distanceSqToSegment(h, u, p, d);
  49682. if (!(b > s)) {
  49683. p.applyMatrix4(this.matrixWorld);
  49684. var w = r.ray.origin.distanceTo(p);
  49685. w < r.near || w > r.far || o.push({
  49686. distance: w,
  49687. point: d.clone().applyMatrix4(this.matrixWorld),
  49688. index: y,
  49689. face: null,
  49690. faceIndex: null,
  49691. object: this
  49692. })
  49693. }
  49694. }
  49695. else
  49696. for (var y = 0, C = v.length / 3 - 1; y < C; y += f) {
  49697. h.fromArray(v, 3 * y),
  49698. u.fromArray(v, 3 * y + 3);
  49699. var b = t.distanceSqToSegment(h, u, p, d);
  49700. if (!(b > s)) {
  49701. p.applyMatrix4(this.matrixWorld);
  49702. var w = r.ray.origin.distanceTo(p);
  49703. w < r.near || w > r.far || o.push({
  49704. distance: w,
  49705. point: d.clone().applyMatrix4(this.matrixWorld),
  49706. index: y,
  49707. face: null,
  49708. faceIndex: null,
  49709. object: this
  49710. })
  49711. }
  49712. }
  49713. } else if (l instanceof n.Geometry)
  49714. for (var _ = l.vertices, T = _.length, y = 0; y < T - 1; y += f) {
  49715. var b = t.distanceSqToSegment(_[y], _[y + 1], p, d);
  49716. if (!(b > s)) {
  49717. p.applyMatrix4(this.matrixWorld);
  49718. var w = r.ray.origin.distanceTo(p);
  49719. w < r.near || w > r.far || o.push({
  49720. distance: w,
  49721. point: d.clone().applyMatrix4(this.matrixWorld),
  49722. index: y,
  49723. face: null,
  49724. faceIndex: null,
  49725. object: this
  49726. })
  49727. }
  49728. }
  49729. }
  49730. }
  49731. }(),
  49732. n.Line.prototype.clone = function() {
  49733. return new this.constructor(this.geometry,this.material).copy(this)
  49734. }
  49735. ,
  49736. n.LineStrip = 0,
  49737. n.LinePieces = 1,
  49738. n.LineSegments = function(e, t) {
  49739. n.Line.call(this, e, t),
  49740. this.type = "LineSegments"
  49741. }
  49742. ,
  49743. n.LineSegments.prototype = Object.create(n.Line.prototype),
  49744. n.LineSegments.prototype.constructor = n.LineSegments,
  49745. n.Mesh = function(e, t) {
  49746. n.Object3D.call(this),
  49747. this.type = "Mesh",
  49748. this.geometry = void 0 !== e ? e : new n.Geometry,
  49749. this.material = void 0 !== t ? t : new n.MeshBasicMaterial({
  49750. color: 16777215 * Math.random()
  49751. }),
  49752. this.drawMode = n.TrianglesDrawMode,
  49753. this.updateMorphTargets()
  49754. }
  49755. ,
  49756. n.Mesh.prototype = Object.create(n.Object3D.prototype),
  49757. n.Mesh.prototype.constructor = n.Mesh,
  49758. n.Mesh.prototype.setDrawMode = function(e) {
  49759. this.drawMode = e
  49760. }
  49761. ,
  49762. n.Mesh.prototype.updateMorphTargets = function() {
  49763. if (void 0 !== this.geometry.morphTargets && this.geometry.morphTargets.length > 0) {
  49764. this.morphTargetBase = -1,
  49765. this.morphTargetInfluences = [],
  49766. this.morphTargetDictionary = {};
  49767. for (var e = 0, t = this.geometry.morphTargets.length; e < t; e++)
  49768. this.morphTargetInfluences.push(0),
  49769. this.morphTargetDictionary[this.geometry.morphTargets[e].name] = e
  49770. }
  49771. }
  49772. ,
  49773. n.Mesh.prototype.getMorphTargetIndexByName = function(e) {
  49774. return void 0 !== this.morphTargetDictionary[e] ? this.morphTargetDictionary[e] : (console.warn("THREE.Mesh.getMorphTargetIndexByName: morph target " + e + " does not exist. Returning 0."),
  49775. 0)
  49776. }
  49777. ,
  49778. n.Mesh.prototype.raycast = function() {
  49779. function e(e, t, i, r, o, a, s) {
  49780. return n.Triangle.barycoordFromPoint(e, t, i, r, m),
  49781. o.multiplyScalar(m.x),
  49782. a.multiplyScalar(m.y),
  49783. s.multiplyScalar(m.z),
  49784. o.add(a).add(s),
  49785. o.clone()
  49786. }
  49787. function t(e, t, i, r, o, a, s) {
  49788. var l, c = e.material;
  49789. if (l = c.side === n.BackSide ? i.intersectTriangle(a, o, r, !0, s) : i.intersectTriangle(r, o, a, c.side !== n.DoubleSide, s),
  49790. null === l)
  49791. return null;
  49792. A.copy(s),
  49793. A.applyMatrix4(e.matrixWorld);
  49794. var h = t.ray.origin.distanceTo(A);
  49795. return h < t.near || h > t.far ? null : {
  49796. distance: h,
  49797. point: A.clone(),
  49798. object: e
  49799. }
  49800. }
  49801. function i(i, r, o, a, h, u, d, m) {
  49802. s.fromArray(a, 3 * u),
  49803. l.fromArray(a, 3 * d),
  49804. c.fromArray(a, 3 * m);
  49805. var A = t(i, r, o, s, l, c, v);
  49806. return A && (h && (p.fromArray(h, 2 * u),
  49807. f.fromArray(h, 2 * d),
  49808. g.fromArray(h, 2 * m),
  49809. A.uv = e(v, s, l, c, p, f, g)),
  49810. A.face = new n.Face3(u,d,m,n.Triangle.normal(s, l, c)),
  49811. A.faceIndex = u),
  49812. A
  49813. }
  49814. var r = new n.Matrix4
  49815. , o = new n.Ray
  49816. , a = new n.Sphere
  49817. , s = new n.Vector3
  49818. , l = new n.Vector3
  49819. , c = new n.Vector3
  49820. , h = new n.Vector3
  49821. , u = new n.Vector3
  49822. , d = new n.Vector3
  49823. , p = new n.Vector2
  49824. , f = new n.Vector2
  49825. , g = new n.Vector2
  49826. , m = new n.Vector3
  49827. , v = new n.Vector3
  49828. , A = new n.Vector3;
  49829. return function(m, A) {
  49830. var y = this.geometry
  49831. , C = this.material
  49832. , I = this.matrixWorld;
  49833. if (void 0 !== C && (null === y.boundingSphere && y.computeBoundingSphere(),
  49834. a.copy(y.boundingSphere),
  49835. a.applyMatrix4(I),
  49836. m.ray.intersectsSphere(a) !== !1 && (r.getInverse(I),
  49837. o.copy(m.ray).applyMatrix4(r),
  49838. null === y.boundingBox || o.intersectsBox(y.boundingBox) !== !1))) {
  49839. var E, b;
  49840. if (y instanceof n.BufferGeometry) {
  49841. var w, _, T, x = y.index, S = y.attributes, M = S.position.array;
  49842. if (void 0 !== S.uv && (E = S.uv.array),
  49843. null !== x)
  49844. for (var R = x.array, P = 0, O = R.length; P < O; P += 3)
  49845. w = R[P],
  49846. _ = R[P + 1],
  49847. T = R[P + 2],
  49848. b = i(this, m, o, M, E, w, _, T),
  49849. b && (b.faceIndex = Math.floor(P / 3),
  49850. A.push(b));
  49851. else
  49852. for (var P = 0, O = M.length; P < O; P += 9)
  49853. w = P / 3,
  49854. _ = w + 1,
  49855. T = w + 2,
  49856. b = i(this, m, o, M, E, w, _, T),
  49857. b && (b.index = w,
  49858. A.push(b))
  49859. } else if (y instanceof n.Geometry) {
  49860. 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];
  49861. k.length > 0 && (E = k);
  49862. for (var H = 0, G = U.length; H < G; H++) {
  49863. var z = U[H]
  49864. , W = B === !0 ? F[z.materialIndex] : C;
  49865. if (void 0 !== W) {
  49866. if (L = V[z.a],
  49867. D = V[z.b],
  49868. N = V[z.c],
  49869. W.morphTargets === !0) {
  49870. var j = y.morphTargets
  49871. , Y = this.morphTargetInfluences;
  49872. s.set(0, 0, 0),
  49873. l.set(0, 0, 0),
  49874. c.set(0, 0, 0);
  49875. for (var X = 0, Z = j.length; X < Z; X++) {
  49876. var q = Y[X];
  49877. if (0 !== q) {
  49878. var K = j[X].vertices;
  49879. s.addScaledVector(h.subVectors(K[z.a], L), q),
  49880. l.addScaledVector(u.subVectors(K[z.b], D), q),
  49881. c.addScaledVector(d.subVectors(K[z.c], N), q)
  49882. }
  49883. }
  49884. s.add(L),
  49885. l.add(D),
  49886. c.add(N),
  49887. L = s,
  49888. D = l,
  49889. N = c
  49890. }
  49891. if (b = t(this, m, o, L, D, N, v)) {
  49892. if (E) {
  49893. var Q = E[H];
  49894. p.copy(Q[0]),
  49895. f.copy(Q[1]),
  49896. g.copy(Q[2]),
  49897. b.uv = e(v, L, D, N, p, f, g)
  49898. }
  49899. b.face = z,
  49900. b.faceIndex = H,
  49901. A.push(b)
  49902. }
  49903. }
  49904. }
  49905. }
  49906. }
  49907. }
  49908. }(),
  49909. n.Mesh.prototype.clone = function() {
  49910. return new this.constructor(this.geometry,this.material).copy(this)
  49911. }
  49912. ,
  49913. n.Bone = function(e) {
  49914. n.Object3D.call(this),
  49915. this.type = "Bone",
  49916. this.skin = e
  49917. }
  49918. ,
  49919. n.Bone.prototype = Object.create(n.Object3D.prototype),
  49920. n.Bone.prototype.constructor = n.Bone,
  49921. n.Bone.prototype.copy = function(e) {
  49922. return n.Object3D.prototype.copy.call(this, e),
  49923. this.skin = e.skin,
  49924. this
  49925. }
  49926. ,
  49927. n.Skeleton = function(e, t, i) {
  49928. if (this.useVertexTexture = void 0 === i || i,
  49929. this.identityMatrix = new n.Matrix4,
  49930. e = e || [],
  49931. this.bones = e.slice(0),
  49932. this.useVertexTexture) {
  49933. var r = Math.sqrt(4 * this.bones.length);
  49934. r = n.Math.nextPowerOfTwo(Math.ceil(r)),
  49935. r = Math.max(r, 4),
  49936. this.boneTextureWidth = r,
  49937. this.boneTextureHeight = r,
  49938. this.boneMatrices = new Float32Array(this.boneTextureWidth * this.boneTextureHeight * 4),
  49939. this.boneTexture = new n.DataTexture(this.boneMatrices,this.boneTextureWidth,this.boneTextureHeight,n.RGBAFormat,n.FloatType)
  49940. } else
  49941. this.boneMatrices = new Float32Array(16 * this.bones.length);
  49942. if (void 0 === t)
  49943. this.calculateInverses();
  49944. else if (this.bones.length === t.length)
  49945. this.boneInverses = t.slice(0);
  49946. else {
  49947. console.warn("THREE.Skeleton bonInverses is the wrong length."),
  49948. this.boneInverses = [];
  49949. for (var o = 0, a = this.bones.length; o < a; o++)
  49950. this.boneInverses.push(new n.Matrix4)
  49951. }
  49952. }
  49953. ,
  49954. n.Skeleton.prototype.calculateInverses = function() {
  49955. this.boneInverses = [];
  49956. for (var e = 0, t = this.bones.length; e < t; e++) {
  49957. var i = new n.Matrix4;
  49958. this.bones[e] && i.getInverse(this.bones[e].matrixWorld),
  49959. this.boneInverses.push(i)
  49960. }
  49961. }
  49962. ,
  49963. n.Skeleton.prototype.pose = function() {
  49964. for (var e, t = 0, i = this.bones.length; t < i; t++)
  49965. e = this.bones[t],
  49966. e && e.matrixWorld.getInverse(this.boneInverses[t]);
  49967. for (var t = 0, i = this.bones.length; t < i; t++)
  49968. e = this.bones[t],
  49969. e && (e.parent ? (e.matrix.getInverse(e.parent.matrixWorld),
  49970. e.matrix.multiply(e.matrixWorld)) : e.matrix.copy(e.matrixWorld),
  49971. e.matrix.decompose(e.position, e.quaternion, e.scale));
  49972. }
  49973. ,
  49974. n.Skeleton.prototype.update = function() {
  49975. var e = new n.Matrix4;
  49976. return function() {
  49977. for (var t = 0, i = this.bones.length; t < i; t++) {
  49978. var n = this.bones[t] ? this.bones[t].matrixWorld : this.identityMatrix;
  49979. e.multiplyMatrices(n, this.boneInverses[t]),
  49980. e.flattenToArrayOffset(this.boneMatrices, 16 * t)
  49981. }
  49982. this.useVertexTexture && (this.boneTexture.needsUpdate = !0)
  49983. }
  49984. }(),
  49985. n.Skeleton.prototype.clone = function() {
  49986. return new n.Skeleton(this.bones,this.boneInverses,this.useVertexTexture)
  49987. }
  49988. ,
  49989. n.SkinnedMesh = function(e, t, i) {
  49990. n.Mesh.call(this, e, t),
  49991. this.type = "SkinnedMesh",
  49992. this.bindMode = "attached",
  49993. this.bindMatrix = new n.Matrix4,
  49994. this.bindMatrixInverse = new n.Matrix4;
  49995. var r = [];
  49996. if (this.geometry && void 0 !== this.geometry.bones) {
  49997. for (var o, a, s = 0, l = this.geometry.bones.length; s < l; ++s)
  49998. a = this.geometry.bones[s],
  49999. o = new n.Bone(this),
  50000. r.push(o),
  50001. o.name = a.name,
  50002. o.position.fromArray(a.pos),
  50003. o.quaternion.fromArray(a.rotq),
  50004. void 0 !== a.scl && o.scale.fromArray(a.scl);
  50005. for (var s = 0, l = this.geometry.bones.length; s < l; ++s)
  50006. a = this.geometry.bones[s],
  50007. a.parent !== -1 && null !== a.parent ? r[a.parent].add(r[s]) : this.add(r[s])
  50008. }
  50009. this.normalizeSkinWeights(),
  50010. this.updateMatrixWorld(!0),
  50011. this.bind(new n.Skeleton(r,void 0,i), this.matrixWorld)
  50012. }
  50013. ,
  50014. n.SkinnedMesh.prototype = Object.create(n.Mesh.prototype),
  50015. n.SkinnedMesh.prototype.constructor = n.SkinnedMesh,
  50016. n.SkinnedMesh.prototype.bind = function(e, t) {
  50017. this.skeleton = e,
  50018. void 0 === t && (this.updateMatrixWorld(!0),
  50019. this.skeleton.calculateInverses(),
  50020. t = this.matrixWorld),
  50021. this.bindMatrix.copy(t),
  50022. this.bindMatrixInverse.getInverse(t)
  50023. }
  50024. ,
  50025. n.SkinnedMesh.prototype.pose = function() {
  50026. this.skeleton.pose()
  50027. }
  50028. ,
  50029. n.SkinnedMesh.prototype.normalizeSkinWeights = function() {
  50030. if (this.geometry instanceof n.Geometry)
  50031. for (var e = 0; e < this.geometry.skinWeights.length; e++) {
  50032. var t = this.geometry.skinWeights[e]
  50033. , i = 1 / t.lengthManhattan();
  50034. i !== 1 / 0 ? t.multiplyScalar(i) : t.set(1, 0, 0, 0)
  50035. }
  50036. else if (this.geometry instanceof n.BufferGeometry)
  50037. for (var r = new n.Vector4, o = this.geometry.attributes.skinWeight, e = 0; e < o.count; e++) {
  50038. r.x = o.getX(e),
  50039. r.y = o.getY(e),
  50040. r.z = o.getZ(e),
  50041. r.w = o.getW(e);
  50042. var i = 1 / r.lengthManhattan();
  50043. i !== 1 / 0 ? r.multiplyScalar(i) : r.set(1, 0, 0, 0),
  50044. o.setXYZW(e, r.x, r.y, r.z, r.w)
  50045. }
  50046. }
  50047. ,
  50048. n.SkinnedMesh.prototype.updateMatrixWorld = function(e) {
  50049. n.Mesh.prototype.updateMatrixWorld.call(this, !0),
  50050. "attached" === this.bindMode ? this.bindMatrixInverse.getInverse(this.matrixWorld) : "detached" === this.bindMode ? this.bindMatrixInverse.getInverse(this.bindMatrix) : console.warn("THREE.SkinnedMesh unrecognized bindMode: " + this.bindMode)
  50051. }
  50052. ,
  50053. n.SkinnedMesh.prototype.clone = function() {
  50054. return new this.constructor(this.geometry,this.material,this.useVertexTexture).copy(this)
  50055. }
  50056. ,
  50057. n.LOD = function() {
  50058. n.Object3D.call(this),
  50059. this.type = "LOD",
  50060. Object.defineProperties(this, {
  50061. levels: {
  50062. enumerable: !0,
  50063. value: []
  50064. },
  50065. objects: {
  50066. get: function() {
  50067. return console.warn("THREE.LOD: .objects has been renamed to .levels."),
  50068. this.levels
  50069. }
  50070. }
  50071. })
  50072. }
  50073. ,
  50074. n.LOD.prototype = Object.create(n.Object3D.prototype),
  50075. n.LOD.prototype.constructor = n.LOD,
  50076. n.LOD.prototype.addLevel = function(e, t) {
  50077. void 0 === t && (t = 0),
  50078. t = Math.abs(t);
  50079. for (var i = this.levels, n = 0; n < i.length && !(t < i[n].distance); n++)
  50080. ;
  50081. i.splice(n, 0, {
  50082. distance: t,
  50083. object: e
  50084. }),
  50085. this.add(e)
  50086. }
  50087. ,
  50088. n.LOD.prototype.getObjectForDistance = function(e) {
  50089. for (var t = this.levels, i = 1, n = t.length; i < n && !(e < t[i].distance); i++)
  50090. ;
  50091. return t[i - 1].object
  50092. }
  50093. ,
  50094. n.LOD.prototype.raycast = function() {
  50095. var e = new n.Vector3;
  50096. return function(t, i) {
  50097. e.setFromMatrixPosition(this.matrixWorld);
  50098. var n = t.ray.origin.distanceTo(e);
  50099. this.getObjectForDistance(n).raycast(t, i)
  50100. }
  50101. }(),
  50102. n.LOD.prototype.update = function() {
  50103. var e = new n.Vector3
  50104. , t = new n.Vector3;
  50105. return function(i) {
  50106. var n = this.levels;
  50107. if (n.length > 1) {
  50108. e.setFromMatrixPosition(i.matrixWorld),
  50109. t.setFromMatrixPosition(this.matrixWorld);
  50110. var r = e.distanceTo(t);
  50111. n[0].object.visible = !0;
  50112. for (var o = 1, a = n.length; o < a && r >= n[o].distance; o++)
  50113. n[o - 1].object.visible = !1,
  50114. n[o].object.visible = !0;
  50115. for (; o < a; o++)
  50116. n[o].object.visible = !1
  50117. }
  50118. }
  50119. }(),
  50120. n.LOD.prototype.copy = function(e) {
  50121. n.Object3D.prototype.copy.call(this, e, !1);
  50122. for (var t = e.levels, i = 0, r = t.length; i < r; i++) {
  50123. var o = t[i];
  50124. this.addLevel(o.object.clone(), o.distance)
  50125. }
  50126. return this
  50127. }
  50128. ,
  50129. n.LOD.prototype.toJSON = function(e) {
  50130. var t = n.Object3D.prototype.toJSON.call(this, e);
  50131. t.object.levels = [];
  50132. for (var i = this.levels, r = 0, o = i.length; r < o; r++) {
  50133. var a = i[r];
  50134. t.object.levels.push({
  50135. object: a.object.uuid,
  50136. distance: a.distance
  50137. })
  50138. }
  50139. return t
  50140. }
  50141. ,
  50142. n.Sprite = function() {
  50143. var e = new Uint16Array([0, 1, 2, 0, 2, 3])
  50144. , t = new Float32Array([-.5, -.5, 0, .5, -.5, 0, .5, .5, 0, -.5, .5, 0])
  50145. , i = new Float32Array([0, 0, 1, 0, 1, 1, 0, 1])
  50146. , r = new n.BufferGeometry;
  50147. return r.setIndex(new n.BufferAttribute(e,1)),
  50148. r.addAttribute("position", new n.BufferAttribute(t,3)),
  50149. r.addAttribute("uv", new n.BufferAttribute(i,2)),
  50150. function(e) {
  50151. n.Object3D.call(this),
  50152. this.type = "Sprite",
  50153. this.geometry = r,
  50154. this.material = void 0 !== e ? e : new n.SpriteMaterial
  50155. }
  50156. }(),
  50157. n.Sprite.prototype = Object.create(n.Object3D.prototype),
  50158. n.Sprite.prototype.constructor = n.Sprite,
  50159. n.Sprite.prototype.raycast = function() {
  50160. var e = new n.Vector3;
  50161. return function(t, i) {
  50162. e.setFromMatrixPosition(this.matrixWorld);
  50163. var n = t.ray.distanceSqToPoint(e)
  50164. , r = this.scale.x * this.scale.y;
  50165. n > r || i.push({
  50166. distance: Math.sqrt(n),
  50167. point: this.position,
  50168. face: null,
  50169. object: this
  50170. })
  50171. }
  50172. }(),
  50173. n.Sprite.prototype.clone = function() {
  50174. return new this.constructor(this.material).copy(this)
  50175. }
  50176. ,
  50177. n.Particle = n.Sprite,
  50178. n.LensFlare = function(e, t, i, r, o) {
  50179. n.Object3D.call(this),
  50180. this.lensFlares = [],
  50181. this.positionScreen = new n.Vector3,
  50182. this.customUpdateCallback = void 0,
  50183. void 0 !== e && this.add(e, t, i, r, o)
  50184. }
  50185. ,
  50186. n.LensFlare.prototype = Object.create(n.Object3D.prototype),
  50187. n.LensFlare.prototype.constructor = n.LensFlare,
  50188. n.LensFlare.prototype.add = function(e, t, i, r, o, a) {
  50189. void 0 === t && (t = -1),
  50190. void 0 === i && (i = 0),
  50191. void 0 === a && (a = 1),
  50192. void 0 === o && (o = new n.Color(16777215)),
  50193. void 0 === r && (r = n.NormalBlending),
  50194. i = Math.min(i, Math.max(0, i)),
  50195. this.lensFlares.push({
  50196. texture: e,
  50197. size: t,
  50198. distance: i,
  50199. x: 0,
  50200. y: 0,
  50201. z: 0,
  50202. scale: 1,
  50203. rotation: 0,
  50204. opacity: a,
  50205. color: o,
  50206. blending: r
  50207. })
  50208. }
  50209. ,
  50210. n.LensFlare.prototype.updateLensFlares = function() {
  50211. var e, t, i = this.lensFlares.length, n = 2 * -this.positionScreen.x, r = 2 * -this.positionScreen.y;
  50212. for (e = 0; e < i; e++)
  50213. t = this.lensFlares[e],
  50214. t.x = this.positionScreen.x + n * t.distance,
  50215. t.y = this.positionScreen.y + r * t.distance,
  50216. t.wantedRotation = t.x * Math.PI * .25,
  50217. t.rotation += .25 * (t.wantedRotation - t.rotation)
  50218. }
  50219. ,
  50220. n.LensFlare.prototype.copy = function(e) {
  50221. n.Object3D.prototype.copy.call(this, e),
  50222. this.positionScreen.copy(e.positionScreen),
  50223. this.customUpdateCallback = e.customUpdateCallback;
  50224. for (var t = 0, i = e.lensFlares.length; t < i; t++)
  50225. this.lensFlares.push(e.lensFlares[t]);
  50226. return this
  50227. }
  50228. ,
  50229. n.Scene = function() {
  50230. n.Object3D.call(this),
  50231. this.type = "Scene",
  50232. this.fog = null,
  50233. this.overrideMaterial = null,
  50234. this.autoUpdate = !0
  50235. }
  50236. ,
  50237. n.Scene.prototype = Object.create(n.Object3D.prototype),
  50238. n.Scene.prototype.constructor = n.Scene,
  50239. n.Scene.prototype.copy = function(e, t) {
  50240. return n.Object3D.prototype.copy.call(this, e, t),
  50241. null !== e.fog && (this.fog = e.fog.clone()),
  50242. null !== e.overrideMaterial && (this.overrideMaterial = e.overrideMaterial.clone()),
  50243. this.autoUpdate = e.autoUpdate,
  50244. this.matrixAutoUpdate = e.matrixAutoUpdate,
  50245. this
  50246. }
  50247. ,
  50248. n.Fog = function(e, t, i) {
  50249. this.name = "",
  50250. this.color = new n.Color(e),
  50251. this.near = void 0 !== t ? t : 1,
  50252. this.far = void 0 !== i ? i : 1e3
  50253. }
  50254. ,
  50255. n.Fog.prototype.clone = function() {
  50256. return new n.Fog(this.color.getHex(),this.near,this.far)
  50257. }
  50258. ,
  50259. n.FogExp2 = function(e, t) {
  50260. this.name = "",
  50261. this.color = new n.Color(e),
  50262. this.density = void 0 !== t ? t : 25e-5
  50263. }
  50264. ,
  50265. n.FogExp2.prototype.clone = function() {
  50266. return new n.FogExp2(this.color.getHex(),this.density)
  50267. }
  50268. ,
  50269. n.ShaderChunk = {},
  50270. n.ShaderChunk.alphamap_fragment = "#ifdef USE_ALPHAMAP\n\tdiffuseColor.a *= texture2D( alphaMap, vUv ).g;\n#endif\n",
  50271. n.ShaderChunk.alphamap_pars_fragment = "#ifdef USE_ALPHAMAP\n\tuniform sampler2D alphaMap;\n#endif\n",
  50272. n.ShaderChunk.alphatest_fragment = "#ifdef ALPHATEST\n\tif ( diffuseColor.a < ALPHATEST ) discard;\n#endif\n",
  50273. 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",
  50274. n.ShaderChunk.aomap_pars_fragment = "#ifdef USE_AOMAP\n\tuniform sampler2D aoMap;\n\tuniform float aoMapIntensity;\n#endif",
  50275. n.ShaderChunk.begin_vertex = "\nvec3 transformed = vec3( position );\n",
  50276. n.ShaderChunk.beginnormal_vertex = "\nvec3 objectNormal = vec3( normal );\n",
  50277. 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",
  50278. 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",
  50279. n.ShaderChunk.color_fragment = "#ifdef USE_COLOR\n\tdiffuseColor.rgb *= vColor;\n#endif",
  50280. n.ShaderChunk.color_pars_fragment = "#ifdef USE_COLOR\n\tvarying vec3 vColor;\n#endif\n",
  50281. n.ShaderChunk.color_pars_vertex = "#ifdef USE_COLOR\n\tvarying vec3 vColor;\n#endif",
  50282. n.ShaderChunk.color_vertex = "#ifdef USE_COLOR\n\tvColor.xyz = color.xyz;\n#endif",
  50283. 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",
  50284. 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",
  50285. n.ShaderChunk.defaultnormal_vertex = "#ifdef FLIP_SIDED\n\tobjectNormal = -objectNormal;\n#endif\nvec3 transformedNormal = normalMatrix * objectNormal;\n",
  50286. n.ShaderChunk.displacementmap_vertex = "#ifdef USE_DISPLACEMENTMAP\n\ttransformed += normal * ( texture2D( displacementMap, uv ).x * displacementScale + displacementBias );\n#endif\n",
  50287. n.ShaderChunk.displacementmap_pars_vertex = "#ifdef USE_DISPLACEMENTMAP\n\tuniform sampler2D displacementMap;\n\tuniform float displacementScale;\n\tuniform float displacementBias;\n#endif\n",
  50288. 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",
  50289. n.ShaderChunk.emissivemap_pars_fragment = "#ifdef USE_EMISSIVEMAP\n\tuniform sampler2D emissiveMap;\n#endif\n",
  50290. 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",
  50291. n.ShaderChunk.encodings_fragment = " gl_FragColor = linearToOutputTexel( gl_FragColor );\n",
  50292. 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",
  50293. 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",
  50294. 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",
  50295. 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",
  50296. 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",
  50297. 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",
  50298. n.ShaderChunk.lightmap_fragment = "#ifdef USE_LIGHTMAP\n\treflectedLight.indirectDiffuse += PI * texture2D( lightMap, vUv2 ).xyz * lightMapIntensity;\n#endif\n",
  50299. n.ShaderChunk.lightmap_pars_fragment = "#ifdef USE_LIGHTMAP\n\tuniform sampler2D lightMap;\n\tuniform float lightMapIntensity;\n#endif",
  50300. 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",
  50301. 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",
  50302. n.ShaderChunk.lights_phong_fragment = "BlinnPhongMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;\nmaterial.specularColor = specular;\nmaterial.specularShininess = shininess;\nmaterial.specularStrength = specularStrength;\n",
  50303. 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",
  50304. n.ShaderChunk.lights_phong_pars_vertex = "#ifdef USE_ENVMAP\n\tvarying vec3 vWorldPosition;\n#endif\n",
  50305. n.ShaderChunk.lights_phong_vertex = "#ifdef USE_ENVMAP\n\tvWorldPosition = worldPosition.xyz;\n#endif\n",
  50306. 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",
  50307. 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",
  50308. 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",
  50309. n.ShaderChunk.logdepthbuf_fragment = "#if defined(USE_LOGDEPTHBUF) && defined(USE_LOGDEPTHBUF_EXT)\n\tgl_FragDepthEXT = log2(vFragDepth) * logDepthBufFC * 0.5;\n#endif",
  50310. 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",
  50311. 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",
  50312. 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",
  50313. n.ShaderChunk.map_fragment = "#ifdef USE_MAP\n\tvec4 texelColor = texture2D( map, vUv );\n\ttexelColor = mapTexelToLinear( texelColor );\n\tdiffuseColor *= texelColor;\n#endif\n",
  50314. n.ShaderChunk.map_pars_fragment = "#ifdef USE_MAP\n\tuniform sampler2D map;\n#endif\n",
  50315. 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",
  50316. n.ShaderChunk.map_particle_pars_fragment = "#ifdef USE_MAP\n\tuniform vec4 offsetRepeat;\n\tuniform sampler2D map;\n#endif\n",
  50317. n.ShaderChunk.metalnessmap_fragment = "float metalnessFactor = metalness;\n#ifdef USE_METALNESSMAP\n\tvec4 texelMetalness = texture2D( metalnessMap, vUv );\n\tmetalnessFactor *= texelMetalness.r;\n#endif\n",
  50318. n.ShaderChunk.metalnessmap_pars_fragment = "#ifdef USE_METALNESSMAP\n\tuniform sampler2D metalnessMap;\n#endif",
  50319. 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",
  50320. 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";
  50321. 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";
  50322. 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",
  50323. 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",
  50324. n.ShaderChunk.premultiplied_alpha_fragment = "#ifdef PREMULTIPLIED_ALPHA\n\tgl_FragColor.rgb *= gl_FragColor.a;\n#endif\n",
  50325. 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",
  50326. n.ShaderChunk.roughnessmap_fragment = "float roughnessFactor = roughness;\n#ifdef USE_ROUGHNESSMAP\n\tvec4 texelRoughness = texture2D( roughnessMap, vUv );\n\troughnessFactor *= texelRoughness.r;\n#endif\n",
  50327. n.ShaderChunk.roughnessmap_pars_fragment = "#ifdef USE_ROUGHNESSMAP\n\tuniform sampler2D roughnessMap;\n#endif",
  50328. 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",
  50329. 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",
  50330. 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",
  50331. 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",
  50332. 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",
  50333. 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",
  50334. 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",
  50335. 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",
  50336. 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",
  50337. n.ShaderChunk.specularmap_pars_fragment = "#ifdef USE_SPECULARMAP\n\tuniform sampler2D specularMap;\n#endif",
  50338. n.ShaderChunk.tonemapping_fragment = "#if defined( TONE_MAPPING )\n gl_FragColor.rgb = toneMapping( gl_FragColor.rgb );\n#endif\n",
  50339. 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",
  50340. n.ShaderChunk.uv2_pars_fragment = "#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tvarying vec2 vUv2;\n#endif",
  50341. n.ShaderChunk.uv2_pars_vertex = "#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tattribute vec2 uv2;\n\tvarying vec2 vUv2;\n#endif",
  50342. n.ShaderChunk.uv2_vertex = "#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tvUv2 = uv2;\n#endif",
  50343. 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",
  50344. 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",
  50345. 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",
  50346. 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",
  50347. n.UniformsUtils = {
  50348. merge: function(e) {
  50349. for (var t = {}, i = 0; i < e.length; i++) {
  50350. var n = this.clone(e[i]);
  50351. for (var r in n)
  50352. t[r] = n[r]
  50353. }
  50354. return t
  50355. },
  50356. clone: function(e) {
  50357. var t = {};
  50358. for (var i in e) {
  50359. t[i] = {};
  50360. for (var r in e[i]) {
  50361. var o = e[i][r];
  50362. 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
  50363. }
  50364. }
  50365. return t
  50366. }
  50367. },
  50368. n.UniformsLib = {
  50369. common: {
  50370. diffuse: {
  50371. type: "c",
  50372. value: new n.Color(15658734)
  50373. },
  50374. opacity: {
  50375. type: "f",
  50376. value: 1
  50377. },
  50378. map: {
  50379. type: "t",
  50380. value: null
  50381. },
  50382. offsetRepeat: {
  50383. type: "v4",
  50384. value: new n.Vector4(0,0,1,1)
  50385. },
  50386. specularMap: {
  50387. type: "t",
  50388. value: null
  50389. },
  50390. alphaMap: {
  50391. type: "t",
  50392. value: null
  50393. },
  50394. envMap: {
  50395. type: "t",
  50396. value: null
  50397. },
  50398. flipEnvMap: {
  50399. type: "f",
  50400. value: -1
  50401. },
  50402. reflectivity: {
  50403. type: "f",
  50404. value: 1
  50405. },
  50406. refractionRatio: {
  50407. type: "f",
  50408. value: .98
  50409. }
  50410. },
  50411. aomap: {
  50412. aoMap: {
  50413. type: "t",
  50414. value: null
  50415. },
  50416. aoMapIntensity: {
  50417. type: "f",
  50418. value: 1
  50419. }
  50420. },
  50421. lightmap: {
  50422. lightMap: {
  50423. type: "t",
  50424. value: null
  50425. },
  50426. lightMapIntensity: {
  50427. type: "f",
  50428. value: 1
  50429. }
  50430. },
  50431. emissivemap: {
  50432. emissiveMap: {
  50433. type: "t",
  50434. value: null
  50435. }
  50436. },
  50437. bumpmap: {
  50438. bumpMap: {
  50439. type: "t",
  50440. value: null
  50441. },
  50442. bumpScale: {
  50443. type: "f",
  50444. value: 1
  50445. }
  50446. },
  50447. normalmap: {
  50448. normalMap: {
  50449. type: "t",
  50450. value: null
  50451. },
  50452. normalScale: {
  50453. type: "v2",
  50454. value: new n.Vector2(1,1)
  50455. }
  50456. },
  50457. displacementmap: {
  50458. displacementMap: {
  50459. type: "t",
  50460. value: null
  50461. },
  50462. displacementScale: {
  50463. type: "f",
  50464. value: 1
  50465. },
  50466. displacementBias: {
  50467. type: "f",
  50468. value: 0
  50469. }
  50470. },
  50471. roughnessmap: {
  50472. roughnessMap: {
  50473. type: "t",
  50474. value: null
  50475. }
  50476. },
  50477. metalnessmap: {
  50478. metalnessMap: {
  50479. type: "t",
  50480. value: null
  50481. }
  50482. },
  50483. fog: {
  50484. fogDensity: {
  50485. type: "f",
  50486. value: 25e-5
  50487. },
  50488. fogNear: {
  50489. type: "f",
  50490. value: 1
  50491. },
  50492. fogFar: {
  50493. type: "f",
  50494. value: 2e3
  50495. },
  50496. fogColor: {
  50497. type: "c",
  50498. value: new n.Color(16777215)
  50499. }
  50500. },
  50501. lights: {
  50502. ambientLightColor: {
  50503. type: "fv",
  50504. value: []
  50505. },
  50506. directionalLights: {
  50507. type: "sa",
  50508. value: [],
  50509. properties: {
  50510. direction: {
  50511. type: "v3"
  50512. },
  50513. color: {
  50514. type: "c"
  50515. },
  50516. shadow: {
  50517. type: "i"
  50518. },
  50519. shadowBias: {
  50520. type: "f"
  50521. },
  50522. shadowRadius: {
  50523. type: "f"
  50524. },
  50525. shadowMapSize: {
  50526. type: "v2"
  50527. }
  50528. }
  50529. },
  50530. directionalShadowMap: {
  50531. type: "tv",
  50532. value: []
  50533. },
  50534. directionalShadowMatrix: {
  50535. type: "m4v",
  50536. value: []
  50537. },
  50538. spotLights: {
  50539. type: "sa",
  50540. value: [],
  50541. properties: {
  50542. color: {
  50543. type: "c"
  50544. },
  50545. position: {
  50546. type: "v3"
  50547. },
  50548. direction: {
  50549. type: "v3"
  50550. },
  50551. distance: {
  50552. type: "f"
  50553. },
  50554. coneCos: {
  50555. type: "f"
  50556. },
  50557. penumbraCos: {
  50558. type: "f"
  50559. },
  50560. decay: {
  50561. type: "f"
  50562. },
  50563. shadow: {
  50564. type: "i"
  50565. },
  50566. shadowBias: {
  50567. type: "f"
  50568. },
  50569. shadowRadius: {
  50570. type: "f"
  50571. },
  50572. shadowMapSize: {
  50573. type: "v2"
  50574. }
  50575. }
  50576. },
  50577. spotShadowMap: {
  50578. type: "tv",
  50579. value: []
  50580. },
  50581. spotShadowMatrix: {
  50582. type: "m4v",
  50583. value: []
  50584. },
  50585. pointLights: {
  50586. type: "sa",
  50587. value: [],
  50588. properties: {
  50589. color: {
  50590. type: "c"
  50591. },
  50592. position: {
  50593. type: "v3"
  50594. },
  50595. decay: {
  50596. type: "f"
  50597. },
  50598. distance: {
  50599. type: "f"
  50600. },
  50601. shadow: {
  50602. type: "i"
  50603. },
  50604. shadowBias: {
  50605. type: "f"
  50606. },
  50607. shadowRadius: {
  50608. type: "f"
  50609. },
  50610. shadowMapSize: {
  50611. type: "v2"
  50612. }
  50613. }
  50614. },
  50615. pointShadowMap: {
  50616. type: "tv",
  50617. value: []
  50618. },
  50619. pointShadowMatrix: {
  50620. type: "m4v",
  50621. value: []
  50622. },
  50623. hemisphereLights: {
  50624. type: "sa",
  50625. value: [],
  50626. properties: {
  50627. direction: {
  50628. type: "v3"
  50629. },
  50630. skyColor: {
  50631. type: "c"
  50632. },
  50633. groundColor: {
  50634. type: "c"
  50635. }
  50636. }
  50637. }
  50638. },
  50639. points: {
  50640. diffuse: {
  50641. type: "c",
  50642. value: new n.Color(15658734)
  50643. },
  50644. opacity: {
  50645. type: "f",
  50646. value: 1
  50647. },
  50648. size: {
  50649. type: "f",
  50650. value: 1
  50651. },
  50652. scale: {
  50653. type: "f",
  50654. value: 1
  50655. },
  50656. map: {
  50657. type: "t",
  50658. value: null
  50659. },
  50660. offsetRepeat: {
  50661. type: "v4",
  50662. value: new n.Vector4(0,0,1,1)
  50663. }
  50664. }
  50665. },
  50666. 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",
  50667. 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",
  50668. 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",
  50669. 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",
  50670. 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",
  50671. 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",
  50672. 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",
  50673. 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",
  50674. 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",
  50675. 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",
  50676. 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",
  50677. 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",
  50678. 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",
  50679. 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",
  50680. 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",
  50681. 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",
  50682. 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",
  50683. 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",
  50684. 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",
  50685. 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",
  50686. 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",
  50687. 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",
  50688. 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",
  50689. 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",
  50690. n.ShaderLib = {
  50691. basic: {
  50692. uniforms: n.UniformsUtils.merge([n.UniformsLib.common, n.UniformsLib.aomap, n.UniformsLib.fog]),
  50693. vertexShader: n.ShaderChunk.meshbasic_vert,
  50694. fragmentShader: n.ShaderChunk.meshbasic_frag
  50695. },
  50696. lambert: {
  50697. uniforms: n.UniformsUtils.merge([n.UniformsLib.common, n.UniformsLib.aomap, n.UniformsLib.lightmap, n.UniformsLib.emissivemap, n.UniformsLib.fog, n.UniformsLib.lights, {
  50698. emissive: {
  50699. type: "c",
  50700. value: new n.Color(0)
  50701. }
  50702. }]),
  50703. vertexShader: n.ShaderChunk.meshlambert_vert,
  50704. fragmentShader: n.ShaderChunk.meshlambert_frag
  50705. },
  50706. phong: {
  50707. 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, {
  50708. emissive: {
  50709. type: "c",
  50710. value: new n.Color(0)
  50711. },
  50712. specular: {
  50713. type: "c",
  50714. value: new n.Color(1118481)
  50715. },
  50716. shininess: {
  50717. type: "f",
  50718. value: 30
  50719. }
  50720. }]),
  50721. vertexShader: n.ShaderChunk.meshphong_vert,
  50722. fragmentShader: n.ShaderChunk.meshphong_frag
  50723. },
  50724. standard: {
  50725. 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, {
  50726. emissive: {
  50727. type: "c",
  50728. value: new n.Color(0)
  50729. },
  50730. roughness: {
  50731. type: "f",
  50732. value: .5
  50733. },
  50734. metalness: {
  50735. type: "f",
  50736. value: 0
  50737. },
  50738. envMapIntensity: {
  50739. type: "f",
  50740. value: 1
  50741. }
  50742. }]),
  50743. vertexShader: n.ShaderChunk.meshstandard_vert,
  50744. fragmentShader: n.ShaderChunk.meshstandard_frag
  50745. },
  50746. points: {
  50747. uniforms: n.UniformsUtils.merge([n.UniformsLib.points, n.UniformsLib.fog]),
  50748. vertexShader: n.ShaderChunk.points_vert,
  50749. fragmentShader: n.ShaderChunk.points_frag
  50750. },
  50751. dashed: {
  50752. uniforms: n.UniformsUtils.merge([n.UniformsLib.common, n.UniformsLib.fog, {
  50753. scale: {
  50754. type: "f",
  50755. value: 1
  50756. },
  50757. dashSize: {
  50758. type: "f",
  50759. value: 1
  50760. },
  50761. totalSize: {
  50762. type: "f",
  50763. value: 2
  50764. }
  50765. }]),
  50766. vertexShader: n.ShaderChunk.linedashed_vert,
  50767. fragmentShader: n.ShaderChunk.linedashed_frag
  50768. },
  50769. depth: {
  50770. uniforms: {
  50771. mNear: {
  50772. type: "f",
  50773. value: 1
  50774. },
  50775. mFar: {
  50776. type: "f",
  50777. value: 2e3
  50778. },
  50779. opacity: {
  50780. type: "f",
  50781. value: 1
  50782. }
  50783. },
  50784. vertexShader: n.ShaderChunk.depth_vert,
  50785. fragmentShader: n.ShaderChunk.depth_frag
  50786. },
  50787. normal: {
  50788. uniforms: {
  50789. opacity: {
  50790. type: "f",
  50791. value: 1
  50792. }
  50793. },
  50794. vertexShader: n.ShaderChunk.normal_vert,
  50795. fragmentShader: n.ShaderChunk.normal_frag
  50796. },
  50797. cube: {
  50798. uniforms: {
  50799. tCube: {
  50800. type: "t",
  50801. value: null
  50802. },
  50803. tFlip: {
  50804. type: "f",
  50805. value: -1
  50806. }
  50807. },
  50808. vertexShader: n.ShaderChunk.cube_vert,
  50809. fragmentShader: n.ShaderChunk.cube_frag
  50810. },
  50811. equirect: {
  50812. uniforms: {
  50813. tEquirect: {
  50814. type: "t",
  50815. value: null
  50816. },
  50817. tFlip: {
  50818. type: "f",
  50819. value: -1
  50820. }
  50821. },
  50822. vertexShader: n.ShaderChunk.equirect_vert,
  50823. fragmentShader: n.ShaderChunk.equirect_frag
  50824. },
  50825. depthRGBA: {
  50826. uniforms: {},
  50827. vertexShader: n.ShaderChunk.depthRGBA_vert,
  50828. fragmentShader: n.ShaderChunk.depthRGBA_frag
  50829. },
  50830. distanceRGBA: {
  50831. uniforms: {
  50832. lightPos: {
  50833. type: "v3",
  50834. value: new n.Vector3(0,0,0)
  50835. }
  50836. },
  50837. vertexShader: n.ShaderChunk.distanceRGBA_vert,
  50838. fragmentShader: n.ShaderChunk.distanceRGBA_frag
  50839. }
  50840. },
  50841. n.WebGLRenderer = function(e) {
  50842. function t() {
  50843. return null === ye ? Oe : 1
  50844. }
  50845. function i(e, t, i, n) {
  50846. se === !0 && (e *= n,
  50847. t *= n,
  50848. i *= n),
  50849. Ye.clearColor(e, t, i, n)
  50850. }
  50851. function r() {
  50852. Ye.init(),
  50853. Ye.scissor(we.copy(Le).multiplyScalar(Oe)),
  50854. Ye.viewport(Te.copy(Ne).multiplyScalar(Oe)),
  50855. i(Se.r, Se.g, Se.b, Me)
  50856. }
  50857. function o() {
  50858. Ae = null,
  50859. be = null,
  50860. Ee = "",
  50861. Ie = -1,
  50862. Ye.reset()
  50863. }
  50864. function a(e) {
  50865. e.preventDefault(),
  50866. o(),
  50867. r(),
  50868. Xe.clear()
  50869. }
  50870. function s(e) {
  50871. var t = e.target;
  50872. t.removeEventListener("dispose", s),
  50873. h(t),
  50874. ke.textures--
  50875. }
  50876. function l(e) {
  50877. var t = e.target;
  50878. t.removeEventListener("dispose", l),
  50879. u(t),
  50880. ke.textures--
  50881. }
  50882. function c(e) {
  50883. var t = e.target;
  50884. t.removeEventListener("dispose", c),
  50885. d(t)
  50886. }
  50887. function h(e) {
  50888. var t = Xe.get(e);
  50889. if (e.image && t.__image__webglTextureCube)
  50890. Ge.deleteTexture(t.__image__webglTextureCube);
  50891. else {
  50892. if (void 0 === t.__webglInit)
  50893. return;
  50894. Ge.deleteTexture(t.__webglTexture)
  50895. }
  50896. Xe.delete(e)
  50897. }
  50898. function u(e) {
  50899. var t = Xe.get(e)
  50900. , i = Xe.get(e.texture);
  50901. if (e && void 0 !== i.__webglTexture) {
  50902. if (Ge.deleteTexture(i.__webglTexture),
  50903. e instanceof n.WebGLRenderTargetCube)
  50904. for (var r = 0; r < 6; r++)
  50905. Ge.deleteFramebuffer(t.__webglFramebuffer[r]),
  50906. Ge.deleteRenderbuffer(t.__webglDepthbuffer[r]);
  50907. else
  50908. Ge.deleteFramebuffer(t.__webglFramebuffer),
  50909. Ge.deleteRenderbuffer(t.__webglDepthbuffer);
  50910. Xe.delete(e.texture),
  50911. Xe.delete(e)
  50912. }
  50913. }
  50914. function d(e) {
  50915. p(e),
  50916. Xe.delete(e)
  50917. }
  50918. function p(e) {
  50919. var t = Xe.get(e).program;
  50920. e.program = void 0,
  50921. void 0 !== t && qe.releaseProgram(t)
  50922. }
  50923. function f(e, t, i, r) {
  50924. var o;
  50925. if (i instanceof n.InstancedBufferGeometry && (o = We.get("ANGLE_instanced_arrays"),
  50926. null === o))
  50927. return void console.error("THREE.WebGLRenderer.setupVertexAttributes: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");
  50928. void 0 === r && (r = 0),
  50929. Ye.initAttributes();
  50930. var a = i.attributes
  50931. , s = t.getAttributes()
  50932. , l = e.defaultAttributeValues;
  50933. for (var c in s) {
  50934. var h = s[c];
  50935. if (h >= 0) {
  50936. var u = a[c];
  50937. if (void 0 !== u) {
  50938. var d = u.itemSize
  50939. , p = Ze.getAttributeBuffer(u);
  50940. if (u instanceof n.InterleavedBufferAttribute) {
  50941. var f = u.data
  50942. , g = f.stride
  50943. , m = u.offset;
  50944. f instanceof n.InstancedInterleavedBuffer ? (Ye.enableAttributeAndDivisor(h, f.meshPerAttribute, o),
  50945. void 0 === i.maxInstancedCount && (i.maxInstancedCount = f.meshPerAttribute * f.count)) : Ye.enableAttribute(h),
  50946. Ge.bindBuffer(Ge.ARRAY_BUFFER, p),
  50947. Ge.vertexAttribPointer(h, d, Ge.FLOAT, !1, g * f.array.BYTES_PER_ELEMENT, (r * g + m) * f.array.BYTES_PER_ELEMENT)
  50948. } else
  50949. u instanceof n.InstancedBufferAttribute ? (Ye.enableAttributeAndDivisor(h, u.meshPerAttribute, o),
  50950. void 0 === i.maxInstancedCount && (i.maxInstancedCount = u.meshPerAttribute * u.count)) : Ye.enableAttribute(h),
  50951. Ge.bindBuffer(Ge.ARRAY_BUFFER, p),
  50952. Ge.vertexAttribPointer(h, d, Ge.FLOAT, !1, 0, r * d * 4)
  50953. } else if (void 0 !== l) {
  50954. var v = l[c];
  50955. if (void 0 !== v)
  50956. switch (v.length) {
  50957. case 2:
  50958. Ge.vertexAttrib2fv(h, v);
  50959. break;
  50960. case 3:
  50961. Ge.vertexAttrib3fv(h, v);
  50962. break;
  50963. case 4:
  50964. Ge.vertexAttrib4fv(h, v);
  50965. break;
  50966. default:
  50967. Ge.vertexAttrib1fv(h, v)
  50968. }
  50969. }
  50970. }
  50971. }
  50972. Ye.disableUnusedAttributes()
  50973. }
  50974. function g(e, t) {
  50975. return Math.abs(t[0]) - Math.abs(e[0])
  50976. }
  50977. function m(e, t) {
  50978. 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
  50979. }
  50980. function v(e, t) {
  50981. 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
  50982. }
  50983. function A(e, t, i, n, r) {
  50984. var o, a;
  50985. i.transparent ? (o = de,
  50986. a = ++pe) : (o = he,
  50987. a = ++ue);
  50988. var s = o[a];
  50989. void 0 !== s ? (s.id = e.id,
  50990. s.object = e,
  50991. s.geometry = t,
  50992. s.material = i,
  50993. s.z = Ve.z,
  50994. s.group = r) : (s = {
  50995. id: e.id,
  50996. object: e,
  50997. geometry: t,
  50998. material: i,
  50999. z: Ve.z,
  51000. group: r
  51001. },
  51002. o.push(s))
  51003. }
  51004. function y(e, t) {
  51005. if (e.visible !== !1) {
  51006. if (e.layers.test(t.layers))
  51007. if (e instanceof n.Light)
  51008. ce.push(e);
  51009. else if (e instanceof n.Sprite)
  51010. e.frustumCulled !== !1 && Be.intersectsObject(e) !== !0 || ge.push(e);
  51011. else if (e instanceof n.LensFlare)
  51012. me.push(e);
  51013. else if (e instanceof n.ImmediateRenderObject)
  51014. ve.sortObjects === !0 && (Ve.setFromMatrixPosition(e.matrixWorld),
  51015. Ve.applyProjection(Fe)),
  51016. A(e, null, e.material, Ve.z, null);
  51017. else if ((e instanceof n.Mesh || e instanceof n.Line || e instanceof n.Points) && (e instanceof n.SkinnedMesh && e.skeleton.update(),
  51018. e.frustumCulled === !1 || Be.intersectsObject(e) === !0)) {
  51019. var i = e.material;
  51020. if (i.visible === !0) {
  51021. ve.sortObjects === !0 && (Ve.setFromMatrixPosition(e.matrixWorld),
  51022. Ve.applyProjection(Fe));
  51023. var r = Ze.update(e);
  51024. if (i instanceof n.MultiMaterial)
  51025. for (var o = r.groups, a = i.materials, s = 0, l = o.length; s < l; s++) {
  51026. var c = o[s]
  51027. , h = a[c.materialIndex];
  51028. h.visible === !0 && A(e, r, h, Ve.z, c)
  51029. }
  51030. else
  51031. A(e, r, i, Ve.z, null)
  51032. }
  51033. }
  51034. for (var u = e.children, s = 0, l = u.length; s < l; s++)
  51035. y(u[s], t)
  51036. }
  51037. }
  51038. function C(e, t, i, r) {
  51039. for (var o = 0, a = e.length; o < a; o++) {
  51040. var s = e[o]
  51041. , l = s.object
  51042. , c = s.geometry
  51043. , h = void 0 === r ? s.material : r
  51044. , u = s.group;
  51045. if (l.modelViewMatrix.multiplyMatrices(t.matrixWorldInverse, l.matrixWorld),
  51046. l.normalMatrix.getNormalMatrix(l.modelViewMatrix),
  51047. l instanceof n.ImmediateRenderObject) {
  51048. E(h);
  51049. var d = w(t, i, h, l);
  51050. Ee = "",
  51051. l.render(function(e) {
  51052. ve.renderBufferImmediate(e, d, h)
  51053. })
  51054. } else
  51055. ve.renderBufferDirect(t, i, c, h, l, u)
  51056. }
  51057. }
  51058. function I(e, t, i) {
  51059. var r = Xe.get(e)
  51060. , o = qe.getParameters(e, Ue, t, i)
  51061. , a = qe.getProgramCode(e, o)
  51062. , s = r.program
  51063. , l = !0;
  51064. if (void 0 === s)
  51065. e.addEventListener("dispose", c);
  51066. else if (s.code !== a)
  51067. p(e);
  51068. else {
  51069. if (void 0 !== o.shaderID)
  51070. return;
  51071. l = !1
  51072. }
  51073. if (l) {
  51074. if (o.shaderID) {
  51075. var h = n.ShaderLib[o.shaderID];
  51076. r.__webglShader = {
  51077. name: e.type,
  51078. uniforms: n.UniformsUtils.clone(h.uniforms),
  51079. vertexShader: h.vertexShader,
  51080. fragmentShader: h.fragmentShader
  51081. }
  51082. } else
  51083. r.__webglShader = {
  51084. name: e.type,
  51085. uniforms: e.uniforms,
  51086. vertexShader: e.vertexShader,
  51087. fragmentShader: e.fragmentShader
  51088. };
  51089. e.__webglShader = r.__webglShader,
  51090. s = qe.acquireProgram(e, o, a),
  51091. r.program = s,
  51092. e.program = s
  51093. }
  51094. var u = s.getAttributes();
  51095. if (e.morphTargets) {
  51096. e.numSupportedMorphTargets = 0;
  51097. for (var d = 0; d < ve.maxMorphTargets; d++)
  51098. u["morphTarget" + d] >= 0 && e.numSupportedMorphTargets++
  51099. }
  51100. if (e.morphNormals) {
  51101. e.numSupportedMorphNormals = 0;
  51102. for (var d = 0; d < ve.maxMorphNormals; d++)
  51103. u["morphNormal" + d] >= 0 && e.numSupportedMorphNormals++
  51104. }
  51105. r.uniformsList = [];
  51106. var f = r.__webglShader.uniforms
  51107. , g = r.program.getUniforms();
  51108. for (var m in f) {
  51109. var v = g[m];
  51110. v && r.uniformsList.push([r.__webglShader.uniforms[m], v])
  51111. }
  51112. (e instanceof n.MeshPhongMaterial || e instanceof n.MeshLambertMaterial || e instanceof n.MeshStandardMaterial || e.lights) && (r.lightsHash = Ue.hash,
  51113. f.ambientLightColor.value = Ue.ambient,
  51114. f.directionalLights.value = Ue.directional,
  51115. f.spotLights.value = Ue.spot,
  51116. f.pointLights.value = Ue.point,
  51117. f.hemisphereLights.value = Ue.hemi,
  51118. f.directionalShadowMap.value = Ue.directionalShadowMap,
  51119. f.directionalShadowMatrix.value = Ue.directionalShadowMatrix,
  51120. f.spotShadowMap.value = Ue.spotShadowMap,
  51121. f.spotShadowMatrix.value = Ue.spotShadowMatrix,
  51122. f.pointShadowMap.value = Ue.pointShadowMap,
  51123. f.pointShadowMatrix.value = Ue.pointShadowMatrix),
  51124. r.hasDynamicUniforms = !1;
  51125. for (var A = 0, y = r.uniformsList.length; A < y; A++) {
  51126. var C = r.uniformsList[A][0];
  51127. if (C.dynamic === !0) {
  51128. r.hasDynamicUniforms = !0;
  51129. break
  51130. }
  51131. }
  51132. }
  51133. function E(e) {
  51134. b(e),
  51135. 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),
  51136. Ye.setDepthFunc(e.depthFunc),
  51137. Ye.setDepthTest(e.depthTest),
  51138. Ye.setDepthWrite(e.depthWrite),
  51139. Ye.setColorWrite(e.colorWrite),
  51140. Ye.setPolygonOffset(e.polygonOffset, e.polygonOffsetFactor, e.polygonOffsetUnits)
  51141. }
  51142. function b(e) {
  51143. e.side !== n.DoubleSide ? Ye.enable(Ge.CULL_FACE) : Ye.disable(Ge.CULL_FACE),
  51144. Ye.setFlipSided(e.side === n.BackSide)
  51145. }
  51146. function w(e, t, i, r) {
  51147. xe = 0;
  51148. var o = Xe.get(i);
  51149. void 0 === o.program && (i.needsUpdate = !0),
  51150. void 0 !== o.lightsHash && o.lightsHash !== Ue.hash && (i.needsUpdate = !0),
  51151. i.needsUpdate && (I(i, t, r),
  51152. i.needsUpdate = !1);
  51153. var a = !1
  51154. , s = !1
  51155. , l = !1
  51156. , c = o.program
  51157. , h = c.getUniforms()
  51158. , u = o.__webglShader.uniforms;
  51159. if (c.id !== Ae && (Ge.useProgram(c.program),
  51160. Ae = c.id,
  51161. a = !0,
  51162. s = !0,
  51163. l = !0),
  51164. i.id !== Ie && (Ie = i.id,
  51165. s = !0),
  51166. (a || e !== be) && (Ge.uniformMatrix4fv(h.projectionMatrix, !1, e.projectionMatrix.elements),
  51167. je.logarithmicDepthBuffer && Ge.uniform1f(h.logDepthBufFC, 2 / (Math.log(e.far + 1) / Math.LN2)),
  51168. e !== be && (be = e,
  51169. s = !0,
  51170. l = !0),
  51171. (i instanceof n.ShaderMaterial || i instanceof n.MeshPhongMaterial || i instanceof n.MeshStandardMaterial || i.envMap) && void 0 !== h.cameraPosition && (Ve.setFromMatrixPosition(e.matrixWorld),
  51172. Ge.uniform3f(h.cameraPosition, Ve.x, Ve.y, Ve.z)),
  51173. (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),
  51174. void 0 !== h.toneMappingExposure && Ge.uniform1f(h.toneMappingExposure, ve.toneMappingExposure),
  51175. void 0 !== h.toneMappingWhitePoint && Ge.uniform1f(h.toneMappingWhitePoint, ve.toneMappingWhitePoint)),
  51176. i.skinning)
  51177. if (r.bindMatrix && void 0 !== h.bindMatrix && Ge.uniformMatrix4fv(h.bindMatrix, !1, r.bindMatrix.elements),
  51178. r.bindMatrixInverse && void 0 !== h.bindMatrixInverse && Ge.uniformMatrix4fv(h.bindMatrixInverse, !1, r.bindMatrixInverse.elements),
  51179. je.floatVertexTextures && r.skeleton && r.skeleton.useVertexTexture) {
  51180. if (void 0 !== h.boneTexture) {
  51181. var d = B();
  51182. Ge.uniform1i(h.boneTexture, d),
  51183. ve.setTexture(r.skeleton.boneTexture, d)
  51184. }
  51185. void 0 !== h.boneTextureWidth && Ge.uniform1i(h.boneTextureWidth, r.skeleton.boneTextureWidth),
  51186. void 0 !== h.boneTextureHeight && Ge.uniform1i(h.boneTextureHeight, r.skeleton.boneTextureHeight)
  51187. } else
  51188. r.skeleton && r.skeleton.boneMatrices && void 0 !== h.boneGlobalMatrices && Ge.uniformMatrix4fv(h.boneGlobalMatrices, !1, r.skeleton.boneMatrices);
  51189. return s && ((i instanceof n.MeshPhongMaterial || i instanceof n.MeshLambertMaterial || i instanceof n.MeshStandardMaterial || i.lights) && D(u, l),
  51190. t && i.fog && R(u, t),
  51191. (i instanceof n.MeshBasicMaterial || i instanceof n.MeshLambertMaterial || i instanceof n.MeshPhongMaterial || i instanceof n.MeshStandardMaterial) && T(u, i),
  51192. i instanceof n.LineBasicMaterial ? x(u, i) : i instanceof n.LineDashedMaterial ? (x(u, i),
  51193. 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,
  51194. u.mFar.value = e.far,
  51195. u.opacity.value = i.opacity) : i instanceof n.MeshNormalMaterial && (u.opacity.value = i.opacity),
  51196. V(o.uniformsList)),
  51197. N(h, r),
  51198. void 0 !== h.modelMatrix && Ge.uniformMatrix4fv(h.modelMatrix, !1, r.matrixWorld.elements),
  51199. o.hasDynamicUniforms === !0 && _(o.uniformsList, r, e),
  51200. c
  51201. }
  51202. function _(e, t, i) {
  51203. for (var n = [], r = 0, o = e.length; r < o; r++) {
  51204. var a = e[r][0]
  51205. , s = a.onUpdateCallback;
  51206. void 0 !== s && (s.bind(a)(t, i),
  51207. n.push(e[r]))
  51208. }
  51209. V(n)
  51210. }
  51211. function T(e, t) {
  51212. e.opacity.value = t.opacity,
  51213. e.diffuse.value = t.color,
  51214. t.emissive && e.emissive.value.copy(t.emissive).multiplyScalar(t.emissiveIntensity),
  51215. e.map.value = t.map,
  51216. e.specularMap.value = t.specularMap,
  51217. e.alphaMap.value = t.alphaMap,
  51218. t.aoMap && (e.aoMap.value = t.aoMap,
  51219. e.aoMapIntensity.value = t.aoMapIntensity);
  51220. var i;
  51221. 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),
  51222. void 0 !== i) {
  51223. i instanceof n.WebGLRenderTarget && (i = i.texture);
  51224. var r = i.offset
  51225. , o = i.repeat;
  51226. e.offsetRepeat.value.set(r.x, r.y, o.x, o.y)
  51227. }
  51228. e.envMap.value = t.envMap,
  51229. e.flipEnvMap.value = t.envMap instanceof n.WebGLRenderTargetCube ? 1 : -1,
  51230. e.reflectivity.value = t.reflectivity,
  51231. e.refractionRatio.value = t.refractionRatio
  51232. }
  51233. function x(e, t) {
  51234. e.diffuse.value = t.color,
  51235. e.opacity.value = t.opacity
  51236. }
  51237. function S(e, t) {
  51238. e.dashSize.value = t.dashSize,
  51239. e.totalSize.value = t.dashSize + t.gapSize,
  51240. e.scale.value = t.scale
  51241. }
  51242. function M(e, t) {
  51243. if (e.diffuse.value = t.color,
  51244. e.opacity.value = t.opacity,
  51245. e.size.value = t.size * Oe,
  51246. e.scale.value = te.clientHeight / 2,
  51247. e.map.value = t.map,
  51248. null !== t.map) {
  51249. var i = t.map.offset
  51250. , n = t.map.repeat;
  51251. e.offsetRepeat.value.set(i.x, i.y, n.x, n.y)
  51252. }
  51253. }
  51254. function R(e, t) {
  51255. e.fogColor.value = t.color,
  51256. t instanceof n.Fog ? (e.fogNear.value = t.near,
  51257. e.fogFar.value = t.far) : t instanceof n.FogExp2 && (e.fogDensity.value = t.density)
  51258. }
  51259. function P(e, t) {
  51260. t.lightMap && (e.lightMap.value = t.lightMap,
  51261. e.lightMapIntensity.value = t.lightMapIntensity),
  51262. t.emissiveMap && (e.emissiveMap.value = t.emissiveMap)
  51263. }
  51264. function O(e, t) {
  51265. e.specular.value = t.specular,
  51266. e.shininess.value = Math.max(t.shininess, 1e-4),
  51267. t.lightMap && (e.lightMap.value = t.lightMap,
  51268. e.lightMapIntensity.value = t.lightMapIntensity),
  51269. t.emissiveMap && (e.emissiveMap.value = t.emissiveMap),
  51270. t.bumpMap && (e.bumpMap.value = t.bumpMap,
  51271. e.bumpScale.value = t.bumpScale),
  51272. t.normalMap && (e.normalMap.value = t.normalMap,
  51273. e.normalScale.value.copy(t.normalScale)),
  51274. t.displacementMap && (e.displacementMap.value = t.displacementMap,
  51275. e.displacementScale.value = t.displacementScale,
  51276. e.displacementBias.value = t.displacementBias)
  51277. }
  51278. function L(e, t) {
  51279. e.roughness.value = t.roughness,
  51280. e.metalness.value = t.metalness,
  51281. t.roughnessMap && (e.roughnessMap.value = t.roughnessMap),
  51282. t.metalnessMap && (e.metalnessMap.value = t.metalnessMap),
  51283. t.lightMap && (e.lightMap.value = t.lightMap,
  51284. e.lightMapIntensity.value = t.lightMapIntensity),
  51285. t.emissiveMap && (e.emissiveMap.value = t.emissiveMap),
  51286. t.bumpMap && (e.bumpMap.value = t.bumpMap,
  51287. e.bumpScale.value = t.bumpScale),
  51288. t.normalMap && (e.normalMap.value = t.normalMap,
  51289. e.normalScale.value.copy(t.normalScale)),
  51290. t.displacementMap && (e.displacementMap.value = t.displacementMap,
  51291. e.displacementScale.value = t.displacementScale,
  51292. e.displacementBias.value = t.displacementBias),
  51293. t.envMap && (e.envMapIntensity.value = t.envMapIntensity)
  51294. }
  51295. function D(e, t) {
  51296. e.ambientLightColor.needsUpdate = t,
  51297. e.directionalLights.needsUpdate = t,
  51298. e.pointLights.needsUpdate = t,
  51299. e.spotLights.needsUpdate = t,
  51300. e.hemisphereLights.needsUpdate = t
  51301. }
  51302. function N(e, t) {
  51303. Ge.uniformMatrix4fv(e.modelViewMatrix, !1, t.modelViewMatrix.elements),
  51304. e.normalMatrix && Ge.uniformMatrix3fv(e.normalMatrix, !1, t.normalMatrix.elements)
  51305. }
  51306. function B() {
  51307. var e = xe;
  51308. return e >= je.maxTextures && console.warn("WebGLRenderer: trying to use " + e + " texture units while this GPU supports only " + je.maxTextures),
  51309. xe += 1,
  51310. e
  51311. }
  51312. function F(e, t, i, r) {
  51313. var o, a;
  51314. if ("1i" === t)
  51315. Ge.uniform1i(i, r);
  51316. else if ("1f" === t)
  51317. Ge.uniform1f(i, r);
  51318. else if ("2f" === t)
  51319. Ge.uniform2f(i, r[0], r[1]);
  51320. else if ("3f" === t)
  51321. Ge.uniform3f(i, r[0], r[1], r[2]);
  51322. else if ("4f" === t)
  51323. Ge.uniform4f(i, r[0], r[1], r[2], r[3]);
  51324. else if ("1iv" === t)
  51325. Ge.uniform1iv(i, r);
  51326. else if ("3iv" === t)
  51327. Ge.uniform3iv(i, r);
  51328. else if ("1fv" === t)
  51329. Ge.uniform1fv(i, r);
  51330. else if ("2fv" === t)
  51331. Ge.uniform2fv(i, r);
  51332. else if ("3fv" === t)
  51333. Ge.uniform3fv(i, r);
  51334. else if ("4fv" === t)
  51335. Ge.uniform4fv(i, r);
  51336. else if ("Matrix2fv" === t)
  51337. Ge.uniformMatrix2fv(i, !1, r);
  51338. else if ("Matrix3fv" === t)
  51339. Ge.uniformMatrix3fv(i, !1, r);
  51340. else if ("Matrix4fv" === t)
  51341. Ge.uniformMatrix4fv(i, !1, r);
  51342. else if ("i" === t)
  51343. Ge.uniform1i(i, r);
  51344. else if ("f" === t)
  51345. Ge.uniform1f(i, r);
  51346. else if ("v2" === t)
  51347. Ge.uniform2f(i, r.x, r.y);
  51348. else if ("v3" === t)
  51349. Ge.uniform3f(i, r.x, r.y, r.z);
  51350. else if ("v4" === t)
  51351. Ge.uniform4f(i, r.x, r.y, r.z, r.w);
  51352. else if ("c" === t)
  51353. Ge.uniform3f(i, r.r, r.g, r.b);
  51354. else if ("s" === t) {
  51355. var s = e.properties;
  51356. for (var l in s) {
  51357. var c = s[l]
  51358. , h = i[l]
  51359. , u = r[l];
  51360. F(c, c.type, h, u)
  51361. }
  51362. } else if ("sa" === t)
  51363. for (var s = e.properties, d = 0, p = r.length; d < p; d++)
  51364. for (var l in s) {
  51365. var c = s[l]
  51366. , h = i[d][l]
  51367. , u = r[d][l];
  51368. F(c, c.type, h, u)
  51369. }
  51370. else if ("iv1" === t)
  51371. Ge.uniform1iv(i, r);
  51372. else if ("iv" === t)
  51373. Ge.uniform3iv(i, r);
  51374. else if ("fv1" === t)
  51375. Ge.uniform1fv(i, r);
  51376. else if ("fv" === t)
  51377. Ge.uniform3fv(i, r);
  51378. else if ("v2v" === t) {
  51379. void 0 === e._array && (e._array = new Float32Array(2 * r.length));
  51380. for (var d = 0, f = 0, g = r.length; d < g; d++,
  51381. f += 2)
  51382. e._array[f + 0] = r[d].x,
  51383. e._array[f + 1] = r[d].y;
  51384. Ge.uniform2fv(i, e._array)
  51385. } else if ("v3v" === t) {
  51386. void 0 === e._array && (e._array = new Float32Array(3 * r.length));
  51387. for (var d = 0, m = 0, g = r.length; d < g; d++,
  51388. m += 3)
  51389. e._array[m + 0] = r[d].x,
  51390. e._array[m + 1] = r[d].y,
  51391. e._array[m + 2] = r[d].z;
  51392. Ge.uniform3fv(i, e._array)
  51393. } else if ("v4v" === t) {
  51394. void 0 === e._array && (e._array = new Float32Array(4 * r.length));
  51395. for (var d = 0, v = 0, g = r.length; d < g; d++,
  51396. v += 4)
  51397. e._array[v + 0] = r[d].x,
  51398. e._array[v + 1] = r[d].y,
  51399. e._array[v + 2] = r[d].z,
  51400. e._array[v + 3] = r[d].w;
  51401. Ge.uniform4fv(i, e._array)
  51402. } else if ("m2" === t)
  51403. Ge.uniformMatrix2fv(i, !1, r.elements);
  51404. else if ("m3" === t)
  51405. Ge.uniformMatrix3fv(i, !1, r.elements);
  51406. else if ("m3v" === t) {
  51407. void 0 === e._array && (e._array = new Float32Array(9 * r.length));
  51408. for (var d = 0, g = r.length; d < g; d++)
  51409. r[d].flattenToArrayOffset(e._array, 9 * d);
  51410. Ge.uniformMatrix3fv(i, !1, e._array)
  51411. } else if ("m4" === t)
  51412. Ge.uniformMatrix4fv(i, !1, r.elements);
  51413. else if ("m4v" === t) {
  51414. void 0 === e._array && (e._array = new Float32Array(16 * r.length));
  51415. for (var d = 0, g = r.length; d < g; d++)
  51416. r[d].flattenToArrayOffset(e._array, 16 * d);
  51417. Ge.uniformMatrix4fv(i, !1, e._array)
  51418. } else if ("t" === t) {
  51419. if (o = r,
  51420. a = B(),
  51421. Ge.uniform1i(i, a),
  51422. !o)
  51423. return;
  51424. 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)
  51425. } else if ("tv" === t) {
  51426. void 0 === e._array && (e._array = []);
  51427. for (var d = 0, g = e.value.length; d < g; d++)
  51428. e._array[d] = B();
  51429. Ge.uniform1iv(i, e._array);
  51430. for (var d = 0, g = e.value.length; d < g; d++)
  51431. o = e.value[d],
  51432. a = e._array[d],
  51433. 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))
  51434. } else
  51435. console.warn("THREE.WebGLRenderer: Unknown uniform type: " + t)
  51436. }
  51437. function V(e) {
  51438. for (var t = 0, i = e.length; t < i; t++) {
  51439. var n = e[t][0];
  51440. if (n.needsUpdate !== !1) {
  51441. var r = n.type
  51442. , o = e[t][1]
  51443. , a = n.value;
  51444. F(n, r, o, a)
  51445. }
  51446. }
  51447. }
  51448. function U(e, t) {
  51449. 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;
  51450. for (Ue.shadowsPointLight = 0,
  51451. i = 0,
  51452. r = e.length; i < r; i++)
  51453. if (o = e[i],
  51454. a = o.color,
  51455. s = o.intensity,
  51456. l = o.distance,
  51457. o instanceof n.AmbientLight)
  51458. c += a.r * s,
  51459. h += a.g * s,
  51460. u += a.b * s;
  51461. else if (o instanceof n.DirectionalLight) {
  51462. var A = Ke.get(o);
  51463. A.color.copy(o.color).multiplyScalar(o.intensity),
  51464. A.direction.setFromMatrixPosition(o.matrixWorld),
  51465. Ve.setFromMatrixPosition(o.target.matrixWorld),
  51466. A.direction.sub(Ve),
  51467. A.direction.transformDirection(d),
  51468. A.shadow = o.castShadow,
  51469. o.castShadow && (A.shadowBias = o.shadow.bias,
  51470. A.shadowRadius = o.shadow.radius,
  51471. A.shadowMapSize = o.shadow.mapSize,
  51472. Ue.shadows[v++] = o),
  51473. Ue.directionalShadowMap[p] = o.shadow.map,
  51474. Ue.directionalShadowMatrix[p] = o.shadow.matrix,
  51475. Ue.directional[p++] = A
  51476. } else if (o instanceof n.SpotLight) {
  51477. var A = Ke.get(o);
  51478. A.position.setFromMatrixPosition(o.matrixWorld),
  51479. A.position.applyMatrix4(d),
  51480. A.color.copy(a).multiplyScalar(s),
  51481. A.distance = l,
  51482. A.direction.setFromMatrixPosition(o.matrixWorld),
  51483. Ve.setFromMatrixPosition(o.target.matrixWorld),
  51484. A.direction.sub(Ve),
  51485. A.direction.transformDirection(d),
  51486. A.coneCos = Math.cos(o.angle),
  51487. A.penumbraCos = Math.cos(o.angle * (1 - o.penumbra)),
  51488. A.decay = 0 === o.distance ? 0 : o.decay,
  51489. A.shadow = o.castShadow,
  51490. o.castShadow && (A.shadowBias = o.shadow.bias,
  51491. A.shadowRadius = o.shadow.radius,
  51492. A.shadowMapSize = o.shadow.mapSize,
  51493. Ue.shadows[v++] = o),
  51494. Ue.spotShadowMap[g] = o.shadow.map,
  51495. Ue.spotShadowMatrix[g] = o.shadow.matrix,
  51496. Ue.spot[g++] = A
  51497. } else if (o instanceof n.PointLight) {
  51498. var A = Ke.get(o);
  51499. A.position.setFromMatrixPosition(o.matrixWorld),
  51500. A.position.applyMatrix4(d),
  51501. A.color.copy(o.color).multiplyScalar(o.intensity),
  51502. A.distance = o.distance,
  51503. A.decay = 0 === o.distance ? 0 : o.decay,
  51504. A.shadow = o.castShadow,
  51505. o.castShadow && (A.shadowBias = o.shadow.bias,
  51506. A.shadowRadius = o.shadow.radius,
  51507. A.shadowMapSize = o.shadow.mapSize,
  51508. Ue.shadows[v++] = o),
  51509. Ue.pointShadowMap[f] = o.shadow.map,
  51510. void 0 === Ue.pointShadowMatrix[f] && (Ue.pointShadowMatrix[f] = new n.Matrix4),
  51511. Ve.setFromMatrixPosition(o.matrixWorld).negate(),
  51512. Ue.pointShadowMatrix[f].identity().setPosition(Ve),
  51513. Ue.point[f++] = A
  51514. } else if (o instanceof n.HemisphereLight) {
  51515. var A = Ke.get(o);
  51516. A.direction.setFromMatrixPosition(o.matrixWorld),
  51517. A.direction.transformDirection(d),
  51518. A.direction.normalize(),
  51519. A.skyColor.copy(o.color).multiplyScalar(s),
  51520. A.groundColor.copy(o.groundColor).multiplyScalar(s),
  51521. Ue.hemi[m++] = A
  51522. }
  51523. Ue.ambient[0] = c,
  51524. Ue.ambient[1] = h,
  51525. Ue.ambient[2] = u,
  51526. Ue.directional.length = p,
  51527. Ue.spot.length = g,
  51528. Ue.point.length = f,
  51529. Ue.hemi.length = m,
  51530. Ue.shadows.length = v,
  51531. Ue.hash = p + "," + f + "," + g + "," + m + "," + v
  51532. }
  51533. function k(e, t, i) {
  51534. var r;
  51535. if (i ? (Ge.texParameteri(e, Ge.TEXTURE_WRAP_S, ee(t.wrapS)),
  51536. Ge.texParameteri(e, Ge.TEXTURE_WRAP_T, ee(t.wrapT)),
  51537. Ge.texParameteri(e, Ge.TEXTURE_MAG_FILTER, ee(t.magFilter)),
  51538. Ge.texParameteri(e, Ge.TEXTURE_MIN_FILTER, ee(t.minFilter))) : (Ge.texParameteri(e, Ge.TEXTURE_WRAP_S, Ge.CLAMP_TO_EDGE),
  51539. Ge.texParameteri(e, Ge.TEXTURE_WRAP_T, Ge.CLAMP_TO_EDGE),
  51540. 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),
  51541. Ge.texParameteri(e, Ge.TEXTURE_MAG_FILTER, $(t.magFilter)),
  51542. Ge.texParameteri(e, Ge.TEXTURE_MIN_FILTER, $(t.minFilter)),
  51543. 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)),
  51544. r = We.get("EXT_texture_filter_anisotropic")) {
  51545. if (t.type === n.FloatType && null === We.get("OES_texture_float_linear"))
  51546. return;
  51547. if (t.type === n.HalfFloatType && null === We.get("OES_texture_half_float_linear"))
  51548. return;
  51549. (t.anisotropy > 1 || Xe.get(t).__currentAnisotropy) && (Ge.texParameterf(e, r.TEXTURE_MAX_ANISOTROPY_EXT, Math.min(t.anisotropy, ve.getMaxAnisotropy())),
  51550. Xe.get(t).__currentAnisotropy = t.anisotropy)
  51551. }
  51552. }
  51553. function H(e, t, i) {
  51554. void 0 === e.__webglInit && (e.__webglInit = !0,
  51555. t.addEventListener("dispose", s),
  51556. e.__webglTexture = Ge.createTexture(),
  51557. ke.textures++),
  51558. Ye.activeTexture(Ge.TEXTURE0 + i),
  51559. Ye.bindTexture(Ge.TEXTURE_2D, e.__webglTexture),
  51560. Ge.pixelStorei(Ge.UNPACK_FLIP_Y_WEBGL, t.flipY),
  51561. Ge.pixelStorei(Ge.UNPACK_PREMULTIPLY_ALPHA_WEBGL, t.premultiplyAlpha),
  51562. Ge.pixelStorei(Ge.UNPACK_ALIGNMENT, t.unpackAlignment);
  51563. var r = G(t.image, je.maxTextureSize);
  51564. W(t) && z(r) === !1 && (r = j(r));
  51565. var o = z(r)
  51566. , a = ee(t.format)
  51567. , l = ee(t.type);
  51568. k(Ge.TEXTURE_2D, t, o);
  51569. var c, h = t.mipmaps;
  51570. if (t instanceof n.DataTexture)
  51571. if (h.length > 0 && o) {
  51572. for (var u = 0, d = h.length; u < d; u++)
  51573. c = h[u],
  51574. Ye.texImage2D(Ge.TEXTURE_2D, u, a, c.width, c.height, 0, a, l, c.data);
  51575. t.generateMipmaps = !1
  51576. } else
  51577. Ye.texImage2D(Ge.TEXTURE_2D, 0, a, r.width, r.height, 0, a, l, r.data);
  51578. else if (t instanceof n.CompressedTexture)
  51579. for (var u = 0, d = h.length; u < d; u++)
  51580. c = h[u],
  51581. 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);
  51582. else if (h.length > 0 && o) {
  51583. for (var u = 0, d = h.length; u < d; u++)
  51584. c = h[u],
  51585. Ye.texImage2D(Ge.TEXTURE_2D, u, a, a, l, c);
  51586. t.generateMipmaps = !1
  51587. } else
  51588. Ye.texImage2D(Ge.TEXTURE_2D, 0, a, a, l, r);
  51589. t.generateMipmaps && o && Ge.generateMipmap(Ge.TEXTURE_2D),
  51590. e.__version = t.version,
  51591. t.onUpdate && t.onUpdate(t)
  51592. }
  51593. function G(e, t) {
  51594. if (e.width > t || e.height > t) {
  51595. var i = t / Math.max(e.width, e.height)
  51596. , n = document.createElement("canvas");
  51597. n.width = Math.floor(e.width * i),
  51598. n.height = Math.floor(e.height * i);
  51599. var r = n.getContext("2d");
  51600. return r.drawImage(e, 0, 0, e.width, e.height, 0, 0, n.width, n.height),
  51601. console.warn("THREE.WebGLRenderer: image is too big (" + e.width + "x" + e.height + "). Resized to " + n.width + "x" + n.height, e),
  51602. n
  51603. }
  51604. return e
  51605. }
  51606. function z(e) {
  51607. return n.Math.isPowerOfTwo(e.width) && n.Math.isPowerOfTwo(e.height)
  51608. }
  51609. function W(e) {
  51610. return e.wrapS !== n.ClampToEdgeWrapping || e.wrapT !== n.ClampToEdgeWrapping || e.minFilter !== n.NearestFilter && e.minFilter !== n.LinearFilter
  51611. }
  51612. function j(e) {
  51613. if (e instanceof HTMLImageElement || e instanceof HTMLCanvasElement) {
  51614. var t = document.createElement("canvas");
  51615. t.width = n.Math.nearestPowerOfTwo(e.width),
  51616. t.height = n.Math.nearestPowerOfTwo(e.height);
  51617. var i = t.getContext("2d");
  51618. return i.drawImage(e, 0, 0, t.width, t.height),
  51619. console.warn("THREE.WebGLRenderer: image is not power of two (" + e.width + "x" + e.height + "). Resized to " + t.width + "x" + t.height, e),
  51620. t
  51621. }
  51622. return e
  51623. }
  51624. function Y(e, t) {
  51625. var i = Xe.get(e);
  51626. if (6 === e.image.length)
  51627. if (e.version > 0 && i.__version !== e.version) {
  51628. i.__image__webglTextureCube || (e.addEventListener("dispose", s),
  51629. i.__image__webglTextureCube = Ge.createTexture(),
  51630. ke.textures++),
  51631. Ye.activeTexture(Ge.TEXTURE0 + t),
  51632. Ye.bindTexture(Ge.TEXTURE_CUBE_MAP, i.__image__webglTextureCube),
  51633. Ge.pixelStorei(Ge.UNPACK_FLIP_Y_WEBGL, e.flipY);
  51634. for (var r = e instanceof n.CompressedTexture, o = e.image[0]instanceof n.DataTexture, a = [], l = 0; l < 6; l++)
  51635. !ve.autoScaleCubemaps || r || o ? a[l] = o ? e.image[l].image : e.image[l] : a[l] = G(e.image[l], je.maxCubemapSize);
  51636. var c = a[0]
  51637. , h = z(c)
  51638. , u = ee(e.format)
  51639. , d = ee(e.type);
  51640. k(Ge.TEXTURE_CUBE_MAP, e, h);
  51641. for (var l = 0; l < 6; l++)
  51642. if (r)
  51643. for (var p, f = a[l].mipmaps, g = 0, m = f.length; g < m; g++)
  51644. p = f[g],
  51645. 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);
  51646. else
  51647. 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]);
  51648. e.generateMipmaps && h && Ge.generateMipmap(Ge.TEXTURE_CUBE_MAP),
  51649. i.__version = e.version,
  51650. e.onUpdate && e.onUpdate(e)
  51651. } else
  51652. Ye.activeTexture(Ge.TEXTURE0 + t),
  51653. Ye.bindTexture(Ge.TEXTURE_CUBE_MAP, i.__image__webglTextureCube)
  51654. }
  51655. function X(e, t) {
  51656. Ye.activeTexture(Ge.TEXTURE0 + t),
  51657. Ye.bindTexture(Ge.TEXTURE_CUBE_MAP, Xe.get(e).__webglTexture)
  51658. }
  51659. function Z(e, t, i, n) {
  51660. var r = ee(t.texture.format)
  51661. , o = ee(t.texture.type);
  51662. Ye.texImage2D(n, 0, r, t.width, t.height, 0, r, o, null),
  51663. Ge.bindFramebuffer(Ge.FRAMEBUFFER, e),
  51664. Ge.framebufferTexture2D(Ge.FRAMEBUFFER, i, n, Xe.get(t.texture).__webglTexture, 0),
  51665. Ge.bindFramebuffer(Ge.FRAMEBUFFER, null)
  51666. }
  51667. function q(e, t) {
  51668. Ge.bindRenderbuffer(Ge.RENDERBUFFER, e),
  51669. t.depthBuffer && !t.stencilBuffer ? (Ge.renderbufferStorage(Ge.RENDERBUFFER, Ge.DEPTH_COMPONENT16, t.width, t.height),
  51670. 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),
  51671. Ge.framebufferRenderbuffer(Ge.FRAMEBUFFER, Ge.DEPTH_STENCIL_ATTACHMENT, Ge.RENDERBUFFER, e)) : Ge.renderbufferStorage(Ge.RENDERBUFFER, Ge.RGBA4, t.width, t.height),
  51672. Ge.bindRenderbuffer(Ge.RENDERBUFFER, null)
  51673. }
  51674. function K(e) {
  51675. var t = Xe.get(e)
  51676. , i = e instanceof n.WebGLRenderTargetCube;
  51677. if (i) {
  51678. t.__webglDepthbuffer = [];
  51679. for (var r = 0; r < 6; r++)
  51680. Ge.bindFramebuffer(Ge.FRAMEBUFFER, t.__webglFramebuffer[r]),
  51681. t.__webglDepthbuffer[r] = Ge.createRenderbuffer(),
  51682. q(t.__webglDepthbuffer[r], e)
  51683. } else
  51684. Ge.bindFramebuffer(Ge.FRAMEBUFFER, t.__webglFramebuffer),
  51685. t.__webglDepthbuffer = Ge.createRenderbuffer(),
  51686. q(t.__webglDepthbuffer, e);
  51687. Ge.bindFramebuffer(Ge.FRAMEBUFFER, null)
  51688. }
  51689. function Q(e) {
  51690. var t = Xe.get(e)
  51691. , i = Xe.get(e.texture);
  51692. e.addEventListener("dispose", l),
  51693. i.__webglTexture = Ge.createTexture(),
  51694. ke.textures++;
  51695. var r = e instanceof n.WebGLRenderTargetCube
  51696. , o = n.Math.isPowerOfTwo(e.width) && n.Math.isPowerOfTwo(e.height);
  51697. if (r) {
  51698. t.__webglFramebuffer = [];
  51699. for (var a = 0; a < 6; a++)
  51700. t.__webglFramebuffer[a] = Ge.createFramebuffer()
  51701. } else
  51702. t.__webglFramebuffer = Ge.createFramebuffer();
  51703. if (r) {
  51704. Ye.bindTexture(Ge.TEXTURE_CUBE_MAP, i.__webglTexture),
  51705. k(Ge.TEXTURE_CUBE_MAP, e.texture, o);
  51706. for (var a = 0; a < 6; a++)
  51707. Z(t.__webglFramebuffer[a], e, Ge.COLOR_ATTACHMENT0, Ge.TEXTURE_CUBE_MAP_POSITIVE_X + a);
  51708. e.texture.generateMipmaps && o && Ge.generateMipmap(Ge.TEXTURE_CUBE_MAP),
  51709. Ye.bindTexture(Ge.TEXTURE_CUBE_MAP, null)
  51710. } else
  51711. Ye.bindTexture(Ge.TEXTURE_2D, i.__webglTexture),
  51712. k(Ge.TEXTURE_2D, e.texture, o),
  51713. Z(t.__webglFramebuffer, e, Ge.COLOR_ATTACHMENT0, Ge.TEXTURE_2D),
  51714. e.texture.generateMipmaps && o && Ge.generateMipmap(Ge.TEXTURE_2D),
  51715. Ye.bindTexture(Ge.TEXTURE_2D, null);
  51716. e.depthBuffer && K(e)
  51717. }
  51718. function J(e) {
  51719. var t = e instanceof n.WebGLRenderTargetCube ? Ge.TEXTURE_CUBE_MAP : Ge.TEXTURE_2D
  51720. , i = Xe.get(e.texture).__webglTexture;
  51721. Ye.bindTexture(t, i),
  51722. Ge.generateMipmap(t),
  51723. Ye.bindTexture(t, null)
  51724. }
  51725. function $(e) {
  51726. return e === n.NearestFilter || e === n.NearestMipMapNearestFilter || e === n.NearestMipMapLinearFilter ? Ge.NEAREST : Ge.LINEAR
  51727. }
  51728. function ee(e) {
  51729. var t;
  51730. if (e === n.RepeatWrapping)
  51731. return Ge.REPEAT;
  51732. if (e === n.ClampToEdgeWrapping)
  51733. return Ge.CLAMP_TO_EDGE;
  51734. if (e === n.MirroredRepeatWrapping)
  51735. return Ge.MIRRORED_REPEAT;
  51736. if (e === n.NearestFilter)
  51737. return Ge.NEAREST;
  51738. if (e === n.NearestMipMapNearestFilter)
  51739. return Ge.NEAREST_MIPMAP_NEAREST;
  51740. if (e === n.NearestMipMapLinearFilter)
  51741. return Ge.NEAREST_MIPMAP_LINEAR;
  51742. if (e === n.LinearFilter)
  51743. return Ge.LINEAR;
  51744. if (e === n.LinearMipMapNearestFilter)
  51745. return Ge.LINEAR_MIPMAP_NEAREST;
  51746. if (e === n.LinearMipMapLinearFilter)
  51747. return Ge.LINEAR_MIPMAP_LINEAR;
  51748. if (e === n.UnsignedByteType)
  51749. return Ge.UNSIGNED_BYTE;
  51750. if (e === n.UnsignedShort4444Type)
  51751. return Ge.UNSIGNED_SHORT_4_4_4_4;
  51752. if (e === n.UnsignedShort5551Type)
  51753. return Ge.UNSIGNED_SHORT_5_5_5_1;
  51754. if (e === n.UnsignedShort565Type)
  51755. return Ge.UNSIGNED_SHORT_5_6_5;
  51756. if (e === n.ByteType)
  51757. return Ge.BYTE;
  51758. if (e === n.ShortType)
  51759. return Ge.SHORT;
  51760. if (e === n.UnsignedShortType)
  51761. return Ge.UNSIGNED_SHORT;
  51762. if (e === n.IntType)
  51763. return Ge.INT;
  51764. if (e === n.UnsignedIntType)
  51765. return Ge.UNSIGNED_INT;
  51766. if (e === n.FloatType)
  51767. return Ge.FLOAT;
  51768. if (t = We.get("OES_texture_half_float"),
  51769. null !== t && e === n.HalfFloatType)
  51770. return t.HALF_FLOAT_OES;
  51771. if (e === n.AlphaFormat)
  51772. return Ge.ALPHA;
  51773. if (e === n.RGBFormat)
  51774. return Ge.RGB;
  51775. if (e === n.RGBAFormat)
  51776. return Ge.RGBA;
  51777. if (e === n.LuminanceFormat)
  51778. return Ge.LUMINANCE;
  51779. if (e === n.LuminanceAlphaFormat)
  51780. return Ge.LUMINANCE_ALPHA;
  51781. if (e === n.AddEquation)
  51782. return Ge.FUNC_ADD;
  51783. if (e === n.SubtractEquation)
  51784. return Ge.FUNC_SUBTRACT;
  51785. if (e === n.ReverseSubtractEquation)
  51786. return Ge.FUNC_REVERSE_SUBTRACT;
  51787. if (e === n.ZeroFactor)
  51788. return Ge.ZERO;
  51789. if (e === n.OneFactor)
  51790. return Ge.ONE;
  51791. if (e === n.SrcColorFactor)
  51792. return Ge.SRC_COLOR;
  51793. if (e === n.OneMinusSrcColorFactor)
  51794. return Ge.ONE_MINUS_SRC_COLOR;
  51795. if (e === n.SrcAlphaFactor)
  51796. return Ge.SRC_ALPHA;
  51797. if (e === n.OneMinusSrcAlphaFactor)
  51798. return Ge.ONE_MINUS_SRC_ALPHA;
  51799. if (e === n.DstAlphaFactor)
  51800. return Ge.DST_ALPHA;
  51801. if (e === n.OneMinusDstAlphaFactor)
  51802. return Ge.ONE_MINUS_DST_ALPHA;
  51803. if (e === n.DstColorFactor)
  51804. return Ge.DST_COLOR;
  51805. if (e === n.OneMinusDstColorFactor)
  51806. return Ge.ONE_MINUS_DST_COLOR;
  51807. if (e === n.SrcAlphaSaturateFactor)
  51808. return Ge.SRC_ALPHA_SATURATE;
  51809. if (t = We.get("WEBGL_compressed_texture_s3tc"),
  51810. null !== t) {
  51811. if (e === n.RGB_S3TC_DXT1_Format)
  51812. return t.COMPRESSED_RGB_S3TC_DXT1_EXT;
  51813. if (e === n.RGBA_S3TC_DXT1_Format)
  51814. return t.COMPRESSED_RGBA_S3TC_DXT1_EXT;
  51815. if (e === n.RGBA_S3TC_DXT3_Format)
  51816. return t.COMPRESSED_RGBA_S3TC_DXT3_EXT;
  51817. if (e === n.RGBA_S3TC_DXT5_Format)
  51818. return t.COMPRESSED_RGBA_S3TC_DXT5_EXT
  51819. }
  51820. if (t = We.get("WEBGL_compressed_texture_pvrtc"),
  51821. null !== t) {
  51822. if (e === n.RGB_PVRTC_4BPPV1_Format)
  51823. return t.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;
  51824. if (e === n.RGB_PVRTC_2BPPV1_Format)
  51825. return t.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;
  51826. if (e === n.RGBA_PVRTC_4BPPV1_Format)
  51827. return t.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;
  51828. if (e === n.RGBA_PVRTC_2BPPV1_Format)
  51829. return t.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG
  51830. }
  51831. if (t = We.get("WEBGL_compressed_texture_etc1"),
  51832. null !== t && e === n.RGB_ETC1_Format)
  51833. return t.COMPRESSED_RGB_ETC1_WEBGL;
  51834. if (t = We.get("EXT_blend_minmax"),
  51835. null !== t) {
  51836. if (e === n.MinEquation)
  51837. return t.MIN_EXT;
  51838. if (e === n.MaxEquation)
  51839. return t.MAX_EXT
  51840. }
  51841. return 0
  51842. }
  51843. console.log("THREE.WebGLRenderer", n.REVISION),
  51844. e = e || {};
  51845. var te = void 0 !== e.canvas ? e.canvas : document.createElement("canvas")
  51846. , ie = void 0 !== e.context ? e.context : null
  51847. , ne = void 0 !== e.alpha && e.alpha
  51848. , re = void 0 === e.depth || e.depth
  51849. , oe = void 0 === e.stencil || e.stencil
  51850. , ae = void 0 !== e.antialias && e.antialias
  51851. , se = void 0 === e.premultipliedAlpha || e.premultipliedAlpha
  51852. , le = void 0 !== e.preserveDrawingBuffer && e.preserveDrawingBuffer
  51853. , ce = []
  51854. , he = []
  51855. , ue = -1
  51856. , de = []
  51857. , pe = -1
  51858. , fe = new Float32Array(8)
  51859. , ge = []
  51860. , me = [];
  51861. this.domElement = te,
  51862. this.context = null,
  51863. this.autoClear = !0,
  51864. this.autoClearColor = !0,
  51865. this.autoClearDepth = !0,
  51866. this.autoClearStencil = !0,
  51867. this.sortObjects = !0,
  51868. this.gammaFactor = 2,
  51869. this.gammaInput = !1,
  51870. this.gammaOutput = !1,
  51871. this.physicallyCorrectLights = !1,
  51872. this.toneMapping = n.LinearToneMapping,
  51873. this.toneMappingExposure = 1,
  51874. this.toneMappingWhitePoint = 1,
  51875. this.maxMorphTargets = 8,
  51876. this.maxMorphNormals = 4,
  51877. this.autoScaleCubemaps = !0;
  51878. var ve = this
  51879. , Ae = null
  51880. , ye = null
  51881. , Ce = null
  51882. , Ie = -1
  51883. , Ee = ""
  51884. , be = null
  51885. , we = new n.Vector4
  51886. , _e = null
  51887. , Te = new n.Vector4
  51888. , xe = 0
  51889. , Se = new n.Color(0)
  51890. , Me = 0
  51891. , Re = te.width
  51892. , Pe = te.height
  51893. , Oe = 1
  51894. , Le = new n.Vector4(0,0,Re,Pe)
  51895. , De = !1
  51896. , Ne = new n.Vector4(0,0,Re,Pe)
  51897. , Be = new n.Frustum
  51898. , Fe = new n.Matrix4
  51899. , Ve = new n.Vector3
  51900. , Ue = {
  51901. hash: "",
  51902. ambient: [0, 0, 0],
  51903. directional: [],
  51904. directionalShadowMap: [],
  51905. directionalShadowMatrix: [],
  51906. spot: [],
  51907. spotShadowMap: [],
  51908. spotShadowMatrix: [],
  51909. point: [],
  51910. pointShadowMap: [],
  51911. pointShadowMatrix: [],
  51912. hemi: [],
  51913. shadows: [],
  51914. shadowsPointLight: 0
  51915. }
  51916. , ke = {
  51917. geometries: 0,
  51918. textures: 0
  51919. }
  51920. , He = {
  51921. calls: 0,
  51922. vertices: 0,
  51923. faces: 0,
  51924. points: 0
  51925. };
  51926. this.info = {
  51927. render: He,
  51928. memory: ke,
  51929. programs: null
  51930. };
  51931. var Ge;
  51932. try {
  51933. var ze = {
  51934. alpha: ne,
  51935. depth: re,
  51936. stencil: oe,
  51937. antialias: ae,
  51938. premultipliedAlpha: se,
  51939. preserveDrawingBuffer: le
  51940. };
  51941. if (Ge = ie || te.getContext("webgl", ze) || te.getContext("experimental-webgl", ze),
  51942. null === Ge)
  51943. throw null !== te.getContext("webgl") ? "Error creating WebGL context with your selected attributes." : "Error creating WebGL context.";
  51944. void 0 === Ge.getShaderPrecisionFormat && (Ge.getShaderPrecisionFormat = function() {
  51945. return {
  51946. rangeMin: 1,
  51947. rangeMax: 1,
  51948. precision: 1
  51949. }
  51950. }
  51951. ),
  51952. te.addEventListener("webglcontextlost", a, !1)
  51953. } catch (e) {
  51954. console.error("THREE.WebGLRenderer: " + e)
  51955. }
  51956. var We = new n.WebGLExtensions(Ge);
  51957. We.get("OES_texture_float"),
  51958. We.get("OES_texture_float_linear"),
  51959. We.get("OES_texture_half_float"),
  51960. We.get("OES_texture_half_float_linear"),
  51961. We.get("OES_standard_derivatives"),
  51962. We.get("ANGLE_instanced_arrays"),
  51963. We.get("OES_element_index_uint") && (n.BufferGeometry.MaxIndex = 4294967296);
  51964. var je = new n.WebGLCapabilities(Ge,We,e)
  51965. , Ye = new n.WebGLState(Ge,We,ee)
  51966. , Xe = new n.WebGLProperties
  51967. , Ze = new n.WebGLObjects(Ge,Xe,this.info)
  51968. , qe = new n.WebGLPrograms(this,je)
  51969. , Ke = new n.WebGLLights;
  51970. this.info.programs = qe.programs;
  51971. var Qe = new n.WebGLBufferRenderer(Ge,We,He)
  51972. , Je = new n.WebGLIndexedBufferRenderer(Ge,We,He);
  51973. r(),
  51974. this.context = Ge,
  51975. this.capabilities = je,
  51976. this.extensions = We,
  51977. this.properties = Xe,
  51978. this.state = Ye;
  51979. var $e = new n.WebGLShadowMap(this,Ue,Ze);
  51980. this.shadowMap = $e;
  51981. var et = new n.SpritePlugin(this,ge)
  51982. , tt = new n.LensFlarePlugin(this,me);
  51983. this.getContext = function() {
  51984. return Ge
  51985. }
  51986. ,
  51987. this.getContextAttributes = function() {
  51988. return Ge.getContextAttributes()
  51989. }
  51990. ,
  51991. this.forceContextLoss = function() {
  51992. We.get("WEBGL_lose_context").loseContext()
  51993. }
  51994. ,
  51995. this.getMaxAnisotropy = function() {
  51996. var e;
  51997. return function() {
  51998. if (void 0 !== e)
  51999. return e;
  52000. var t = We.get("EXT_texture_filter_anisotropic");
  52001. return e = null !== t ? Ge.getParameter(t.MAX_TEXTURE_MAX_ANISOTROPY_EXT) : 0
  52002. }
  52003. }(),
  52004. this.getPrecision = function() {
  52005. return je.precision
  52006. }
  52007. ,
  52008. this.getPixelRatio = function() {
  52009. return Oe
  52010. }
  52011. ,
  52012. this.setPixelRatio = function(e) {
  52013. void 0 !== e && (Oe = e,
  52014. this.setSize(Ne.z, Ne.w, !1))
  52015. }
  52016. ,
  52017. this.getSize = function() {
  52018. return {
  52019. width: Re,
  52020. height: Pe
  52021. }
  52022. }
  52023. ,
  52024. this.setSize = function(e, t, i, devicePixelRatio) {
  52025. if(devicePixelRatio != void 0) Oe = devicePixelRatio; //xzw add 改分辨率 始终保持清晰
  52026. Re = e,
  52027. Pe = t,
  52028. te.width = e * Oe,
  52029. te.height = t * Oe,
  52030. i !== !1 && (te.style.width = e + "px",
  52031. te.style.height = t + "px"),
  52032. this.setViewport(0, 0, e, t)
  52033. }
  52034. ,
  52035. this.setViewport = function(e, t, i, n) {
  52036. Ye.viewport(Ne.set(e, t, i, n))
  52037. }
  52038. ,
  52039. this.setScissor = function(e, t, i, n) {
  52040. Ye.scissor(Le.set(e, t, i, n))
  52041. }
  52042. ,
  52043. this.setScissorTest = function(e) {
  52044. Ye.setScissorTest(De = e)
  52045. }
  52046. ,
  52047. this.getClearColor = function() {
  52048. return Se
  52049. }
  52050. ,
  52051. this.setClearColor = function(e, t) {
  52052. Se.set(e),
  52053. Me = void 0 !== t ? t : 1,
  52054. i(Se.r, Se.g, Se.b, Me)
  52055. }
  52056. ,
  52057. this.getClearAlpha = function() {
  52058. return Me
  52059. }
  52060. ,
  52061. this.setClearAlpha = function(e) {
  52062. Me = e,
  52063. i(Se.r, Se.g, Se.b, Me)
  52064. }
  52065. ,
  52066. this.clear = function(e, t, i) {
  52067. var n = 0;
  52068. (void 0 === e || e) && (n |= Ge.COLOR_BUFFER_BIT),
  52069. (void 0 === t || t) && (n |= Ge.DEPTH_BUFFER_BIT),
  52070. (void 0 === i || i) && (n |= Ge.STENCIL_BUFFER_BIT),
  52071. Ge.clear(n)
  52072. }
  52073. ,
  52074. this.clearColor = function() {
  52075. this.clear(!0, !1, !1)
  52076. }
  52077. ,
  52078. this.clearDepth = function() {
  52079. this.clear(!1, !0, !1)
  52080. }
  52081. ,
  52082. this.clearStencil = function() {
  52083. this.clear(!1, !1, !0)
  52084. }
  52085. ,
  52086. this.clearTarget = function(e, t, i, n) {
  52087. this.setRenderTarget(e),
  52088. this.clear(t, i, n)
  52089. }
  52090. ,
  52091. this.resetGLState = o,
  52092. this.dispose = function() {
  52093. te.removeEventListener("webglcontextlost", a, !1)
  52094. }
  52095. ,
  52096. this.renderBufferImmediate = function(e, t, i) {
  52097. Ye.initAttributes();
  52098. var r = Xe.get(e);
  52099. e.hasPositions && !r.position && (r.position = Ge.createBuffer()),
  52100. e.hasNormals && !r.normal && (r.normal = Ge.createBuffer()),
  52101. e.hasUvs && !r.uv && (r.uv = Ge.createBuffer()),
  52102. e.hasColors && !r.color && (r.color = Ge.createBuffer());
  52103. var o = t.getAttributes();
  52104. if (e.hasPositions && (Ge.bindBuffer(Ge.ARRAY_BUFFER, r.position),
  52105. Ge.bufferData(Ge.ARRAY_BUFFER, e.positionArray, Ge.DYNAMIC_DRAW),
  52106. Ye.enableAttribute(o.position),
  52107. Ge.vertexAttribPointer(o.position, 3, Ge.FLOAT, !1, 0, 0)),
  52108. e.hasNormals) {
  52109. if (Ge.bindBuffer(Ge.ARRAY_BUFFER, r.normal),
  52110. "MeshPhongMaterial" !== i.type && "MeshStandardMaterial" !== i.type && i.shading === n.FlatShading)
  52111. for (var a = 0, s = 3 * e.count; a < s; a += 9) {
  52112. var l = e.normalArray
  52113. , c = (l[a + 0] + l[a + 3] + l[a + 6]) / 3
  52114. , h = (l[a + 1] + l[a + 4] + l[a + 7]) / 3
  52115. , u = (l[a + 2] + l[a + 5] + l[a + 8]) / 3;
  52116. l[a + 0] = c,
  52117. l[a + 1] = h,
  52118. l[a + 2] = u,
  52119. l[a + 3] = c,
  52120. l[a + 4] = h,
  52121. l[a + 5] = u,
  52122. l[a + 6] = c,
  52123. l[a + 7] = h,
  52124. l[a + 8] = u
  52125. }
  52126. Ge.bufferData(Ge.ARRAY_BUFFER, e.normalArray, Ge.DYNAMIC_DRAW),
  52127. Ye.enableAttribute(o.normal),
  52128. Ge.vertexAttribPointer(o.normal, 3, Ge.FLOAT, !1, 0, 0)
  52129. }
  52130. e.hasUvs && i.map && (Ge.bindBuffer(Ge.ARRAY_BUFFER, r.uv),
  52131. Ge.bufferData(Ge.ARRAY_BUFFER, e.uvArray, Ge.DYNAMIC_DRAW),
  52132. Ye.enableAttribute(o.uv),
  52133. Ge.vertexAttribPointer(o.uv, 2, Ge.FLOAT, !1, 0, 0)),
  52134. e.hasColors && i.vertexColors !== n.NoColors && (Ge.bindBuffer(Ge.ARRAY_BUFFER, r.color),
  52135. Ge.bufferData(Ge.ARRAY_BUFFER, e.colorArray, Ge.DYNAMIC_DRAW),
  52136. Ye.enableAttribute(o.color),
  52137. Ge.vertexAttribPointer(o.color, 3, Ge.FLOAT, !1, 0, 0)),
  52138. Ye.disableUnusedAttributes(),
  52139. Ge.drawArrays(Ge.TRIANGLES, 0, e.count),
  52140. e.count = 0
  52141. }
  52142. ,
  52143. this.renderBufferDirect = function(e, i, r, o, a, s) {
  52144. E(o);
  52145. var l = w(e, i, o, a)
  52146. , c = !1
  52147. , h = r.id + "_" + l.id + "_" + o.wireframe;
  52148. h !== Ee && (Ee = h,
  52149. c = !0);
  52150. var u = a.morphTargetInfluences;
  52151. if (void 0 !== u) {
  52152. for (var d = [], p = 0, m = u.length; p < m; p++) {
  52153. var v = u[p];
  52154. d.push([v, p])
  52155. }
  52156. d.sort(g),
  52157. d.length > 8 && (d.length = 8);
  52158. for (var A = r.morphAttributes, p = 0, m = d.length; p < m; p++) {
  52159. var v = d[p];
  52160. if (fe[p] = v[0],
  52161. 0 !== v[0]) {
  52162. var y = v[1];
  52163. o.morphTargets === !0 && A.position && r.addAttribute("morphTarget" + p, A.position[y]),
  52164. o.morphNormals === !0 && A.normal && r.addAttribute("morphNormal" + p, A.normal[y])
  52165. } else
  52166. o.morphTargets === !0 && r.removeAttribute("morphTarget" + p),
  52167. o.morphNormals === !0 && r.removeAttribute("morphNormal" + p)
  52168. }
  52169. var C = l.getUniforms();
  52170. null !== C.morphTargetInfluences && Ge.uniform1fv(C.morphTargetInfluences, fe),
  52171. c = !0
  52172. }
  52173. var y = r.index
  52174. , I = r.attributes.position;
  52175. o.wireframe === !0 && (y = Ze.getWireframeAttribute(r));
  52176. var b;
  52177. null !== y ? (b = Je,
  52178. b.setIndex(y)) : b = Qe,
  52179. c && (f(o, l, r),
  52180. null !== y && Ge.bindBuffer(Ge.ELEMENT_ARRAY_BUFFER, Ze.getAttributeBuffer(y)));
  52181. var _ = 0
  52182. , T = 1 / 0;
  52183. null !== y ? T = y.count : void 0 !== I && (T = I.count);
  52184. var x = r.drawRange.start
  52185. , S = r.drawRange.count
  52186. , M = null !== s ? s.start : 0
  52187. , R = null !== s ? s.count : 1 / 0
  52188. , P = Math.max(_, x, M)
  52189. , O = Math.min(_ + T, x + S, M + R) - 1
  52190. , L = Math.max(0, O - P + 1);
  52191. if (a instanceof n.Mesh)
  52192. if (o.wireframe === !0)
  52193. Ye.setLineWidth(o.wireframeLinewidth * t()),
  52194. b.setMode(Ge.LINES);
  52195. else
  52196. switch (a.drawMode) {
  52197. case n.TrianglesDrawMode:
  52198. b.setMode(Ge.TRIANGLES);
  52199. break;
  52200. case n.TriangleStripDrawMode:
  52201. b.setMode(Ge.TRIANGLE_STRIP);
  52202. break;
  52203. case n.TriangleFanDrawMode:
  52204. b.setMode(Ge.TRIANGLE_FAN)
  52205. }
  52206. else if (a instanceof n.Line) {
  52207. var D = o.linewidth;
  52208. void 0 === D && (D = 1),
  52209. Ye.setLineWidth(D * t()),
  52210. a instanceof n.LineSegments ? b.setMode(Ge.LINES) : b.setMode(Ge.LINE_STRIP)
  52211. } else
  52212. a instanceof n.Points && b.setMode(Ge.POINTS);
  52213. r instanceof n.InstancedBufferGeometry ? r.maxInstancedCount > 0 && b.renderInstances(r, P, L) : b.render(P, L)
  52214. }
  52215. ,
  52216. this.render = function(e, t, i, r) {
  52217. if (t instanceof n.Camera == !1)
  52218. return void console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");
  52219. var o = e.fog;
  52220. if (Ee = "",
  52221. Ie = -1,
  52222. be = null,
  52223. e.autoUpdate === !0 && e.updateMatrixWorld(),
  52224. null === t.parent && t.updateMatrixWorld(),
  52225. t.matrixWorldInverse.getInverse(t.matrixWorld),
  52226. Fe.multiplyMatrices(t.projectionMatrix, t.matrixWorldInverse),
  52227. Be.setFromMatrix(Fe),
  52228. ce.length = 0,
  52229. ue = -1,
  52230. pe = -1,
  52231. ge.length = 0,
  52232. me.length = 0,
  52233. y(e, t),
  52234. he.length = ue + 1,
  52235. de.length = pe + 1,
  52236. ve.sortObjects === !0 && (he.sort(m),
  52237. de.sort(v)),
  52238. U(ce, t),
  52239. $e.render(e, t),
  52240. He.calls = 0,
  52241. He.vertices = 0,
  52242. He.faces = 0,
  52243. He.points = 0,
  52244. void 0 === i && (i = null),
  52245. this.setRenderTarget(i),
  52246. (this.autoClear || r) && this.clear(this.autoClearColor, this.autoClearDepth, this.autoClearStencil),
  52247. e.overrideMaterial) {
  52248. var a = e.overrideMaterial;
  52249. C(he, t, o, a),
  52250. C(de, t, o, a)
  52251. } else
  52252. Ye.setBlending(n.NoBlending),
  52253. C(he, t, o),
  52254. C(de, t, o);
  52255. if (et.render(e, t),
  52256. tt.render(e, t, Te),
  52257. i) {
  52258. var s = i.texture;
  52259. s.generateMipmaps && z(i) && s.minFilter !== n.NearestFilter && s.minFilter !== n.LinearFilter && J(i)
  52260. }
  52261. Ye.setDepthTest(!0),
  52262. Ye.setDepthWrite(!0),
  52263. Ye.setColorWrite(!0)
  52264. }
  52265. ,
  52266. this.setFaceCulling = function(e, t) {
  52267. e === n.CullFaceNone ? Ye.disable(Ge.CULL_FACE) : (t === n.FrontFaceDirectionCW ? Ge.frontFace(Ge.CW) : Ge.frontFace(Ge.CCW),
  52268. e === n.CullFaceBack ? Ge.cullFace(Ge.BACK) : e === n.CullFaceFront ? Ge.cullFace(Ge.FRONT) : Ge.cullFace(Ge.FRONT_AND_BACK),
  52269. Ye.enable(Ge.CULL_FACE))
  52270. }
  52271. ,
  52272. this.setTexture = function(e, t) {
  52273. var i = Xe.get(e);
  52274. if (e.version > 0 && i.__version !== e.version) {
  52275. var n = e.image;
  52276. 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)
  52277. }
  52278. Ye.activeTexture(Ge.TEXTURE0 + t),
  52279. Ye.bindTexture(Ge.TEXTURE_2D, i.__webglTexture)
  52280. }
  52281. ,
  52282. this.getCurrentRenderTarget = function() {
  52283. return ye
  52284. }
  52285. ,
  52286. this.setRenderTargetFramebuffer = function ( renderTarget, defaultFramebuffer ) {//add
  52287. const renderTargetProperties = Xe.get( renderTarget );
  52288. renderTargetProperties.__webglFramebuffer = defaultFramebuffer;
  52289. renderTargetProperties.__useDefaultFramebuffer = defaultFramebuffer === undefined;
  52290. },
  52291. this.setFramebuffer = function ( value ) {//add
  52292. if ( Ce !== value && ye === null ) Ge.bindFramebuffer( 36160, value );
  52293. Ce = value;
  52294. },
  52295. this.setRenderTarget = function(e) {
  52296. ye = e,
  52297. e && void 0 === Xe.get(e).__webglFramebuffer && Q(e);
  52298. var t, i = e instanceof n.WebGLRenderTargetCube;
  52299. if (e) {
  52300. var r = Xe.get(e);
  52301. t = i ? r.__webglFramebuffer[e.activeCubeFace] : r.__webglFramebuffer,
  52302. we.copy(e.scissor),
  52303. _e = e.scissorTest,
  52304. Te.copy(e.viewport)
  52305. } else
  52306. t = null,
  52307. we.copy(Le).multiplyScalar(Oe),
  52308. _e = De,
  52309. Te.copy(Ne).multiplyScalar(Oe);
  52310. if (Ce !== t && (Ge.bindFramebuffer(Ge.FRAMEBUFFER, t),
  52311. Ce = t),
  52312. Ye.scissor(we),
  52313. Ye.setScissorTest(_e),
  52314. Ye.viewport(Te),
  52315. i) {
  52316. var o = Xe.get(e.texture);
  52317. Ge.framebufferTexture2D(Ge.FRAMEBUFFER, Ge.COLOR_ATTACHMENT0, Ge.TEXTURE_CUBE_MAP_POSITIVE_X + e.activeCubeFace, o.__webglTexture, e.activeMipMapLevel)
  52318. }
  52319. }
  52320. ,
  52321. this.readRenderTargetPixels = function(e, t, i, r, o, a) {
  52322. if (e instanceof n.WebGLRenderTarget == !1)
  52323. return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");
  52324. var s = Xe.get(e).__webglFramebuffer;
  52325. if (s) {
  52326. var l = !1;
  52327. s !== Ce && (Ge.bindFramebuffer(Ge.FRAMEBUFFER, s),
  52328. l = !0);
  52329. try {
  52330. var c = e.texture;
  52331. if (c.format !== n.RGBAFormat && ee(c.format) !== Ge.getParameter(Ge.IMPLEMENTATION_COLOR_READ_FORMAT))
  52332. return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");
  52333. 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")))
  52334. return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");
  52335. 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.")
  52336. } finally {
  52337. l && Ge.bindFramebuffer(Ge.FRAMEBUFFER, Ce)
  52338. }
  52339. }
  52340. }
  52341. }
  52342. ,
  52343. n.WebGLRenderTarget = function(e, t, i) {
  52344. this.uuid = n.Math.generateUUID(),
  52345. this.width = e,
  52346. this.height = t,
  52347. this.scissor = new n.Vector4(0,0,e,t),
  52348. this.scissorTest = !1,
  52349. this.viewport = new n.Vector4(0,0,e,t),
  52350. i = i || {},
  52351. void 0 === i.minFilter && (i.minFilter = n.LinearFilter),
  52352. this.texture = new n.Texture(void 0,void 0,i.wrapS,i.wrapT,i.magFilter,i.minFilter,i.format,i.type,i.anisotropy),
  52353. this.depthBuffer = void 0 === i.depthBuffer || i.depthBuffer,
  52354. this.stencilBuffer = void 0 === i.stencilBuffer || i.stencilBuffer
  52355. }
  52356. ,
  52357. n.WebGLRenderTarget.prototype = {
  52358. constructor: n.WebGLRenderTarget,
  52359. setSize: function(e, t) {
  52360. this.width === e && this.height === t || (this.width = e,
  52361. this.height = t,
  52362. this.dispose()),
  52363. this.viewport.set(0, 0, e, t),
  52364. this.scissor.set(0, 0, e, t)
  52365. },
  52366. clone: function() {
  52367. return (new this.constructor).copy(this)
  52368. },
  52369. copy: function(e) {
  52370. return this.width = e.width,
  52371. this.height = e.height,
  52372. this.viewport.copy(e.viewport),
  52373. this.texture = e.texture.clone(),
  52374. this.depthBuffer = e.depthBuffer,
  52375. this.stencilBuffer = e.stencilBuffer,
  52376. this
  52377. },
  52378. dispose: function() {
  52379. this.dispatchEvent({
  52380. type: "dispose"
  52381. })
  52382. }
  52383. },
  52384. n.EventDispatcher.prototype.apply(n.WebGLRenderTarget.prototype),
  52385. n.WebGLRenderTargetCube = function(e, t, i) {
  52386. n.WebGLRenderTarget.call(this, e, t, i),
  52387. this.activeCubeFace = 0,
  52388. this.activeMipMapLevel = 0
  52389. }
  52390. ,
  52391. n.WebGLRenderTargetCube.prototype = Object.create(n.WebGLRenderTarget.prototype),
  52392. n.WebGLRenderTargetCube.prototype.constructor = n.WebGLRenderTargetCube,
  52393. n.WebGLBufferRenderer = function(e, t, i) {
  52394. function r(e) {
  52395. s = e
  52396. }
  52397. function o(t, n) {
  52398. e.drawArrays(s, t, n),
  52399. i.calls++,
  52400. i.vertices += n,
  52401. s === e.TRIANGLES && (i.faces += n / 3)
  52402. }
  52403. function a(r) {
  52404. var o = t.get("ANGLE_instanced_arrays");
  52405. if (null === o)
  52406. return void console.error("THREE.WebGLBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");
  52407. var a = r.attributes.position
  52408. , l = 0;
  52409. a instanceof n.InterleavedBufferAttribute ? (l = a.data.count,
  52410. o.drawArraysInstancedANGLE(s, 0, l, r.maxInstancedCount)) : (l = a.count,
  52411. o.drawArraysInstancedANGLE(s, 0, l, r.maxInstancedCount)),
  52412. i.calls++,
  52413. i.vertices += l * r.maxInstancedCount,
  52414. s === e.TRIANGLES && (i.faces += r.maxInstancedCount * l / 3)
  52415. }
  52416. var s;
  52417. this.setMode = r,
  52418. this.render = o,
  52419. this.renderInstances = a
  52420. }
  52421. ,
  52422. n.WebGLIndexedBufferRenderer = function(e, t, i) {
  52423. function n(e) {
  52424. s = e
  52425. }
  52426. function r(i) {
  52427. i.array instanceof Uint32Array && t.get("OES_element_index_uint") ? (l = e.UNSIGNED_INT,
  52428. c = 4) : (l = e.UNSIGNED_SHORT,
  52429. c = 2)
  52430. }
  52431. function o(t, n) {
  52432. e.drawElements(s, n, l, t * c),
  52433. i.calls++,
  52434. i.vertices += n,
  52435. s === e.TRIANGLES && (i.faces += n / 3)
  52436. }
  52437. function a(n, r, o) {
  52438. var a = t.get("ANGLE_instanced_arrays");
  52439. 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),
  52440. i.calls++,
  52441. i.vertices += o * n.maxInstancedCount,
  52442. void (s === e.TRIANGLES && (i.faces += n.maxInstancedCount * o / 3)))
  52443. }
  52444. var s, l, c;
  52445. this.setMode = n,
  52446. this.setIndex = r,
  52447. this.render = o,
  52448. this.renderInstances = a
  52449. }
  52450. ,
  52451. n.WebGLExtensions = function(e) {
  52452. var t = {};
  52453. this.get = function(i) {
  52454. if (void 0 !== t[i])
  52455. return t[i];
  52456. var n;
  52457. switch (i) {
  52458. case "EXT_texture_filter_anisotropic":
  52459. n = e.getExtension("EXT_texture_filter_anisotropic") || e.getExtension("MOZ_EXT_texture_filter_anisotropic") || e.getExtension("WEBKIT_EXT_texture_filter_anisotropic");
  52460. break;
  52461. case "WEBGL_compressed_texture_s3tc":
  52462. n = e.getExtension("WEBGL_compressed_texture_s3tc") || e.getExtension("MOZ_WEBGL_compressed_texture_s3tc") || e.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc");
  52463. break;
  52464. case "WEBGL_compressed_texture_pvrtc":
  52465. n = e.getExtension("WEBGL_compressed_texture_pvrtc") || e.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc");
  52466. break;
  52467. case "WEBGL_compressed_texture_etc1":
  52468. n = e.getExtension("WEBGL_compressed_texture_etc1");
  52469. break;
  52470. default:
  52471. n = e.getExtension(i)
  52472. }
  52473. return null === n && console.warn("THREE.WebGLRenderer: " + i + " extension not supported."),
  52474. t[i] = n,
  52475. n
  52476. }
  52477. }
  52478. ,
  52479. n.WebGLCapabilities = function(e, t, i) {
  52480. function n(t) {
  52481. if ("highp" === t) {
  52482. if (e.getShaderPrecisionFormat(e.VERTEX_SHADER, e.HIGH_FLOAT).precision > 0 && e.getShaderPrecisionFormat(e.FRAGMENT_SHADER, e.HIGH_FLOAT).precision > 0)
  52483. return "highp";
  52484. t = "mediump"
  52485. }
  52486. 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"
  52487. }
  52488. this.getMaxPrecision = n,
  52489. this.precision = void 0 !== i.precision ? i.precision : "highp",
  52490. this.logarithmicDepthBuffer = void 0 !== i.logarithmicDepthBuffer && i.logarithmicDepthBuffer,
  52491. this.maxTextures = e.getParameter(e.MAX_TEXTURE_IMAGE_UNITS),
  52492. this.maxVertexTextures = e.getParameter(e.MAX_VERTEX_TEXTURE_IMAGE_UNITS),
  52493. this.maxTextureSize = e.getParameter(e.MAX_TEXTURE_SIZE),
  52494. this.maxCubemapSize = e.getParameter(e.MAX_CUBE_MAP_TEXTURE_SIZE),
  52495. this.maxAttributes = e.getParameter(e.MAX_VERTEX_ATTRIBS),
  52496. this.maxVertexUniforms = e.getParameter(e.MAX_VERTEX_UNIFORM_VECTORS),
  52497. this.maxVaryings = e.getParameter(e.MAX_VARYING_VECTORS),
  52498. this.maxFragmentUniforms = e.getParameter(e.MAX_FRAGMENT_UNIFORM_VECTORS),
  52499. this.vertexTextures = this.maxVertexTextures > 0,
  52500. this.floatFragmentTextures = !!t.get("OES_texture_float"),
  52501. this.floatVertexTextures = this.vertexTextures && this.floatFragmentTextures;
  52502. var r = n(this.precision);
  52503. r !== this.precision && (console.warn("THREE.WebGLRenderer:", this.precision, "not supported, using", r, "instead."),
  52504. this.precision = r),
  52505. this.logarithmicDepthBuffer && (this.logarithmicDepthBuffer = !!t.get("EXT_frag_depth"))
  52506. }
  52507. ,
  52508. n.WebGLGeometries = function(e, t, i) {
  52509. function r(e) {
  52510. var t = e.geometry;
  52511. if (void 0 !== h[t.id])
  52512. return h[t.id];
  52513. t.addEventListener("dispose", o);
  52514. var r;
  52515. return t instanceof n.BufferGeometry ? r = t : t instanceof n.Geometry && (void 0 === t._bufferGeometry && (t._bufferGeometry = (new n.BufferGeometry).setFromObject(e)),
  52516. r = t._bufferGeometry),
  52517. h[t.id] = r,
  52518. i.memory.geometries++,
  52519. r
  52520. }
  52521. function o(e) {
  52522. var n = e.target
  52523. , r = h[n.id];
  52524. null !== r.index && s(r.index),
  52525. l(r.attributes),
  52526. n.removeEventListener("dispose", o),
  52527. delete h[n.id];
  52528. var a = t.get(n);
  52529. a.wireframe && s(a.wireframe),
  52530. t.delete(n);
  52531. var c = t.get(r);
  52532. c.wireframe && s(c.wireframe),
  52533. t.delete(r),
  52534. i.memory.geometries--
  52535. }
  52536. function a(e) {
  52537. return e instanceof n.InterleavedBufferAttribute ? t.get(e.data).__webglBuffer : t.get(e).__webglBuffer
  52538. }
  52539. function s(t) {
  52540. var i = a(t);
  52541. void 0 !== i && (e.deleteBuffer(i),
  52542. c(t))
  52543. }
  52544. function l(e) {
  52545. for (var t in e)
  52546. s(e[t])
  52547. }
  52548. function c(e) {
  52549. e instanceof n.InterleavedBufferAttribute ? t.delete(e.data) : t.delete(e)
  52550. }
  52551. var h = {};
  52552. this.get = r
  52553. }
  52554. ,
  52555. n.WebGLLights = function() {
  52556. var e = {};
  52557. this.get = function(t) {
  52558. if (void 0 !== e[t.id])
  52559. return e[t.id];
  52560. var i;
  52561. switch (t.type) {
  52562. case "DirectionalLight":
  52563. i = {
  52564. direction: new n.Vector3,
  52565. color: new n.Color,
  52566. shadow: !1,
  52567. shadowBias: 0,
  52568. shadowRadius: 1,
  52569. shadowMapSize: new n.Vector2
  52570. };
  52571. break;
  52572. case "SpotLight":
  52573. i = {
  52574. position: new n.Vector3,
  52575. direction: new n.Vector3,
  52576. color: new n.Color,
  52577. distance: 0,
  52578. coneCos: 0,
  52579. penumbraCos: 0,
  52580. decay: 0,
  52581. shadow: !1,
  52582. shadowBias: 0,
  52583. shadowRadius: 1,
  52584. shadowMapSize: new n.Vector2
  52585. };
  52586. break;
  52587. case "PointLight":
  52588. i = {
  52589. position: new n.Vector3,
  52590. color: new n.Color,
  52591. distance: 0,
  52592. decay: 0,
  52593. shadow: !1,
  52594. shadowBias: 0,
  52595. shadowRadius: 1,
  52596. shadowMapSize: new n.Vector2
  52597. };
  52598. break;
  52599. case "HemisphereLight":
  52600. i = {
  52601. direction: new n.Vector3,
  52602. skyColor: new n.Color,
  52603. groundColor: new n.Color
  52604. }
  52605. }
  52606. return e[t.id] = i,
  52607. i
  52608. }
  52609. }
  52610. ,
  52611. n.WebGLObjects = function(e, t, i) {
  52612. function r(t) {
  52613. var i = u.get(t);
  52614. t.geometry instanceof n.Geometry && i.updateFromObject(t);
  52615. var r = i.index
  52616. , a = i.attributes;
  52617. null !== r && o(r, e.ELEMENT_ARRAY_BUFFER);
  52618. for (var s in a)
  52619. o(a[s], e.ARRAY_BUFFER);
  52620. var l = i.morphAttributes;
  52621. for (var s in l)
  52622. for (var c = l[s], h = 0, d = c.length; h < d; h++)
  52623. o(c[h], e.ARRAY_BUFFER);
  52624. return i
  52625. }
  52626. function o(e, i) {
  52627. var r = e instanceof n.InterleavedBufferAttribute ? e.data : e
  52628. , o = t.get(r);
  52629. void 0 === o.__webglBuffer ? a(o, r, i) : o.version !== r.version && s(o, r, i)
  52630. }
  52631. function a(t, i, n) {
  52632. t.__webglBuffer = e.createBuffer(),
  52633. e.bindBuffer(n, t.__webglBuffer);
  52634. var r = i.dynamic ? e.DYNAMIC_DRAW : e.STATIC_DRAW;
  52635. e.bufferData(n, i.array, r),
  52636. t.version = i.version
  52637. }
  52638. function s(t, i, n) {
  52639. e.bindBuffer(n, t.__webglBuffer),
  52640. 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)),
  52641. i.updateRange.count = 0),
  52642. t.version = i.version
  52643. }
  52644. function l(e) {
  52645. return e instanceof n.InterleavedBufferAttribute ? t.get(e.data).__webglBuffer : t.get(e).__webglBuffer
  52646. }
  52647. function c(i) {
  52648. var r = t.get(i);
  52649. if (void 0 !== r.wireframe)
  52650. return r.wireframe;
  52651. var a = []
  52652. , s = i.index
  52653. , l = i.attributes
  52654. , c = l.position;
  52655. if (null !== s)
  52656. for (var u = {}, d = s.array, p = 0, f = d.length; p < f; p += 3) {
  52657. var g = d[p + 0]
  52658. , m = d[p + 1]
  52659. , v = d[p + 2];
  52660. h(u, g, m) && a.push(g, m),
  52661. h(u, m, v) && a.push(m, v),
  52662. h(u, v, g) && a.push(v, g)
  52663. }
  52664. else
  52665. for (var d = l.position.array, p = 0, f = d.length / 3 - 1; p < f; p += 3) {
  52666. var g = p + 0
  52667. , m = p + 1
  52668. , v = p + 2;
  52669. a.push(g, m, m, v, v, g)
  52670. }
  52671. var A = c.count > 65535 ? Uint32Array : Uint16Array
  52672. , y = new n.BufferAttribute(new A(a),1);
  52673. return o(y, e.ELEMENT_ARRAY_BUFFER),
  52674. r.wireframe = y,
  52675. y
  52676. }
  52677. function h(e, t, i) {
  52678. if (t > i) {
  52679. var n = t;
  52680. t = i,
  52681. i = n
  52682. }
  52683. var r = e[t];
  52684. return void 0 === r ? (e[t] = [i],
  52685. !0) : r.indexOf(i) === -1 && (r.push(i),
  52686. !0)
  52687. }
  52688. var u = new n.WebGLGeometries(e,t,i);
  52689. this.getAttributeBuffer = l,
  52690. this.getWireframeAttribute = c,
  52691. this.update = r
  52692. }
  52693. ,
  52694. n.WebGLProgram = function() {
  52695. function e(e) {
  52696. switch (e) {
  52697. case n.LinearEncoding:
  52698. return ["Linear", "( value )"];
  52699. case n.sRGBEncoding:
  52700. return ["sRGB", "( value )"];
  52701. case n.RGBEEncoding:
  52702. return ["RGBE", "( value )"];
  52703. case n.RGBM7Encoding:
  52704. return ["RGBM", "( value, 7.0 )"];
  52705. case n.RGBM16Encoding:
  52706. return ["RGBM", "( value, 16.0 )"];
  52707. case n.RGBDEncoding:
  52708. return ["RGBD", "( value, 256.0 )"];
  52709. case n.GammaEncoding:
  52710. return ["Gamma", "( value, float( GAMMA_FACTOR ) )"];
  52711. default:
  52712. throw new Error("unsupported encoding: " + e)
  52713. }
  52714. }
  52715. function t(t, i) {
  52716. var n = e(i);
  52717. return "vec4 " + t + "( vec4 value ) { return " + n[0] + "ToLinear" + n[1] + "; }"
  52718. }
  52719. function i(t, i) {
  52720. var n = e(i);
  52721. return "vec4 " + t + "( vec4 value ) { return LinearTo" + n[0] + n[1] + "; }"
  52722. }
  52723. function r(e, t) {
  52724. var i;
  52725. switch (t) {
  52726. case n.LinearToneMapping:
  52727. i = "Linear";
  52728. break;
  52729. case n.ReinhardToneMapping:
  52730. i = "Reinhard";
  52731. break;
  52732. case n.Uncharted2ToneMapping:
  52733. i = "Uncharted2";
  52734. break;
  52735. case n.CineonToneMapping:
  52736. i = "OptimizedCineon";
  52737. break;
  52738. default:
  52739. throw new Error("unsupported toneMapping: " + t)
  52740. }
  52741. return "vec3 " + e + "( vec3 color ) { return " + i + "ToneMapping( color ); }"
  52742. }
  52743. function o(e, t, i) {
  52744. e = e || {};
  52745. 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" : ""];
  52746. return n.filter(c).join("\n")
  52747. }
  52748. function a(e) {
  52749. var t = [];
  52750. for (var i in e) {
  52751. var n = e[i];
  52752. n !== !1 && t.push("#define " + i + " " + n)
  52753. }
  52754. return t.join("\n")
  52755. }
  52756. function s(e, t, i) {
  52757. for (var n = {}, r = e.getProgramParameter(t, e.ACTIVE_UNIFORMS), o = 0; o < r; o++) {
  52758. var a = e.getActiveUniform(t, o)
  52759. , s = a.name
  52760. , l = e.getUniformLocation(t, s)
  52761. , c = f.exec(s);
  52762. if (c) {
  52763. var h = c[1]
  52764. , u = c[2]
  52765. , d = n[h];
  52766. d || (d = n[h] = {}),
  52767. d[u] = l
  52768. } else if (c = g.exec(s)) {
  52769. var p = c[1]
  52770. , v = c[2]
  52771. , A = c[3]
  52772. , y = n[p];
  52773. y || (y = n[p] = []);
  52774. var C = y[v];
  52775. C || (C = y[v] = {}),
  52776. C[A] = l
  52777. } else if (c = m.exec(s)) {
  52778. var p = c[1];
  52779. n[p] = l
  52780. } else
  52781. n[s] = l
  52782. }
  52783. return n
  52784. }
  52785. function l(e, t, i) {
  52786. for (var n = {}, r = e.getProgramParameter(t, e.ACTIVE_ATTRIBUTES), o = 0; o < r; o++) {
  52787. var a = e.getActiveAttrib(t, o)
  52788. , s = a.name;
  52789. n[s] = e.getAttribLocation(t, s)
  52790. }
  52791. return n
  52792. }
  52793. function c(e) {
  52794. return "" !== e
  52795. }
  52796. function h(e, t) {
  52797. 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)
  52798. }
  52799. function u(e) {
  52800. function t(e, t) {
  52801. var i = n.ShaderChunk[t];
  52802. if (void 0 === i)
  52803. throw new Error("Can not resolve #include <" + t + ">");
  52804. return u(i)
  52805. }
  52806. var i = /#include +<([\w\d.]+)>/g;
  52807. return e.replace(i, t)
  52808. }
  52809. function d(e) {
  52810. function t(e, t, i, n) {
  52811. for (var r = "", o = parseInt(t); o < parseInt(i); o++)
  52812. r += n.replace(/\[ i \]/g, "[ " + o + " ]");
  52813. return r
  52814. }
  52815. var i = /for \( int i \= (\d+)\; i < (\d+)\; i \+\+ \) \{([\s\S]+?)(?=\})\}/g;
  52816. return e.replace(i, t)
  52817. }
  52818. var p = 0
  52819. , f = /^([\w\d_]+)\.([\w\d_]+)$/
  52820. , g = /^([\w\d_]+)\[(\d+)\]\.([\w\d_]+)$/
  52821. , m = /^([\w\d_]+)\[0\]$/;
  52822. return function(e, f, g, m) {
  52823. var v = e.context
  52824. , A = g.extensions
  52825. , y = g.defines
  52826. , C = g.__webglShader.vertexShader
  52827. , I = g.__webglShader.fragmentShader
  52828. , E = "SHADOWMAP_TYPE_BASIC";
  52829. m.shadowMapType === n.PCFShadowMap ? E = "SHADOWMAP_TYPE_PCF" : m.shadowMapType === n.PCFSoftShadowMap && (E = "SHADOWMAP_TYPE_PCF_SOFT");
  52830. var b = "ENVMAP_TYPE_CUBE"
  52831. , w = "ENVMAP_MODE_REFLECTION"
  52832. , _ = "ENVMAP_BLENDING_MULTIPLY";
  52833. if (m.envMap) {
  52834. switch (g.envMap.mapping) {
  52835. case n.CubeReflectionMapping:
  52836. case n.CubeRefractionMapping:
  52837. b = "ENVMAP_TYPE_CUBE";
  52838. break;
  52839. case n.CubeUVReflectionMapping:
  52840. case n.CubeUVRefractionMapping:
  52841. b = "ENVMAP_TYPE_CUBE_UV";
  52842. break;
  52843. case n.EquirectangularReflectionMapping:
  52844. case n.EquirectangularRefractionMapping:
  52845. b = "ENVMAP_TYPE_EQUIREC";
  52846. break;
  52847. case n.SphericalReflectionMapping:
  52848. b = "ENVMAP_TYPE_SPHERE"
  52849. }
  52850. switch (g.envMap.mapping) {
  52851. case n.CubeRefractionMapping:
  52852. case n.EquirectangularRefractionMapping:
  52853. w = "ENVMAP_MODE_REFRACTION"
  52854. }
  52855. switch (g.combine) {
  52856. case n.MultiplyOperation:
  52857. _ = "ENVMAP_BLENDING_MULTIPLY";
  52858. break;
  52859. case n.MixOperation:
  52860. _ = "ENVMAP_BLENDING_MIX";
  52861. break;
  52862. case n.AddOperation:
  52863. _ = "ENVMAP_BLENDING_ADD"
  52864. }
  52865. }
  52866. var T, x, S = e.gammaFactor > 0 ? e.gammaFactor : 1, M = o(A, m, e.extensions), R = a(y), P = v.createProgram();
  52867. g instanceof n.RawShaderMaterial ? (T = "",
  52868. 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"),
  52869. 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")),
  52870. C = u(C, m),
  52871. C = h(C, m),
  52872. I = u(I, m),
  52873. I = h(I, m),
  52874. g instanceof n.ShaderMaterial == !1 && (C = d(C),
  52875. I = d(I));
  52876. var O = T + C
  52877. , L = x + I
  52878. , D = n.WebGLShader(v, v.VERTEX_SHADER, O)
  52879. , N = n.WebGLShader(v, v.FRAGMENT_SHADER, L);
  52880. v.attachShader(P, D),
  52881. v.attachShader(P, N),
  52882. void 0 !== g.index0AttributeName ? v.bindAttribLocation(P, 0, g.index0AttributeName) : m.morphTargets === !0 && v.bindAttribLocation(P, 0, "position"),
  52883. v.linkProgram(P);
  52884. var B = v.getProgramInfoLog(P)
  52885. , F = v.getShaderInfoLog(D)
  52886. , V = v.getShaderInfoLog(N)
  52887. , U = !0
  52888. , k = !0;
  52889. v.getProgramParameter(P, v.LINK_STATUS) === !1 ? (U = !1,
  52890. 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),
  52891. k && (this.diagnostics = {
  52892. runnable: U,
  52893. material: g,
  52894. programLog: B,
  52895. vertexShader: {
  52896. log: F,
  52897. prefix: T
  52898. },
  52899. fragmentShader: {
  52900. log: V,
  52901. prefix: x
  52902. }
  52903. }),
  52904. v.deleteShader(D),
  52905. v.deleteShader(N);
  52906. var H;
  52907. this.getUniforms = function() {
  52908. return void 0 === H && (H = s(v, P)),
  52909. H
  52910. }
  52911. ;
  52912. var G;
  52913. return this.getAttributes = function() {
  52914. return void 0 === G && (G = l(v, P)),
  52915. G
  52916. }
  52917. ,
  52918. this.destroy = function() {
  52919. v.deleteProgram(P),
  52920. this.program = void 0
  52921. }
  52922. ,
  52923. Object.defineProperties(this, {
  52924. uniforms: {
  52925. get: function() {
  52926. return console.warn("THREE.WebGLProgram: .uniforms is now .getUniforms()."),
  52927. this.getUniforms()
  52928. }
  52929. },
  52930. attributes: {
  52931. get: function() {
  52932. return console.warn("THREE.WebGLProgram: .attributes is now .getAttributes()."),
  52933. this.getAttributes()
  52934. }
  52935. }
  52936. }),
  52937. this.id = p++,
  52938. this.code = f,
  52939. this.usedTimes = 1,
  52940. this.program = P,
  52941. this.vertexShader = D,
  52942. this.fragmentShader = N,
  52943. this
  52944. }
  52945. }(),
  52946. n.WebGLPrograms = function(e, t) {
  52947. function i(e) {
  52948. if (t.floatVertexTextures && e && e.skeleton && e.skeleton.useVertexTexture)
  52949. return 1024;
  52950. var i = t.maxVertexUniforms
  52951. , r = Math.floor((i - 20) / 4)
  52952. , o = r;
  52953. return void 0 !== e && e instanceof n.SkinnedMesh && (o = Math.min(e.skeleton.bones.length, o),
  52954. 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)")),
  52955. o
  52956. }
  52957. function r(e, t) {
  52958. var i;
  52959. return e ? e instanceof n.Texture ? i = e.encoding : e instanceof n.WebGLRenderTarget && (i = e.texture.encoding) : i = n.LinearEncoding,
  52960. i === n.LinearEncoding && t && (i = n.GammaEncoding),
  52961. i
  52962. }
  52963. var o = []
  52964. , a = {
  52965. MeshDepthMaterial: "depth",
  52966. MeshNormalMaterial: "normal",
  52967. MeshBasicMaterial: "basic",
  52968. MeshLambertMaterial: "lambert",
  52969. MeshPhongMaterial: "phong",
  52970. MeshStandardMaterial: "standard",
  52971. LineBasicMaterial: "basic",
  52972. LineDashedMaterial: "dashed",
  52973. PointsMaterial: "points"
  52974. }
  52975. , 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"];
  52976. this.getParameters = function(o, s, l, c) {
  52977. var h = a[o.type]
  52978. , u = i(c)
  52979. , d = e.getPrecision();
  52980. null !== o.precision && (d = t.getMaxPrecision(o.precision),
  52981. d !== o.precision && console.warn("THREE.WebGLProgram.getParameters:", o.precision, "not supported, using", d, "instead."));
  52982. var p = {
  52983. shaderID: h,
  52984. precision: d,
  52985. supportsVertexTextures: t.vertexTextures,
  52986. outputEncoding: r(e.getCurrentRenderTarget(), e.gammaOutput),
  52987. map: !!o.map,
  52988. mapEncoding: r(o.map, e.gammaInput),
  52989. envMap: !!o.envMap,
  52990. envMapMode: o.envMap && o.envMap.mapping,
  52991. envMapEncoding: r(o.envMap, e.gammaInput),
  52992. envMapCubeUV: !!o.envMap && (o.envMap.mapping === n.CubeUVReflectionMapping || o.envMap.mapping === n.CubeUVRefractionMapping),
  52993. lightMap: !!o.lightMap,
  52994. aoMap: !!o.aoMap,
  52995. emissiveMap: !!o.emissiveMap,
  52996. emissiveMapEncoding: r(o.emissiveMap, e.gammaInput),
  52997. bumpMap: !!o.bumpMap,
  52998. normalMap: !!o.normalMap,
  52999. displacementMap: !!o.displacementMap,
  53000. roughnessMap: !!o.roughnessMap,
  53001. metalnessMap: !!o.metalnessMap,
  53002. specularMap: !!o.specularMap,
  53003. alphaMap: !!o.alphaMap,
  53004. combine: o.combine,
  53005. vertexColors: o.vertexColors,
  53006. fog: l,
  53007. useFog: o.fog,
  53008. fogExp: l instanceof n.FogExp2,
  53009. flatShading: o.shading === n.FlatShading,
  53010. sizeAttenuation: o.sizeAttenuation,
  53011. logarithmicDepthBuffer: t.logarithmicDepthBuffer,
  53012. skinning: o.skinning,
  53013. maxBones: u,
  53014. useVertexTexture: t.floatVertexTextures && c && c.skeleton && c.skeleton.useVertexTexture,
  53015. morphTargets: o.morphTargets,
  53016. morphNormals: o.morphNormals,
  53017. maxMorphTargets: e.maxMorphTargets,
  53018. maxMorphNormals: e.maxMorphNormals,
  53019. numDirLights: s.directional.length,
  53020. numPointLights: s.point.length,
  53021. numSpotLights: s.spot.length,
  53022. numHemiLights: s.hemi.length,
  53023. pointLightShadows: s.shadowsPointLight,
  53024. shadowMapEnabled: e.shadowMap.enabled && c.receiveShadow && s.shadows.length > 0,
  53025. shadowMapType: e.shadowMap.type,
  53026. toneMapping: e.toneMapping,
  53027. physicallyCorrectLights: e.physicallyCorrectLights,
  53028. premultipliedAlpha: o.premultipliedAlpha,
  53029. alphaTest: o.alphaTest,
  53030. doubleSided: o.side === n.DoubleSide,
  53031. flipSided: o.side === n.BackSide
  53032. };
  53033. return p
  53034. }
  53035. ,
  53036. this.getProgramCode = function(e, t) {
  53037. var i = [];
  53038. if (t.shaderID ? i.push(t.shaderID) : (i.push(e.fragmentShader),
  53039. i.push(e.vertexShader)),
  53040. void 0 !== e.defines)
  53041. for (var n in e.defines)
  53042. i.push(n),
  53043. i.push(e.defines[n]);
  53044. for (var r = 0; r < s.length; r++) {
  53045. var o = s[r];
  53046. i.push(o),
  53047. i.push(t[o])
  53048. }
  53049. return i.join()
  53050. }
  53051. ,
  53052. this.acquireProgram = function(t, i, r) {
  53053. for (var a, s = 0, l = o.length; s < l; s++) {
  53054. var c = o[s];
  53055. if (c.code === r) {
  53056. a = c,
  53057. ++a.usedTimes;
  53058. break
  53059. }
  53060. }
  53061. return void 0 === a && (a = new n.WebGLProgram(e,r,t,i),
  53062. o.push(a)),
  53063. a
  53064. }
  53065. ,
  53066. this.releaseProgram = function(e) {
  53067. if (0 === --e.usedTimes) {
  53068. var t = o.indexOf(e);
  53069. o[t] = o[o.length - 1],
  53070. o.pop(),
  53071. e.destroy()
  53072. }
  53073. }
  53074. ,
  53075. this.programs = o
  53076. }
  53077. ,
  53078. n.WebGLProperties = function() {
  53079. var e = {};
  53080. this.get = function(t) {
  53081. var i = t.uuid
  53082. , n = e[i];
  53083. return void 0 === n && (n = {},
  53084. e[i] = n),
  53085. n
  53086. }
  53087. ,
  53088. this.delete = function(t) {
  53089. delete e[t.uuid]
  53090. }
  53091. ,
  53092. this.clear = function() {
  53093. e = {}
  53094. }
  53095. }
  53096. ,
  53097. n.WebGLShader = function() {
  53098. function e(e) {
  53099. for (var t = e.split("\n"), i = 0; i < t.length; i++)
  53100. t[i] = i + 1 + ": " + t[i];
  53101. return t.join("\n")
  53102. }
  53103. return function(t, i, n) {
  53104. var r = t.createShader(i);
  53105. return t.shaderSource(r, n),
  53106. t.compileShader(r),
  53107. t.getShaderParameter(r, t.COMPILE_STATUS) === !1 && console.error("THREE.WebGLShader: Shader couldn't compile."),
  53108. "" !== t.getShaderInfoLog(r) && console.warn("THREE.WebGLShader: gl.getShaderInfoLog()", i === t.VERTEX_SHADER ? "vertex" : "fragment", t.getShaderInfoLog(r), e(n)),
  53109. r
  53110. }
  53111. }(),
  53112. n.WebGLShadowMap = function(e, t, i) {
  53113. function r(e, t, i, r) {
  53114. var o = e.geometry
  53115. , a = null
  53116. , s = v
  53117. , l = e.customDepthMaterial;
  53118. if (i && (s = A,
  53119. l = e.customDistanceMaterial),
  53120. l)
  53121. a = l;
  53122. else {
  53123. var c = void 0 !== o.morphTargets && o.morphTargets.length > 0 && t.morphTargets
  53124. , h = e instanceof n.SkinnedMesh && t.skinning
  53125. , u = 0;
  53126. c && (u |= f),
  53127. h && (u |= g),
  53128. a = s[u]
  53129. }
  53130. return a.visible = t.visible,
  53131. a.wireframe = t.wireframe,
  53132. a.wireframeLinewidth = t.wireframeLinewidth,
  53133. i && void 0 !== a.uniforms.lightPos && a.uniforms.lightPos.value.copy(r),
  53134. a
  53135. }
  53136. function o(e, t, i) {
  53137. if (e.visible !== !1) {
  53138. 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)) {
  53139. var r = e.material;
  53140. r.visible === !0 && (e.modelViewMatrix.multiplyMatrices(i.matrixWorldInverse, e.matrixWorld),
  53141. p.push(e))
  53142. }
  53143. for (var a = e.children, s = 0, c = a.length; s < c; s++)
  53144. o(a[s], t, i)
  53145. }
  53146. }
  53147. 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) {
  53148. var x = 0 !== (T & f)
  53149. , S = 0 !== (T & g)
  53150. , M = new n.ShaderMaterial({
  53151. uniforms: b,
  53152. vertexShader: E.vertexShader,
  53153. fragmentShader: E.fragmentShader,
  53154. morphTargets: x,
  53155. skinning: S
  53156. });
  53157. v[T] = M;
  53158. var R = new n.ShaderMaterial({
  53159. defines: {
  53160. USE_SHADOWMAP: ""
  53161. },
  53162. uniforms: _,
  53163. vertexShader: w.vertexShader,
  53164. fragmentShader: w.fragmentShader,
  53165. morphTargets: x,
  53166. skinning: S
  53167. });
  53168. A[T] = R
  53169. }
  53170. var P = this;
  53171. this.enabled = !1,
  53172. this.autoUpdate = !0,
  53173. this.needsUpdate = !1,
  53174. this.type = n.PCFShadowMap,
  53175. this.cullFace = n.CullFaceFront,
  53176. this.render = function(f, g) {
  53177. var m, v, A = t.shadows;
  53178. if (0 !== A.length && P.enabled !== !1 && (P.autoUpdate !== !1 || P.needsUpdate !== !1)) {
  53179. s.clearColor(1, 1, 1, 1),
  53180. s.disable(a.BLEND),
  53181. s.enable(a.CULL_FACE),
  53182. a.frontFace(a.CCW),
  53183. a.cullFace(P.cullFace === n.CullFaceFront ? a.FRONT : a.BACK),
  53184. s.setDepthTest(!0),
  53185. s.setScissorTest(!1);
  53186. for (var E = 0, b = A.length; E < b; E++) {
  53187. var w = A[E]
  53188. , _ = w.shadow
  53189. , T = _.camera;
  53190. if (h.copy(_.mapSize),
  53191. w instanceof n.PointLight) {
  53192. m = 6,
  53193. v = !0;
  53194. var x = h.x
  53195. , S = h.y;
  53196. I[0].set(2 * x, S, x, S),
  53197. I[1].set(0, S, x, S),
  53198. I[2].set(3 * x, S, x, S),
  53199. I[3].set(x, S, x, S),
  53200. I[4].set(3 * x, 0, x, S),
  53201. I[5].set(x, 0, x, S),
  53202. h.x *= 4,
  53203. h.y *= 2
  53204. } else
  53205. m = 1,
  53206. v = !1;
  53207. if (null === _.map) {
  53208. var M = {
  53209. minFilter: n.NearestFilter,
  53210. magFilter: n.NearestFilter,
  53211. format: n.RGBAFormat
  53212. };
  53213. _.map = new n.WebGLRenderTarget(h.x,h.y,M),
  53214. w instanceof n.SpotLight && (T.aspect = h.x / h.y),
  53215. T.updateProjectionMatrix()
  53216. }
  53217. var R = _.map
  53218. , O = _.matrix;
  53219. d.setFromMatrixPosition(w.matrixWorld),
  53220. T.position.copy(d),
  53221. e.setRenderTarget(R),
  53222. e.clear();
  53223. for (var L = 0; L < m; L++) {
  53224. if (v) {
  53225. u.copy(T.position),
  53226. u.add(y[L]),
  53227. T.up.copy(C[L]),
  53228. T.lookAt(u);
  53229. var D = I[L];
  53230. s.viewport(D)
  53231. } else
  53232. u.setFromMatrixPosition(w.target.matrixWorld),
  53233. T.lookAt(u);
  53234. T.updateMatrixWorld(),
  53235. T.matrixWorldInverse.getInverse(T.matrixWorld),
  53236. O.set(.5, 0, 0, .5, 0, .5, 0, .5, 0, 0, .5, .5, 0, 0, 0, 1),
  53237. O.multiply(T.projectionMatrix),
  53238. O.multiply(T.matrixWorldInverse),
  53239. c.multiplyMatrices(T.projectionMatrix, T.matrixWorldInverse),
  53240. l.setFromMatrix(c),
  53241. p.length = 0,
  53242. o(f, g, T);
  53243. for (var N = 0, B = p.length; N < B; N++) {
  53244. var F = p[N]
  53245. , V = i.update(F)
  53246. , U = F.material;
  53247. if (U instanceof n.MultiMaterial)
  53248. for (var k = V.groups, H = U.materials, G = 0, z = k.length; G < z; G++) {
  53249. var W = k[G]
  53250. , j = H[W.materialIndex];
  53251. if (j.visible === !0) {
  53252. var Y = r(F, j, v, d);
  53253. e.renderBufferDirect(T, null, V, Y, F, W)
  53254. }
  53255. }
  53256. else {
  53257. var Y = r(F, U, v, d);
  53258. e.renderBufferDirect(T, null, V, Y, F, null)
  53259. }
  53260. }
  53261. }
  53262. }
  53263. var X = e.getClearColor()
  53264. , Z = e.getClearAlpha();
  53265. e.setClearColor(X, Z),
  53266. s.enable(a.BLEND),
  53267. P.cullFace === n.CullFaceFront && a.cullFace(a.BACK),
  53268. P.needsUpdate = !1
  53269. }
  53270. }
  53271. }
  53272. ,
  53273. n.WebGLState = function(e, t, i) {
  53274. var r = this
  53275. , o = new n.Vector4
  53276. , a = new Uint8Array(16)
  53277. , s = new Uint8Array(16)
  53278. , l = new Uint8Array(16)
  53279. , c = {}
  53280. , h = null
  53281. , u = null
  53282. , d = null
  53283. , p = null
  53284. , f = null
  53285. , g = null
  53286. , m = null
  53287. , v = null
  53288. , A = !1
  53289. , y = null
  53290. , C = null
  53291. , I = null
  53292. , E = null
  53293. , b = null
  53294. , w = null
  53295. , _ = null
  53296. , T = null
  53297. , x = null
  53298. , S = null
  53299. , M = null
  53300. , R = null
  53301. , P = null
  53302. , O = null
  53303. , L = null
  53304. , D = e.getParameter(e.MAX_TEXTURE_IMAGE_UNITS)
  53305. , N = void 0
  53306. , B = {}
  53307. , F = new n.Vector4
  53308. , V = null
  53309. , U = null
  53310. , k = new n.Vector4
  53311. , H = new n.Vector4
  53312. , G = e.createTexture();
  53313. e.bindTexture(e.TEXTURE_2D, G),
  53314. e.texParameteri(e.TEXTURE_2D, e.TEXTURE_MIN_FILTER, e.LINEAR),
  53315. e.texImage2D(e.TEXTURE_2D, 0, e.RGB, 1, 1, 0, e.RGB, e.UNSIGNED_BYTE, new Uint8Array(3)),
  53316. this.init = function() {
  53317. this.clearColor(0, 0, 0, 1),
  53318. this.clearDepth(1),
  53319. this.clearStencil(0),
  53320. this.enable(e.DEPTH_TEST),
  53321. e.depthFunc(e.LEQUAL),
  53322. e.frontFace(e.CCW),
  53323. e.cullFace(e.BACK),
  53324. this.enable(e.CULL_FACE),
  53325. this.enable(e.BLEND),
  53326. e.blendEquation(e.FUNC_ADD),
  53327. e.blendFunc(e.SRC_ALPHA, e.ONE_MINUS_SRC_ALPHA)
  53328. }
  53329. ,
  53330. this.initAttributes = function() {
  53331. for (var e = 0, t = a.length; e < t; e++)
  53332. a[e] = 0
  53333. }
  53334. ,
  53335. this.enableAttribute = function(i) {
  53336. if (a[i] = 1,
  53337. 0 === s[i] && (e.enableVertexAttribArray(i),
  53338. s[i] = 1),
  53339. 0 !== l[i]) {
  53340. var n = t.get("ANGLE_instanced_arrays");
  53341. n.vertexAttribDivisorANGLE(i, 0),
  53342. l[i] = 0
  53343. }
  53344. }
  53345. ,
  53346. this.enableAttributeAndDivisor = function(t, i, n) {
  53347. a[t] = 1,
  53348. 0 === s[t] && (e.enableVertexAttribArray(t),
  53349. s[t] = 1),
  53350. l[t] !== i && (n.vertexAttribDivisorANGLE(t, i),
  53351. l[t] = i)
  53352. }
  53353. ,
  53354. this.disableUnusedAttributes = function() {
  53355. for (var t = 0, i = s.length; t < i; t++)
  53356. s[t] !== a[t] && (e.disableVertexAttribArray(t),
  53357. s[t] = 0)
  53358. }
  53359. ,
  53360. this.enable = function(t) {
  53361. c[t] !== !0 && (e.enable(t),
  53362. c[t] = !0)
  53363. }
  53364. ,
  53365. this.disable = function(t) {
  53366. c[t] !== !1 && (e.disable(t),
  53367. c[t] = !1)
  53368. }
  53369. ,
  53370. this.getCompressedTextureFormats = function() {
  53371. if (null === h && (h = [],
  53372. t.get("WEBGL_compressed_texture_pvrtc") || t.get("WEBGL_compressed_texture_s3tc") || t.get("WEBGL_compressed_texture_etc1")))
  53373. for (var i = e.getParameter(e.COMPRESSED_TEXTURE_FORMATS), n = 0; n < i.length; n++)
  53374. h.push(i[n]);
  53375. return h
  53376. }
  53377. ,
  53378. this.setBlending = function(t, r, o, a, s, l, c, h) {
  53379. t === n.NoBlending ? this.disable(e.BLEND) : this.enable(e.BLEND),
  53380. t === u && h === A || (t === n.AdditiveBlending ? h ? (e.blendEquationSeparate(e.FUNC_ADD, e.FUNC_ADD),
  53381. e.blendFuncSeparate(e.ONE, e.ONE, e.ONE, e.ONE)) : (e.blendEquation(e.FUNC_ADD),
  53382. e.blendFunc(e.SRC_ALPHA, e.ONE)) : t === n.SubtractiveBlending ? h ? (e.blendEquationSeparate(e.FUNC_ADD, e.FUNC_ADD),
  53383. e.blendFuncSeparate(e.ZERO, e.ZERO, e.ONE_MINUS_SRC_COLOR, e.ONE_MINUS_SRC_ALPHA)) : (e.blendEquation(e.FUNC_ADD),
  53384. e.blendFunc(e.ZERO, e.ONE_MINUS_SRC_COLOR)) : t === n.MultiplyBlending ? h ? (e.blendEquationSeparate(e.FUNC_ADD, e.FUNC_ADD),
  53385. e.blendFuncSeparate(e.ZERO, e.ZERO, e.SRC_COLOR, e.SRC_ALPHA)) : (e.blendEquation(e.FUNC_ADD),
  53386. e.blendFunc(e.ZERO, e.SRC_COLOR)) : h ? (e.blendEquationSeparate(e.FUNC_ADD, e.FUNC_ADD),
  53387. e.blendFuncSeparate(e.ONE, e.ONE_MINUS_SRC_ALPHA, e.ONE, e.ONE_MINUS_SRC_ALPHA)) : (e.blendEquationSeparate(e.FUNC_ADD, e.FUNC_ADD),
  53388. e.blendFuncSeparate(e.SRC_ALPHA, e.ONE_MINUS_SRC_ALPHA, e.ONE, e.ONE_MINUS_SRC_ALPHA)),
  53389. u = t,
  53390. A = h),
  53391. t === n.CustomBlending ? (s = s || r,
  53392. l = l || o,
  53393. c = c || a,
  53394. r === d && s === g || (e.blendEquationSeparate(i(r), i(s)),
  53395. d = r,
  53396. g = s),
  53397. o === p && a === f && l === m && c === v || (e.blendFuncSeparate(i(o), i(a), i(l), i(c)),
  53398. p = o,
  53399. f = a,
  53400. m = l,
  53401. v = c)) : (d = null,
  53402. p = null,
  53403. f = null,
  53404. g = null,
  53405. m = null,
  53406. v = null)
  53407. }
  53408. ,
  53409. this.setDepthFunc = function(t) {
  53410. if (y !== t) {
  53411. if (t)
  53412. switch (t) {
  53413. case n.NeverDepth:
  53414. e.depthFunc(e.NEVER);
  53415. break;
  53416. case n.AlwaysDepth:
  53417. e.depthFunc(e.ALWAYS);
  53418. break;
  53419. case n.LessDepth:
  53420. e.depthFunc(e.LESS);
  53421. break;
  53422. case n.LessEqualDepth:
  53423. e.depthFunc(e.LEQUAL);
  53424. break;
  53425. case n.EqualDepth:
  53426. e.depthFunc(e.EQUAL);
  53427. break;
  53428. case n.GreaterEqualDepth:
  53429. e.depthFunc(e.GEQUAL);
  53430. break;
  53431. case n.GreaterDepth:
  53432. e.depthFunc(e.GREATER);
  53433. break;
  53434. case n.NotEqualDepth:
  53435. e.depthFunc(e.NOTEQUAL);
  53436. break;
  53437. default:
  53438. e.depthFunc(e.LEQUAL)
  53439. }
  53440. else
  53441. e.depthFunc(e.LEQUAL);
  53442. y = t
  53443. }
  53444. }
  53445. ,
  53446. this.setDepthTest = function(t) {
  53447. t ? this.enable(e.DEPTH_TEST) : this.disable(e.DEPTH_TEST)
  53448. }
  53449. ,
  53450. this.setDepthWrite = function(t) {
  53451. C !== t && (e.depthMask(t),
  53452. C = t)
  53453. }
  53454. ,
  53455. this.setColorWrite = function(t) {
  53456. I !== t && (e.colorMask(t, t, t, t),
  53457. I = t)
  53458. }
  53459. ,
  53460. this.setStencilFunc = function(t, i, n) {
  53461. b === t && w === i && _ === n || (e.stencilFunc(t, i, n),
  53462. b = t,
  53463. w = i,
  53464. _ = n)
  53465. }
  53466. ,
  53467. this.setStencilOp = function(t, i, n) {
  53468. T === t && x === i && S === n || (e.stencilOp(t, i, n),
  53469. T = t,
  53470. x = i,
  53471. S = n)
  53472. }
  53473. ,
  53474. this.setStencilTest = function(t) {
  53475. t ? this.enable(e.STENCIL_TEST) : this.disable(e.STENCIL_TEST)
  53476. }
  53477. ,
  53478. this.setStencilWrite = function(t) {
  53479. E !== t && (e.stencilMask(t),
  53480. E = t)
  53481. }
  53482. ,
  53483. this.setFlipSided = function(t) {
  53484. M !== t && (t ? e.frontFace(e.CW) : e.frontFace(e.CCW),
  53485. M = t)
  53486. }
  53487. ,
  53488. this.setLineWidth = function(t) {
  53489. t !== R && (e.lineWidth(t),
  53490. R = t)
  53491. }
  53492. ,
  53493. this.setPolygonOffset = function(t, i, n) {
  53494. t ? this.enable(e.POLYGON_OFFSET_FILL) : this.disable(e.POLYGON_OFFSET_FILL),
  53495. !t || P === i && O === n || (e.polygonOffset(i, n),
  53496. P = i,
  53497. O = n)
  53498. }
  53499. ,
  53500. this.getScissorTest = function() {
  53501. return L
  53502. }
  53503. ,
  53504. this.setScissorTest = function(t) {
  53505. L = t,
  53506. t ? this.enable(e.SCISSOR_TEST) : this.disable(e.SCISSOR_TEST)
  53507. }
  53508. ,
  53509. this.activeTexture = function(t) {
  53510. void 0 === t && (t = e.TEXTURE0 + D - 1),
  53511. N !== t && (e.activeTexture(t),
  53512. N = t)
  53513. }
  53514. ,
  53515. this.bindTexture = function(t, i) {
  53516. void 0 === N && r.activeTexture();
  53517. var n = B[N];
  53518. void 0 === n && (n = {
  53519. type: void 0,
  53520. texture: void 0
  53521. },
  53522. B[N] = n),
  53523. n.type === t && n.texture === i || (e.bindTexture(t, i || G),
  53524. n.type = t,
  53525. n.texture = i)
  53526. }
  53527. ,
  53528. this.compressedTexImage2D = function() {
  53529. try {
  53530. e.compressedTexImage2D.apply(e, arguments)
  53531. } catch (e) {
  53532. console.error(e)
  53533. }
  53534. }
  53535. ,
  53536. this.texImage2D = function() {
  53537. try {
  53538. e.texImage2D.apply(e, arguments)
  53539. } catch (e) {
  53540. console.error(e)
  53541. }
  53542. }
  53543. ,
  53544. this.clearColor = function(t, i, n, r) {
  53545. o.set(t, i, n, r),
  53546. F.equals(o) === !1 && (e.clearColor(t, i, n, r),
  53547. F.copy(o))
  53548. }
  53549. ,
  53550. this.clearDepth = function(t) {
  53551. V !== t && (e.clearDepth(t),
  53552. V = t)
  53553. }
  53554. ,
  53555. this.clearStencil = function(t) {
  53556. U !== t && (e.clearStencil(t),
  53557. U = t)
  53558. }
  53559. ,
  53560. this.scissor = function(t) {
  53561. k.equals(t) === !1 && (e.scissor(t.x, t.y, t.z, t.w),
  53562. k.copy(t))
  53563. }
  53564. ,
  53565. this.viewport = function(t) {
  53566. H.equals(t) === !1 && (e.viewport(t.x, t.y, t.z, t.w),
  53567. H.copy(t))
  53568. }
  53569. ,
  53570. this.reset = function() {
  53571. for (var t = 0; t < s.length; t++)
  53572. 1 === s[t] && (e.disableVertexAttribArray(t),
  53573. s[t] = 0);
  53574. c = {},
  53575. h = null,
  53576. N = void 0,
  53577. B = {},
  53578. u = null,
  53579. I = null,
  53580. C = null,
  53581. E = null,
  53582. M = null
  53583. }
  53584. }
  53585. ,
  53586. n.LensFlarePlugin = function(e, t) {
  53587. function i() {
  53588. var e = new Float32Array([-1, -1, 0, 0, 1, -1, 1, 0, 1, 1, 1, 1, -1, 1, 0, 1])
  53589. , t = new Uint16Array([0, 1, 2, 0, 2, 3]);
  53590. o = p.createBuffer(),
  53591. a = p.createBuffer(),
  53592. p.bindBuffer(p.ARRAY_BUFFER, o),
  53593. p.bufferData(p.ARRAY_BUFFER, e, p.STATIC_DRAW),
  53594. p.bindBuffer(p.ELEMENT_ARRAY_BUFFER, a),
  53595. p.bufferData(p.ELEMENT_ARRAY_BUFFER, t, p.STATIC_DRAW),
  53596. u = p.createTexture(),
  53597. d = p.createTexture(),
  53598. f.bindTexture(p.TEXTURE_2D, u),
  53599. p.texImage2D(p.TEXTURE_2D, 0, p.RGB, 16, 16, 0, p.RGB, p.UNSIGNED_BYTE, null),
  53600. p.texParameteri(p.TEXTURE_2D, p.TEXTURE_WRAP_S, p.CLAMP_TO_EDGE),
  53601. p.texParameteri(p.TEXTURE_2D, p.TEXTURE_WRAP_T, p.CLAMP_TO_EDGE),
  53602. p.texParameteri(p.TEXTURE_2D, p.TEXTURE_MAG_FILTER, p.NEAREST),
  53603. p.texParameteri(p.TEXTURE_2D, p.TEXTURE_MIN_FILTER, p.NEAREST),
  53604. f.bindTexture(p.TEXTURE_2D, d),
  53605. p.texImage2D(p.TEXTURE_2D, 0, p.RGBA, 16, 16, 0, p.RGBA, p.UNSIGNED_BYTE, null),
  53606. p.texParameteri(p.TEXTURE_2D, p.TEXTURE_WRAP_S, p.CLAMP_TO_EDGE),
  53607. p.texParameteri(p.TEXTURE_2D, p.TEXTURE_WRAP_T, p.CLAMP_TO_EDGE),
  53608. p.texParameteri(p.TEXTURE_2D, p.TEXTURE_MAG_FILTER, p.NEAREST),
  53609. p.texParameteri(p.TEXTURE_2D, p.TEXTURE_MIN_FILTER, p.NEAREST),
  53610. h = p.getParameter(p.MAX_VERTEX_TEXTURE_IMAGE_UNITS) > 0;
  53611. var i;
  53612. i = h ? {
  53613. 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"),
  53614. 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")
  53615. } : {
  53616. 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"),
  53617. 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")
  53618. },
  53619. s = r(i),
  53620. l = {
  53621. vertex: p.getAttribLocation(s, "position"),
  53622. uv: p.getAttribLocation(s, "uv")
  53623. },
  53624. c = {
  53625. renderType: p.getUniformLocation(s, "renderType"),
  53626. map: p.getUniformLocation(s, "map"),
  53627. occlusionMap: p.getUniformLocation(s, "occlusionMap"),
  53628. opacity: p.getUniformLocation(s, "opacity"),
  53629. color: p.getUniformLocation(s, "color"),
  53630. scale: p.getUniformLocation(s, "scale"),
  53631. rotation: p.getUniformLocation(s, "rotation"),
  53632. screenPosition: p.getUniformLocation(s, "screenPosition")
  53633. }
  53634. }
  53635. function r(t) {
  53636. var i = p.createProgram()
  53637. , n = p.createShader(p.FRAGMENT_SHADER)
  53638. , r = p.createShader(p.VERTEX_SHADER)
  53639. , o = "precision " + e.getPrecision() + " float;\n";
  53640. return p.shaderSource(n, o + t.fragmentShader),
  53641. p.shaderSource(r, o + t.vertexShader),
  53642. p.compileShader(n),
  53643. p.compileShader(r),
  53644. p.attachShader(i, n),
  53645. p.attachShader(i, r),
  53646. p.linkProgram(i),
  53647. i
  53648. }
  53649. var o, a, s, l, c, h, u, d, p = e.context, f = e.state;
  53650. this.render = function(r, g, m) {
  53651. if (0 !== t.length) {
  53652. var v = new n.Vector3
  53653. , A = m.w / m.z
  53654. , y = .5 * m.z
  53655. , C = .5 * m.w
  53656. , I = 16 / m.w
  53657. , E = new n.Vector2(I * A,I)
  53658. , b = new n.Vector3(1,1,0)
  53659. , w = new n.Vector2(1,1);
  53660. void 0 === s && i(),
  53661. p.useProgram(s),
  53662. f.initAttributes(),
  53663. f.enableAttribute(l.vertex),
  53664. f.enableAttribute(l.uv),
  53665. f.disableUnusedAttributes(),
  53666. p.uniform1i(c.occlusionMap, 0),
  53667. p.uniform1i(c.map, 1),
  53668. p.bindBuffer(p.ARRAY_BUFFER, o),
  53669. p.vertexAttribPointer(l.vertex, 2, p.FLOAT, !1, 16, 0),
  53670. p.vertexAttribPointer(l.uv, 2, p.FLOAT, !1, 16, 8),
  53671. p.bindBuffer(p.ELEMENT_ARRAY_BUFFER, a),
  53672. f.disable(p.CULL_FACE),
  53673. f.setDepthWrite(!1);
  53674. for (var _ = 0, T = t.length; _ < T; _++) {
  53675. I = 16 / m.w,
  53676. E.set(I * A, I);
  53677. var x = t[_];
  53678. if (v.set(x.matrixWorld.elements[12], x.matrixWorld.elements[13], x.matrixWorld.elements[14]),
  53679. v.applyMatrix4(g.matrixWorldInverse),
  53680. v.applyProjection(g.projectionMatrix),
  53681. b.copy(v),
  53682. w.x = b.x * y + y,
  53683. w.y = b.y * C + C,
  53684. h || w.x > 0 && w.x < m.z && w.y > 0 && w.y < m.w) {
  53685. f.activeTexture(p.TEXTURE0),
  53686. f.bindTexture(p.TEXTURE_2D, null),
  53687. f.activeTexture(p.TEXTURE1),
  53688. f.bindTexture(p.TEXTURE_2D, u),
  53689. p.copyTexImage2D(p.TEXTURE_2D, 0, p.RGB, m.x + w.x - 8, m.y + w.y - 8, 16, 16, 0),
  53690. p.uniform1i(c.renderType, 0),
  53691. p.uniform2f(c.scale, E.x, E.y),
  53692. p.uniform3f(c.screenPosition, b.x, b.y, b.z),
  53693. f.disable(p.BLEND),
  53694. f.enable(p.DEPTH_TEST),
  53695. p.drawElements(p.TRIANGLES, 6, p.UNSIGNED_SHORT, 0),
  53696. f.activeTexture(p.TEXTURE0),
  53697. f.bindTexture(p.TEXTURE_2D, d),
  53698. p.copyTexImage2D(p.TEXTURE_2D, 0, p.RGBA, m.x + w.x - 8, m.y + w.y - 8, 16, 16, 0),
  53699. p.uniform1i(c.renderType, 1),
  53700. f.disable(p.DEPTH_TEST),
  53701. f.activeTexture(p.TEXTURE1),
  53702. f.bindTexture(p.TEXTURE_2D, u),
  53703. p.drawElements(p.TRIANGLES, 6, p.UNSIGNED_SHORT, 0),
  53704. x.positionScreen.copy(b),
  53705. x.customUpdateCallback ? x.customUpdateCallback(x) : x.updateLensFlares(),
  53706. p.uniform1i(c.renderType, 2),
  53707. f.enable(p.BLEND);
  53708. for (var S = 0, M = x.lensFlares.length; S < M; S++) {
  53709. var R = x.lensFlares[S];
  53710. R.opacity > .001 && R.scale > .001 && (b.x = R.x,
  53711. b.y = R.y,
  53712. b.z = R.z,
  53713. I = R.size * R.scale / m.w,
  53714. E.x = I * A,
  53715. E.y = I,
  53716. p.uniform3f(c.screenPosition, b.x, b.y, b.z),
  53717. p.uniform2f(c.scale, E.x, E.y),
  53718. p.uniform1f(c.rotation, R.rotation),
  53719. p.uniform1f(c.opacity, R.opacity),
  53720. p.uniform3f(c.color, R.color.r, R.color.g, R.color.b),
  53721. f.setBlending(R.blending, R.blendEquation, R.blendSrc, R.blendDst),
  53722. e.setTexture(R.texture, 1),
  53723. p.drawElements(p.TRIANGLES, 6, p.UNSIGNED_SHORT, 0))
  53724. }
  53725. }
  53726. }
  53727. f.enable(p.CULL_FACE),
  53728. f.enable(p.DEPTH_TEST),
  53729. f.setDepthWrite(!0),
  53730. e.resetGLState()
  53731. }
  53732. }
  53733. }
  53734. ,
  53735. n.SpritePlugin = function(e, t) {
  53736. function i() {
  53737. var e = new Float32Array([-.5, -.5, 0, 0, .5, -.5, 1, 0, .5, .5, 1, 1, -.5, .5, 0, 1])
  53738. , t = new Uint16Array([0, 1, 2, 0, 2, 3]);
  53739. a = d.createBuffer(),
  53740. s = d.createBuffer(),
  53741. d.bindBuffer(d.ARRAY_BUFFER, a),
  53742. d.bufferData(d.ARRAY_BUFFER, e, d.STATIC_DRAW),
  53743. d.bindBuffer(d.ELEMENT_ARRAY_BUFFER, s),
  53744. d.bufferData(d.ELEMENT_ARRAY_BUFFER, t, d.STATIC_DRAW),
  53745. l = r(),
  53746. c = {
  53747. position: d.getAttribLocation(l, "position"),
  53748. uv: d.getAttribLocation(l, "uv")
  53749. },
  53750. h = {
  53751. uvOffset: d.getUniformLocation(l, "uvOffset"),
  53752. uvScale: d.getUniformLocation(l, "uvScale"),
  53753. rotation: d.getUniformLocation(l, "rotation"),
  53754. scale: d.getUniformLocation(l, "scale"),
  53755. color: d.getUniformLocation(l, "color"),
  53756. map: d.getUniformLocation(l, "map"),
  53757. opacity: d.getUniformLocation(l, "opacity"),
  53758. modelViewMatrix: d.getUniformLocation(l, "modelViewMatrix"),
  53759. projectionMatrix: d.getUniformLocation(l, "projectionMatrix"),
  53760. fogType: d.getUniformLocation(l, "fogType"),
  53761. fogDensity: d.getUniformLocation(l, "fogDensity"),
  53762. fogNear: d.getUniformLocation(l, "fogNear"),
  53763. fogFar: d.getUniformLocation(l, "fogFar"),
  53764. fogColor: d.getUniformLocation(l, "fogColor"),
  53765. alphaTest: d.getUniformLocation(l, "alphaTest")
  53766. };
  53767. var i = document.createElement("canvas");
  53768. i.width = 8,
  53769. i.height = 8;
  53770. var o = i.getContext("2d");
  53771. o.fillStyle = "white",
  53772. o.fillRect(0, 0, 8, 8),
  53773. u = new n.Texture(i),
  53774. u.needsUpdate = !0
  53775. }
  53776. function r() {
  53777. var t = d.createProgram()
  53778. , i = d.createShader(d.VERTEX_SHADER)
  53779. , n = d.createShader(d.FRAGMENT_SHADER);
  53780. 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")),
  53781. 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")),
  53782. d.compileShader(i),
  53783. d.compileShader(n),
  53784. d.attachShader(t, i),
  53785. d.attachShader(t, n),
  53786. d.linkProgram(t),
  53787. t
  53788. }
  53789. function o(e, t) {
  53790. return e.renderOrder !== t.renderOrder ? e.renderOrder - t.renderOrder : e.z !== t.z ? t.z - e.z : t.id - e.id
  53791. }
  53792. 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;
  53793. this.render = function(r, v) {
  53794. if (0 !== t.length) {
  53795. void 0 === l && i(),
  53796. d.useProgram(l),
  53797. p.initAttributes(),
  53798. p.enableAttribute(c.position),
  53799. p.enableAttribute(c.uv),
  53800. p.disableUnusedAttributes(),
  53801. p.disable(d.CULL_FACE),
  53802. p.enable(d.BLEND),
  53803. d.bindBuffer(d.ARRAY_BUFFER, a),
  53804. d.vertexAttribPointer(c.position, 2, d.FLOAT, !1, 16, 0),
  53805. d.vertexAttribPointer(c.uv, 2, d.FLOAT, !1, 16, 8),
  53806. d.bindBuffer(d.ELEMENT_ARRAY_BUFFER, s),
  53807. d.uniformMatrix4fv(h.projectionMatrix, !1, v.projectionMatrix.elements),
  53808. p.activeTexture(d.TEXTURE0),
  53809. d.uniform1i(h.map, 0);
  53810. var A = 0
  53811. , y = 0
  53812. , C = r.fog;
  53813. C ? (d.uniform3f(h.fogColor, C.color.r, C.color.g, C.color.b),
  53814. C instanceof n.Fog ? (d.uniform1f(h.fogNear, C.near),
  53815. d.uniform1f(h.fogFar, C.far),
  53816. d.uniform1i(h.fogType, 1),
  53817. A = 1,
  53818. y = 1) : C instanceof n.FogExp2 && (d.uniform1f(h.fogDensity, C.density),
  53819. d.uniform1i(h.fogType, 2),
  53820. A = 2,
  53821. y = 2)) : (d.uniform1i(h.fogType, 0),
  53822. A = 0,
  53823. y = 0);
  53824. for (var I = 0, E = t.length; I < E; I++) {
  53825. var b = t[I];
  53826. b.modelViewMatrix.multiplyMatrices(v.matrixWorldInverse, b.matrixWorld),
  53827. b.z = -b.modelViewMatrix.elements[14]
  53828. }
  53829. t.sort(o);
  53830. for (var w = [], I = 0, E = t.length; I < E; I++) {
  53831. var b = t[I]
  53832. , _ = b.material;
  53833. d.uniform1f(h.alphaTest, _.alphaTest),
  53834. d.uniformMatrix4fv(h.modelViewMatrix, !1, b.modelViewMatrix.elements),
  53835. b.matrixWorld.decompose(f, g, m),
  53836. w[0] = m.x,
  53837. w[1] = m.y;
  53838. var T = 0;
  53839. r.fog && _.fog && (T = y),
  53840. A !== T && (d.uniform1i(h.fogType, T),
  53841. A = T),
  53842. null !== _.map ? (d.uniform2f(h.uvOffset, _.map.offset.x, _.map.offset.y),
  53843. d.uniform2f(h.uvScale, _.map.repeat.x, _.map.repeat.y)) : (d.uniform2f(h.uvOffset, 0, 0),
  53844. d.uniform2f(h.uvScale, 1, 1)),
  53845. d.uniform1f(h.opacity, _.opacity),
  53846. d.uniform3f(h.color, _.color.r, _.color.g, _.color.b),
  53847. d.uniform1f(h.rotation, _.rotation),
  53848. d.uniform2fv(h.scale, w),
  53849. p.setBlending(_.blending, _.blendEquation, _.blendSrc, _.blendDst),
  53850. p.setDepthTest(_.depthTest),
  53851. p.setDepthWrite(_.depthWrite),
  53852. _.map && _.map.image && _.map.image.width ? e.setTexture(_.map, 0) : e.setTexture(u, 0),
  53853. d.drawElements(d.TRIANGLES, 6, d.UNSIGNED_SHORT, 0)
  53854. }
  53855. p.enable(d.CULL_FACE),
  53856. e.resetGLState()
  53857. }
  53858. }
  53859. }
  53860. ,
  53861. Object.defineProperties(n.Box2.prototype, {
  53862. empty: {
  53863. value: function() {
  53864. return console.warn("THREE.Box2: .empty() has been renamed to .isEmpty()."),
  53865. this.isEmpty()
  53866. }
  53867. },
  53868. isIntersectionBox: {
  53869. value: function(e) {
  53870. return console.warn("THREE.Box2: .isIntersectionBox() has been renamed to .intersectsBox()."),
  53871. this.intersectsBox(e)
  53872. }
  53873. }
  53874. }),
  53875. Object.defineProperties(n.Box3.prototype, {
  53876. empty: {
  53877. value: function() {
  53878. return console.warn("THREE.Box3: .empty() has been renamed to .isEmpty()."),
  53879. this.isEmpty()
  53880. }
  53881. },
  53882. isIntersectionBox: {
  53883. value: function(e) {
  53884. return console.warn("THREE.Box3: .isIntersectionBox() has been renamed to .intersectsBox()."),
  53885. this.intersectsBox(e)
  53886. }
  53887. },
  53888. isIntersectionSphere: {
  53889. value: function(e) {
  53890. return console.warn("THREE.Box3: .isIntersectionSphere() has been renamed to .intersectsSphere()."),
  53891. this.intersectsSphere(e)
  53892. }
  53893. }
  53894. }),
  53895. Object.defineProperties(n.Matrix3.prototype, {
  53896. multiplyVector3: {
  53897. value: function(e) {
  53898. return console.warn("THREE.Matrix3: .multiplyVector3() has been removed. Use vector.applyMatrix3( matrix ) instead."),
  53899. e.applyMatrix3(this)
  53900. }
  53901. },
  53902. multiplyVector3Array: {
  53903. value: function(e) {
  53904. return console.warn("THREE.Matrix3: .multiplyVector3Array() has been renamed. Use matrix.applyToVector3Array( array ) instead."),
  53905. this.applyToVector3Array(e)
  53906. }
  53907. }
  53908. }),
  53909. Object.defineProperties(n.Matrix4.prototype, {
  53910. extractPosition: {
  53911. value: function(e) {
  53912. return console.warn("THREE.Matrix4: .extractPosition() has been renamed to .copyPosition()."),
  53913. this.copyPosition(e)
  53914. }
  53915. },
  53916. setRotationFromQuaternion: {
  53917. value: function(e) {
  53918. return console.warn("THREE.Matrix4: .setRotationFromQuaternion() has been renamed to .makeRotationFromQuaternion()."),
  53919. this.makeRotationFromQuaternion(e)
  53920. }
  53921. },
  53922. multiplyVector3: {
  53923. value: function(e) {
  53924. return console.warn("THREE.Matrix4: .multiplyVector3() has been removed. Use vector.applyMatrix4( matrix ) or vector.applyProjection( matrix ) instead."),
  53925. e.applyProjection(this)
  53926. }
  53927. },
  53928. multiplyVector4: {
  53929. value: function(e) {
  53930. return console.warn("THREE.Matrix4: .multiplyVector4() has been removed. Use vector.applyMatrix4( matrix ) instead."),
  53931. e.applyMatrix4(this)
  53932. }
  53933. },
  53934. multiplyVector3Array: {
  53935. value: function(e) {
  53936. return console.warn("THREE.Matrix4: .multiplyVector3Array() has been renamed. Use matrix.applyToVector3Array( array ) instead."),
  53937. this.applyToVector3Array(e)
  53938. }
  53939. },
  53940. rotateAxis: {
  53941. value: function(e) {
  53942. console.warn("THREE.Matrix4: .rotateAxis() has been removed. Use Vector3.transformDirection( matrix ) instead."),
  53943. e.transformDirection(this)
  53944. }
  53945. },
  53946. crossVector: {
  53947. value: function(e) {
  53948. return console.warn("THREE.Matrix4: .crossVector() has been removed. Use vector.applyMatrix4( matrix ) instead."),
  53949. e.applyMatrix4(this)
  53950. }
  53951. },
  53952. translate: {
  53953. value: function(e) {
  53954. console.error("THREE.Matrix4: .translate() has been removed.")
  53955. }
  53956. },
  53957. rotateX: {
  53958. value: function(e) {
  53959. console.error("THREE.Matrix4: .rotateX() has been removed.")
  53960. }
  53961. },
  53962. rotateY: {
  53963. value: function(e) {
  53964. console.error("THREE.Matrix4: .rotateY() has been removed.")
  53965. }
  53966. },
  53967. rotateZ: {
  53968. value: function(e) {
  53969. console.error("THREE.Matrix4: .rotateZ() has been removed.")
  53970. }
  53971. },
  53972. rotateByAxis: {
  53973. value: function(e, t) {
  53974. console.error("THREE.Matrix4: .rotateByAxis() has been removed.")
  53975. }
  53976. }
  53977. }),
  53978. Object.defineProperties(n.Plane.prototype, {
  53979. isIntersectionLine: {
  53980. value: function(e) {
  53981. return console.warn("THREE.Plane: .isIntersectionLine() has been renamed to .intersectsLine()."),
  53982. this.intersectsLine(e)
  53983. }
  53984. }
  53985. }),
  53986. Object.defineProperties(n.Quaternion.prototype, {
  53987. multiplyVector3: {
  53988. value: function(e) {
  53989. return console.warn("THREE.Quaternion: .multiplyVector3() has been removed. Use is now vector.applyQuaternion( quaternion ) instead."),
  53990. e.applyQuaternion(this)
  53991. }
  53992. }
  53993. }),
  53994. Object.defineProperties(n.Ray.prototype, {
  53995. isIntersectionBox: {
  53996. value: function(e) {
  53997. return console.warn("THREE.Ray: .isIntersectionBox() has been renamed to .intersectsBox()."),
  53998. this.intersectsBox(e)
  53999. }
  54000. },
  54001. isIntersectionPlane: {
  54002. value: function(e) {
  54003. return console.warn("THREE.Ray: .isIntersectionPlane() has been renamed to .intersectsPlane()."),
  54004. this.intersectsPlane(e)
  54005. }
  54006. },
  54007. isIntersectionSphere: {
  54008. value: function(e) {
  54009. return console.warn("THREE.Ray: .isIntersectionSphere() has been renamed to .intersectsSphere()."),
  54010. this.intersectsSphere(e)
  54011. }
  54012. }
  54013. }),
  54014. Object.defineProperties(n.Vector3.prototype, {
  54015. setEulerFromRotationMatrix: {
  54016. value: function() {
  54017. console.error("THREE.Vector3: .setEulerFromRotationMatrix() has been removed. Use Euler.setFromRotationMatrix() instead.")
  54018. }
  54019. },
  54020. setEulerFromQuaternion: {
  54021. value: function() {
  54022. console.error("THREE.Vector3: .setEulerFromQuaternion() has been removed. Use Euler.setFromQuaternion() instead.")
  54023. }
  54024. },
  54025. getPositionFromMatrix: {
  54026. value: function(e) {
  54027. return console.warn("THREE.Vector3: .getPositionFromMatrix() has been renamed to .setFromMatrixPosition()."),
  54028. this.setFromMatrixPosition(e)
  54029. }
  54030. },
  54031. getScaleFromMatrix: {
  54032. value: function(e) {
  54033. return console.warn("THREE.Vector3: .getScaleFromMatrix() has been renamed to .setFromMatrixScale()."),
  54034. this.setFromMatrixScale(e)
  54035. }
  54036. },
  54037. getColumnFromMatrix: {
  54038. value: function(e, t) {
  54039. return console.warn("THREE.Vector3: .getColumnFromMatrix() has been renamed to .setFromMatrixColumn()."),
  54040. this.setFromMatrixColumn(e, t)
  54041. }
  54042. }
  54043. }),
  54044. n.Face4 = function(e, t, i, r, o, a, s) {
  54045. return console.warn("THREE.Face4 has been removed. A THREE.Face3 will be created instead."),
  54046. new n.Face3(e,t,i,o,a,s)
  54047. }
  54048. ,
  54049. n.Vertex = function(e, t, i) {
  54050. return console.warn("THREE.Vertex has been removed. Use THREE.Vector3 instead."),
  54051. new n.Vector3(e,t,i)
  54052. }
  54053. ,
  54054. Object.defineProperties(n.Object3D.prototype, {
  54055. eulerOrder: {
  54056. get: function() {
  54057. return console.warn("THREE.Object3D: .eulerOrder is now .rotation.order."),
  54058. this.rotation.order
  54059. },
  54060. set: function(e) {
  54061. console.warn("THREE.Object3D: .eulerOrder is now .rotation.order."),
  54062. this.rotation.order = e
  54063. }
  54064. },
  54065. getChildByName: {
  54066. value: function(e) {
  54067. return console.warn("THREE.Object3D: .getChildByName() has been renamed to .getObjectByName()."),
  54068. this.getObjectByName(e)
  54069. }
  54070. },
  54071. renderDepth: {
  54072. set: function(e) {
  54073. console.warn("THREE.Object3D: .renderDepth has been removed. Use .renderOrder, instead.")
  54074. }
  54075. },
  54076. translate: {
  54077. value: function(e, t) {
  54078. return console.warn("THREE.Object3D: .translate() has been removed. Use .translateOnAxis( axis, distance ) instead."),
  54079. this.translateOnAxis(t, e)
  54080. }
  54081. },
  54082. useQuaternion: {
  54083. get: function() {
  54084. console.warn("THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.")
  54085. },
  54086. set: function(e) {
  54087. console.warn("THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.")
  54088. }
  54089. }
  54090. }),
  54091. Object.defineProperties(n, {
  54092. PointCloud: {
  54093. value: function(e, t) {
  54094. return console.warn("THREE.PointCloud has been renamed to THREE.Points."),
  54095. new n.Points(e,t)
  54096. }
  54097. },
  54098. ParticleSystem: {
  54099. value: function(e, t) {
  54100. return console.warn("THREE.ParticleSystem has been renamed to THREE.Points."),
  54101. new n.Points(e,t)
  54102. }
  54103. }
  54104. }),
  54105. Object.defineProperties(n.Light.prototype, {
  54106. onlyShadow: {
  54107. set: function(e) {
  54108. console.warn("THREE.Light: .onlyShadow has been removed.")
  54109. }
  54110. },
  54111. shadowCameraFov: {
  54112. set: function(e) {
  54113. console.warn("THREE.Light: .shadowCameraFov is now .shadow.camera.fov."),
  54114. this.shadow.camera.fov = e
  54115. }
  54116. },
  54117. shadowCameraLeft: {
  54118. set: function(e) {
  54119. console.warn("THREE.Light: .shadowCameraLeft is now .shadow.camera.left."),
  54120. this.shadow.camera.left = e
  54121. }
  54122. },
  54123. shadowCameraRight: {
  54124. set: function(e) {
  54125. console.warn("THREE.Light: .shadowCameraRight is now .shadow.camera.right."),
  54126. this.shadow.camera.right = e
  54127. }
  54128. },
  54129. shadowCameraTop: {
  54130. set: function(e) {
  54131. console.warn("THREE.Light: .shadowCameraTop is now .shadow.camera.top."),
  54132. this.shadow.camera.top = e
  54133. }
  54134. },
  54135. shadowCameraBottom: {
  54136. set: function(e) {
  54137. console.warn("THREE.Light: .shadowCameraBottom is now .shadow.camera.bottom."),
  54138. this.shadow.camera.bottom = e
  54139. }
  54140. },
  54141. shadowCameraNear: {
  54142. set: function(e) {
  54143. console.warn("THREE.Light: .shadowCameraNear is now .shadow.camera.near."),
  54144. this.shadow.camera.near = e
  54145. }
  54146. },
  54147. shadowCameraFar: {
  54148. set: function(e) {
  54149. console.warn("THREE.Light: .shadowCameraFar is now .shadow.camera.far."),
  54150. this.shadow.camera.far = e
  54151. }
  54152. },
  54153. shadowCameraVisible: {
  54154. set: function(e) {
  54155. console.warn("THREE.Light: .shadowCameraVisible has been removed. Use new THREE.CameraHelper( light.shadow.camera ) instead.")
  54156. }
  54157. },
  54158. shadowBias: {
  54159. set: function(e) {
  54160. console.warn("THREE.Light: .shadowBias is now .shadow.bias."),
  54161. this.shadow.bias = e
  54162. }
  54163. },
  54164. shadowDarkness: {
  54165. set: function(e) {
  54166. console.warn("THREE.Light: .shadowDarkness has been removed.")
  54167. }
  54168. },
  54169. shadowMapWidth: {
  54170. set: function(e) {
  54171. console.warn("THREE.Light: .shadowMapWidth is now .shadow.mapSize.width."),
  54172. this.shadow.mapSize.width = e
  54173. }
  54174. },
  54175. shadowMapHeight: {
  54176. set: function(e) {
  54177. console.warn("THREE.Light: .shadowMapHeight is now .shadow.mapSize.height."),
  54178. this.shadow.mapSize.height = e
  54179. }
  54180. }
  54181. }),
  54182. Object.defineProperties(n.BufferAttribute.prototype, {
  54183. length: {
  54184. get: function() {
  54185. return console.warn("THREE.BufferAttribute: .length has been deprecated. Please use .count."),
  54186. this.array.length
  54187. }
  54188. }
  54189. }),
  54190. Object.defineProperties(n.BufferGeometry.prototype, {
  54191. drawcalls: {
  54192. get: function() {
  54193. return console.error("THREE.BufferGeometry: .drawcalls has been renamed to .groups."),
  54194. this.groups
  54195. }
  54196. },
  54197. offsets: {
  54198. get: function() {
  54199. return console.warn("THREE.BufferGeometry: .offsets has been renamed to .groups."),
  54200. this.groups
  54201. }
  54202. },
  54203. addIndex: {
  54204. value: function(e) {
  54205. console.warn("THREE.BufferGeometry: .addIndex() has been renamed to .setIndex()."),
  54206. this.setIndex(e)
  54207. }
  54208. },
  54209. addDrawCall: {
  54210. value: function(e, t, i) {
  54211. void 0 !== i && console.warn("THREE.BufferGeometry: .addDrawCall() no longer supports indexOffset."),
  54212. console.warn("THREE.BufferGeometry: .addDrawCall() is now .addGroup()."),
  54213. this.addGroup(e, t)
  54214. }
  54215. },
  54216. clearDrawCalls: {
  54217. value: function() {
  54218. console.warn("THREE.BufferGeometry: .clearDrawCalls() is now .clearGroups()."),
  54219. this.clearGroups()
  54220. }
  54221. },
  54222. computeTangents: {
  54223. value: function() {
  54224. console.warn("THREE.BufferGeometry: .computeTangents() has been removed.")
  54225. }
  54226. },
  54227. computeOffsets: {
  54228. value: function() {
  54229. console.warn("THREE.BufferGeometry: .computeOffsets() has been removed.")
  54230. }
  54231. }
  54232. }),
  54233. Object.defineProperties(n.Material.prototype, {
  54234. wrapAround: {
  54235. get: function() {
  54236. console.warn("THREE." + this.type + ": .wrapAround has been removed.")
  54237. },
  54238. set: function(e) {
  54239. console.warn("THREE." + this.type + ": .wrapAround has been removed.")
  54240. }
  54241. },
  54242. wrapRGB: {
  54243. get: function() {
  54244. return console.warn("THREE." + this.type + ": .wrapRGB has been removed."),
  54245. new n.Color
  54246. }
  54247. }
  54248. }),
  54249. Object.defineProperties(n, {
  54250. PointCloudMaterial: {
  54251. value: function(e) {
  54252. return console.warn("THREE.PointCloudMaterial has been renamed to THREE.PointsMaterial."),
  54253. new n.PointsMaterial(e)
  54254. }
  54255. },
  54256. ParticleBasicMaterial: {
  54257. value: function(e) {
  54258. return console.warn("THREE.ParticleBasicMaterial has been renamed to THREE.PointsMaterial."),
  54259. new n.PointsMaterial(e)
  54260. }
  54261. },
  54262. ParticleSystemMaterial: {
  54263. value: function(e) {
  54264. return console.warn("THREE.ParticleSystemMaterial has been renamed to THREE.PointsMaterial."),
  54265. new n.PointsMaterial(e)
  54266. }
  54267. }
  54268. }),
  54269. Object.defineProperties(n.MeshPhongMaterial.prototype, {
  54270. metal: {
  54271. get: function() {
  54272. return console.warn("THREE.MeshPhongMaterial: .metal has been removed. Use THREE.MeshStandardMaterial instead."),
  54273. !1
  54274. },
  54275. set: function(e) {
  54276. console.warn("THREE.MeshPhongMaterial: .metal has been removed. Use THREE.MeshStandardMaterial instead")
  54277. }
  54278. }
  54279. }),
  54280. Object.defineProperties(n.ShaderMaterial.prototype, {
  54281. derivatives: {
  54282. get: function() {
  54283. return console.warn("THREE.ShaderMaterial: .derivatives has been moved to .extensions.derivatives."),
  54284. this.extensions.derivatives
  54285. },
  54286. set: function(e) {
  54287. console.warn("THREE. ShaderMaterial: .derivatives has been moved to .extensions.derivatives."),
  54288. this.extensions.derivatives = e
  54289. }
  54290. }
  54291. }),
  54292. Object.defineProperties(n.WebGLRenderer.prototype, {
  54293. supportsFloatTextures: {
  54294. value: function() {
  54295. return console.warn("THREE.WebGLRenderer: .supportsFloatTextures() is now .extensions.get( 'OES_texture_float' )."),
  54296. this.extensions.get("OES_texture_float")
  54297. }
  54298. },
  54299. supportsHalfFloatTextures: {
  54300. value: function() {
  54301. return console.warn("THREE.WebGLRenderer: .supportsHalfFloatTextures() is now .extensions.get( 'OES_texture_half_float' )."),
  54302. this.extensions.get("OES_texture_half_float")
  54303. }
  54304. },
  54305. supportsStandardDerivatives: {
  54306. value: function() {
  54307. return console.warn("THREE.WebGLRenderer: .supportsStandardDerivatives() is now .extensions.get( 'OES_standard_derivatives' )."),
  54308. this.extensions.get("OES_standard_derivatives")
  54309. }
  54310. },
  54311. supportsCompressedTextureS3TC: {
  54312. value: function() {
  54313. return console.warn("THREE.WebGLRenderer: .supportsCompressedTextureS3TC() is now .extensions.get( 'WEBGL_compressed_texture_s3tc' )."),
  54314. this.extensions.get("WEBGL_compressed_texture_s3tc")
  54315. }
  54316. },
  54317. supportsCompressedTexturePVRTC: {
  54318. value: function() {
  54319. return console.warn("THREE.WebGLRenderer: .supportsCompressedTexturePVRTC() is now .extensions.get( 'WEBGL_compressed_texture_pvrtc' )."),
  54320. this.extensions.get("WEBGL_compressed_texture_pvrtc")
  54321. }
  54322. },
  54323. supportsBlendMinMax: {
  54324. value: function() {
  54325. return console.warn("THREE.WebGLRenderer: .supportsBlendMinMax() is now .extensions.get( 'EXT_blend_minmax' )."),
  54326. this.extensions.get("EXT_blend_minmax")
  54327. }
  54328. },
  54329. supportsVertexTextures: {
  54330. value: function() {
  54331. return this.capabilities.vertexTextures
  54332. }
  54333. },
  54334. supportsInstancedArrays: {
  54335. value: function() {
  54336. return console.warn("THREE.WebGLRenderer: .supportsInstancedArrays() is now .extensions.get( 'ANGLE_instanced_arrays' )."),
  54337. this.extensions.get("ANGLE_instanced_arrays")
  54338. }
  54339. },
  54340. enableScissorTest: {
  54341. value: function(e) {
  54342. console.warn("THREE.WebGLRenderer: .enableScissorTest() is now .setScissorTest()."),
  54343. this.setScissorTest(e)
  54344. }
  54345. },
  54346. initMaterial: {
  54347. value: function() {
  54348. console.warn("THREE.WebGLRenderer: .initMaterial() has been removed.")
  54349. }
  54350. },
  54351. addPrePlugin: {
  54352. value: function() {
  54353. console.warn("THREE.WebGLRenderer: .addPrePlugin() has been removed.")
  54354. }
  54355. },
  54356. addPostPlugin: {
  54357. value: function() {
  54358. console.warn("THREE.WebGLRenderer: .addPostPlugin() has been removed.")
  54359. }
  54360. },
  54361. updateShadowMap: {
  54362. value: function() {
  54363. console.warn("THREE.WebGLRenderer: .updateShadowMap() has been removed.")
  54364. }
  54365. },
  54366. shadowMapEnabled: {
  54367. get: function() {
  54368. return this.shadowMap.enabled
  54369. },
  54370. set: function(e) {
  54371. console.warn("THREE.WebGLRenderer: .shadowMapEnabled is now .shadowMap.enabled."),
  54372. this.shadowMap.enabled = e
  54373. }
  54374. },
  54375. shadowMapType: {
  54376. get: function() {
  54377. return this.shadowMap.type
  54378. },
  54379. set: function(e) {
  54380. console.warn("THREE.WebGLRenderer: .shadowMapType is now .shadowMap.type."),
  54381. this.shadowMap.type = e
  54382. }
  54383. },
  54384. shadowMapCullFace: {
  54385. get: function() {
  54386. return this.shadowMap.cullFace
  54387. },
  54388. set: function(e) {
  54389. console.warn("THREE.WebGLRenderer: .shadowMapCullFace is now .shadowMap.cullFace."),
  54390. this.shadowMap.cullFace = e
  54391. }
  54392. }
  54393. }),
  54394. Object.defineProperties(n.WebGLRenderTarget.prototype, {
  54395. wrapS: {
  54396. get: function() {
  54397. return console.warn("THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS."),
  54398. this.texture.wrapS
  54399. },
  54400. set: function(e) {
  54401. console.warn("THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS."),
  54402. this.texture.wrapS = e
  54403. }
  54404. },
  54405. wrapT: {
  54406. get: function() {
  54407. return console.warn("THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT."),
  54408. this.texture.wrapT
  54409. },
  54410. set: function(e) {
  54411. console.warn("THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT."),
  54412. this.texture.wrapT = e
  54413. }
  54414. },
  54415. magFilter: {
  54416. get: function() {
  54417. return console.warn("THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter."),
  54418. this.texture.magFilter
  54419. },
  54420. set: function(e) {
  54421. console.warn("THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter."),
  54422. this.texture.magFilter = e
  54423. }
  54424. },
  54425. minFilter: {
  54426. get: function() {
  54427. return console.warn("THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter."),
  54428. this.texture.minFilter
  54429. },
  54430. set: function(e) {
  54431. console.warn("THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter."),
  54432. this.texture.minFilter = e
  54433. }
  54434. },
  54435. anisotropy: {
  54436. get: function() {
  54437. return console.warn("THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy."),
  54438. this.texture.anisotropy
  54439. },
  54440. set: function(e) {
  54441. console.warn("THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy."),
  54442. this.texture.anisotropy = e
  54443. }
  54444. },
  54445. offset: {
  54446. get: function() {
  54447. return console.warn("THREE.WebGLRenderTarget: .offset is now .texture.offset."),
  54448. this.texture.offset
  54449. },
  54450. set: function(e) {
  54451. console.warn("THREE.WebGLRenderTarget: .offset is now .texture.offset."),
  54452. this.texture.offset = e
  54453. }
  54454. },
  54455. repeat: {
  54456. get: function() {
  54457. return console.warn("THREE.WebGLRenderTarget: .repeat is now .texture.repeat."),
  54458. this.texture.repeat
  54459. },
  54460. set: function(e) {
  54461. console.warn("THREE.WebGLRenderTarget: .repeat is now .texture.repeat."),
  54462. this.texture.repeat = e
  54463. }
  54464. },
  54465. format: {
  54466. get: function() {
  54467. return console.warn("THREE.WebGLRenderTarget: .format is now .texture.format."),
  54468. this.texture.format
  54469. },
  54470. set: function(e) {
  54471. console.warn("THREE.WebGLRenderTarget: .format is now .texture.format."),
  54472. this.texture.format = e
  54473. }
  54474. },
  54475. type: {
  54476. get: function() {
  54477. return console.warn("THREE.WebGLRenderTarget: .type is now .texture.type."),
  54478. this.texture.type
  54479. },
  54480. set: function(e) {
  54481. console.warn("THREE.WebGLRenderTarget: .type is now .texture.type."),
  54482. this.texture.type = e
  54483. }
  54484. },
  54485. generateMipmaps: {
  54486. get: function() {
  54487. return console.warn("THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps."),
  54488. this.texture.generateMipmaps
  54489. },
  54490. set: function(e) {
  54491. console.warn("THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps."),
  54492. this.texture.generateMipmaps = e
  54493. }
  54494. }
  54495. }),
  54496. n.GeometryUtils = {
  54497. merge: function(e, t, i) {
  54498. console.warn("THREE.GeometryUtils: .merge() has been moved to Geometry. Use geometry.merge( geometry2, matrix, materialIndexOffset ) instead.");
  54499. var r;
  54500. t instanceof n.Mesh && (t.matrixAutoUpdate && t.updateMatrix(),
  54501. r = t.matrix,
  54502. t = t.geometry),
  54503. e.merge(t, r, i)
  54504. },
  54505. center: function(e) {
  54506. return console.warn("THREE.GeometryUtils: .center() has been moved to Geometry. Use geometry.center() instead."),
  54507. e.center()
  54508. }
  54509. },
  54510. n.ImageUtils = {
  54511. crossOrigin: void 0,
  54512. loadTexture: function(e, t, i, r) {
  54513. console.warn("THREE.ImageUtils.loadTexture has been deprecated. Use THREE.TextureLoader() instead.");
  54514. var o = new n.TextureLoader;
  54515. o.setCrossOrigin(this.crossOrigin);
  54516. var a = o.load(e, i, void 0, r);
  54517. return t && (a.mapping = t),
  54518. a
  54519. },
  54520. loadTextureCube: function(e, t, i, r) {
  54521. console.warn("THREE.ImageUtils.loadTextureCube has been deprecated. Use THREE.CubeTextureLoader() instead.");
  54522. var o = new n.CubeTextureLoader;
  54523. o.setCrossOrigin(this.crossOrigin);
  54524. var a = o.load(e, i, void 0, r);
  54525. return t && (a.mapping = t),
  54526. a
  54527. },
  54528. loadCompressedTexture: function() {
  54529. console.error("THREE.ImageUtils.loadCompressedTexture has been removed. Use THREE.DDSLoader instead.")
  54530. },
  54531. loadCompressedTextureCube: function() {
  54532. console.error("THREE.ImageUtils.loadCompressedTextureCube has been removed. Use THREE.DDSLoader instead.")
  54533. }
  54534. },
  54535. n.Projector = function() {
  54536. console.error("THREE.Projector has been moved to /examples/js/renderers/Projector.js."),
  54537. this.projectVector = function(e, t) {
  54538. console.warn("THREE.Projector: .projectVector() is now vector.project()."),
  54539. e.project(t)
  54540. }
  54541. ,
  54542. this.unprojectVector = function(e, t) {
  54543. console.warn("THREE.Projector: .unprojectVector() is now vector.unproject()."),
  54544. e.unproject(t)
  54545. }
  54546. ,
  54547. this.pickingRay = function(e, t) {
  54548. console.error("THREE.Projector: .pickingRay() is now raycaster.setFromCamera().")
  54549. }
  54550. }
  54551. ,
  54552. n.CanvasRenderer = function() {
  54553. console.error("THREE.CanvasRenderer has been moved to /examples/js/renderers/CanvasRenderer.js"),
  54554. this.domElement = document.createElement("canvas"),
  54555. this.clear = function() {}
  54556. ,
  54557. this.render = function() {}
  54558. ,
  54559. this.setClearColor = function() {}
  54560. ,
  54561. this.setSize = function() {}
  54562. }
  54563. ,
  54564. n.MeshFaceMaterial = n.MultiMaterial,
  54565. n.CurveUtils = {
  54566. tangentQuadraticBezier: function(e, t, i, n) {
  54567. return 2 * (1 - e) * (i - t) + 2 * e * (n - i)
  54568. },
  54569. tangentCubicBezier: function(e, t, i, n, r) {
  54570. 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
  54571. },
  54572. tangentSpline: function(e, t, i, n, r) {
  54573. var o = 6 * e * e - 6 * e
  54574. , a = 3 * e * e - 4 * e + 1
  54575. , s = -6 * e * e + 6 * e
  54576. , l = 3 * e * e - 2 * e;
  54577. return o + a + s + l
  54578. },
  54579. interpolate: function(e, t, i, n, r) {
  54580. var o = .5 * (i - e)
  54581. , a = .5 * (n - t)
  54582. , s = r * r
  54583. , l = r * s;
  54584. return (2 * t - 2 * i + o + a) * l + (-3 * t + 3 * i - 2 * o - a) * s + o * r + t
  54585. }
  54586. },
  54587. n.SceneUtils = {
  54588. createMultiMaterialObject: function(e, t) {
  54589. for (var i = new n.Group, r = 0, o = t.length; r < o; r++)
  54590. i.add(new n.Mesh(e,t[r]));
  54591. return i
  54592. },
  54593. detach: function(e, t, i) {
  54594. e.applyMatrix(t.matrixWorld),
  54595. t.remove(e),
  54596. i.add(e)
  54597. },
  54598. attach: function(e, t, i) {
  54599. var r = new n.Matrix4;
  54600. r.getInverse(i.matrixWorld),
  54601. e.applyMatrix(r),
  54602. t.remove(e),
  54603. i.add(e)
  54604. }
  54605. },
  54606. n.ShapeUtils = {
  54607. area: function(e) {
  54608. for (var t = e.length, i = 0, n = t - 1, r = 0; r < t; n = r++)
  54609. i += e[n].x * e[r].y - e[r].x * e[n].y;
  54610. return .5 * i
  54611. },
  54612. triangulate: function() {
  54613. function e(e, t, i, n, r, o) {
  54614. var a, s, l, c, h, u, d, p, f;
  54615. if (s = e[o[t]].x,
  54616. l = e[o[t]].y,
  54617. c = e[o[i]].x,
  54618. h = e[o[i]].y,
  54619. u = e[o[n]].x,
  54620. d = e[o[n]].y,
  54621. Number.EPSILON > (c - s) * (d - l) - (h - l) * (u - s))
  54622. return !1;
  54623. var g, m, v, A, y, C, I, E, b, w, _, T, x, S, M;
  54624. for (g = u - c,
  54625. m = d - h,
  54626. v = s - u,
  54627. A = l - d,
  54628. y = c - s,
  54629. C = h - l,
  54630. a = 0; a < r; a++)
  54631. if (p = e[o[a]].x,
  54632. f = e[o[a]].y,
  54633. !(p === s && f === l || p === c && f === h || p === u && f === d) && (I = p - s,
  54634. E = f - l,
  54635. b = p - c,
  54636. w = f - h,
  54637. _ = p - u,
  54638. T = f - d,
  54639. M = g * w - m * b,
  54640. x = y * E - C * I,
  54641. S = v * T - A * _,
  54642. M >= -Number.EPSILON && S >= -Number.EPSILON && x >= -Number.EPSILON))
  54643. return !1;
  54644. return !0
  54645. }
  54646. return function(t, i) {
  54647. var r = t.length;
  54648. if (r < 3)
  54649. return null;
  54650. var o, a, s, l = [], c = [], h = [];
  54651. if (n.ShapeUtils.area(t) > 0)
  54652. for (a = 0; a < r; a++)
  54653. c[a] = a;
  54654. else
  54655. for (a = 0; a < r; a++)
  54656. c[a] = r - 1 - a;
  54657. var u = r
  54658. , d = 2 * u;
  54659. for (a = u - 1; u > 2; ) {
  54660. if (d-- <= 0)
  54661. return console.warn("THREE.ShapeUtils: Unable to triangulate polygon! in triangulate()"),
  54662. i ? h : l;
  54663. if (o = a,
  54664. u <= o && (o = 0),
  54665. a = o + 1,
  54666. u <= a && (a = 0),
  54667. s = a + 1,
  54668. u <= s && (s = 0),
  54669. e(t, o, a, s, u, c)) {
  54670. var p, f, g, m, v;
  54671. for (p = c[o],
  54672. f = c[a],
  54673. g = c[s],
  54674. l.push([t[p], t[f], t[g]]),
  54675. h.push([c[o], c[a], c[s]]),
  54676. m = a,
  54677. v = a + 1; v < u; m++,
  54678. v++)
  54679. c[m] = c[v];
  54680. u--,
  54681. d = 2 * u
  54682. }
  54683. }
  54684. return i ? h : l
  54685. }
  54686. }(),
  54687. triangulateShape: function(e, t) {
  54688. function i(e, t, i) {
  54689. 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
  54690. }
  54691. function r(e, t, n, r, o) {
  54692. var a = t.x - e.x
  54693. , s = t.y - e.y
  54694. , l = r.x - n.x
  54695. , c = r.y - n.y
  54696. , h = e.x - n.x
  54697. , u = e.y - n.y
  54698. , d = s * l - a * c
  54699. , p = s * h - a * u;
  54700. if (Math.abs(d) > Number.EPSILON) {
  54701. var f;
  54702. if (d > 0) {
  54703. if (p < 0 || p > d)
  54704. return [];
  54705. if (f = c * h - l * u,
  54706. f < 0 || f > d)
  54707. return []
  54708. } else {
  54709. if (p > 0 || p < d)
  54710. return [];
  54711. if (f = c * h - l * u,
  54712. f > 0 || f < d)
  54713. return []
  54714. }
  54715. if (0 === f)
  54716. return !o || 0 !== p && p !== d ? [e] : [];
  54717. if (f === d)
  54718. return !o || 0 !== p && p !== d ? [t] : [];
  54719. if (0 === p)
  54720. return [n];
  54721. if (p === d)
  54722. return [r];
  54723. var g = f / d;
  54724. return [{
  54725. x: e.x + g * a,
  54726. y: e.y + g * s
  54727. }]
  54728. }
  54729. if (0 !== p || c * h !== l * u)
  54730. return [];
  54731. var m = 0 === a && 0 === s
  54732. , v = 0 === l && 0 === c;
  54733. if (m && v)
  54734. return e.x !== n.x || e.y !== n.y ? [] : [e];
  54735. if (m)
  54736. return i(n, r, e) ? [e] : [];
  54737. if (v)
  54738. return i(e, t, n) ? [n] : [];
  54739. var A, y, C, I, E, b, w, _;
  54740. return 0 !== a ? (e.x < t.x ? (A = e,
  54741. C = e.x,
  54742. y = t,
  54743. I = t.x) : (A = t,
  54744. C = t.x,
  54745. y = e,
  54746. I = e.x),
  54747. n.x < r.x ? (E = n,
  54748. w = n.x,
  54749. b = r,
  54750. _ = r.x) : (E = r,
  54751. w = r.x,
  54752. b = n,
  54753. _ = n.x)) : (e.y < t.y ? (A = e,
  54754. C = e.y,
  54755. y = t,
  54756. I = t.y) : (A = t,
  54757. C = t.y,
  54758. y = e,
  54759. I = e.y),
  54760. n.y < r.y ? (E = n,
  54761. w = n.y,
  54762. b = r,
  54763. _ = r.y) : (E = r,
  54764. w = r.y,
  54765. b = n,
  54766. _ = n.y)),
  54767. C <= w ? I < w ? [] : I === w ? o ? [] : [E] : I <= _ ? [E, y] : [E, b] : C > _ ? [] : C === _ ? o ? [] : [A] : I <= _ ? [A, y] : [A, b]
  54768. }
  54769. function o(e, t, i, n) {
  54770. var r = t.x - e.x
  54771. , o = t.y - e.y
  54772. , a = i.x - e.x
  54773. , s = i.y - e.y
  54774. , l = n.x - e.x
  54775. , c = n.y - e.y
  54776. , h = r * s - o * a
  54777. , u = r * c - o * l;
  54778. if (Math.abs(h) > Number.EPSILON) {
  54779. var d = l * s - c * a;
  54780. return h > 0 ? u >= 0 && d >= 0 : u >= 0 || d >= 0
  54781. }
  54782. return u > 0
  54783. }
  54784. function a(e, t) {
  54785. function i(e, t) {
  54786. var i = A.length - 1
  54787. , n = e - 1;
  54788. n < 0 && (n = i);
  54789. var r = e + 1;
  54790. r > i && (r = 0);
  54791. var a = o(A[e], A[n], A[r], s[t]);
  54792. if (!a)
  54793. return !1;
  54794. var l = s.length - 1
  54795. , c = t - 1;
  54796. c < 0 && (c = l);
  54797. var h = t + 1;
  54798. return h > l && (h = 0),
  54799. a = o(s[t], s[c], s[h], A[e]),
  54800. !!a
  54801. }
  54802. function n(e, t) {
  54803. var i, n, o;
  54804. for (i = 0; i < A.length; i++)
  54805. if (n = i + 1,
  54806. n %= A.length,
  54807. o = r(e, t, A[i], A[n], !0),
  54808. o.length > 0)
  54809. return !0;
  54810. return !1
  54811. }
  54812. function a(e, i) {
  54813. var n, o, a, s, l;
  54814. for (n = 0; n < y.length; n++)
  54815. for (o = t[y[n]],
  54816. a = 0; a < o.length; a++)
  54817. if (s = a + 1,
  54818. s %= o.length,
  54819. l = r(e, i, o[a], o[s], !0),
  54820. l.length > 0)
  54821. return !0;
  54822. return !1
  54823. }
  54824. 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++)
  54825. y.push(I);
  54826. for (var b = 0, w = 2 * y.length; y.length > 0; ) {
  54827. if (w--,
  54828. w < 0) {
  54829. console.log("Infinite Loop! Holes left:" + y.length + ", Probably Hole outside Shape!");
  54830. break
  54831. }
  54832. for (c = b; c < A.length; c++) {
  54833. h = A[c],
  54834. l = -1;
  54835. for (var I = 0; I < y.length; I++)
  54836. if (d = y[I],
  54837. p = h.x + ":" + h.y + ":" + d,
  54838. void 0 === C[p]) {
  54839. s = t[d];
  54840. for (var _ = 0; _ < s.length; _++)
  54841. if (u = s[_],
  54842. i(c, _) && !n(h, u) && !a(h, u)) {
  54843. l = _,
  54844. y.splice(I, 1),
  54845. f = A.slice(0, c + 1),
  54846. g = A.slice(c),
  54847. m = s.slice(l),
  54848. v = s.slice(0, l + 1),
  54849. A = f.concat(m).concat(v).concat(g),
  54850. b = c;
  54851. break
  54852. }
  54853. if (l >= 0)
  54854. break;
  54855. C[p] = !0
  54856. }
  54857. if (l >= 0)
  54858. break
  54859. }
  54860. }
  54861. return A
  54862. }
  54863. for (var s, l, c, h, u, d, p = {}, f = e.concat(), g = 0, m = t.length; g < m; g++)
  54864. Array.prototype.push.apply(f, t[g]);
  54865. for (s = 0,
  54866. l = f.length; s < l; s++)
  54867. u = f[s].x + ":" + f[s].y,
  54868. void 0 !== p[u] && console.warn("THREE.Shape: Duplicate point", u),
  54869. p[u] = s;
  54870. var v = a(e, t)
  54871. , A = n.ShapeUtils.triangulate(v, !1);
  54872. for (s = 0,
  54873. l = A.length; s < l; s++)
  54874. for (h = A[s],
  54875. c = 0; c < 3; c++)
  54876. u = h[c].x + ":" + h[c].y,
  54877. d = p[u],
  54878. void 0 !== d && (h[c] = d);
  54879. return A.concat()
  54880. },
  54881. isClockWise: function(e) {
  54882. return n.ShapeUtils.area(e) < 0
  54883. },
  54884. b2: function() {
  54885. function e(e, t) {
  54886. var i = 1 - e;
  54887. return i * i * t
  54888. }
  54889. function t(e, t) {
  54890. return 2 * (1 - e) * e * t
  54891. }
  54892. function i(e, t) {
  54893. return e * e * t
  54894. }
  54895. return function(n, r, o, a) {
  54896. return e(n, r) + t(n, o) + i(n, a)
  54897. }
  54898. }(),
  54899. b3: function() {
  54900. function e(e, t) {
  54901. var i = 1 - e;
  54902. return i * i * i * t
  54903. }
  54904. function t(e, t) {
  54905. var i = 1 - e;
  54906. return 3 * i * i * e * t
  54907. }
  54908. function i(e, t) {
  54909. var i = 1 - e;
  54910. return 3 * i * e * e * t
  54911. }
  54912. function n(e, t) {
  54913. return e * e * e * t
  54914. }
  54915. return function(r, o, a, s, l) {
  54916. return e(r, o) + t(r, a) + i(r, s) + n(r, l)
  54917. }
  54918. }()
  54919. },
  54920. n.Curve = function() {}
  54921. ,
  54922. n.Curve.prototype = {
  54923. constructor: n.Curve,
  54924. getPoint: function(e) {
  54925. return console.warn("THREE.Curve: Warning, getPoint() not implemented!"),
  54926. null
  54927. },
  54928. getPointAt: function(e) {
  54929. var t = this.getUtoTmapping(e);
  54930. return this.getPoint(t)
  54931. },
  54932. getPoints: function(e) {
  54933. e || (e = 5);
  54934. var t, i = [];
  54935. for (t = 0; t <= e; t++)
  54936. i.push(this.getPoint(t / e));
  54937. return i
  54938. },
  54939. getSpacedPoints: function(e) {
  54940. e || (e = 5);
  54941. var t, i = [];
  54942. for (t = 0; t <= e; t++)
  54943. i.push(this.getPointAt(t / e));
  54944. return i
  54945. },
  54946. getLength: function() {
  54947. var e = this.getLengths();
  54948. return e[e.length - 1]
  54949. },
  54950. getLengths: function(e) {
  54951. if (e || (e = this.__arcLengthDivisions ? this.__arcLengthDivisions : 200),
  54952. this.cacheArcLengths && this.cacheArcLengths.length === e + 1 && !this.needsUpdate)
  54953. return this.cacheArcLengths;
  54954. this.needsUpdate = !1;
  54955. var t, i, n = [], r = this.getPoint(0), o = 0;
  54956. for (n.push(0),
  54957. i = 1; i <= e; i++)
  54958. t = this.getPoint(i / e),
  54959. o += t.distanceTo(r),
  54960. n.push(o),
  54961. r = t;
  54962. return this.cacheArcLengths = n,
  54963. n
  54964. },
  54965. updateArcLengths: function() {
  54966. this.needsUpdate = !0,
  54967. this.getLengths()
  54968. },
  54969. getUtoTmapping: function(e, t) {
  54970. var i, n = this.getLengths(), r = 0, o = n.length;
  54971. i = t ? t : e * n[o - 1];
  54972. for (var a, s = 0, l = o - 1; s <= l; )
  54973. if (r = Math.floor(s + (l - s) / 2),
  54974. a = n[r] - i,
  54975. a < 0)
  54976. s = r + 1;
  54977. else {
  54978. if (!(a > 0)) {
  54979. l = r;
  54980. break
  54981. }
  54982. l = r - 1
  54983. }
  54984. if (r = l,
  54985. n[r] === i) {
  54986. var c = r / (o - 1);
  54987. return c
  54988. }
  54989. var h = n[r]
  54990. , u = n[r + 1]
  54991. , d = u - h
  54992. , p = (i - h) / d
  54993. , c = (r + p) / (o - 1);
  54994. return c
  54995. },
  54996. getTangent: function(e) {
  54997. var t = 1e-4
  54998. , i = e - t
  54999. , n = e + t;
  55000. i < 0 && (i = 0),
  55001. n > 1 && (n = 1);
  55002. var r = this.getPoint(i)
  55003. , o = this.getPoint(n)
  55004. , a = o.clone().sub(r);
  55005. return a.normalize()
  55006. },
  55007. getTangentAt: function(e) {
  55008. var t = this.getUtoTmapping(e);
  55009. return this.getTangent(t)
  55010. }
  55011. },
  55012. n.Curve.create = function(e, t) {
  55013. return e.prototype = Object.create(n.Curve.prototype),
  55014. e.prototype.constructor = e,
  55015. e.prototype.getPoint = t,
  55016. e
  55017. }
  55018. ,
  55019. n.CurvePath = function() {
  55020. this.curves = [],
  55021. this.autoClose = !1
  55022. }
  55023. ,
  55024. n.CurvePath.prototype = Object.create(n.Curve.prototype),
  55025. n.CurvePath.prototype.constructor = n.CurvePath,
  55026. n.CurvePath.prototype.add = function(e) {
  55027. this.curves.push(e)
  55028. }
  55029. ,
  55030. n.CurvePath.prototype.closePath = function() {
  55031. var e = this.curves[0].getPoint(0)
  55032. , t = this.curves[this.curves.length - 1].getPoint(1);
  55033. e.equals(t) || this.curves.push(new n.LineCurve(t,e))
  55034. }
  55035. ,
  55036. n.CurvePath.prototype.getPoint = function(e) {
  55037. for (var t = e * this.getLength(), i = this.getCurveLengths(), n = 0; n < i.length; ) {
  55038. if (i[n] >= t) {
  55039. var r = i[n] - t
  55040. , o = this.curves[n]
  55041. , a = 1 - r / o.getLength();
  55042. return o.getPointAt(a)
  55043. }
  55044. n++
  55045. }
  55046. return null
  55047. }
  55048. ,
  55049. n.CurvePath.prototype.getLength = function() {
  55050. var e = this.getCurveLengths();
  55051. return e[e.length - 1]
  55052. }
  55053. ,
  55054. n.CurvePath.prototype.getCurveLengths = function() {
  55055. if (this.cacheLengths && this.cacheLengths.length === this.curves.length)
  55056. return this.cacheLengths;
  55057. for (var e = [], t = 0, i = 0, n = this.curves.length; i < n; i++)
  55058. t += this.curves[i].getLength(),
  55059. e.push(t);
  55060. return this.cacheLengths = e,
  55061. e
  55062. }
  55063. ,
  55064. n.CurvePath.prototype.createPointsGeometry = function(e) {
  55065. var t = this.getPoints(e);
  55066. return this.createGeometry(t)
  55067. }
  55068. ,
  55069. n.CurvePath.prototype.createSpacedPointsGeometry = function(e) {
  55070. var t = this.getSpacedPoints(e);
  55071. return this.createGeometry(t)
  55072. }
  55073. ,
  55074. n.CurvePath.prototype.createGeometry = function(e) {
  55075. for (var t = new n.Geometry, i = 0, r = e.length; i < r; i++) {
  55076. var o = e[i];
  55077. t.vertices.push(new n.Vector3(o.x,o.y,o.z || 0))
  55078. }
  55079. return t
  55080. }
  55081. ,
  55082. n.Font = function(e) {
  55083. this.data = e
  55084. }
  55085. ,
  55086. n.Font.prototype = {
  55087. constructor: n.Font,
  55088. generateShapes: function(e, t, i) {
  55089. function r(e) {
  55090. for (var i = String(e).split(""), n = t / a.resolution, r = 0, s = [], l = 0; l < i.length; l++) {
  55091. var c = o(i[l], n, r);
  55092. r += c.offset,
  55093. s.push(c.path)
  55094. }
  55095. return s
  55096. }
  55097. function o(e, t, r) {
  55098. var o = a.glyphs[e] || a.glyphs["?"];
  55099. if (o) {
  55100. 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;
  55101. if (o.o)
  55102. for (var E = o._cachedOutline || (o._cachedOutline = o.o.split(" ")), b = 0, w = E.length; b < w; ) {
  55103. var _ = E[b++];
  55104. switch (_) {
  55105. case "m":
  55106. s = E[b++] * t + r,
  55107. l = E[b++] * t,
  55108. A.moveTo(s, l);
  55109. break;
  55110. case "l":
  55111. s = E[b++] * t + r,
  55112. l = E[b++] * t,
  55113. A.lineTo(s, l);
  55114. break;
  55115. case "q":
  55116. if (c = E[b++] * t + r,
  55117. h = E[b++] * t,
  55118. p = E[b++] * t + r,
  55119. f = E[b++] * t,
  55120. A.quadraticCurveTo(p, f, c, h),
  55121. v = y[y.length - 1]) {
  55122. u = v.x,
  55123. d = v.y;
  55124. for (var T = 1; T <= i; T++) {
  55125. var x = T / i;
  55126. C(x, u, p, c),
  55127. C(x, d, f, h)
  55128. }
  55129. }
  55130. break;
  55131. case "b":
  55132. if (c = E[b++] * t + r,
  55133. h = E[b++] * t,
  55134. p = E[b++] * t + r,
  55135. f = E[b++] * t,
  55136. g = E[b++] * t + r,
  55137. m = E[b++] * t,
  55138. A.bezierCurveTo(p, f, g, m, c, h),
  55139. v = y[y.length - 1]) {
  55140. u = v.x,
  55141. d = v.y;
  55142. for (var T = 1; T <= i; T++) {
  55143. var x = T / i;
  55144. I(x, u, p, g, c),
  55145. I(x, d, f, m, h)
  55146. }
  55147. }
  55148. }
  55149. }
  55150. return {
  55151. offset: o.ha * t,
  55152. path: A
  55153. }
  55154. }
  55155. }
  55156. void 0 === t && (t = 100),
  55157. void 0 === i && (i = 4);
  55158. for (var a = this.data, s = r(e), l = [], c = 0, h = s.length; c < h; c++)
  55159. Array.prototype.push.apply(l, s[c].toShapes());
  55160. return l
  55161. }
  55162. },
  55163. n.Path = function(e) {
  55164. n.CurvePath.call(this),
  55165. this.actions = [],
  55166. e && this.fromPoints(e)
  55167. }
  55168. ,
  55169. n.Path.prototype = Object.create(n.CurvePath.prototype),
  55170. n.Path.prototype.constructor = n.Path,
  55171. n.Path.prototype.fromPoints = function(e) {
  55172. this.moveTo(e[0].x, e[0].y);
  55173. for (var t = 1, i = e.length; t < i; t++)
  55174. this.lineTo(e[t].x, e[t].y)
  55175. }
  55176. ,
  55177. n.Path.prototype.moveTo = function(e, t) {
  55178. this.actions.push({
  55179. action: "moveTo",
  55180. args: [e, t]
  55181. })
  55182. }
  55183. ,
  55184. n.Path.prototype.lineTo = function(e, t) {
  55185. var i = this.actions[this.actions.length - 1].args
  55186. , r = i[i.length - 2]
  55187. , o = i[i.length - 1]
  55188. , a = new n.LineCurve(new n.Vector2(r,o),new n.Vector2(e,t));
  55189. this.curves.push(a),
  55190. this.actions.push({
  55191. action: "lineTo",
  55192. args: [e, t]
  55193. })
  55194. }
  55195. ,
  55196. n.Path.prototype.quadraticCurveTo = function(e, t, i, r) {
  55197. var o = this.actions[this.actions.length - 1].args
  55198. , a = o[o.length - 2]
  55199. , s = o[o.length - 1]
  55200. , l = new n.QuadraticBezierCurve(new n.Vector2(a,s),new n.Vector2(e,t),new n.Vector2(i,r));
  55201. this.curves.push(l),
  55202. this.actions.push({
  55203. action: "quadraticCurveTo",
  55204. args: [e, t, i, r]
  55205. })
  55206. }
  55207. ,
  55208. n.Path.prototype.bezierCurveTo = function(e, t, i, r, o, a) {
  55209. var s = this.actions[this.actions.length - 1].args
  55210. , l = s[s.length - 2]
  55211. , c = s[s.length - 1]
  55212. , h = new n.CubicBezierCurve(new n.Vector2(l,c),new n.Vector2(e,t),new n.Vector2(i,r),new n.Vector2(o,a));
  55213. this.curves.push(h),
  55214. this.actions.push({
  55215. action: "bezierCurveTo",
  55216. args: [e, t, i, r, o, a]
  55217. })
  55218. }
  55219. ,
  55220. n.Path.prototype.splineThru = function(e) {
  55221. var t = Array.prototype.slice.call(arguments)
  55222. , i = this.actions[this.actions.length - 1].args
  55223. , r = i[i.length - 2]
  55224. , o = i[i.length - 1]
  55225. , a = [new n.Vector2(r,o)];
  55226. Array.prototype.push.apply(a, e);
  55227. var s = new n.SplineCurve(a);
  55228. this.curves.push(s),
  55229. this.actions.push({
  55230. action: "splineThru",
  55231. args: t
  55232. })
  55233. }
  55234. ,
  55235. n.Path.prototype.arc = function(e, t, i, n, r, o) {
  55236. var a = this.actions[this.actions.length - 1].args
  55237. , s = a[a.length - 2]
  55238. , l = a[a.length - 1];
  55239. this.absarc(e + s, t + l, i, n, r, o)
  55240. }
  55241. ,
  55242. n.Path.prototype.absarc = function(e, t, i, n, r, o) {
  55243. this.absellipse(e, t, i, i, n, r, o)
  55244. }
  55245. ,
  55246. n.Path.prototype.ellipse = function(e, t, i, n, r, o, a, s) {
  55247. var l = this.actions[this.actions.length - 1].args
  55248. , c = l[l.length - 2]
  55249. , h = l[l.length - 1];
  55250. this.absellipse(e + c, t + h, i, n, r, o, a, s)
  55251. }
  55252. ,
  55253. n.Path.prototype.absellipse = function(e, t, i, r, o, a, s, l) {
  55254. var c = [e, t, i, r, o, a, s, l || 0]
  55255. , h = new n.EllipseCurve(e,t,i,r,o,a,s,l);
  55256. this.curves.push(h);
  55257. var u = h.getPoint(1);
  55258. c.push(u.x),
  55259. c.push(u.y),
  55260. this.actions.push({
  55261. action: "ellipse",
  55262. args: c
  55263. })
  55264. }
  55265. ,
  55266. n.Path.prototype.getSpacedPoints = function(e) {
  55267. e || (e = 40);
  55268. for (var t = [], i = 0; i < e; i++)
  55269. t.push(this.getPoint(i / e));
  55270. return this.autoClose && t.push(t[0]),
  55271. t
  55272. }
  55273. ,
  55274. n.Path.prototype.getPoints = function(e) {
  55275. e = e || 12;
  55276. 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++) {
  55277. var A = this.actions[m]
  55278. , y = A.action
  55279. , C = A.args;
  55280. switch (y) {
  55281. case "moveTo":
  55282. g.push(new n.Vector2(C[0],C[1]));
  55283. break;
  55284. case "lineTo":
  55285. g.push(new n.Vector2(C[0],C[1]));
  55286. break;
  55287. case "quadraticCurveTo":
  55288. t = C[2],
  55289. i = C[3],
  55290. a = C[0],
  55291. s = C[1],
  55292. g.length > 0 ? (h = g[g.length - 1],
  55293. l = h.x,
  55294. c = h.y) : (h = this.actions[m - 1].args,
  55295. l = h[h.length - 2],
  55296. c = h[h.length - 1]);
  55297. for (var I = 1; I <= e; I++) {
  55298. var E = I / e;
  55299. u = p(E, l, a, t),
  55300. d = p(E, c, s, i),
  55301. g.push(new n.Vector2(u,d))
  55302. }
  55303. break;
  55304. case "bezierCurveTo":
  55305. t = C[4],
  55306. i = C[5],
  55307. a = C[0],
  55308. s = C[1],
  55309. r = C[2],
  55310. o = C[3],
  55311. g.length > 0 ? (h = g[g.length - 1],
  55312. l = h.x,
  55313. c = h.y) : (h = this.actions[m - 1].args,
  55314. l = h[h.length - 2],
  55315. c = h[h.length - 1]);
  55316. for (var I = 1; I <= e; I++) {
  55317. var E = I / e;
  55318. u = f(E, l, a, r, t),
  55319. d = f(E, c, s, o, i),
  55320. g.push(new n.Vector2(u,d))
  55321. }
  55322. break;
  55323. case "splineThru":
  55324. h = this.actions[m - 1].args;
  55325. var b = new n.Vector2(h[h.length - 2],h[h.length - 1])
  55326. , w = [b]
  55327. , _ = e * C[0].length;
  55328. w = w.concat(C[0]);
  55329. for (var T = new n.SplineCurve(w), I = 1; I <= _; I++)
  55330. g.push(T.getPointAt(I / _));
  55331. break;
  55332. case "arc":
  55333. 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++) {
  55334. var E = I / N;
  55335. L || (E = 1 - E),
  55336. x = P + E * D,
  55337. u = S + R * Math.cos(x),
  55338. d = M + R * Math.sin(x),
  55339. g.push(new n.Vector2(u,d))
  55340. }
  55341. break;
  55342. case "ellipse":
  55343. 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;
  55344. 0 !== k && (B = Math.cos(k),
  55345. F = Math.sin(k));
  55346. for (var I = 1; I <= N; I++) {
  55347. var E = I / N;
  55348. if (L || (E = 1 - E),
  55349. x = P + E * D,
  55350. u = S + V * Math.cos(x),
  55351. d = M + U * Math.sin(x),
  55352. 0 !== k) {
  55353. var H = u
  55354. , G = d;
  55355. u = (H - S) * B - (G - M) * F + S,
  55356. d = (H - S) * F + (G - M) * B + M
  55357. }
  55358. g.push(new n.Vector2(u,d))
  55359. }
  55360. }
  55361. }
  55362. var z = g[g.length - 1];
  55363. 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),
  55364. this.autoClose && g.push(g[0]),
  55365. g
  55366. }
  55367. ,
  55368. n.Path.prototype.toShapes = function(e, t) {
  55369. function i(e) {
  55370. for (var t = [], i = new n.Path, r = 0, o = e.length; r < o; r++) {
  55371. var a = e[r]
  55372. , s = a.args
  55373. , l = a.action;
  55374. "moveTo" === l && 0 !== i.actions.length && (t.push(i),
  55375. i = new n.Path),
  55376. i[l].apply(i, s)
  55377. }
  55378. return 0 !== i.actions.length && t.push(i),
  55379. t
  55380. }
  55381. function r(e) {
  55382. for (var t = [], i = 0, r = e.length; i < r; i++) {
  55383. var o = e[i]
  55384. , a = new n.Shape;
  55385. a.actions = o.actions,
  55386. a.curves = o.curves,
  55387. t.push(a)
  55388. }
  55389. return t
  55390. }
  55391. function o(e, t) {
  55392. for (var i = t.length, n = !1, r = i - 1, o = 0; o < i; r = o++) {
  55393. var a = t[r]
  55394. , s = t[o]
  55395. , l = s.x - a.x
  55396. , c = s.y - a.y;
  55397. if (Math.abs(c) > Number.EPSILON) {
  55398. if (c < 0 && (a = t[o],
  55399. l = -l,
  55400. s = t[r],
  55401. c = -c),
  55402. e.y < a.y || e.y > s.y)
  55403. continue;
  55404. if (e.y === a.y) {
  55405. if (e.x === a.x)
  55406. return !0
  55407. } else {
  55408. var h = c * (e.x - a.x) - l * (e.y - a.y);
  55409. if (0 === h)
  55410. return !0;
  55411. if (h < 0)
  55412. continue;
  55413. n = !n
  55414. }
  55415. } else {
  55416. if (e.y !== a.y)
  55417. continue;
  55418. if (s.x <= e.x && e.x <= a.x || a.x <= e.x && e.x <= s.x)
  55419. return !0
  55420. }
  55421. }
  55422. return n
  55423. }
  55424. var a = n.ShapeUtils.isClockWise
  55425. , s = i(this.actions);
  55426. if (0 === s.length)
  55427. return [];
  55428. if (t === !0)
  55429. return r(s);
  55430. var l, c, h, u = [];
  55431. if (1 === s.length)
  55432. return c = s[0],
  55433. h = new n.Shape,
  55434. h.actions = c.actions,
  55435. h.curves = c.curves,
  55436. u.push(h),
  55437. u;
  55438. var d = !a(s[0].getPoints());
  55439. d = e ? !d : d;
  55440. var p, f = [], g = [], m = [], v = 0;
  55441. g[v] = void 0,
  55442. m[v] = [];
  55443. for (var A = 0, y = s.length; A < y; A++)
  55444. c = s[A],
  55445. p = c.getPoints(),
  55446. l = a(p),
  55447. l = e ? !l : l,
  55448. l ? (!d && g[v] && v++,
  55449. g[v] = {
  55450. s: new n.Shape,
  55451. p: p
  55452. },
  55453. g[v].s.actions = c.actions,
  55454. g[v].s.curves = c.curves,
  55455. d && v++,
  55456. m[v] = []) : m[v].push({
  55457. h: c,
  55458. p: p[0]
  55459. });
  55460. if (!g[0])
  55461. return r(s);
  55462. if (g.length > 1) {
  55463. for (var C = !1, I = [], E = 0, b = g.length; E < b; E++)
  55464. f[E] = [];
  55465. for (var E = 0, b = g.length; E < b; E++)
  55466. for (var w = m[E], _ = 0; _ < w.length; _++) {
  55467. for (var T = w[_], x = !0, S = 0; S < g.length; S++)
  55468. o(T.p, g[S].p) && (E !== S && I.push({
  55469. froms: E,
  55470. tos: S,
  55471. hole: _
  55472. }),
  55473. x ? (x = !1,
  55474. f[S].push(T)) : C = !0);
  55475. x && f[E].push(T)
  55476. }
  55477. I.length > 0 && (C || (m = f))
  55478. }
  55479. for (var M, A = 0, R = g.length; A < R; A++) {
  55480. h = g[A].s,
  55481. u.push(h),
  55482. M = m[A];
  55483. for (var P = 0, O = M.length; P < O; P++)
  55484. h.holes.push(M[P].h)
  55485. }
  55486. return u
  55487. }
  55488. ,
  55489. n.Shape = function() {
  55490. n.Path.apply(this, arguments),
  55491. this.holes = []
  55492. }
  55493. ,
  55494. n.Shape.prototype = Object.create(n.Path.prototype),
  55495. n.Shape.prototype.constructor = n.Shape,
  55496. n.Shape.prototype.extrude = function(e) {
  55497. return new n.ExtrudeGeometry(this,e)
  55498. }
  55499. ,
  55500. n.Shape.prototype.makeGeometry = function(e) {
  55501. return new n.ShapeGeometry(this,e)
  55502. }
  55503. ,
  55504. n.Shape.prototype.getPointsHoles = function(e) {
  55505. for (var t = [], i = 0, n = this.holes.length; i < n; i++)
  55506. t[i] = this.holes[i].getPoints(e);
  55507. return t
  55508. }
  55509. ,
  55510. n.Shape.prototype.extractAllPoints = function(e) {
  55511. return {
  55512. shape: this.getPoints(e),
  55513. holes: this.getPointsHoles(e)
  55514. }
  55515. }
  55516. ,
  55517. n.Shape.prototype.extractPoints = function(e) {
  55518. return this.extractAllPoints(e)
  55519. }
  55520. ,
  55521. n.LineCurve = function(e, t) {
  55522. this.v1 = e,
  55523. this.v2 = t
  55524. }
  55525. ,
  55526. n.LineCurve.prototype = Object.create(n.Curve.prototype),
  55527. n.LineCurve.prototype.constructor = n.LineCurve,
  55528. n.LineCurve.prototype.getPoint = function(e) {
  55529. var t = this.v2.clone().sub(this.v1);
  55530. return t.multiplyScalar(e).add(this.v1),
  55531. t
  55532. }
  55533. ,
  55534. n.LineCurve.prototype.getPointAt = function(e) {
  55535. return this.getPoint(e)
  55536. }
  55537. ,
  55538. n.LineCurve.prototype.getTangent = function(e) {
  55539. var t = this.v2.clone().sub(this.v1);
  55540. return t.normalize()
  55541. }
  55542. ,
  55543. n.QuadraticBezierCurve = function(e, t, i) {
  55544. this.v0 = e,
  55545. this.v1 = t,
  55546. this.v2 = i
  55547. }
  55548. ,
  55549. n.QuadraticBezierCurve.prototype = Object.create(n.Curve.prototype),
  55550. n.QuadraticBezierCurve.prototype.constructor = n.QuadraticBezierCurve,
  55551. n.QuadraticBezierCurve.prototype.getPoint = function(e) {
  55552. var t = n.ShapeUtils.b2;
  55553. 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))
  55554. }
  55555. ,
  55556. n.QuadraticBezierCurve.prototype.getTangent = function(e) {
  55557. var t = n.CurveUtils.tangentQuadraticBezier;
  55558. 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()
  55559. }
  55560. ,
  55561. n.CubicBezierCurve = function(e, t, i, n) {
  55562. this.v0 = e,
  55563. this.v1 = t,
  55564. this.v2 = i,
  55565. this.v3 = n
  55566. }
  55567. ,
  55568. n.CubicBezierCurve.prototype = Object.create(n.Curve.prototype),
  55569. n.CubicBezierCurve.prototype.constructor = n.CubicBezierCurve,
  55570. n.CubicBezierCurve.prototype.getPoint = function(e) {
  55571. var t = n.ShapeUtils.b3;
  55572. 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))
  55573. }
  55574. ,
  55575. n.CubicBezierCurve.prototype.getTangent = function(e) {
  55576. var t = n.CurveUtils.tangentCubicBezier;
  55577. 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()
  55578. }
  55579. ,
  55580. n.SplineCurve = function(e) {
  55581. this.points = void 0 == e ? [] : e
  55582. }
  55583. ,
  55584. n.SplineCurve.prototype = Object.create(n.Curve.prototype),
  55585. n.SplineCurve.prototype.constructor = n.SplineCurve,
  55586. n.SplineCurve.prototype.getPoint = function(e) {
  55587. var t = this.points
  55588. , i = (t.length - 1) * e
  55589. , r = Math.floor(i)
  55590. , o = i - r
  55591. , a = t[0 === r ? r : r - 1]
  55592. , s = t[r]
  55593. , l = t[r > t.length - 2 ? t.length - 1 : r + 1]
  55594. , c = t[r > t.length - 3 ? t.length - 1 : r + 2]
  55595. , h = n.CurveUtils.interpolate;
  55596. return new n.Vector2(h(a.x, s.x, l.x, c.x, o),h(a.y, s.y, l.y, c.y, o))
  55597. }
  55598. ,
  55599. n.EllipseCurve = function(e, t, i, n, r, o, a, s) {
  55600. this.aX = e,
  55601. this.aY = t,
  55602. this.xRadius = i,
  55603. this.yRadius = n,
  55604. this.aStartAngle = r,
  55605. this.aEndAngle = o,
  55606. this.aClockwise = a,
  55607. this.aRotation = s || 0
  55608. }
  55609. ,
  55610. n.EllipseCurve.prototype = Object.create(n.Curve.prototype),
  55611. n.EllipseCurve.prototype.constructor = n.EllipseCurve,
  55612. n.EllipseCurve.prototype.getPoint = function(e) {
  55613. var t = this.aEndAngle - this.aStartAngle;
  55614. t < 0 && (t += 2 * Math.PI),
  55615. t > 2 * Math.PI && (t -= 2 * Math.PI);
  55616. var i;
  55617. i = this.aClockwise === !0 ? this.aEndAngle + (1 - e) * (2 * Math.PI - t) : this.aStartAngle + e * t;
  55618. var r = this.aX + this.xRadius * Math.cos(i)
  55619. , o = this.aY + this.yRadius * Math.sin(i);
  55620. if (0 !== this.aRotation) {
  55621. var a = Math.cos(this.aRotation)
  55622. , s = Math.sin(this.aRotation)
  55623. , l = r
  55624. , c = o;
  55625. r = (l - this.aX) * a - (c - this.aY) * s + this.aX,
  55626. o = (l - this.aX) * s + (c - this.aY) * a + this.aY
  55627. }
  55628. return new n.Vector2(r,o)
  55629. }
  55630. ,
  55631. n.ArcCurve = function(e, t, i, r, o, a) {
  55632. n.EllipseCurve.call(this, e, t, i, i, r, o, a)
  55633. }
  55634. ,
  55635. n.ArcCurve.prototype = Object.create(n.EllipseCurve.prototype),
  55636. n.ArcCurve.prototype.constructor = n.ArcCurve,
  55637. n.LineCurve3 = n.Curve.create(function(e, t) {
  55638. this.v1 = e,
  55639. this.v2 = t
  55640. }, function(e) {
  55641. var t = new n.Vector3;
  55642. return t.subVectors(this.v2, this.v1),
  55643. t.multiplyScalar(e),
  55644. t.add(this.v1),
  55645. t
  55646. }),
  55647. n.QuadraticBezierCurve3 = n.Curve.create(function(e, t, i) {
  55648. this.v0 = e,
  55649. this.v1 = t,
  55650. this.v2 = i
  55651. }, function(e) {
  55652. var t = n.ShapeUtils.b2;
  55653. 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))
  55654. }),
  55655. n.CubicBezierCurve3 = n.Curve.create(function(e, t, i, n) {
  55656. this.v0 = e,
  55657. this.v1 = t,
  55658. this.v2 = i,
  55659. this.v3 = n
  55660. }, function(e) {
  55661. var t = n.ShapeUtils.b3;
  55662. 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))
  55663. }),
  55664. n.SplineCurve3 = n.Curve.create(function(e) {
  55665. console.warn("THREE.SplineCurve3 will be deprecated. Please use THREE.CatmullRomCurve3"),
  55666. this.points = void 0 == e ? [] : e
  55667. }, function(e) {
  55668. var t = this.points
  55669. , i = (t.length - 1) * e
  55670. , r = Math.floor(i)
  55671. , o = i - r
  55672. , a = t[0 == r ? r : r - 1]
  55673. , s = t[r]
  55674. , l = t[r > t.length - 2 ? t.length - 1 : r + 1]
  55675. , c = t[r > t.length - 3 ? t.length - 1 : r + 2]
  55676. , h = n.CurveUtils.interpolate;
  55677. 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))
  55678. }),
  55679. n.CatmullRomCurve3 = function() {
  55680. function e() {}
  55681. var t = new n.Vector3
  55682. , i = new e
  55683. , r = new e
  55684. , o = new e;
  55685. return e.prototype.init = function(e, t, i, n) {
  55686. this.c0 = e,
  55687. this.c1 = i,
  55688. this.c2 = -3 * e + 3 * t - 2 * i - n,
  55689. this.c3 = 2 * e - 2 * t + i + n
  55690. }
  55691. ,
  55692. e.prototype.initNonuniformCatmullRom = function(e, t, i, n, r, o, a) {
  55693. var s = (t - e) / r - (i - e) / (r + o) + (i - t) / o
  55694. , l = (i - t) / o - (n - t) / (o + a) + (n - i) / a;
  55695. s *= o,
  55696. l *= o,
  55697. this.init(t, i, s, l)
  55698. }
  55699. ,
  55700. e.prototype.initCatmullRom = function(e, t, i, n, r) {
  55701. this.init(t, i, r * (i - e), r * (n - t))
  55702. }
  55703. ,
  55704. e.prototype.calc = function(e) {
  55705. var t = e * e
  55706. , i = t * e;
  55707. return this.c0 + this.c1 * e + this.c2 * t + this.c3 * i
  55708. }
  55709. ,
  55710. n.Curve.create(function(e) {
  55711. this.points = e || [],
  55712. this.closed = !1
  55713. }, function(e) {
  55714. var a, s, l, c, h = this.points;
  55715. c = h.length,
  55716. c < 2 && console.log("duh, you need at least 2 points"),
  55717. a = (c - (this.closed ? 0 : 1)) * e,
  55718. s = Math.floor(a),
  55719. l = a - s,
  55720. this.closed ? s += s > 0 ? 0 : (Math.floor(Math.abs(s) / h.length) + 1) * h.length : 0 === l && s === c - 1 && (s = c - 2,
  55721. l = 1);
  55722. var u, d, p, f;
  55723. if (this.closed || s > 0 ? u = h[(s - 1) % c] : (t.subVectors(h[0], h[1]).add(h[0]),
  55724. u = t),
  55725. d = h[s % c],
  55726. p = h[(s + 1) % c],
  55727. this.closed || s + 2 < c ? f = h[(s + 2) % c] : (t.subVectors(h[c - 1], h[c - 2]).add(h[c - 1]),
  55728. f = t),
  55729. void 0 === this.type || "centripetal" === this.type || "chordal" === this.type) {
  55730. var g = "chordal" === this.type ? .5 : .25
  55731. , m = Math.pow(u.distanceToSquared(d), g)
  55732. , v = Math.pow(d.distanceToSquared(p), g)
  55733. , A = Math.pow(p.distanceToSquared(f), g);
  55734. v < 1e-4 && (v = 1),
  55735. m < 1e-4 && (m = v),
  55736. A < 1e-4 && (A = v),
  55737. i.initNonuniformCatmullRom(u.x, d.x, p.x, f.x, m, v, A),
  55738. r.initNonuniformCatmullRom(u.y, d.y, p.y, f.y, m, v, A),
  55739. o.initNonuniformCatmullRom(u.z, d.z, p.z, f.z, m, v, A)
  55740. } else if ("catmullrom" === this.type) {
  55741. var y = void 0 !== this.tension ? this.tension : .5;
  55742. i.initCatmullRom(u.x, d.x, p.x, f.x, y),
  55743. r.initCatmullRom(u.y, d.y, p.y, f.y, y),
  55744. o.initCatmullRom(u.z, d.z, p.z, f.z, y)
  55745. }
  55746. var C = new n.Vector3(i.calc(l),r.calc(l),o.calc(l));
  55747. return C
  55748. })
  55749. }(),
  55750. n.ClosedSplineCurve3 = function(e) {
  55751. console.warn("THREE.ClosedSplineCurve3 has been deprecated. Please use THREE.CatmullRomCurve3."),
  55752. n.CatmullRomCurve3.call(this, e),
  55753. this.type = "catmullrom",
  55754. this.closed = !0
  55755. }
  55756. ,
  55757. n.ClosedSplineCurve3.prototype = Object.create(n.CatmullRomCurve3.prototype),
  55758. n.BoxGeometry = function(e, t, i, r, o, a) {
  55759. n.Geometry.call(this),
  55760. this.type = "BoxGeometry",
  55761. this.parameters = {
  55762. width: e,
  55763. height: t,
  55764. depth: i,
  55765. widthSegments: r,
  55766. heightSegments: o,
  55767. depthSegments: a
  55768. },
  55769. this.fromBufferGeometry(new n.BoxBufferGeometry(e,t,i,r,o,a)),
  55770. this.mergeVertices()
  55771. }
  55772. ,
  55773. n.BoxGeometry.prototype = Object.create(n.Geometry.prototype),
  55774. n.BoxGeometry.prototype.constructor = n.BoxGeometry,
  55775. n.CubeGeometry = n.BoxGeometry,
  55776. n.BoxBufferGeometry = function(e, t, i, r, o, a) {
  55777. function s(e, t, i) {
  55778. var n = 0;
  55779. return n += e * t * 2,
  55780. n += e * i * 2,
  55781. n += i * t * 2,
  55782. 4 * n
  55783. }
  55784. function l(e, t, i, r, o, a, s, l, h, u, I) {
  55785. 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++)
  55786. for (var L = O * b - _, D = 0; D < x; D++) {
  55787. var N = D * E - w;
  55788. P[e] = N * r,
  55789. P[t] = L * o,
  55790. P[i] = T,
  55791. p[m] = P.x,
  55792. p[m + 1] = P.y,
  55793. p[m + 2] = P.z,
  55794. P[e] = 0,
  55795. P[t] = 0,
  55796. P[i] = l > 0 ? 1 : -1,
  55797. f[m] = P.x,
  55798. f[m + 1] = P.y,
  55799. f[m + 2] = P.z,
  55800. g[v] = D / h,
  55801. g[v + 1] = 1 - O / u,
  55802. m += 3,
  55803. v += 2,
  55804. M += 1
  55805. }
  55806. for (O = 0; O < u; O++)
  55807. for (D = 0; D < h; D++) {
  55808. var B = y + D + x * O
  55809. , F = y + D + x * (O + 1)
  55810. , V = y + (D + 1) + x * (O + 1)
  55811. , U = y + (D + 1) + x * O;
  55812. d[A] = B,
  55813. d[A + 1] = F,
  55814. d[A + 2] = U,
  55815. d[A + 3] = F,
  55816. d[A + 4] = V,
  55817. d[A + 5] = U,
  55818. A += 6,
  55819. R += 6
  55820. }
  55821. c.addGroup(C, R, I),
  55822. C += R,
  55823. y += M
  55824. }
  55825. n.BufferGeometry.call(this),
  55826. this.type = "BoxBufferGeometry",
  55827. this.parameters = {
  55828. width: e,
  55829. height: t,
  55830. depth: i,
  55831. widthSegments: r,
  55832. heightSegments: o,
  55833. depthSegments: a
  55834. };
  55835. var c = this;
  55836. r = Math.floor(r) || 1,
  55837. o = Math.floor(o) || 1,
  55838. a = Math.floor(a) || 1;
  55839. var h = s(r, o, a)
  55840. , u = h / 4 * 6
  55841. , d = new (u > 65535 ? Uint32Array : Uint16Array)(u)
  55842. , p = new Float32Array(3 * h)
  55843. , f = new Float32Array(3 * h)
  55844. , g = new Float32Array(2 * h)
  55845. , m = 0
  55846. , v = 0
  55847. , A = 0
  55848. , y = 0
  55849. , C = 0;
  55850. l("z", "y", "x", -1, -1, i, t, e, a, o, 0),
  55851. l("z", "y", "x", 1, -1, i, t, -e, a, o, 1),
  55852. l("x", "z", "y", 1, 1, e, i, t, r, a, 2),
  55853. l("x", "z", "y", 1, -1, e, i, -t, r, a, 3),
  55854. l("x", "y", "z", 1, -1, e, t, i, r, o, 4),
  55855. l("x", "y", "z", -1, -1, e, t, -i, r, o, 5),
  55856. this.setIndex(new n.BufferAttribute(d,1)),
  55857. this.addAttribute("position", new n.BufferAttribute(p,3)),
  55858. this.addAttribute("normal", new n.BufferAttribute(f,3)),
  55859. this.addAttribute("uv", new n.BufferAttribute(g,2))
  55860. }
  55861. ,
  55862. n.BoxBufferGeometry.prototype = Object.create(n.BufferGeometry.prototype),
  55863. n.BoxBufferGeometry.prototype.constructor = n.BoxBufferGeometry,
  55864. n.CircleGeometry = function(e, t, i, r) {
  55865. n.Geometry.call(this),
  55866. this.type = "CircleGeometry",
  55867. this.parameters = {
  55868. radius: e,
  55869. segments: t,
  55870. thetaStart: i,
  55871. thetaLength: r
  55872. },
  55873. this.fromBufferGeometry(new n.CircleBufferGeometry(e,t,i,r))
  55874. }
  55875. ,
  55876. n.CircleGeometry.prototype = Object.create(n.Geometry.prototype),
  55877. n.CircleGeometry.prototype.constructor = n.CircleGeometry,
  55878. n.CircleBufferGeometry = function(e, t, i, r) {
  55879. n.BufferGeometry.call(this),
  55880. this.type = "CircleBufferGeometry",
  55881. this.parameters = {
  55882. radius: e,
  55883. segments: t,
  55884. thetaStart: i,
  55885. thetaLength: r
  55886. },
  55887. e = e || 50,
  55888. t = void 0 !== t ? Math.max(3, t) : 8,
  55889. i = void 0 !== i ? i : 0,
  55890. r = void 0 !== r ? r : 2 * Math.PI;
  55891. var o = t + 2
  55892. , a = new Float32Array(3 * o)
  55893. , s = new Float32Array(3 * o)
  55894. , l = new Float32Array(2 * o);
  55895. s[2] = 1,
  55896. l[0] = .5,
  55897. l[1] = .5;
  55898. for (var c = 0, h = 3, u = 2; c <= t; c++,
  55899. h += 3,
  55900. u += 2) {
  55901. var d = i + c / t * r;
  55902. a[h] = e * Math.cos(d),
  55903. a[h + 1] = e * Math.sin(d),
  55904. s[h + 2] = 1,
  55905. l[u] = (a[h] / e + 1) / 2,
  55906. l[u + 1] = (a[h + 1] / e + 1) / 2
  55907. }
  55908. for (var p = [], h = 1; h <= t; h++)
  55909. p.push(h, h + 1, 0);
  55910. this.setIndex(new n.BufferAttribute(new Uint16Array(p),1)),
  55911. this.addAttribute("position", new n.BufferAttribute(a,3)),
  55912. this.addAttribute("normal", new n.BufferAttribute(s,3)),
  55913. this.addAttribute("uv", new n.BufferAttribute(l,2)),
  55914. this.boundingSphere = new n.Sphere(new n.Vector3,e)
  55915. }
  55916. ,
  55917. n.CircleBufferGeometry.prototype = Object.create(n.BufferGeometry.prototype),
  55918. n.CircleBufferGeometry.prototype.constructor = n.CircleBufferGeometry,
  55919. n.CylinderBufferGeometry = function(e, t, i, r, o, a, s, l) {
  55920. function c() {
  55921. var e = (r + 1) * (o + 1);
  55922. return a === !1 && (e += 2 * (r + 1) + 2 * r),
  55923. e
  55924. }
  55925. function h() {
  55926. var e = r * o * 2 * 3;
  55927. return a === !1 && (e += 2 * r * 3),
  55928. e
  55929. }
  55930. function u() {
  55931. var a, c, h = new n.Vector3, u = new n.Vector3, d = (t - e) / i;
  55932. for (c = 0; c <= o; c++) {
  55933. var p = []
  55934. , f = c / o
  55935. , b = f * (t - e) + e;
  55936. for (a = 0; a <= r; a++) {
  55937. var w = a / r;
  55938. u.x = b * Math.sin(w * l + s),
  55939. u.y = -f * i + E,
  55940. u.z = b * Math.cos(w * l + s),
  55941. m.setXYZ(y, u.x, u.y, u.z),
  55942. h.copy(u),
  55943. (0 === e && 0 === c || 0 === t && c === o) && (h.x = Math.sin(w * l + s),
  55944. h.z = Math.cos(w * l + s)),
  55945. h.setY(Math.sqrt(h.x * h.x + h.z * h.z) * d).normalize(),
  55946. v.setXYZ(y, h.x, h.y, h.z),
  55947. A.setXY(y, w, 1 - f),
  55948. p.push(y),
  55949. y++
  55950. }
  55951. I.push(p)
  55952. }
  55953. for (a = 0; a < r; a++)
  55954. for (c = 0; c < o; c++) {
  55955. var _ = I[c][a]
  55956. , T = I[c + 1][a]
  55957. , x = I[c + 1][a + 1]
  55958. , S = I[c][a + 1];
  55959. g.setX(C, _),
  55960. C++,
  55961. g.setX(C, T),
  55962. C++,
  55963. g.setX(C, S),
  55964. C++,
  55965. g.setX(C, T),
  55966. C++,
  55967. g.setX(C, x),
  55968. C++,
  55969. g.setX(C, S),
  55970. C++
  55971. }
  55972. }
  55973. function d(i) {
  55974. var o, a, c, h = new n.Vector2, u = new n.Vector3, d = i === !0 ? e : t, p = i === !0 ? 1 : -1;
  55975. for (a = y,
  55976. o = 1; o <= r; o++)
  55977. m.setXYZ(y, 0, E * p, 0),
  55978. v.setXYZ(y, 0, p, 0),
  55979. i === !0 ? (h.x = o / r,
  55980. h.y = 0) : (h.x = (o - 1) / r,
  55981. h.y = 1),
  55982. A.setXY(y, h.x, h.y),
  55983. y++;
  55984. for (c = y,
  55985. o = 0; o <= r; o++) {
  55986. var f = o / r;
  55987. u.x = d * Math.sin(f * l + s),
  55988. u.y = E * p,
  55989. u.z = d * Math.cos(f * l + s),
  55990. m.setXYZ(y, u.x, u.y, u.z),
  55991. v.setXYZ(y, 0, p, 0),
  55992. A.setXY(y, f, i === !0 ? 1 : 0),
  55993. y++
  55994. }
  55995. for (o = 0; o < r; o++) {
  55996. var I = a + o
  55997. , b = c + o;
  55998. i === !0 ? (g.setX(C, b),
  55999. C++,
  56000. g.setX(C, b + 1),
  56001. C++,
  56002. g.setX(C, I),
  56003. C++) : (g.setX(C, b + 1),
  56004. C++,
  56005. g.setX(C, b),
  56006. C++,
  56007. g.setX(C, I),
  56008. C++)
  56009. }
  56010. }
  56011. n.BufferGeometry.call(this),
  56012. this.type = "CylinderBufferGeometry",
  56013. this.parameters = {
  56014. radiusTop: e,
  56015. radiusBottom: t,
  56016. height: i,
  56017. radialSegments: r,
  56018. heightSegments: o,
  56019. openEnded: a,
  56020. thetaStart: s,
  56021. thetaLength: l
  56022. },
  56023. e = void 0 !== e ? e : 20,
  56024. t = void 0 !== t ? t : 20,
  56025. i = void 0 !== i ? i : 100,
  56026. r = Math.floor(r) || 8,
  56027. o = Math.floor(o) || 1,
  56028. a = void 0 !== a && a,
  56029. s = void 0 !== s ? s : 0,
  56030. l = void 0 !== l ? l : 2 * Math.PI;
  56031. var p = c()
  56032. , f = h()
  56033. , g = new n.BufferAttribute(new (f > 65535 ? Uint32Array : Uint16Array)(f),1)
  56034. , m = new n.BufferAttribute(new Float32Array(3 * p),3)
  56035. , v = new n.BufferAttribute(new Float32Array(3 * p),3)
  56036. , A = new n.BufferAttribute(new Float32Array(2 * p),2)
  56037. , y = 0
  56038. , C = 0
  56039. , I = []
  56040. , E = i / 2;
  56041. u(),
  56042. a === !1 && (e > 0 && d(!0),
  56043. t > 0 && d(!1)),
  56044. this.setIndex(g),
  56045. this.addAttribute("position", m),
  56046. this.addAttribute("normal", v),
  56047. this.addAttribute("uv", A)
  56048. }
  56049. ,
  56050. n.CylinderBufferGeometry.prototype = Object.create(n.BufferGeometry.prototype),
  56051. n.CylinderBufferGeometry.prototype.constructor = n.CylinderBufferGeometry,
  56052. n.CylinderGeometry = function(e, t, i, r, o, a, s, l) {
  56053. n.Geometry.call(this),
  56054. this.type = "CylinderGeometry",
  56055. this.parameters = {
  56056. radiusTop: e,
  56057. radiusBottom: t,
  56058. height: i,
  56059. radialSegments: r,
  56060. heightSegments: o,
  56061. openEnded: a,
  56062. thetaStart: s,
  56063. thetaLength: l
  56064. },
  56065. this.fromBufferGeometry(new n.CylinderBufferGeometry(e,t,i,r,o,a,s,l)),
  56066. this.mergeVertices()
  56067. }
  56068. ,
  56069. n.CylinderGeometry.prototype = Object.create(n.Geometry.prototype),
  56070. n.CylinderGeometry.prototype.constructor = n.CylinderGeometry,
  56071. n.EdgesGeometry = function(e, t) {
  56072. function i(e, t) {
  56073. return e - t
  56074. }
  56075. n.BufferGeometry.call(this),
  56076. t = void 0 !== t ? t : 1;
  56077. var r, o = Math.cos(n.Math.degToRad(t)), a = [0, 0], s = {}, l = ["a", "b", "c"];
  56078. e instanceof n.BufferGeometry ? (r = new n.Geometry,
  56079. r.fromBufferGeometry(e)) : r = e.clone(),
  56080. r.mergeVertices(),
  56081. r.computeFaceNormals();
  56082. for (var c = r.vertices, h = r.faces, u = 0, d = h.length; u < d; u++)
  56083. for (var p = h[u], f = 0; f < 3; f++) {
  56084. a[0] = p[l[f]],
  56085. a[1] = p[l[(f + 1) % 3]],
  56086. a.sort(i);
  56087. var g = a.toString();
  56088. void 0 === s[g] ? s[g] = {
  56089. vert1: a[0],
  56090. vert2: a[1],
  56091. face1: u,
  56092. face2: void 0
  56093. } : s[g].face2 = u
  56094. }
  56095. var m = [];
  56096. for (var g in s) {
  56097. var v = s[g];
  56098. if (void 0 === v.face2 || h[v.face1].normal.dot(h[v.face2].normal) <= o) {
  56099. var A = c[v.vert1];
  56100. m.push(A.x),
  56101. m.push(A.y),
  56102. m.push(A.z),
  56103. A = c[v.vert2],
  56104. m.push(A.x),
  56105. m.push(A.y),
  56106. m.push(A.z)
  56107. }
  56108. }
  56109. this.addAttribute("position", new n.BufferAttribute(new Float32Array(m),3))
  56110. }
  56111. ,
  56112. n.EdgesGeometry.prototype = Object.create(n.BufferGeometry.prototype),
  56113. n.EdgesGeometry.prototype.constructor = n.EdgesGeometry,
  56114. n.ExtrudeGeometry = function(e, t) {
  56115. return "undefined" == typeof e ? void (e = []) : (n.Geometry.call(this),
  56116. this.type = "ExtrudeGeometry",
  56117. e = Array.isArray(e) ? e : [e],
  56118. this.addShapeList(e, t),
  56119. void this.computeFaceNormals())
  56120. }
  56121. ;
  56122. n.ExtrudeGeometry.prototype = Object.create(n.Geometry.prototype);
  56123. n.ExtrudeGeometry.prototype.constructor = n.ExtrudeGeometry,
  56124. n.ExtrudeGeometry.prototype.addShapeList = function(e, t) {
  56125. for (var i = e.length, n = 0; n < i; n++) {
  56126. var r = e[n];
  56127. this.addShape(r, t)
  56128. }
  56129. }
  56130. ,
  56131. n.ExtrudeGeometry.prototype.addShape = function(e, t) {
  56132. function i(e, t, i) {
  56133. return t || console.error("THREE.ExtrudeGeometry: vec does not exist"),
  56134. t.clone().multiplyScalar(i).add(e)
  56135. }
  56136. function r(e, t, i) {
  56137. 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;
  56138. if (Math.abs(d) > Number.EPSILON) {
  56139. var p = Math.sqrt(u)
  56140. , f = Math.sqrt(c * c + h * h)
  56141. , g = t.x - l / p
  56142. , m = t.y + s / p
  56143. , v = i.x - h / f
  56144. , A = i.y + c / f
  56145. , y = ((v - g) * h - (A - m) * c) / (s * h - l * c);
  56146. r = g + s * y - e.x,
  56147. o = m + l * y - e.y;
  56148. var C = r * r + o * o;
  56149. if (C <= 2)
  56150. return new n.Vector2(r,o);
  56151. a = Math.sqrt(C / 2)
  56152. } else {
  56153. var I = !1;
  56154. s > Number.EPSILON ? c > Number.EPSILON && (I = !0) : s < -Number.EPSILON ? c < -Number.EPSILON && (I = !0) : Math.sign(l) === Math.sign(h) && (I = !0),
  56155. I ? (r = -l,
  56156. o = s,
  56157. a = Math.sqrt(u)) : (r = s,
  56158. o = l,
  56159. a = Math.sqrt(u / 2))
  56160. }
  56161. return new n.Vector2(r / a,o / a)
  56162. }
  56163. function o() {
  56164. if (C) {
  56165. var e = 0
  56166. , t = z * e;
  56167. for (Y = 0; Y < W; Y++)
  56168. G = N[Y],
  56169. c(G[2] + t, G[1] + t, G[0] + t);
  56170. for (e = E + 2 * y,
  56171. t = z * e,
  56172. Y = 0; Y < W; Y++)
  56173. G = N[Y],
  56174. c(G[0] + t, G[1] + t, G[2] + t)
  56175. } else {
  56176. for (Y = 0; Y < W; Y++)
  56177. G = N[Y],
  56178. c(G[2], G[1], G[0]);
  56179. for (Y = 0; Y < W; Y++)
  56180. G = N[Y],
  56181. c(G[0] + z * E, G[1] + z * E, G[2] + z * E)
  56182. }
  56183. }
  56184. function a() {
  56185. var e = 0;
  56186. for (s(B, e),
  56187. e += B.length,
  56188. x = 0,
  56189. S = L.length; x < S; x++)
  56190. T = L[x],
  56191. s(T, e),
  56192. e += T.length
  56193. }
  56194. function s(e, t) {
  56195. var i, n;
  56196. for (Y = e.length; --Y >= 0; ) {
  56197. i = Y,
  56198. n = Y - 1,
  56199. n < 0 && (n = e.length - 1);
  56200. var r = 0
  56201. , o = E + 2 * y;
  56202. for (r = 0; r < o; r++) {
  56203. var a = z * r
  56204. , s = z * (r + 1)
  56205. , l = t + i + a
  56206. , c = t + n + a
  56207. , u = t + n + s
  56208. , d = t + i + s;
  56209. h(l, c, u, d, e, r, o, i, n)
  56210. }
  56211. }
  56212. }
  56213. function l(e, t, i) {
  56214. M.vertices.push(new n.Vector3(e,t,i))
  56215. }
  56216. function c(e, t, i) {
  56217. e += R,
  56218. t += R,
  56219. i += R,
  56220. M.faces.push(new n.Face3(e,t,i,null,null,0));
  56221. var r = _.generateTopUV(M, e, t, i);
  56222. M.faceVertexUvs[0].push(r)
  56223. }
  56224. function h(e, t, i, r, o, a, s, l, c) {
  56225. e += R,
  56226. t += R,
  56227. i += R,
  56228. r += R,
  56229. M.faces.push(new n.Face3(e,t,r,null,null,1)),
  56230. M.faces.push(new n.Face3(t,i,r,null,null,1));
  56231. var h = _.generateSideWallUV(M, e, t, i, r);
  56232. M.faceVertexUvs[0].push([h[0], h[1], h[3]]),
  56233. M.faceVertexUvs[0].push([h[1], h[2], h[3]])
  56234. }
  56235. 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;
  56236. b && (u = b.getSpacedPoints(E),
  56237. w = !0,
  56238. C = !1,
  56239. d = void 0 !== t.frames ? t.frames : new n.TubeGeometry.FrenetFrames(b,E,!1),
  56240. p = new n.Vector3,
  56241. f = new n.Vector3,
  56242. g = new n.Vector3),
  56243. C || (y = 0,
  56244. v = 0,
  56245. A = 0);
  56246. 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);
  56247. if (D) {
  56248. for (O = O.reverse(),
  56249. x = 0,
  56250. S = L.length; x < S; x++)
  56251. T = L[x],
  56252. n.ShapeUtils.isClockWise(T) && (L[x] = T.reverse());
  56253. D = !1
  56254. }
  56255. var N = n.ShapeUtils.triangulateShape(O, L)
  56256. , B = O;
  56257. for (x = 0,
  56258. S = L.length; x < S; x++)
  56259. T = L[x],
  56260. O = O.concat(T);
  56261. 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++,
  56262. Z++,
  56263. q++)
  56264. Z === X && (Z = 0),
  56265. q === X && (q = 0),
  56266. j[Y] = r(B[Y], B[Z], B[q]);
  56267. var K, Q = [], J = j.concat();
  56268. for (x = 0,
  56269. S = L.length; x < S; x++) {
  56270. for (T = L[x],
  56271. K = [],
  56272. Y = 0,
  56273. X = T.length,
  56274. Z = X - 1,
  56275. q = Y + 1; Y < X; Y++,
  56276. Z++,
  56277. q++)
  56278. Z === X && (Z = 0),
  56279. q === X && (q = 0),
  56280. K[Y] = r(T[Y], T[Z], T[q]);
  56281. Q.push(K),
  56282. J = J.concat(K)
  56283. }
  56284. for (F = 0; F < y; F++) {
  56285. for (U = F / y,
  56286. k = v * (1 - U),
  56287. V = A * Math.sin(U * Math.PI / 2),
  56288. Y = 0,
  56289. X = B.length; Y < X; Y++)
  56290. H = i(B[Y], j[Y], V),
  56291. l(H.x, H.y, -k);
  56292. for (x = 0,
  56293. S = L.length; x < S; x++)
  56294. for (T = L[x],
  56295. K = Q[x],
  56296. Y = 0,
  56297. X = T.length; Y < X; Y++)
  56298. H = i(T[Y], K[Y], V),
  56299. l(H.x, H.y, -k)
  56300. }
  56301. for (V = A,
  56302. Y = 0; Y < z; Y++)
  56303. H = C ? i(O[Y], J[Y], V) : O[Y],
  56304. w ? (f.copy(d.normals[0]).multiplyScalar(H.x),
  56305. p.copy(d.binormals[0]).multiplyScalar(H.y),
  56306. g.copy(u[0]).add(f).add(p),
  56307. l(g.x, g.y, g.z)) : l(H.x, H.y, 0);
  56308. var $;
  56309. for ($ = 1; $ <= E; $++)
  56310. for (Y = 0; Y < z; Y++)
  56311. H = C ? i(O[Y], J[Y], V) : O[Y],
  56312. w ? (f.copy(d.normals[$]).multiplyScalar(H.x),
  56313. p.copy(d.binormals[$]).multiplyScalar(H.y),
  56314. g.copy(u[$]).add(f).add(p),
  56315. l(g.x, g.y, g.z)) : l(H.x, H.y, m / E * $);
  56316. for (F = y - 1; F >= 0; F--) {
  56317. for (U = F / y,
  56318. k = v * (1 - U),
  56319. V = A * Math.sin(U * Math.PI / 2),
  56320. Y = 0,
  56321. X = B.length; Y < X; Y++)
  56322. H = i(B[Y], j[Y], V),
  56323. l(H.x, H.y, m + k);
  56324. for (x = 0,
  56325. S = L.length; x < S; x++)
  56326. for (T = L[x],
  56327. K = Q[x],
  56328. Y = 0,
  56329. X = T.length; Y < X; Y++)
  56330. H = i(T[Y], K[Y], V),
  56331. w ? l(H.x, H.y + u[E - 1].y, u[E - 1].x + k) : l(H.x, H.y, m + k)
  56332. }
  56333. o(),
  56334. a()
  56335. }
  56336. ,
  56337. n.ExtrudeGeometry.WorldUVGenerator = {
  56338. generateTopUV: function(e, t, i, r) {
  56339. var o = e.vertices
  56340. , a = o[t]
  56341. , s = o[i]
  56342. , l = o[r];
  56343. return [new n.Vector2(a.x,a.y), new n.Vector2(s.x,s.y), new n.Vector2(l.x,l.y)]
  56344. },
  56345. generateSideWallUV: function(e, t, i, r, o) {
  56346. var a = e.vertices
  56347. , s = a[t]
  56348. , l = a[i]
  56349. , c = a[r]
  56350. , h = a[o];
  56351. 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)]
  56352. }
  56353. },
  56354. n.ShapeGeometry = function(e, t) {
  56355. n.Geometry.call(this),
  56356. this.type = "ShapeGeometry",
  56357. Array.isArray(e) === !1 && (e = [e]),
  56358. this.addShapeList(e, t),
  56359. this.computeFaceNormals()
  56360. }
  56361. ,
  56362. n.ShapeGeometry.prototype = Object.create(n.Geometry.prototype),
  56363. n.ShapeGeometry.prototype.constructor = n.ShapeGeometry,
  56364. n.ShapeGeometry.prototype.addShapeList = function(e, t) {
  56365. for (var i = 0, n = e.length; i < n; i++)
  56366. this.addShape(e[i], t);
  56367. return this
  56368. }
  56369. ,
  56370. n.ShapeGeometry.prototype.addShape = function(e, t) {
  56371. void 0 === t && (t = {});
  56372. 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);
  56373. if (p) {
  56374. for (u = u.reverse(),
  56375. i = 0,
  56376. r = d.length; i < r; i++)
  56377. o = d[i],
  56378. n.ShapeUtils.isClockWise(o) && (d[i] = o.reverse());
  56379. p = !1
  56380. }
  56381. var f = n.ShapeUtils.triangulateShape(u, d);
  56382. for (i = 0,
  56383. r = d.length; i < r; i++)
  56384. o = d[i],
  56385. u = u.concat(o);
  56386. var g, m, v = u.length, A = f.length;
  56387. for (i = 0; i < v; i++)
  56388. g = u[i],
  56389. this.vertices.push(new n.Vector3(g.x,g.y,0));
  56390. for (i = 0; i < A; i++) {
  56391. m = f[i];
  56392. var y = m[0] + c
  56393. , C = m[1] + c
  56394. , I = m[2] + c;
  56395. this.faces.push(new n.Face3(y,C,I,null,null,s)),
  56396. this.faceVertexUvs[0].push(l.generateTopUV(this, y, C, I))
  56397. }
  56398. }
  56399. ,
  56400. n.LatheBufferGeometry = function(e, t, i, r) {
  56401. n.BufferGeometry.call(this),
  56402. this.type = "LatheBufferGeometry",
  56403. this.parameters = {
  56404. points: e,
  56405. segments: t,
  56406. phiStart: i,
  56407. phiLength: r
  56408. },
  56409. t = Math.floor(t) || 12,
  56410. i = i || 0,
  56411. r = r || 2 * Math.PI,
  56412. r = n.Math.clamp(r, 0, 2 * Math.PI);
  56413. 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),
  56414. 1 / t), m = new n.Vector3, v = new n.Vector2;
  56415. for (a = 0; a <= t; a++) {
  56416. var A = i + a * g * r
  56417. , y = Math.sin(A)
  56418. , C = Math.cos(A);
  56419. for (s = 0; s <= e.length - 1; s++)
  56420. m.x = e[s].x * y,
  56421. m.y = e[s].y,
  56422. m.z = e[s].x * C,
  56423. u.setXYZ(p, m.x, m.y, m.z),
  56424. v.x = a / t,
  56425. v.y = s / (e.length - 1),
  56426. d.setXY(p, v.x, v.y),
  56427. p++
  56428. }
  56429. for (a = 0; a < t; a++)
  56430. for (s = 0; s < e.length - 1; s++) {
  56431. o = s + a * e.length;
  56432. var I = o
  56433. , E = o + e.length
  56434. , b = o + e.length + 1
  56435. , w = o + 1;
  56436. h.setX(f, I),
  56437. f++,
  56438. h.setX(f, E),
  56439. f++,
  56440. h.setX(f, w),
  56441. f++,
  56442. h.setX(f, E),
  56443. f++,
  56444. h.setX(f, b),
  56445. f++,
  56446. h.setX(f, w),
  56447. f++
  56448. }
  56449. if (this.setIndex(h),
  56450. this.addAttribute("position", u),
  56451. this.addAttribute("uv", d),
  56452. this.computeVertexNormals(),
  56453. r === 2 * Math.PI) {
  56454. var _ = this.attributes.normal.array
  56455. , T = new n.Vector3
  56456. , x = new n.Vector3
  56457. , S = new n.Vector3;
  56458. for (o = t * e.length * 3,
  56459. a = 0,
  56460. s = 0; a < e.length; a++,
  56461. s += 3)
  56462. T.x = _[s + 0],
  56463. T.y = _[s + 1],
  56464. T.z = _[s + 2],
  56465. x.x = _[o + s + 0],
  56466. x.y = _[o + s + 1],
  56467. x.z = _[o + s + 2],
  56468. S.addVectors(T, x).normalize(),
  56469. _[s + 0] = _[o + s + 0] = S.x,
  56470. _[s + 1] = _[o + s + 1] = S.y,
  56471. _[s + 2] = _[o + s + 2] = S.z
  56472. }
  56473. }
  56474. ,
  56475. n.LatheBufferGeometry.prototype = Object.create(n.BufferGeometry.prototype),
  56476. n.LatheBufferGeometry.prototype.constructor = n.LatheBufferGeometry,
  56477. n.LatheGeometry = function(e, t, i, r) {
  56478. n.Geometry.call(this),
  56479. this.type = "LatheGeometry",
  56480. this.parameters = {
  56481. points: e,
  56482. segments: t,
  56483. phiStart: i,
  56484. phiLength: r
  56485. },
  56486. this.fromBufferGeometry(new n.LatheBufferGeometry(e,t,i,r)),
  56487. this.mergeVertices()
  56488. }
  56489. ,
  56490. n.LatheGeometry.prototype = Object.create(n.Geometry.prototype),
  56491. n.LatheGeometry.prototype.constructor = n.LatheGeometry,
  56492. n.PlaneGeometry = function(e, t, i, r) {
  56493. n.Geometry.call(this),
  56494. this.type = "PlaneGeometry",
  56495. this.parameters = {
  56496. width: e,
  56497. height: t,
  56498. widthSegments: i,
  56499. heightSegments: r
  56500. },
  56501. this.fromBufferGeometry(new n.PlaneBufferGeometry(e,t,i,r))
  56502. }
  56503. ,
  56504. n.PlaneGeometry.prototype = Object.create(n.Geometry.prototype),
  56505. n.PlaneGeometry.prototype.constructor = n.PlaneGeometry,
  56506. n.PlaneBufferGeometry = function(e, t, i, r) {
  56507. n.BufferGeometry.call(this),
  56508. this.type = "PlaneBufferGeometry",
  56509. this.parameters = {
  56510. width: e,
  56511. height: t,
  56512. widthSegments: i,
  56513. heightSegments: r
  56514. };
  56515. 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++)
  56516. for (var y = A * d - a, C = 0; C < c; C++) {
  56517. var I = C * u - o;
  56518. p[m] = I,
  56519. p[m + 1] = -y,
  56520. f[m + 2] = 1,
  56521. g[v] = C / s,
  56522. g[v + 1] = 1 - A / l,
  56523. m += 3,
  56524. v += 2
  56525. }
  56526. m = 0;
  56527. for (var E = new (p.length / 3 > 65535 ? Uint32Array : Uint16Array)(s * l * 6), A = 0; A < l; A++)
  56528. for (var C = 0; C < s; C++) {
  56529. var b = C + c * A
  56530. , w = C + c * (A + 1)
  56531. , _ = C + 1 + c * (A + 1)
  56532. , T = C + 1 + c * A;
  56533. E[m] = b,
  56534. E[m + 1] = w,
  56535. E[m + 2] = T,
  56536. E[m + 3] = w,
  56537. E[m + 4] = _,
  56538. E[m + 5] = T,
  56539. m += 6
  56540. }
  56541. this.setIndex(new n.BufferAttribute(E,1)),
  56542. this.addAttribute("position", new n.BufferAttribute(p,3)),
  56543. this.addAttribute("normal", new n.BufferAttribute(f,3)),
  56544. this.addAttribute("uv", new n.BufferAttribute(g,2))
  56545. }
  56546. ,
  56547. n.PlaneBufferGeometry.prototype = Object.create(n.BufferGeometry.prototype),
  56548. n.PlaneBufferGeometry.prototype.constructor = n.PlaneBufferGeometry,
  56549. n.RingBufferGeometry = function(e, t, i, r, o, a) {
  56550. n.BufferGeometry.call(this),
  56551. this.type = "RingBufferGeometry",
  56552. this.parameters = {
  56553. innerRadius: e,
  56554. outerRadius: t,
  56555. thetaSegments: i,
  56556. phiSegments: r,
  56557. thetaStart: o,
  56558. thetaLength: a
  56559. },
  56560. e = e || 20,
  56561. t = t || 50,
  56562. o = void 0 !== o ? o : 0,
  56563. a = void 0 !== a ? a : 2 * Math.PI,
  56564. i = void 0 !== i ? Math.max(3, i) : 8,
  56565. r = void 0 !== r ? Math.max(1, r) : 1;
  56566. 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;
  56567. for (l = 0; l <= r; l++) {
  56568. for (c = 0; c <= i; c++)
  56569. s = o + c / i * a,
  56570. C.x = A * Math.cos(s),
  56571. C.y = A * Math.sin(s),
  56572. p.setXYZ(m, C.x, C.y, C.z),
  56573. f.setXYZ(m, 0, 0, 1),
  56574. I.x = (C.x / t + 1) / 2,
  56575. I.y = (C.y / t + 1) / 2,
  56576. g.setXY(m, I.x, I.y),
  56577. m++;
  56578. A += y
  56579. }
  56580. for (l = 0; l < r; l++) {
  56581. var E = l * (i + 1);
  56582. for (c = 0; c < i; c++) {
  56583. s = c + E;
  56584. var b = s
  56585. , w = s + i + 1
  56586. , _ = s + i + 2
  56587. , T = s + 1;
  56588. d.setX(v, b),
  56589. v++,
  56590. d.setX(v, w),
  56591. v++,
  56592. d.setX(v, _),
  56593. v++,
  56594. d.setX(v, b),
  56595. v++,
  56596. d.setX(v, _),
  56597. v++,
  56598. d.setX(v, T),
  56599. v++
  56600. }
  56601. }
  56602. this.setIndex(d),
  56603. this.addAttribute("position", p),
  56604. this.addAttribute("normal", f),
  56605. this.addAttribute("uv", g)
  56606. }
  56607. ,
  56608. n.RingBufferGeometry.prototype = Object.create(n.BufferGeometry.prototype),
  56609. n.RingBufferGeometry.prototype.constructor = n.RingBufferGeometry,
  56610. n.RingGeometry = function(e, t, i, r, o, a) {
  56611. n.Geometry.call(this),
  56612. this.type = "RingGeometry",
  56613. this.parameters = {
  56614. innerRadius: e,
  56615. outerRadius: t,
  56616. thetaSegments: i,
  56617. phiSegments: r,
  56618. thetaStart: o,
  56619. thetaLength: a
  56620. },
  56621. this.fromBufferGeometry(new n.RingBufferGeometry(e,t,i,r,o,a))
  56622. }
  56623. ,
  56624. n.RingGeometry.prototype = Object.create(n.Geometry.prototype),
  56625. n.RingGeometry.prototype.constructor = n.RingGeometry,
  56626. n.SphereGeometry = function(e, t, i, r, o, a, s) {
  56627. n.Geometry.call(this),
  56628. this.type = "SphereGeometry",
  56629. this.parameters = {
  56630. radius: e,
  56631. widthSegments: t,
  56632. heightSegments: i,
  56633. phiStart: r,
  56634. phiLength: o,
  56635. thetaStart: a,
  56636. thetaLength: s
  56637. },
  56638. this.fromBufferGeometry(new n.SphereBufferGeometry(e,t,i,r,o,a,s))
  56639. }
  56640. ,
  56641. n.SphereGeometry.prototype = Object.create(n.Geometry.prototype),
  56642. n.SphereGeometry.prototype.constructor = n.SphereGeometry,
  56643. n.SphereBufferGeometry = function(e, t, i, r, o, a, s) {
  56644. n.BufferGeometry.call(this),
  56645. this.type = "SphereBufferGeometry",
  56646. this.parameters = {
  56647. radius: e,
  56648. widthSegments: t,
  56649. heightSegments: i,
  56650. phiStart: r,
  56651. phiLength: o,
  56652. thetaStart: a,
  56653. thetaLength: s
  56654. },
  56655. e = e || 50,
  56656. t = Math.max(3, Math.floor(t) || 8),
  56657. i = Math.max(2, Math.floor(i) || 6),
  56658. r = void 0 !== r ? r : 0,
  56659. o = void 0 !== o ? o : 2 * Math.PI,
  56660. a = void 0 !== a ? a : 0,
  56661. s = void 0 !== s ? s : Math.PI;
  56662. 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++) {
  56663. for (var v = [], A = m / i, y = 0; y <= t; y++) {
  56664. var C = y / t
  56665. , I = -e * Math.cos(r + C * o) * Math.sin(a + A * s)
  56666. , E = e * Math.cos(a + A * s)
  56667. , b = e * Math.sin(r + C * o) * Math.sin(a + A * s);
  56668. g.set(I, E, b).normalize(),
  56669. h.setXYZ(p, I, E, b),
  56670. u.setXYZ(p, g.x, g.y, g.z),
  56671. d.setXY(p, C, 1 - A),
  56672. v.push(p),
  56673. p++
  56674. }
  56675. f.push(v)
  56676. }
  56677. for (var w = [], m = 0; m < i; m++)
  56678. for (var y = 0; y < t; y++) {
  56679. var _ = f[m][y + 1]
  56680. , T = f[m][y]
  56681. , x = f[m + 1][y]
  56682. , S = f[m + 1][y + 1];
  56683. (0 !== m || a > 0) && w.push(_, T, S),
  56684. (m !== i - 1 || l < Math.PI) && w.push(T, x, S)
  56685. }
  56686. this.setIndex(new (h.count > 65535 ? n.Uint32Attribute : n.Uint16Attribute)(w,1)),
  56687. this.addAttribute("position", h),
  56688. this.addAttribute("normal", u),
  56689. this.addAttribute("uv", d),
  56690. this.boundingSphere = new n.Sphere(new n.Vector3,e)
  56691. }
  56692. ,
  56693. n.SphereBufferGeometry.prototype = Object.create(n.BufferGeometry.prototype),
  56694. n.SphereBufferGeometry.prototype.constructor = n.SphereBufferGeometry,
  56695. n.TextGeometry = function(e, t) {
  56696. t = t || {};
  56697. var i = t.font;
  56698. if (i instanceof n.Font == !1)
  56699. return console.error("THREE.TextGeometry: font parameter is not an instance of THREE.Font."),
  56700. new n.Geometry;
  56701. var r = i.generateShapes(e, t.size, t.curveSegments);
  56702. t.amount = void 0 !== t.height ? t.height : 50,
  56703. void 0 === t.bevelThickness && (t.bevelThickness = 10),
  56704. void 0 === t.bevelSize && (t.bevelSize = 8),
  56705. void 0 === t.bevelEnabled && (t.bevelEnabled = !1),
  56706. n.ExtrudeGeometry.call(this, r, t),
  56707. this.type = "TextGeometry"
  56708. }
  56709. ,
  56710. n.TextGeometry.prototype = Object.create(n.ExtrudeGeometry.prototype),
  56711. n.TextGeometry.prototype.constructor = n.TextGeometry,
  56712. n.TorusBufferGeometry = function(e, t, i, r, o) {
  56713. n.BufferGeometry.call(this),
  56714. this.type = "TorusBufferGeometry",
  56715. this.parameters = {
  56716. radius: e,
  56717. tube: t,
  56718. radialSegments: i,
  56719. tubularSegments: r,
  56720. arc: o
  56721. },
  56722. e = e || 100,
  56723. t = t || 40,
  56724. i = Math.floor(i) || 8,
  56725. r = Math.floor(r) || 6,
  56726. o = o || 2 * Math.PI;
  56727. 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;
  56728. for (a = 0; a <= i; a++)
  56729. for (s = 0; s <= r; s++) {
  56730. var C = s / r * o
  56731. , I = a / i * Math.PI * 2;
  56732. A.x = (e + t * Math.cos(I)) * Math.cos(C),
  56733. A.y = (e + t * Math.cos(I)) * Math.sin(C),
  56734. A.z = t * Math.sin(I),
  56735. u[f] = A.x,
  56736. u[f + 1] = A.y,
  56737. u[f + 2] = A.z,
  56738. v.x = e * Math.cos(C),
  56739. v.y = e * Math.sin(C),
  56740. y.subVectors(A, v).normalize(),
  56741. d[f] = y.x,
  56742. d[f + 1] = y.y,
  56743. d[f + 2] = y.z,
  56744. p[g] = s / r,
  56745. p[g + 1] = a / i,
  56746. f += 3,
  56747. g += 2
  56748. }
  56749. for (a = 1; a <= i; a++)
  56750. for (s = 1; s <= r; s++) {
  56751. var E = (r + 1) * a + s - 1
  56752. , b = (r + 1) * (a - 1) + s - 1
  56753. , w = (r + 1) * (a - 1) + s
  56754. , _ = (r + 1) * a + s;
  56755. h[m] = E,
  56756. h[m + 1] = b,
  56757. h[m + 2] = _,
  56758. h[m + 3] = b,
  56759. h[m + 4] = w,
  56760. h[m + 5] = _,
  56761. m += 6
  56762. }
  56763. this.setIndex(new n.BufferAttribute(h,1)),
  56764. this.addAttribute("position", new n.BufferAttribute(u,3)),
  56765. this.addAttribute("normal", new n.BufferAttribute(d,3)),
  56766. this.addAttribute("uv", new n.BufferAttribute(p,2))
  56767. }
  56768. ,
  56769. n.TorusBufferGeometry.prototype = Object.create(n.BufferGeometry.prototype),
  56770. n.TorusBufferGeometry.prototype.constructor = n.TorusBufferGeometry,
  56771. n.TorusGeometry = function(e, t, i, r, o) {
  56772. n.Geometry.call(this),
  56773. this.type = "TorusGeometry",
  56774. this.parameters = {
  56775. radius: e,
  56776. tube: t,
  56777. radialSegments: i,
  56778. tubularSegments: r,
  56779. arc: o
  56780. },
  56781. this.fromBufferGeometry(new n.TorusBufferGeometry(e,t,i,r,o))
  56782. }
  56783. ,
  56784. n.TorusGeometry.prototype = Object.create(n.Geometry.prototype),
  56785. n.TorusGeometry.prototype.constructor = n.TorusGeometry,
  56786. n.TorusKnotBufferGeometry = function(e, t, i, r, o, a) {
  56787. function s(e, t, i, n, r) {
  56788. var o = Math.cos(e)
  56789. , a = Math.sin(e)
  56790. , s = i / t * e
  56791. , l = Math.cos(s);
  56792. r.x = n * (2 + l) * .5 * o,
  56793. r.y = n * (2 + l) * a * .5,
  56794. r.z = n * Math.sin(s) * .5
  56795. }
  56796. n.BufferGeometry.call(this),
  56797. this.type = "TorusKnotBufferGeometry",
  56798. this.parameters = {
  56799. radius: e,
  56800. tube: t,
  56801. tubularSegments: i,
  56802. radialSegments: r,
  56803. p: o,
  56804. q: a
  56805. },
  56806. e = e || 100,
  56807. t = t || 40,
  56808. i = Math.floor(i) || 64,
  56809. r = Math.floor(r) || 8,
  56810. o = o || 2,
  56811. a = a || 3;
  56812. 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;
  56813. for (l = 0; l <= i; ++l) {
  56814. var T = l / i * o * Math.PI * 2;
  56815. for (s(T, o, a, e, I),
  56816. s(T + .01, o, a, e, E),
  56817. w.subVectors(E, I),
  56818. _.addVectors(E, I),
  56819. b.crossVectors(w, _),
  56820. _.crossVectors(b, w),
  56821. b.normalize(),
  56822. _.normalize(),
  56823. c = 0; c <= r; ++c) {
  56824. var x = c / r * Math.PI * 2
  56825. , S = -t * Math.cos(x)
  56826. , M = t * Math.sin(x);
  56827. A.x = I.x + (S * _.x + M * b.x),
  56828. A.y = I.y + (S * _.y + M * b.y),
  56829. A.z = I.z + (S * _.z + M * b.z),
  56830. p.setXYZ(m, A.x, A.y, A.z),
  56831. y.subVectors(A, I).normalize(),
  56832. f.setXYZ(m, y.x, y.y, y.z),
  56833. C.x = l / i,
  56834. C.y = c / r,
  56835. g.setXY(m, C.x, C.y),
  56836. m++
  56837. }
  56838. }
  56839. for (c = 1; c <= i; c++)
  56840. for (l = 1; l <= r; l++) {
  56841. var R = (r + 1) * (c - 1) + (l - 1)
  56842. , P = (r + 1) * c + (l - 1)
  56843. , O = (r + 1) * c + l
  56844. , L = (r + 1) * (c - 1) + l;
  56845. d.setX(v, R),
  56846. v++,
  56847. d.setX(v, P),
  56848. v++,
  56849. d.setX(v, L),
  56850. v++,
  56851. d.setX(v, P),
  56852. v++,
  56853. d.setX(v, O),
  56854. v++,
  56855. d.setX(v, L),
  56856. v++
  56857. }
  56858. this.setIndex(d),
  56859. this.addAttribute("position", p),
  56860. this.addAttribute("normal", f),
  56861. this.addAttribute("uv", g)
  56862. }
  56863. ,
  56864. n.TorusKnotBufferGeometry.prototype = Object.create(n.BufferGeometry.prototype),
  56865. n.TorusKnotBufferGeometry.prototype.constructor = n.TorusKnotBufferGeometry,
  56866. n.TorusKnotGeometry = function(e, t, i, r, o, a, s) {
  56867. n.Geometry.call(this),
  56868. this.type = "TorusKnotGeometry",
  56869. this.parameters = {
  56870. radius: e,
  56871. tube: t,
  56872. tubularSegments: i,
  56873. radialSegments: r,
  56874. p: o,
  56875. q: a
  56876. },
  56877. void 0 !== s && console.warn("THREE.TorusKnotGeometry: heightScale has been deprecated. Use .scale( x, y, z ) instead."),
  56878. this.fromBufferGeometry(new n.TorusKnotBufferGeometry(e,t,i,r,o,a)),
  56879. this.mergeVertices()
  56880. }
  56881. ,
  56882. n.TorusKnotGeometry.prototype = Object.create(n.Geometry.prototype),
  56883. n.TorusKnotGeometry.prototype.constructor = n.TorusKnotGeometry,
  56884. n.TubeGeometry = function(e, t, i, r, o, a) {
  56885. function s(e, t, i) {
  56886. return R.vertices.push(new n.Vector3(e,t,i)) - 1
  56887. }
  56888. n.Geometry.call(this),
  56889. this.type = "TubeGeometry",
  56890. this.parameters = {
  56891. path: e,
  56892. segments: t,
  56893. radius: i,
  56894. radialSegments: r,
  56895. closed: o,
  56896. taper: a
  56897. },
  56898. t = t || 64,
  56899. i = i || 1,
  56900. r = r || 8,
  56901. o = o || !1,
  56902. a = a || n.TubeGeometry.NoTaper;
  56903. 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;
  56904. for (this.tangents = D,
  56905. this.normals = N,
  56906. this.binormals = B,
  56907. v = 0; v < P; v++)
  56908. for (M[v] = [],
  56909. u = v / (P - 1),
  56910. m = e.getPointAt(u),
  56911. l = D[v],
  56912. c = N[v],
  56913. h = B[v],
  56914. p = i * a(u),
  56915. A = 0; A < r; A++)
  56916. d = A / r * 2 * Math.PI,
  56917. f = -p * Math.cos(d),
  56918. g = p * Math.sin(d),
  56919. O.copy(m),
  56920. O.x += f * c.x + g * h.x,
  56921. O.y += f * c.y + g * h.y,
  56922. O.z += f * c.z + g * h.z,
  56923. M[v][A] = s(O.x, O.y, O.z);
  56924. for (v = 0; v < t; v++)
  56925. for (A = 0; A < r; A++)
  56926. y = o ? (v + 1) % t : v + 1,
  56927. C = (A + 1) % r,
  56928. I = M[v][A],
  56929. E = M[y][A],
  56930. b = M[y][C],
  56931. w = M[v][C],
  56932. _ = new n.Vector2(v / t,A / r),
  56933. T = new n.Vector2((v + 1) / t,A / r),
  56934. x = new n.Vector2((v + 1) / t,(A + 1) / r),
  56935. S = new n.Vector2(v / t,(A + 1) / r),
  56936. this.faces.push(new n.Face3(I,E,w)),
  56937. this.faceVertexUvs[0].push([_, T, S]),
  56938. this.faces.push(new n.Face3(E,b,w)),
  56939. this.faceVertexUvs[0].push([T.clone(), x, S.clone()]);
  56940. this.computeFaceNormals(),
  56941. this.computeVertexNormals()
  56942. }
  56943. ,
  56944. n.TubeGeometry.prototype = Object.create(n.Geometry.prototype),
  56945. n.TubeGeometry.prototype.constructor = n.TubeGeometry,
  56946. n.TubeGeometry.NoTaper = function(e) {
  56947. return 1
  56948. }
  56949. ,
  56950. n.TubeGeometry.SinusoidalTaper = function(e) {
  56951. return Math.sin(Math.PI * e)
  56952. }
  56953. ,
  56954. n.TubeGeometry.FrenetFrames = function(e, t, i) {
  56955. function r() {
  56956. f[0] = new n.Vector3,
  56957. g[0] = new n.Vector3,
  56958. a = Number.MAX_VALUE,
  56959. s = Math.abs(p[0].x),
  56960. l = Math.abs(p[0].y),
  56961. c = Math.abs(p[0].z),
  56962. s <= a && (a = s,
  56963. d.set(1, 0, 0)),
  56964. l <= a && (a = l,
  56965. d.set(0, 1, 0)),
  56966. c <= a && d.set(0, 0, 1),
  56967. m.crossVectors(p[0], d).normalize(),
  56968. f[0].crossVectors(p[0], m),
  56969. g[0].crossVectors(p[0], f[0])
  56970. }
  56971. 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;
  56972. for (this.tangents = p,
  56973. this.normals = f,
  56974. this.binormals = g,
  56975. h = 0; h < A; h++)
  56976. u = h / (A - 1),
  56977. p[h] = e.getTangentAt(u),
  56978. p[h].normalize();
  56979. for (r(),
  56980. h = 1; h < A; h++)
  56981. f[h] = f[h - 1].clone(),
  56982. g[h] = g[h - 1].clone(),
  56983. m.crossVectors(p[h - 1], p[h]),
  56984. m.length() > Number.EPSILON && (m.normalize(),
  56985. o = Math.acos(n.Math.clamp(p[h - 1].dot(p[h]), -1, 1)),
  56986. f[h].applyMatrix4(v.makeRotationAxis(m, o))),
  56987. g[h].crossVectors(p[h], f[h]);
  56988. if (i)
  56989. for (o = Math.acos(n.Math.clamp(f[0].dot(f[A - 1]), -1, 1)),
  56990. o /= A - 1,
  56991. p[0].dot(m.crossVectors(f[0], f[A - 1])) > 0 && (o = -o),
  56992. h = 1; h < A; h++)
  56993. f[h].applyMatrix4(v.makeRotationAxis(p[h], o * h)),
  56994. g[h].crossVectors(p[h], f[h])
  56995. }
  56996. ,
  56997. n.PolyhedronGeometry = function(e, t, i, r) {
  56998. function o(e) {
  56999. var t = e.normalize().clone();
  57000. t.index = u.vertices.push(t) - 1;
  57001. var i = l(e) / 2 / Math.PI + .5
  57002. , r = c(e) / Math.PI + .5;
  57003. return t.uv = new n.Vector2(i,1 - r),
  57004. t
  57005. }
  57006. function a(e, t, i, r) {
  57007. var o = new n.Face3(e.index,t.index,i.index,[e.clone(), t.clone(), i.clone()],void 0,r);
  57008. u.faces.push(o),
  57009. C.copy(e).add(t).add(i).divideScalar(3);
  57010. var a = l(C);
  57011. u.faceVertexUvs[0].push([h(e.uv, e, a), h(t.uv, t, a), h(i.uv, i, a)])
  57012. }
  57013. function s(e, t) {
  57014. 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++) {
  57015. l[h] = [];
  57016. 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++)
  57017. 0 === g && h === i ? l[h][g] = d : l[h][g] = o(d.clone().lerp(p, g / f))
  57018. }
  57019. for (var h = 0; h < i; h++)
  57020. for (var g = 0; g < 2 * (i - h) - 1; g++) {
  57021. var m = Math.floor(g / 2);
  57022. 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)
  57023. }
  57024. }
  57025. function l(e) {
  57026. return Math.atan2(e.z, -e.x)
  57027. }
  57028. function c(e) {
  57029. return Math.atan2(-e.y, Math.sqrt(e.x * e.x + e.z * e.z))
  57030. }
  57031. function h(e, t, i) {
  57032. return i < 0 && 1 === e.x && (e = new n.Vector2(e.x - 1,e.y)),
  57033. 0 === t.x && 0 === t.z && (e = new n.Vector2(i / 2 / Math.PI + .5,e.y)),
  57034. e.clone()
  57035. }
  57036. n.Geometry.call(this),
  57037. this.type = "PolyhedronGeometry",
  57038. this.parameters = {
  57039. vertices: e,
  57040. indices: t,
  57041. radius: i,
  57042. detail: r
  57043. },
  57044. i = i || 1,
  57045. r = r || 0;
  57046. for (var u = this, d = 0, p = e.length; d < p; d += 3)
  57047. o(new n.Vector3(e[d],e[d + 1],e[d + 2]));
  57048. for (var f = this.vertices, g = [], d = 0, m = 0, p = t.length; d < p; d += 3,
  57049. m++) {
  57050. var v = f[t[d]]
  57051. , A = f[t[d + 1]]
  57052. , y = f[t[d + 2]];
  57053. g[m] = new n.Face3(v.index,A.index,y.index,[v.clone(), A.clone(), y.clone()],void 0,m)
  57054. }
  57055. for (var C = new n.Vector3, d = 0, p = g.length; d < p; d++)
  57056. s(g[d], r);
  57057. for (var d = 0, p = this.faceVertexUvs[0].length; d < p; d++) {
  57058. var I = this.faceVertexUvs[0][d]
  57059. , E = I[0].x
  57060. , b = I[1].x
  57061. , w = I[2].x
  57062. , _ = Math.max(E, b, w)
  57063. , T = Math.min(E, b, w);
  57064. _ > .9 && T < .1 && (E < .2 && (I[0].x += 1),
  57065. b < .2 && (I[1].x += 1),
  57066. w < .2 && (I[2].x += 1))
  57067. }
  57068. for (var d = 0, p = this.vertices.length; d < p; d++)
  57069. this.vertices[d].multiplyScalar(i);
  57070. this.mergeVertices(),
  57071. this.computeFaceNormals(),
  57072. this.boundingSphere = new n.Sphere(new n.Vector3,i)
  57073. }
  57074. ,
  57075. n.PolyhedronGeometry.prototype = Object.create(n.Geometry.prototype),
  57076. n.PolyhedronGeometry.prototype.constructor = n.PolyhedronGeometry,
  57077. n.DodecahedronGeometry = function(e, t) {
  57078. var i = (1 + Math.sqrt(5)) / 2
  57079. , r = 1 / i
  57080. , 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]
  57081. , 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];
  57082. n.PolyhedronGeometry.call(this, o, a, e, t),
  57083. this.type = "DodecahedronGeometry",
  57084. this.parameters = {
  57085. radius: e,
  57086. detail: t
  57087. }
  57088. }
  57089. ,
  57090. n.DodecahedronGeometry.prototype = Object.create(n.PolyhedronGeometry.prototype),
  57091. n.DodecahedronGeometry.prototype.constructor = n.DodecahedronGeometry,
  57092. n.IcosahedronGeometry = function(e, t) {
  57093. var i = (1 + Math.sqrt(5)) / 2
  57094. , 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]
  57095. , 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];
  57096. n.PolyhedronGeometry.call(this, r, o, e, t),
  57097. this.type = "IcosahedronGeometry",
  57098. this.parameters = {
  57099. radius: e,
  57100. detail: t
  57101. }
  57102. }
  57103. ,
  57104. n.IcosahedronGeometry.prototype = Object.create(n.PolyhedronGeometry.prototype),
  57105. n.IcosahedronGeometry.prototype.constructor = n.IcosahedronGeometry,
  57106. n.OctahedronGeometry = function(e, t) {
  57107. var i = [1, 0, 0, -1, 0, 0, 0, 1, 0, 0, -1, 0, 0, 0, 1, 0, 0, -1]
  57108. , 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];
  57109. n.PolyhedronGeometry.call(this, i, r, e, t),
  57110. this.type = "OctahedronGeometry",
  57111. this.parameters = {
  57112. radius: e,
  57113. detail: t
  57114. }
  57115. }
  57116. ,
  57117. n.OctahedronGeometry.prototype = Object.create(n.PolyhedronGeometry.prototype),
  57118. n.OctahedronGeometry.prototype.constructor = n.OctahedronGeometry,
  57119. n.TetrahedronGeometry = function(e, t) {
  57120. var i = [1, 1, 1, -1, -1, 1, -1, 1, -1, 1, -1, -1]
  57121. , r = [2, 1, 0, 0, 3, 2, 1, 3, 0, 2, 3, 1];
  57122. n.PolyhedronGeometry.call(this, i, r, e, t),
  57123. this.type = "TetrahedronGeometry",
  57124. this.parameters = {
  57125. radius: e,
  57126. detail: t
  57127. }
  57128. }
  57129. ,
  57130. n.TetrahedronGeometry.prototype = Object.create(n.PolyhedronGeometry.prototype),
  57131. n.TetrahedronGeometry.prototype.constructor = n.TetrahedronGeometry,
  57132. n.ParametricGeometry = function(e, t, i) {
  57133. n.Geometry.call(this),
  57134. this.type = "ParametricGeometry",
  57135. this.parameters = {
  57136. func: e,
  57137. slices: t,
  57138. stacks: i
  57139. };
  57140. var r, o, a, s, l, c = this.vertices, h = this.faces, u = this.faceVertexUvs[0], d = t + 1;
  57141. for (r = 0; r <= i; r++)
  57142. for (l = r / i,
  57143. o = 0; o <= t; o++)
  57144. s = o / t,
  57145. a = e(s, l),
  57146. c.push(a);
  57147. var p, f, g, m, v, A, y, C;
  57148. for (r = 0; r < i; r++)
  57149. for (o = 0; o < t; o++)
  57150. p = r * d + o,
  57151. f = r * d + o + 1,
  57152. g = (r + 1) * d + o + 1,
  57153. m = (r + 1) * d + o,
  57154. v = new n.Vector2(o / t,r / i),
  57155. A = new n.Vector2((o + 1) / t,r / i),
  57156. y = new n.Vector2((o + 1) / t,(r + 1) / i),
  57157. C = new n.Vector2(o / t,(r + 1) / i),
  57158. h.push(new n.Face3(p,f,m)),
  57159. u.push([v, A, C]),
  57160. h.push(new n.Face3(f,g,m)),
  57161. u.push([A.clone(), y, C.clone()]);
  57162. this.computeFaceNormals(),
  57163. this.computeVertexNormals()
  57164. }
  57165. ,
  57166. n.ParametricGeometry.prototype = Object.create(n.Geometry.prototype),
  57167. n.ParametricGeometry.prototype.constructor = n.ParametricGeometry,
  57168. n.WireframeGeometry = function(e) {
  57169. function t(e, t) {
  57170. return e - t
  57171. }
  57172. n.BufferGeometry.call(this);
  57173. var i = [0, 0]
  57174. , r = {}
  57175. , o = ["a", "b", "c"];
  57176. if (e instanceof n.Geometry) {
  57177. for (var a = e.vertices, s = e.faces, l = 0, c = new Uint32Array(6 * s.length), h = 0, u = s.length; h < u; h++)
  57178. for (var d = s[h], p = 0; p < 3; p++) {
  57179. i[0] = d[o[p]],
  57180. i[1] = d[o[(p + 1) % 3]],
  57181. i.sort(t);
  57182. var f = i.toString();
  57183. void 0 === r[f] && (c[2 * l] = i[0],
  57184. c[2 * l + 1] = i[1],
  57185. r[f] = !0,
  57186. l++)
  57187. }
  57188. for (var g = new Float32Array(2 * l * 3), h = 0, u = l; h < u; h++)
  57189. for (var p = 0; p < 2; p++) {
  57190. var m = a[c[2 * h + p]]
  57191. , v = 6 * h + 3 * p;
  57192. g[v + 0] = m.x,
  57193. g[v + 1] = m.y,
  57194. g[v + 2] = m.z
  57195. }
  57196. this.addAttribute("position", new n.BufferAttribute(g,3))
  57197. } else if (e instanceof n.BufferGeometry)
  57198. if (null !== e.index) {
  57199. var A = e.index.array
  57200. , a = e.attributes.position
  57201. , y = e.groups
  57202. , l = 0;
  57203. 0 === y.length && e.addGroup(0, A.length);
  57204. for (var c = new Uint32Array(2 * A.length), C = 0, I = y.length; C < I; ++C)
  57205. for (var E = y[C], b = E.start, w = E.count, h = b, _ = b + w; h < _; h += 3)
  57206. for (var p = 0; p < 3; p++) {
  57207. i[0] = A[h + p],
  57208. i[1] = A[h + (p + 1) % 3],
  57209. i.sort(t);
  57210. var f = i.toString();
  57211. void 0 === r[f] && (c[2 * l] = i[0],
  57212. c[2 * l + 1] = i[1],
  57213. r[f] = !0,
  57214. l++)
  57215. }
  57216. for (var g = new Float32Array(2 * l * 3), h = 0, u = l; h < u; h++)
  57217. for (var p = 0; p < 2; p++) {
  57218. var v = 6 * h + 3 * p
  57219. , T = c[2 * h + p];
  57220. g[v + 0] = a.getX(T),
  57221. g[v + 1] = a.getY(T),
  57222. g[v + 2] = a.getZ(T)
  57223. }
  57224. this.addAttribute("position", new n.BufferAttribute(g,3))
  57225. } else {
  57226. 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++)
  57227. for (var p = 0; p < 3; p++) {
  57228. var v = 18 * h + 6 * p
  57229. , S = 9 * h + 3 * p;
  57230. g[v + 0] = a[S],
  57231. g[v + 1] = a[S + 1],
  57232. g[v + 2] = a[S + 2];
  57233. var T = 9 * h + 3 * ((p + 1) % 3);
  57234. g[v + 3] = a[T],
  57235. g[v + 4] = a[T + 1],
  57236. g[v + 5] = a[T + 2]
  57237. }
  57238. this.addAttribute("position", new n.BufferAttribute(g,3))
  57239. }
  57240. }
  57241. ,
  57242. n.WireframeGeometry.prototype = Object.create(n.BufferGeometry.prototype),
  57243. n.WireframeGeometry.prototype.constructor = n.WireframeGeometry,
  57244. n.AxisHelper = function(e) {
  57245. e = e || 1;
  57246. var t = new Float32Array([0, 0, 0, e, 0, 0, 0, 0, 0, 0, e, 0, 0, 0, 0, 0, 0, e])
  57247. , i = new Float32Array([1, 0, 0, 1, .6, 0, 0, 1, 0, .6, 1, 0, 0, 0, 1, 0, .6, 1])
  57248. , r = new n.BufferGeometry;
  57249. r.addAttribute("position", new n.BufferAttribute(t,3)),
  57250. r.addAttribute("color", new n.BufferAttribute(i,3));
  57251. var o = new n.LineBasicMaterial({
  57252. vertexColors: n.VertexColors
  57253. });
  57254. n.LineSegments.call(this, r, o)
  57255. }
  57256. ,
  57257. n.AxisHelper.prototype = Object.create(n.LineSegments.prototype),
  57258. n.AxisHelper.prototype.constructor = n.AxisHelper,
  57259. n.ArrowHelper = function() {
  57260. var e = new n.Geometry;
  57261. e.vertices.push(new n.Vector3(0,0,0), new n.Vector3(0,1,0));
  57262. var t = new n.CylinderGeometry(0,.5,1,5,1);
  57263. return t.translate(0, -.5, 0),
  57264. function(i, r, o, a, s, l) {
  57265. n.Object3D.call(this),
  57266. void 0 === a && (a = 16776960),
  57267. void 0 === o && (o = 1),
  57268. void 0 === s && (s = .2 * o),
  57269. void 0 === l && (l = .2 * s),
  57270. this.position.copy(r),
  57271. this.line = new n.Line(e,new n.LineBasicMaterial({
  57272. color: a
  57273. })),
  57274. this.line.matrixAutoUpdate = !1,
  57275. this.add(this.line),
  57276. this.cone = new n.Mesh(t,new n.MeshBasicMaterial({
  57277. color: a
  57278. })),
  57279. this.cone.matrixAutoUpdate = !1,
  57280. this.add(this.cone),
  57281. this.setDirection(i),
  57282. this.setLength(o, s, l)
  57283. }
  57284. }(),
  57285. n.ArrowHelper.prototype = Object.create(n.Object3D.prototype),
  57286. n.ArrowHelper.prototype.constructor = n.ArrowHelper,
  57287. n.ArrowHelper.prototype.setDirection = function() {
  57288. var e, t = new n.Vector3;
  57289. return function(i) {
  57290. 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(),
  57291. e = Math.acos(i.y),
  57292. this.quaternion.setFromAxisAngle(t, e))
  57293. }
  57294. }(),
  57295. n.ArrowHelper.prototype.setLength = function(e, t, i) {
  57296. void 0 === t && (t = .2 * e),
  57297. void 0 === i && (i = .2 * t),
  57298. this.line.scale.set(1, Math.max(0, e - t), 1),
  57299. this.line.updateMatrix(),
  57300. this.cone.scale.set(i, t, i),
  57301. this.cone.position.y = e,
  57302. this.cone.updateMatrix()
  57303. }
  57304. ,
  57305. n.ArrowHelper.prototype.setColor = function(e) {
  57306. this.line.material.color.set(e),
  57307. this.cone.material.color.set(e)
  57308. }
  57309. ,
  57310. n.BoxHelper = function(e) {
  57311. 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])
  57312. , i = new Float32Array(24)
  57313. , r = new n.BufferGeometry;
  57314. r.setIndex(new n.BufferAttribute(t,1)),
  57315. r.addAttribute("position", new n.BufferAttribute(i,3)),
  57316. n.LineSegments.call(this, r, new n.LineBasicMaterial({
  57317. color: 16776960
  57318. })),
  57319. void 0 !== e && this.update(e)
  57320. }
  57321. ,
  57322. n.BoxHelper.prototype = Object.create(n.LineSegments.prototype),
  57323. n.BoxHelper.prototype.constructor = n.BoxHelper,
  57324. n.BoxHelper.prototype.update = function() {
  57325. var e = new n.Box3;
  57326. return function(t) {
  57327. if (e.setFromObject(t),
  57328. !e.isEmpty()) {
  57329. var i = e.min
  57330. , n = e.max
  57331. , r = this.geometry.attributes.position
  57332. , o = r.array;
  57333. o[0] = n.x,
  57334. o[1] = n.y,
  57335. o[2] = n.z,
  57336. o[3] = i.x,
  57337. o[4] = n.y,
  57338. o[5] = n.z,
  57339. o[6] = i.x,
  57340. o[7] = i.y,
  57341. o[8] = n.z,
  57342. o[9] = n.x,
  57343. o[10] = i.y,
  57344. o[11] = n.z,
  57345. o[12] = n.x,
  57346. o[13] = n.y,
  57347. o[14] = i.z,
  57348. o[15] = i.x,
  57349. o[16] = n.y,
  57350. o[17] = i.z,
  57351. o[18] = i.x,
  57352. o[19] = i.y,
  57353. o[20] = i.z,
  57354. o[21] = n.x,
  57355. o[22] = i.y,
  57356. o[23] = i.z,
  57357. r.needsUpdate = !0,
  57358. this.geometry.computeBoundingSphere()
  57359. }
  57360. }
  57361. }(),
  57362. n.BoundingBoxHelper = function(e, t) {
  57363. var i = void 0 !== t ? t : 8947848;
  57364. this.object = e,
  57365. this.box = new n.Box3,
  57366. n.Mesh.call(this, new n.BoxGeometry(1,1,1), new n.MeshBasicMaterial({
  57367. color: i,
  57368. wireframe: !0
  57369. }))
  57370. }
  57371. ,
  57372. n.BoundingBoxHelper.prototype = Object.create(n.Mesh.prototype),
  57373. n.BoundingBoxHelper.prototype.constructor = n.BoundingBoxHelper,
  57374. n.BoundingBoxHelper.prototype.update = function() {
  57375. this.box.setFromObject(this.object),
  57376. this.box.size(this.scale),
  57377. this.box.center(this.position)
  57378. }
  57379. ,
  57380. n.CameraHelper = function(e) {
  57381. function t(e, t, n) {
  57382. i(e, n),
  57383. i(t, n)
  57384. }
  57385. function i(e, t) {
  57386. r.vertices.push(new n.Vector3),
  57387. r.colors.push(new n.Color(t)),
  57388. void 0 === a[e] && (a[e] = []),
  57389. a[e].push(r.vertices.length - 1)
  57390. }
  57391. var r = new n.Geometry
  57392. , o = new n.LineBasicMaterial({
  57393. color: 16777215,
  57394. vertexColors: n.FaceColors
  57395. })
  57396. , a = {}
  57397. , s = 16755200
  57398. , l = 16711680
  57399. , c = 43775
  57400. , h = 16777215
  57401. , u = 3355443;
  57402. t("n1", "n2", s),
  57403. t("n2", "n4", s),
  57404. t("n4", "n3", s),
  57405. t("n3", "n1", s),
  57406. t("f1", "f2", s),
  57407. t("f2", "f4", s),
  57408. t("f4", "f3", s),
  57409. t("f3", "f1", s),
  57410. t("n1", "f1", s),
  57411. t("n2", "f2", s),
  57412. t("n3", "f3", s),
  57413. t("n4", "f4", s),
  57414. t("p", "n1", l),
  57415. t("p", "n2", l),
  57416. t("p", "n3", l),
  57417. t("p", "n4", l),
  57418. t("u1", "u2", c),
  57419. t("u2", "u3", c),
  57420. t("u3", "u1", c),
  57421. t("c", "t", h),
  57422. t("p", "c", u),
  57423. t("cn1", "cn2", u),
  57424. t("cn3", "cn4", u),
  57425. t("cf1", "cf2", u),
  57426. t("cf3", "cf4", u),
  57427. n.LineSegments.call(this, r, o),
  57428. this.camera = e,
  57429. this.camera.updateProjectionMatrix(),
  57430. this.matrix = e.matrixWorld,
  57431. this.matrixAutoUpdate = !1,
  57432. this.pointMap = a,
  57433. this.update()
  57434. }
  57435. ,
  57436. n.CameraHelper.prototype = Object.create(n.LineSegments.prototype),
  57437. n.CameraHelper.prototype.constructor = n.CameraHelper,
  57438. n.CameraHelper.prototype.update = function() {
  57439. function e(e, n, a, s) {
  57440. r.set(n, a, s).unproject(o);
  57441. var l = i[e];
  57442. if (void 0 !== l)
  57443. for (var c = 0, h = l.length; c < h; c++)
  57444. t.vertices[l[c]].copy(r)
  57445. }
  57446. var t, i, r = new n.Vector3, o = new n.Camera;
  57447. return function() {
  57448. t = this.geometry,
  57449. i = this.pointMap;
  57450. var n = 1
  57451. , r = 1;
  57452. o.projectionMatrix.copy(this.camera.projectionMatrix),
  57453. e("c", 0, 0, -1),
  57454. e("t", 0, 0, 1),
  57455. e("n1", -n, -r, -1),
  57456. e("n2", n, -r, -1),
  57457. e("n3", -n, r, -1),
  57458. e("n4", n, r, -1),
  57459. e("f1", -n, -r, 1),
  57460. e("f2", n, -r, 1),
  57461. e("f3", -n, r, 1),
  57462. e("f4", n, r, 1),
  57463. e("u1", .7 * n, 1.1 * r, -1),
  57464. e("u2", .7 * -n, 1.1 * r, -1),
  57465. e("u3", 0, 2 * r, -1),
  57466. e("cf1", -n, 0, 1),
  57467. e("cf2", n, 0, 1),
  57468. e("cf3", 0, -r, 1),
  57469. e("cf4", 0, r, 1),
  57470. e("cn1", -n, 0, -1),
  57471. e("cn2", n, 0, -1),
  57472. e("cn3", 0, -r, -1),
  57473. e("cn4", 0, r, -1),
  57474. t.verticesNeedUpdate = !0
  57475. }
  57476. }(),
  57477. n.DirectionalLightHelper = function(e, t) {
  57478. n.Object3D.call(this),
  57479. this.light = e,
  57480. this.light.updateMatrixWorld(),
  57481. this.matrix = e.matrixWorld,
  57482. this.matrixAutoUpdate = !1,
  57483. t = t || 1;
  57484. var i = new n.Geometry;
  57485. 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));
  57486. var r = new n.LineBasicMaterial({
  57487. fog: !1
  57488. });
  57489. r.color.copy(this.light.color).multiplyScalar(this.light.intensity),
  57490. this.lightPlane = new n.Line(i,r),
  57491. this.add(this.lightPlane),
  57492. i = new n.Geometry,
  57493. i.vertices.push(new n.Vector3, new n.Vector3),
  57494. r = new n.LineBasicMaterial({
  57495. fog: !1
  57496. }),
  57497. r.color.copy(this.light.color).multiplyScalar(this.light.intensity),
  57498. this.targetLine = new n.Line(i,r),
  57499. this.add(this.targetLine),
  57500. this.update()
  57501. }
  57502. ,
  57503. n.DirectionalLightHelper.prototype = Object.create(n.Object3D.prototype),
  57504. n.DirectionalLightHelper.prototype.constructor = n.DirectionalLightHelper,
  57505. n.DirectionalLightHelper.prototype.dispose = function() {
  57506. this.lightPlane.geometry.dispose(),
  57507. this.lightPlane.material.dispose(),
  57508. this.targetLine.geometry.dispose(),
  57509. this.targetLine.material.dispose()
  57510. }
  57511. ,
  57512. n.DirectionalLightHelper.prototype.update = function() {
  57513. var e = new n.Vector3
  57514. , t = new n.Vector3
  57515. , i = new n.Vector3;
  57516. return function() {
  57517. e.setFromMatrixPosition(this.light.matrixWorld),
  57518. t.setFromMatrixPosition(this.light.target.matrixWorld),
  57519. i.subVectors(t, e),
  57520. this.lightPlane.lookAt(i),
  57521. this.lightPlane.material.color.copy(this.light.color).multiplyScalar(this.light.intensity),
  57522. this.targetLine.geometry.vertices[1].copy(i),
  57523. this.targetLine.geometry.verticesNeedUpdate = !0,
  57524. this.targetLine.material.color.copy(this.lightPlane.material.color)
  57525. }
  57526. }(),
  57527. n.EdgesHelper = function(e, t, i) {
  57528. var r = void 0 !== t ? t : 16777215;
  57529. n.LineSegments.call(this, new n.EdgesGeometry(e.geometry,i), new n.LineBasicMaterial({
  57530. color: r
  57531. })),
  57532. this.matrix = e.matrixWorld,
  57533. this.matrixAutoUpdate = !1
  57534. }
  57535. ,
  57536. n.EdgesHelper.prototype = Object.create(n.LineSegments.prototype),
  57537. n.EdgesHelper.prototype.constructor = n.EdgesHelper,
  57538. n.FaceNormalsHelper = function(e, t, i, r) {
  57539. this.object = e,
  57540. this.size = void 0 !== t ? t : 1;
  57541. var o = void 0 !== i ? i : 16776960
  57542. , a = void 0 !== r ? r : 1
  57543. , s = 0
  57544. , l = this.object.geometry;
  57545. l instanceof n.Geometry ? s = l.faces.length : console.warn("THREE.FaceNormalsHelper: only THREE.Geometry is supported. Use THREE.VertexNormalsHelper, instead.");
  57546. var c = new n.BufferGeometry
  57547. , h = new n.Float32Attribute(2 * s * 3,3);
  57548. c.addAttribute("position", h),
  57549. n.LineSegments.call(this, c, new n.LineBasicMaterial({
  57550. color: o,
  57551. linewidth: a
  57552. })),
  57553. this.matrixAutoUpdate = !1,
  57554. this.update()
  57555. }
  57556. ,
  57557. n.FaceNormalsHelper.prototype = Object.create(n.LineSegments.prototype),
  57558. n.FaceNormalsHelper.prototype.constructor = n.FaceNormalsHelper,
  57559. n.FaceNormalsHelper.prototype.update = function() {
  57560. var e = new n.Vector3
  57561. , t = new n.Vector3
  57562. , i = new n.Matrix3;
  57563. return function() {
  57564. this.object.updateMatrixWorld(!0),
  57565. i.getNormalMatrix(this.object.matrixWorld);
  57566. 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++) {
  57567. var u = s[c]
  57568. , d = u.normal;
  57569. e.copy(a[u.a]).add(a[u.b]).add(a[u.c]).divideScalar(3).applyMatrix4(n),
  57570. t.copy(d).applyMatrix3(i).normalize().multiplyScalar(this.size).add(e),
  57571. r.setXYZ(l, e.x, e.y, e.z),
  57572. l += 1,
  57573. r.setXYZ(l, t.x, t.y, t.z),
  57574. l += 1
  57575. }
  57576. return r.needsUpdate = !0,
  57577. this
  57578. }
  57579. }(),
  57580. n.GridHelper = function(e, t) {
  57581. var i = new n.Geometry
  57582. , r = new n.LineBasicMaterial({
  57583. vertexColors: n.VertexColors
  57584. });
  57585. this.color1 = new n.Color(4473924),
  57586. this.color2 = new n.Color(8947848);
  57587. for (var o = -e; o <= e; o += t) {
  57588. 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));
  57589. var a = 0 === o ? this.color1 : this.color2;
  57590. i.colors.push(a, a, a, a)
  57591. }
  57592. n.LineSegments.call(this, i, r)
  57593. }
  57594. ,
  57595. n.GridHelper.prototype = Object.create(n.LineSegments.prototype),
  57596. n.GridHelper.prototype.constructor = n.GridHelper,
  57597. n.GridHelper.prototype.setColors = function(e, t) {
  57598. this.color1.set(e),
  57599. this.color2.set(t),
  57600. this.geometry.colorsNeedUpdate = !0
  57601. }
  57602. ,
  57603. n.HemisphereLightHelper = function(e, t) {
  57604. n.Object3D.call(this),
  57605. this.light = e,
  57606. this.light.updateMatrixWorld(),
  57607. this.matrix = e.matrixWorld,
  57608. this.matrixAutoUpdate = !1,
  57609. this.colors = [new n.Color, new n.Color];
  57610. var i = new n.SphereGeometry(t,4,2);
  57611. i.rotateX(-Math.PI / 2);
  57612. for (var r = 0, o = 8; r < o; r++)
  57613. i.faces[r].color = this.colors[r < 4 ? 0 : 1];
  57614. var a = new n.MeshBasicMaterial({
  57615. vertexColors: n.FaceColors,
  57616. wireframe: !0
  57617. });
  57618. this.lightSphere = new n.Mesh(i,a),
  57619. this.add(this.lightSphere),
  57620. this.update()
  57621. }
  57622. ,
  57623. n.HemisphereLightHelper.prototype = Object.create(n.Object3D.prototype),
  57624. n.HemisphereLightHelper.prototype.constructor = n.HemisphereLightHelper,
  57625. n.HemisphereLightHelper.prototype.dispose = function() {
  57626. this.lightSphere.geometry.dispose(),
  57627. this.lightSphere.material.dispose()
  57628. }
  57629. ,
  57630. n.HemisphereLightHelper.prototype.update = function() {
  57631. var e = new n.Vector3;
  57632. return function() {
  57633. this.colors[0].copy(this.light.color).multiplyScalar(this.light.intensity),
  57634. this.colors[1].copy(this.light.groundColor).multiplyScalar(this.light.intensity),
  57635. this.lightSphere.lookAt(e.setFromMatrixPosition(this.light.matrixWorld).negate()),
  57636. this.lightSphere.geometry.colorsNeedUpdate = !0
  57637. }
  57638. }(),
  57639. n.PointLightHelper = function(e, t) {
  57640. this.light = e,
  57641. this.light.updateMatrixWorld();
  57642. var i = new n.SphereGeometry(t,4,2)
  57643. , r = new n.MeshBasicMaterial({
  57644. wireframe: !0,
  57645. fog: !1
  57646. });
  57647. r.color.copy(this.light.color).multiplyScalar(this.light.intensity),
  57648. n.Mesh.call(this, i, r),
  57649. this.matrix = this.light.matrixWorld,
  57650. this.matrixAutoUpdate = !1
  57651. }
  57652. ,
  57653. n.PointLightHelper.prototype = Object.create(n.Mesh.prototype),
  57654. n.PointLightHelper.prototype.constructor = n.PointLightHelper,
  57655. n.PointLightHelper.prototype.dispose = function() {
  57656. this.geometry.dispose(),
  57657. this.material.dispose()
  57658. }
  57659. ,
  57660. n.PointLightHelper.prototype.update = function() {
  57661. this.material.color.copy(this.light.color).multiplyScalar(this.light.intensity)
  57662. }
  57663. ,
  57664. n.SkeletonHelper = function(e) {
  57665. this.bones = this.getBoneList(e);
  57666. for (var t = new n.Geometry, i = 0; i < this.bones.length; i++) {
  57667. var r = this.bones[i];
  57668. r.parent instanceof n.Bone && (t.vertices.push(new n.Vector3),
  57669. t.vertices.push(new n.Vector3),
  57670. t.colors.push(new n.Color(0,0,1)),
  57671. t.colors.push(new n.Color(0,1,0)))
  57672. }
  57673. t.dynamic = !0;
  57674. var o = new n.LineBasicMaterial({
  57675. vertexColors: n.VertexColors,
  57676. depthTest: !1,
  57677. depthWrite: !1,
  57678. transparent: !0
  57679. });
  57680. n.LineSegments.call(this, t, o),
  57681. this.root = e,
  57682. this.matrix = e.matrixWorld,
  57683. this.matrixAutoUpdate = !1,
  57684. this.update()
  57685. }
  57686. ,
  57687. n.SkeletonHelper.prototype = Object.create(n.LineSegments.prototype),
  57688. n.SkeletonHelper.prototype.constructor = n.SkeletonHelper,
  57689. n.SkeletonHelper.prototype.getBoneList = function(e) {
  57690. var t = [];
  57691. e instanceof n.Bone && t.push(e);
  57692. for (var i = 0; i < e.children.length; i++)
  57693. t.push.apply(t, this.getBoneList(e.children[i]));
  57694. return t
  57695. }
  57696. ,
  57697. n.SkeletonHelper.prototype.update = function() {
  57698. 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++) {
  57699. var a = this.bones[o];
  57700. a.parent instanceof n.Bone && (i.multiplyMatrices(t, a.matrixWorld),
  57701. e.vertices[r].setFromMatrixPosition(i),
  57702. i.multiplyMatrices(t, a.parent.matrixWorld),
  57703. e.vertices[r + 1].setFromMatrixPosition(i),
  57704. r += 2)
  57705. }
  57706. e.verticesNeedUpdate = !0,
  57707. e.computeBoundingSphere()
  57708. }
  57709. ,
  57710. n.SpotLightHelper = function(e) {
  57711. n.Object3D.call(this),
  57712. this.light = e,
  57713. this.light.updateMatrixWorld(),
  57714. this.matrix = e.matrixWorld,
  57715. this.matrixAutoUpdate = !1;
  57716. var t = new n.CylinderGeometry(0,1,1,8,1,!0);
  57717. t.translate(0, -.5, 0),
  57718. t.rotateX(-Math.PI / 2);
  57719. var i = new n.MeshBasicMaterial({
  57720. wireframe: !0,
  57721. fog: !1
  57722. });
  57723. this.cone = new n.Mesh(t,i),
  57724. this.add(this.cone),
  57725. this.update()
  57726. }
  57727. ,
  57728. n.SpotLightHelper.prototype = Object.create(n.Object3D.prototype),
  57729. n.SpotLightHelper.prototype.constructor = n.SpotLightHelper,
  57730. n.SpotLightHelper.prototype.dispose = function() {
  57731. this.cone.geometry.dispose(),
  57732. this.cone.material.dispose()
  57733. }
  57734. ,
  57735. n.SpotLightHelper.prototype.update = function() {
  57736. var e = new n.Vector3
  57737. , t = new n.Vector3;
  57738. return function() {
  57739. var i = this.light.distance ? this.light.distance : 1e4
  57740. , n = i * Math.tan(this.light.angle);
  57741. this.cone.scale.set(n, n, i),
  57742. e.setFromMatrixPosition(this.light.matrixWorld),
  57743. t.setFromMatrixPosition(this.light.target.matrixWorld),
  57744. this.cone.lookAt(t.sub(e)),
  57745. this.cone.material.color.copy(this.light.color).multiplyScalar(this.light.intensity)
  57746. }
  57747. }(),
  57748. n.VertexNormalsHelper = function(e, t, i, r) {
  57749. this.object = e,
  57750. this.size = void 0 !== t ? t : 1;
  57751. var o = void 0 !== i ? i : 16711680
  57752. , a = void 0 !== r ? r : 1
  57753. , s = 0
  57754. , l = this.object.geometry;
  57755. l instanceof n.Geometry ? s = 3 * l.faces.length : l instanceof n.BufferGeometry && (s = l.attributes.normal.count);
  57756. var c = new n.BufferGeometry
  57757. , h = new n.Float32Attribute(2 * s * 3,3);
  57758. c.addAttribute("position", h),
  57759. n.LineSegments.call(this, c, new n.LineBasicMaterial({
  57760. color: o,
  57761. linewidth: a
  57762. })),
  57763. this.matrixAutoUpdate = !1,
  57764. this.update()
  57765. }
  57766. ,
  57767. n.VertexNormalsHelper.prototype = Object.create(n.LineSegments.prototype),
  57768. n.VertexNormalsHelper.prototype.constructor = n.VertexNormalsHelper,
  57769. n.VertexNormalsHelper.prototype.update = function() {
  57770. var e = new n.Vector3
  57771. , t = new n.Vector3
  57772. , i = new n.Matrix3;
  57773. return function() {
  57774. var r = ["a", "b", "c"];
  57775. this.object.updateMatrixWorld(!0),
  57776. i.getNormalMatrix(this.object.matrixWorld);
  57777. var o = this.object.matrixWorld
  57778. , a = this.geometry.attributes.position
  57779. , s = this.object.geometry;
  57780. if (s instanceof n.Geometry)
  57781. for (var l = s.vertices, c = s.faces, h = 0, u = 0, d = c.length; u < d; u++)
  57782. for (var p = c[u], f = 0, g = p.vertexNormals.length; f < g; f++) {
  57783. var m = l[p[r[f]]]
  57784. , v = p.vertexNormals[f];
  57785. e.copy(m).applyMatrix4(o),
  57786. t.copy(v).applyMatrix3(i).normalize().multiplyScalar(this.size).add(e),
  57787. a.setXYZ(h, e.x, e.y, e.z),
  57788. h += 1,
  57789. a.setXYZ(h, t.x, t.y, t.z),
  57790. h += 1
  57791. }
  57792. else if (s instanceof n.BufferGeometry)
  57793. for (var A = s.attributes.position, y = s.attributes.normal, h = 0, f = 0, g = A.count; f < g; f++)
  57794. e.set(A.getX(f), A.getY(f), A.getZ(f)).applyMatrix4(o),
  57795. t.set(y.getX(f), y.getY(f), y.getZ(f)),
  57796. t.applyMatrix3(i).normalize().multiplyScalar(this.size).add(e),
  57797. a.setXYZ(h, e.x, e.y, e.z),
  57798. h += 1,
  57799. a.setXYZ(h, t.x, t.y, t.z),
  57800. h += 1;
  57801. return a.needsUpdate = !0,
  57802. this
  57803. }
  57804. }(),
  57805. n.WireframeHelper = function(e, t) {
  57806. var i = void 0 !== t ? t : 16777215;
  57807. n.LineSegments.call(this, new n.WireframeGeometry(e.geometry), new n.LineBasicMaterial({
  57808. color: i
  57809. })),
  57810. this.matrix = e.matrixWorld,
  57811. this.matrixAutoUpdate = !1
  57812. }
  57813. ,
  57814. n.WireframeHelper.prototype = Object.create(n.LineSegments.prototype),
  57815. n.WireframeHelper.prototype.constructor = n.WireframeHelper,
  57816. n.ImmediateRenderObject = function(e) {
  57817. n.Object3D.call(this),
  57818. this.material = e,
  57819. this.render = function(e) {}
  57820. }
  57821. ,
  57822. n.ImmediateRenderObject.prototype = Object.create(n.Object3D.prototype),
  57823. n.ImmediateRenderObject.prototype.constructor = n.ImmediateRenderObject,
  57824. n.MorphBlendMesh = function(e, t) {
  57825. n.Mesh.call(this, e, t),
  57826. this.animationsMap = {},
  57827. this.animationsList = [];
  57828. var i = this.geometry.morphTargets.length
  57829. , r = "__default"
  57830. , o = 0
  57831. , a = i - 1
  57832. , s = i / 1;
  57833. this.createAnimation(r, o, a, s),
  57834. this.setAnimationWeight(r, 1)
  57835. }
  57836. ,
  57837. n.MorphBlendMesh.prototype = Object.create(n.Mesh.prototype),
  57838. n.MorphBlendMesh.prototype.constructor = n.MorphBlendMesh,
  57839. n.MorphBlendMesh.prototype.createAnimation = function(e, t, i, n) {
  57840. var r = {
  57841. start: t,
  57842. end: i,
  57843. length: i - t + 1,
  57844. fps: n,
  57845. duration: (i - t) / n,
  57846. lastFrame: 0,
  57847. currentFrame: 0,
  57848. active: !1,
  57849. time: 0,
  57850. direction: 1,
  57851. weight: 1,
  57852. directionBackwards: !1,
  57853. mirroredLoop: !1
  57854. };
  57855. this.animationsMap[e] = r,
  57856. this.animationsList.push(r)
  57857. }
  57858. ,
  57859. n.MorphBlendMesh.prototype.autoCreateAnimations = function(e) {
  57860. for (var t, i = /([a-z]+)_?(\d+)/i, n = {}, r = this.geometry, o = 0, a = r.morphTargets.length; o < a; o++) {
  57861. var s = r.morphTargets[o]
  57862. , l = s.name.match(i);
  57863. if (l && l.length > 1) {
  57864. var c = l[1];
  57865. n[c] || (n[c] = {
  57866. start: 1 / 0,
  57867. end: -(1 / 0)
  57868. });
  57869. var h = n[c];
  57870. o < h.start && (h.start = o),
  57871. o > h.end && (h.end = o),
  57872. t || (t = c)
  57873. }
  57874. }
  57875. for (var c in n) {
  57876. var h = n[c];
  57877. this.createAnimation(c, h.start, h.end, e)
  57878. }
  57879. this.firstAnimation = t
  57880. }
  57881. ,
  57882. n.MorphBlendMesh.prototype.setAnimationDirectionForward = function(e) {
  57883. var t = this.animationsMap[e];
  57884. t && (t.direction = 1,
  57885. t.directionBackwards = !1)
  57886. }
  57887. ,
  57888. n.MorphBlendMesh.prototype.setAnimationDirectionBackward = function(e) {
  57889. var t = this.animationsMap[e];
  57890. t && (t.direction = -1,
  57891. t.directionBackwards = !0)
  57892. }
  57893. ,
  57894. n.MorphBlendMesh.prototype.setAnimationFPS = function(e, t) {
  57895. var i = this.animationsMap[e];
  57896. i && (i.fps = t,
  57897. i.duration = (i.end - i.start) / i.fps)
  57898. }
  57899. ,
  57900. n.MorphBlendMesh.prototype.setAnimationDuration = function(e, t) {
  57901. var i = this.animationsMap[e];
  57902. i && (i.duration = t,
  57903. i.fps = (i.end - i.start) / i.duration)
  57904. }
  57905. ,
  57906. n.MorphBlendMesh.prototype.setAnimationWeight = function(e, t) {
  57907. var i = this.animationsMap[e];
  57908. i && (i.weight = t)
  57909. }
  57910. ,
  57911. n.MorphBlendMesh.prototype.setAnimationTime = function(e, t) {
  57912. var i = this.animationsMap[e];
  57913. i && (i.time = t)
  57914. }
  57915. ,
  57916. n.MorphBlendMesh.prototype.getAnimationTime = function(e) {
  57917. var t = 0
  57918. , i = this.animationsMap[e];
  57919. return i && (t = i.time),
  57920. t
  57921. }
  57922. ,
  57923. n.MorphBlendMesh.prototype.getAnimationDuration = function(e) {
  57924. var t = -1
  57925. , i = this.animationsMap[e];
  57926. return i && (t = i.duration),
  57927. t
  57928. }
  57929. ,
  57930. n.MorphBlendMesh.prototype.playAnimation = function(e) {
  57931. var t = this.animationsMap[e];
  57932. t ? (t.time = 0,
  57933. t.active = !0) : console.warn("THREE.MorphBlendMesh: animation[" + e + "] undefined in .playAnimation()")
  57934. }
  57935. ,
  57936. n.MorphBlendMesh.prototype.stopAnimation = function(e) {
  57937. var t = this.animationsMap[e];
  57938. t && (t.active = !1)
  57939. }
  57940. ,
  57941. n.MorphBlendMesh.prototype.update = function(e) {
  57942. for (var t = 0, i = this.animationsList.length; t < i; t++) {
  57943. var r = this.animationsList[t];
  57944. if (r.active) {
  57945. var o = r.duration / r.length;
  57946. r.time += r.direction * e,
  57947. r.mirroredLoop ? (r.time > r.duration || r.time < 0) && (r.direction *= -1,
  57948. r.time > r.duration && (r.time = r.duration,
  57949. r.directionBackwards = !0),
  57950. r.time < 0 && (r.time = 0,
  57951. r.directionBackwards = !1)) : (r.time = r.time % r.duration,
  57952. r.time < 0 && (r.time += r.duration));
  57953. var a = r.start + n.Math.clamp(Math.floor(r.time / o), 0, r.length - 1)
  57954. , s = r.weight;
  57955. a !== r.currentFrame && (this.morphTargetInfluences[r.lastFrame] = 0,
  57956. this.morphTargetInfluences[r.currentFrame] = 1 * s,
  57957. this.morphTargetInfluences[a] = 0,
  57958. r.lastFrame = r.currentFrame,
  57959. r.currentFrame = a);
  57960. var l = r.time % o / o;
  57961. r.directionBackwards && (l = 1 - l),
  57962. r.currentFrame !== r.lastFrame ? (this.morphTargetInfluences[r.currentFrame] = l * s,
  57963. this.morphTargetInfluences[r.lastFrame] = (1 - l) * s) : this.morphTargetInfluences[r.currentFrame] = s
  57964. }
  57965. }
  57966. }
  57967. ,
  57968. "undefined" != typeof i ? ("undefined" != typeof t && t.exports && (i = t.exports = n),
  57969. i.THREE = n) : this.THREE = n
  57970. window.THREE = n
  57971. getObjLoader()
  57972. initByTHREE(THREE)
  57973. }
  57974. , {}]
  57975. }, {}, [116]);