main_2020_show.js 2.6 MB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471747274737474747574767477747874797480748174827483748474857486748774887489749074917492749374947495749674977498749975007501750275037504750575067507750875097510751175127513751475157516751775187519752075217522752375247525752675277528752975307531753275337534753575367537753875397540754175427543754475457546754775487549755075517552755375547555755675577558755975607561756275637564756575667567756875697570757175727573757475757576757775787579758075817582758375847585758675877588758975907591759275937594759575967597759875997600760176027603760476057606760776087609761076117612761376147615761676177618761976207621762276237624762576267627762876297630763176327633763476357636763776387639764076417642764376447645764676477648764976507651765276537654765576567657765876597660766176627663766476657666766776687669767076717672767376747675767676777678767976807681768276837684768576867687768876897690769176927693769476957696769776987699770077017702770377047705770677077708770977107711771277137714771577167717771877197720772177227723772477257726772777287729773077317732773377347735773677377738773977407741774277437744774577467747774877497750775177527753775477557756775777587759776077617762776377647765776677677768776977707771777277737774777577767777777877797780778177827783778477857786778777887789779077917792779377947795779677977798779978007801780278037804780578067807780878097810781178127813781478157816781778187819782078217822782378247825782678277828782978307831783278337834783578367837783878397840784178427843784478457846784778487849785078517852785378547855785678577858785978607861786278637864786578667867786878697870787178727873787478757876787778787879788078817882788378847885788678877888788978907891789278937894789578967897789878997900790179027903790479057906790779087909791079117912791379147915791679177918791979207921792279237924792579267927792879297930793179327933793479357936793779387939794079417942794379447945794679477948794979507951795279537954795579567957795879597960796179627963796479657966796779687969797079717972797379747975797679777978797979807981798279837984798579867987798879897990799179927993799479957996799779987999800080018002800380048005800680078008800980108011801280138014801580168017801880198020802180228023802480258026802780288029803080318032803380348035803680378038803980408041804280438044804580468047804880498050805180528053805480558056805780588059806080618062806380648065806680678068806980708071807280738074807580768077807880798080808180828083808480858086808780888089809080918092809380948095809680978098809981008101810281038104810581068107810881098110811181128113811481158116811781188119812081218122812381248125812681278128812981308131813281338134813581368137813881398140814181428143814481458146814781488149815081518152815381548155815681578158815981608161816281638164816581668167816881698170817181728173817481758176817781788179818081818182818381848185818681878188818981908191819281938194819581968197819881998200820182028203820482058206820782088209821082118212821382148215821682178218821982208221822282238224822582268227822882298230823182328233823482358236823782388239824082418242824382448245824682478248824982508251825282538254825582568257825882598260826182628263826482658266826782688269827082718272827382748275827682778278827982808281828282838284828582868287828882898290829182928293829482958296829782988299830083018302830383048305830683078308830983108311831283138314831583168317831883198320832183228323832483258326832783288329833083318332833383348335833683378338833983408341834283438344834583468347834883498350835183528353835483558356835783588359836083618362836383648365836683678368836983708371837283738374837583768377837883798380838183828383838483858386838783888389839083918392839383948395839683978398839984008401840284038404840584068407840884098410841184128413841484158416841784188419842084218422842384248425842684278428842984308431843284338434843584368437843884398440844184428443844484458446844784488449845084518452845384548455845684578458845984608461846284638464846584668467846884698470847184728473847484758476847784788479848084818482848384848485848684878488848984908491849284938494849584968497849884998500850185028503850485058506850785088509851085118512851385148515851685178518851985208521852285238524852585268527852885298530853185328533853485358536853785388539854085418542854385448545854685478548854985508551855285538554855585568557855885598560856185628563856485658566856785688569857085718572857385748575857685778578857985808581858285838584858585868587858885898590859185928593859485958596859785988599860086018602860386048605860686078608860986108611861286138614861586168617861886198620862186228623862486258626862786288629863086318632863386348635863686378638863986408641864286438644864586468647864886498650865186528653865486558656865786588659866086618662866386648665866686678668866986708671867286738674867586768677867886798680868186828683868486858686868786888689869086918692869386948695869686978698869987008701870287038704870587068707870887098710871187128713871487158716871787188719872087218722872387248725872687278728872987308731873287338734873587368737873887398740874187428743874487458746874787488749875087518752875387548755875687578758875987608761876287638764876587668767876887698770877187728773877487758776877787788779878087818782878387848785878687878788878987908791879287938794879587968797879887998800880188028803880488058806880788088809881088118812881388148815881688178818881988208821882288238824882588268827882888298830883188328833883488358836883788388839884088418842884388448845884688478848884988508851885288538854885588568857885888598860886188628863886488658866886788688869887088718872887388748875887688778878887988808881888288838884888588868887888888898890889188928893889488958896889788988899890089018902890389048905890689078908890989108911891289138914891589168917891889198920892189228923892489258926892789288929893089318932893389348935893689378938893989408941894289438944894589468947894889498950895189528953895489558956895789588959896089618962896389648965896689678968896989708971897289738974897589768977897889798980898189828983898489858986898789888989899089918992899389948995899689978998899990009001900290039004900590069007900890099010901190129013901490159016901790189019902090219022902390249025902690279028902990309031903290339034903590369037903890399040904190429043904490459046904790489049905090519052905390549055905690579058905990609061906290639064906590669067906890699070907190729073907490759076907790789079908090819082908390849085908690879088908990909091909290939094909590969097909890999100910191029103910491059106910791089109911091119112911391149115911691179118911991209121912291239124912591269127912891299130913191329133913491359136913791389139914091419142914391449145914691479148914991509151915291539154915591569157915891599160916191629163916491659166916791689169917091719172917391749175917691779178917991809181918291839184918591869187918891899190919191929193919491959196919791989199920092019202920392049205920692079208920992109211921292139214921592169217921892199220922192229223922492259226922792289229923092319232923392349235923692379238923992409241924292439244924592469247924892499250925192529253925492559256925792589259926092619262926392649265926692679268926992709271927292739274927592769277927892799280928192829283928492859286928792889289929092919292929392949295929692979298929993009301930293039304930593069307930893099310931193129313931493159316931793189319932093219322932393249325932693279328932993309331933293339334933593369337933893399340934193429343934493459346934793489349935093519352935393549355935693579358935993609361936293639364936593669367936893699370937193729373937493759376937793789379938093819382938393849385938693879388938993909391939293939394939593969397939893999400940194029403940494059406940794089409941094119412941394149415941694179418941994209421942294239424942594269427942894299430943194329433943494359436943794389439944094419442944394449445944694479448944994509451945294539454945594569457945894599460946194629463946494659466946794689469947094719472947394749475947694779478947994809481948294839484948594869487948894899490949194929493949494959496949794989499950095019502950395049505950695079508950995109511951295139514951595169517951895199520952195229523952495259526952795289529953095319532953395349535953695379538953995409541954295439544954595469547954895499550955195529553955495559556955795589559956095619562956395649565956695679568956995709571957295739574957595769577957895799580958195829583958495859586958795889589959095919592959395949595959695979598959996009601960296039604960596069607960896099610961196129613961496159616961796189619962096219622962396249625962696279628962996309631963296339634963596369637963896399640964196429643964496459646964796489649965096519652965396549655965696579658965996609661966296639664966596669667966896699670967196729673967496759676967796789679968096819682968396849685968696879688968996909691969296939694969596969697969896999700970197029703970497059706970797089709971097119712971397149715971697179718971997209721972297239724972597269727972897299730973197329733973497359736973797389739974097419742974397449745974697479748974997509751975297539754975597569757975897599760976197629763976497659766976797689769977097719772977397749775977697779778977997809781978297839784978597869787978897899790979197929793979497959796979797989799980098019802980398049805980698079808980998109811981298139814981598169817981898199820982198229823982498259826982798289829983098319832983398349835983698379838983998409841984298439844984598469847984898499850985198529853985498559856985798589859986098619862986398649865986698679868986998709871987298739874987598769877987898799880988198829883988498859886988798889889989098919892989398949895989698979898989999009901990299039904990599069907990899099910991199129913991499159916991799189919992099219922992399249925992699279928992999309931993299339934993599369937993899399940994199429943994499459946994799489949995099519952995399549955995699579958995999609961996299639964996599669967996899699970997199729973997499759976997799789979998099819982998399849985998699879988998999909991999299939994999599969997999899991000010001100021000310004100051000610007100081000910010100111001210013100141001510016100171001810019100201002110022100231002410025100261002710028100291003010031100321003310034100351003610037100381003910040100411004210043100441004510046100471004810049100501005110052100531005410055100561005710058100591006010061100621006310064100651006610067100681006910070100711007210073100741007510076100771007810079100801008110082100831008410085100861008710088100891009010091100921009310094100951009610097100981009910100101011010210103101041010510106101071010810109101101011110112101131011410115101161011710118101191012010121101221012310124101251012610127101281012910130101311013210133101341013510136101371013810139101401014110142101431014410145101461014710148101491015010151101521015310154101551015610157101581015910160101611016210163101641016510166101671016810169101701017110172101731017410175101761017710178101791018010181101821018310184101851018610187101881018910190101911019210193101941019510196101971019810199102001020110202102031020410205102061020710208102091021010211102121021310214102151021610217102181021910220102211022210223102241022510226102271022810229102301023110232102331023410235102361023710238102391024010241102421024310244102451024610247102481024910250102511025210253102541025510256102571025810259102601026110262102631026410265102661026710268102691027010271102721027310274102751027610277102781027910280102811028210283102841028510286102871028810289102901029110292102931029410295102961029710298102991030010301103021030310304103051030610307103081030910310103111031210313103141031510316103171031810319103201032110322103231032410325103261032710328103291033010331103321033310334103351033610337103381033910340103411034210343103441034510346103471034810349103501035110352103531035410355103561035710358103591036010361103621036310364103651036610367103681036910370103711037210373103741037510376103771037810379103801038110382103831038410385103861038710388103891039010391103921039310394103951039610397103981039910400104011040210403104041040510406104071040810409104101041110412104131041410415104161041710418104191042010421104221042310424104251042610427104281042910430104311043210433104341043510436104371043810439104401044110442104431044410445104461044710448104491045010451104521045310454104551045610457104581045910460104611046210463104641046510466104671046810469104701047110472104731047410475104761047710478104791048010481104821048310484104851048610487104881048910490104911049210493104941049510496104971049810499105001050110502105031050410505105061050710508105091051010511105121051310514105151051610517105181051910520105211052210523105241052510526105271052810529105301053110532105331053410535105361053710538105391054010541105421054310544105451054610547105481054910550105511055210553105541055510556105571055810559105601056110562105631056410565105661056710568105691057010571105721057310574105751057610577105781057910580105811058210583105841058510586105871058810589105901059110592105931059410595105961059710598105991060010601106021060310604106051060610607106081060910610106111061210613106141061510616106171061810619106201062110622106231062410625106261062710628106291063010631106321063310634106351063610637106381063910640106411064210643106441064510646106471064810649106501065110652106531065410655106561065710658106591066010661106621066310664106651066610667106681066910670106711067210673106741067510676106771067810679106801068110682106831068410685106861068710688106891069010691106921069310694106951069610697106981069910700107011070210703107041070510706107071070810709107101071110712107131071410715107161071710718107191072010721107221072310724107251072610727107281072910730107311073210733107341073510736107371073810739107401074110742107431074410745107461074710748107491075010751107521075310754107551075610757107581075910760107611076210763107641076510766107671076810769107701077110772107731077410775107761077710778107791078010781107821078310784107851078610787107881078910790107911079210793107941079510796107971079810799108001080110802108031080410805108061080710808108091081010811108121081310814108151081610817108181081910820108211082210823108241082510826108271082810829108301083110832108331083410835108361083710838108391084010841108421084310844108451084610847108481084910850108511085210853108541085510856108571085810859108601086110862108631086410865108661086710868108691087010871108721087310874108751087610877108781087910880108811088210883108841088510886108871088810889108901089110892108931089410895108961089710898108991090010901109021090310904109051090610907109081090910910109111091210913109141091510916109171091810919109201092110922109231092410925109261092710928109291093010931109321093310934109351093610937109381093910940109411094210943109441094510946109471094810949109501095110952109531095410955109561095710958109591096010961109621096310964109651096610967109681096910970109711097210973109741097510976109771097810979109801098110982109831098410985109861098710988109891099010991109921099310994109951099610997109981099911000110011100211003110041100511006110071100811009110101101111012110131101411015110161101711018110191102011021110221102311024110251102611027110281102911030110311103211033110341103511036110371103811039110401104111042110431104411045110461104711048110491105011051110521105311054110551105611057110581105911060110611106211063110641106511066110671106811069110701107111072110731107411075110761107711078110791108011081110821108311084110851108611087110881108911090110911109211093110941109511096110971109811099111001110111102111031110411105111061110711108111091111011111111121111311114111151111611117111181111911120111211112211123111241112511126111271112811129111301113111132111331113411135111361113711138111391114011141111421114311144111451114611147111481114911150111511115211153111541115511156111571115811159111601116111162111631116411165111661116711168111691117011171111721117311174111751117611177111781117911180111811118211183111841118511186111871118811189111901119111192111931119411195111961119711198111991120011201112021120311204112051120611207112081120911210112111121211213112141121511216112171121811219112201122111222112231122411225112261122711228112291123011231112321123311234112351123611237112381123911240112411124211243112441124511246112471124811249112501125111252112531125411255112561125711258112591126011261112621126311264112651126611267112681126911270112711127211273112741127511276112771127811279112801128111282112831128411285112861128711288112891129011291112921129311294112951129611297112981129911300113011130211303113041130511306113071130811309113101131111312113131131411315113161131711318113191132011321113221132311324113251132611327113281132911330113311133211333113341133511336113371133811339113401134111342113431134411345113461134711348113491135011351113521135311354113551135611357113581135911360113611136211363113641136511366113671136811369113701137111372113731137411375113761137711378113791138011381113821138311384113851138611387113881138911390113911139211393113941139511396113971139811399114001140111402114031140411405114061140711408114091141011411114121141311414114151141611417114181141911420114211142211423114241142511426114271142811429114301143111432114331143411435114361143711438114391144011441114421144311444114451144611447114481144911450114511145211453114541145511456114571145811459114601146111462114631146411465114661146711468114691147011471114721147311474114751147611477114781147911480114811148211483114841148511486114871148811489114901149111492114931149411495114961149711498114991150011501115021150311504115051150611507115081150911510115111151211513115141151511516115171151811519115201152111522115231152411525115261152711528115291153011531115321153311534115351153611537115381153911540115411154211543115441154511546115471154811549115501155111552115531155411555115561155711558115591156011561115621156311564115651156611567115681156911570115711157211573115741157511576115771157811579115801158111582115831158411585115861158711588115891159011591115921159311594115951159611597115981159911600116011160211603116041160511606116071160811609116101161111612116131161411615116161161711618116191162011621116221162311624116251162611627116281162911630116311163211633116341163511636116371163811639116401164111642116431164411645116461164711648116491165011651116521165311654116551165611657116581165911660116611166211663116641166511666116671166811669116701167111672116731167411675116761167711678116791168011681116821168311684116851168611687116881168911690116911169211693116941169511696116971169811699117001170111702117031170411705117061170711708117091171011711117121171311714117151171611717117181171911720117211172211723117241172511726117271172811729117301173111732117331173411735117361173711738117391174011741117421174311744117451174611747117481174911750117511175211753117541175511756117571175811759117601176111762117631176411765117661176711768117691177011771117721177311774117751177611777117781177911780117811178211783117841178511786117871178811789117901179111792117931179411795117961179711798117991180011801118021180311804118051180611807118081180911810118111181211813118141181511816118171181811819118201182111822118231182411825118261182711828118291183011831118321183311834118351183611837118381183911840118411184211843118441184511846118471184811849118501185111852118531185411855118561185711858118591186011861118621186311864118651186611867118681186911870118711187211873118741187511876118771187811879118801188111882118831188411885118861188711888118891189011891118921189311894118951189611897118981189911900119011190211903119041190511906119071190811909119101191111912119131191411915119161191711918119191192011921119221192311924119251192611927119281192911930119311193211933119341193511936119371193811939119401194111942119431194411945119461194711948119491195011951119521195311954119551195611957119581195911960119611196211963119641196511966119671196811969119701197111972119731197411975119761197711978119791198011981119821198311984119851198611987119881198911990119911199211993119941199511996119971199811999120001200112002120031200412005120061200712008120091201012011120121201312014120151201612017120181201912020120211202212023120241202512026120271202812029120301203112032120331203412035120361203712038120391204012041120421204312044120451204612047120481204912050120511205212053120541205512056120571205812059120601206112062120631206412065120661206712068120691207012071120721207312074120751207612077120781207912080120811208212083120841208512086120871208812089120901209112092120931209412095120961209712098120991210012101121021210312104121051210612107121081210912110121111211212113121141211512116121171211812119121201212112122121231212412125121261212712128121291213012131121321213312134121351213612137121381213912140121411214212143121441214512146121471214812149121501215112152121531215412155121561215712158121591216012161121621216312164121651216612167121681216912170121711217212173121741217512176121771217812179121801218112182121831218412185121861218712188121891219012191121921219312194121951219612197121981219912200122011220212203122041220512206122071220812209122101221112212122131221412215122161221712218122191222012221122221222312224122251222612227122281222912230122311223212233122341223512236122371223812239122401224112242122431224412245122461224712248122491225012251122521225312254122551225612257122581225912260122611226212263122641226512266122671226812269122701227112272122731227412275122761227712278122791228012281122821228312284122851228612287122881228912290122911229212293122941229512296122971229812299123001230112302123031230412305123061230712308123091231012311123121231312314123151231612317123181231912320123211232212323123241232512326123271232812329123301233112332123331233412335123361233712338123391234012341123421234312344123451234612347123481234912350123511235212353123541235512356123571235812359123601236112362123631236412365123661236712368123691237012371123721237312374123751237612377123781237912380123811238212383123841238512386123871238812389123901239112392123931239412395123961239712398123991240012401124021240312404124051240612407124081240912410124111241212413124141241512416124171241812419124201242112422124231242412425124261242712428124291243012431124321243312434124351243612437124381243912440124411244212443124441244512446124471244812449124501245112452124531245412455124561245712458124591246012461124621246312464124651246612467124681246912470124711247212473124741247512476124771247812479124801248112482124831248412485124861248712488124891249012491124921249312494124951249612497124981249912500125011250212503125041250512506125071250812509125101251112512125131251412515125161251712518125191252012521125221252312524125251252612527125281252912530125311253212533125341253512536125371253812539125401254112542125431254412545125461254712548125491255012551125521255312554125551255612557125581255912560125611256212563125641256512566125671256812569125701257112572125731257412575125761257712578125791258012581125821258312584125851258612587125881258912590125911259212593125941259512596125971259812599126001260112602126031260412605126061260712608126091261012611126121261312614126151261612617126181261912620126211262212623126241262512626126271262812629126301263112632126331263412635126361263712638126391264012641126421264312644126451264612647126481264912650126511265212653126541265512656126571265812659126601266112662126631266412665126661266712668126691267012671126721267312674126751267612677126781267912680126811268212683126841268512686126871268812689126901269112692126931269412695126961269712698126991270012701127021270312704127051270612707127081270912710127111271212713127141271512716127171271812719127201272112722127231272412725127261272712728127291273012731127321273312734127351273612737127381273912740127411274212743127441274512746127471274812749127501275112752127531275412755127561275712758127591276012761127621276312764127651276612767127681276912770127711277212773127741277512776127771277812779127801278112782127831278412785127861278712788127891279012791127921279312794127951279612797127981279912800128011280212803128041280512806128071280812809128101281112812128131281412815128161281712818128191282012821128221282312824128251282612827128281282912830128311283212833128341283512836128371283812839128401284112842128431284412845128461284712848128491285012851128521285312854128551285612857128581285912860128611286212863128641286512866128671286812869128701287112872128731287412875128761287712878128791288012881128821288312884128851288612887128881288912890128911289212893128941289512896128971289812899129001290112902129031290412905129061290712908129091291012911129121291312914129151291612917129181291912920129211292212923129241292512926129271292812929129301293112932129331293412935129361293712938129391294012941129421294312944129451294612947129481294912950129511295212953129541295512956129571295812959129601296112962129631296412965129661296712968129691297012971129721297312974129751297612977129781297912980129811298212983129841298512986129871298812989129901299112992129931299412995129961299712998129991300013001130021300313004130051300613007130081300913010130111301213013130141301513016130171301813019130201302113022130231302413025130261302713028130291303013031130321303313034130351303613037130381303913040130411304213043130441304513046130471304813049130501305113052130531305413055130561305713058130591306013061130621306313064130651306613067130681306913070130711307213073130741307513076130771307813079130801308113082130831308413085130861308713088130891309013091130921309313094130951309613097130981309913100131011310213103131041310513106131071310813109131101311113112131131311413115131161311713118131191312013121131221312313124131251312613127131281312913130131311313213133131341313513136131371313813139131401314113142131431314413145131461314713148131491315013151131521315313154131551315613157131581315913160131611316213163131641316513166131671316813169131701317113172131731317413175131761317713178131791318013181131821318313184131851318613187131881318913190131911319213193131941319513196131971319813199132001320113202132031320413205132061320713208132091321013211132121321313214132151321613217132181321913220132211322213223132241322513226132271322813229132301323113232132331323413235132361323713238132391324013241132421324313244132451324613247132481324913250132511325213253132541325513256132571325813259132601326113262132631326413265132661326713268132691327013271132721327313274132751327613277132781327913280132811328213283132841328513286132871328813289132901329113292132931329413295132961329713298132991330013301133021330313304133051330613307133081330913310133111331213313133141331513316133171331813319133201332113322133231332413325133261332713328133291333013331133321333313334133351333613337133381333913340133411334213343133441334513346133471334813349133501335113352133531335413355133561335713358133591336013361133621336313364133651336613367133681336913370133711337213373133741337513376133771337813379133801338113382133831338413385133861338713388133891339013391133921339313394133951339613397133981339913400134011340213403134041340513406134071340813409134101341113412134131341413415134161341713418134191342013421134221342313424134251342613427134281342913430134311343213433134341343513436134371343813439134401344113442134431344413445134461344713448134491345013451134521345313454134551345613457134581345913460134611346213463134641346513466134671346813469134701347113472134731347413475134761347713478134791348013481134821348313484134851348613487134881348913490134911349213493134941349513496134971349813499135001350113502135031350413505135061350713508135091351013511135121351313514135151351613517135181351913520135211352213523135241352513526135271352813529135301353113532135331353413535135361353713538135391354013541135421354313544135451354613547135481354913550135511355213553135541355513556135571355813559135601356113562135631356413565135661356713568135691357013571135721357313574135751357613577135781357913580135811358213583135841358513586135871358813589135901359113592135931359413595135961359713598135991360013601136021360313604136051360613607136081360913610136111361213613136141361513616136171361813619136201362113622136231362413625136261362713628136291363013631136321363313634136351363613637136381363913640136411364213643136441364513646136471364813649136501365113652136531365413655136561365713658136591366013661136621366313664136651366613667136681366913670136711367213673136741367513676136771367813679136801368113682136831368413685136861368713688136891369013691136921369313694136951369613697136981369913700137011370213703137041370513706137071370813709137101371113712137131371413715137161371713718137191372013721137221372313724137251372613727137281372913730137311373213733137341373513736137371373813739137401374113742137431374413745137461374713748137491375013751137521375313754137551375613757137581375913760137611376213763137641376513766137671376813769137701377113772137731377413775137761377713778137791378013781137821378313784137851378613787137881378913790137911379213793137941379513796137971379813799138001380113802138031380413805138061380713808138091381013811138121381313814138151381613817138181381913820138211382213823138241382513826138271382813829138301383113832138331383413835138361383713838138391384013841138421384313844138451384613847138481384913850138511385213853138541385513856138571385813859138601386113862138631386413865138661386713868138691387013871138721387313874138751387613877138781387913880138811388213883138841388513886138871388813889138901389113892138931389413895138961389713898138991390013901139021390313904139051390613907139081390913910139111391213913139141391513916139171391813919139201392113922139231392413925139261392713928139291393013931139321393313934139351393613937139381393913940139411394213943139441394513946139471394813949139501395113952139531395413955139561395713958139591396013961139621396313964139651396613967139681396913970139711397213973139741397513976139771397813979139801398113982139831398413985139861398713988139891399013991139921399313994139951399613997139981399914000140011400214003140041400514006140071400814009140101401114012140131401414015140161401714018140191402014021140221402314024140251402614027140281402914030140311403214033140341403514036140371403814039140401404114042140431404414045140461404714048140491405014051140521405314054140551405614057140581405914060140611406214063140641406514066140671406814069140701407114072140731407414075140761407714078140791408014081140821408314084140851408614087140881408914090140911409214093140941409514096140971409814099141001410114102141031410414105141061410714108141091411014111141121411314114141151411614117141181411914120141211412214123141241412514126141271412814129141301413114132141331413414135141361413714138141391414014141141421414314144141451414614147141481414914150141511415214153141541415514156141571415814159141601416114162141631416414165141661416714168141691417014171141721417314174141751417614177141781417914180141811418214183141841418514186141871418814189141901419114192141931419414195141961419714198141991420014201142021420314204142051420614207142081420914210142111421214213142141421514216142171421814219142201422114222142231422414225142261422714228142291423014231142321423314234142351423614237142381423914240142411424214243142441424514246142471424814249142501425114252142531425414255142561425714258142591426014261142621426314264142651426614267142681426914270142711427214273142741427514276142771427814279142801428114282142831428414285142861428714288142891429014291142921429314294142951429614297142981429914300143011430214303143041430514306143071430814309143101431114312143131431414315143161431714318143191432014321143221432314324143251432614327143281432914330143311433214333143341433514336143371433814339143401434114342143431434414345143461434714348143491435014351143521435314354143551435614357143581435914360143611436214363143641436514366143671436814369143701437114372143731437414375143761437714378143791438014381143821438314384143851438614387143881438914390143911439214393143941439514396143971439814399144001440114402144031440414405144061440714408144091441014411144121441314414144151441614417144181441914420144211442214423144241442514426144271442814429144301443114432144331443414435144361443714438144391444014441144421444314444144451444614447144481444914450144511445214453144541445514456144571445814459144601446114462144631446414465144661446714468144691447014471144721447314474144751447614477144781447914480144811448214483144841448514486144871448814489144901449114492144931449414495144961449714498144991450014501145021450314504145051450614507145081450914510145111451214513145141451514516145171451814519145201452114522145231452414525145261452714528145291453014531145321453314534145351453614537145381453914540145411454214543145441454514546145471454814549145501455114552145531455414555145561455714558145591456014561145621456314564145651456614567145681456914570145711457214573145741457514576145771457814579145801458114582145831458414585145861458714588145891459014591145921459314594145951459614597145981459914600146011460214603146041460514606146071460814609146101461114612146131461414615146161461714618146191462014621146221462314624146251462614627146281462914630146311463214633146341463514636146371463814639146401464114642146431464414645146461464714648146491465014651146521465314654146551465614657146581465914660146611466214663146641466514666146671466814669146701467114672146731467414675146761467714678146791468014681146821468314684146851468614687146881468914690146911469214693146941469514696146971469814699147001470114702147031470414705147061470714708147091471014711147121471314714147151471614717147181471914720147211472214723147241472514726147271472814729147301473114732147331473414735147361473714738147391474014741147421474314744147451474614747147481474914750147511475214753147541475514756147571475814759147601476114762147631476414765147661476714768147691477014771147721477314774147751477614777147781477914780147811478214783147841478514786147871478814789147901479114792147931479414795147961479714798147991480014801148021480314804148051480614807148081480914810148111481214813148141481514816148171481814819148201482114822148231482414825148261482714828148291483014831148321483314834148351483614837148381483914840148411484214843148441484514846148471484814849148501485114852148531485414855148561485714858148591486014861148621486314864148651486614867148681486914870148711487214873148741487514876148771487814879148801488114882148831488414885148861488714888148891489014891148921489314894148951489614897148981489914900149011490214903149041490514906149071490814909149101491114912149131491414915149161491714918149191492014921149221492314924149251492614927149281492914930149311493214933149341493514936149371493814939149401494114942149431494414945149461494714948149491495014951149521495314954149551495614957149581495914960149611496214963149641496514966149671496814969149701497114972149731497414975149761497714978149791498014981149821498314984149851498614987149881498914990149911499214993149941499514996149971499814999150001500115002150031500415005150061500715008150091501015011150121501315014150151501615017150181501915020150211502215023150241502515026150271502815029150301503115032150331503415035150361503715038150391504015041150421504315044150451504615047150481504915050150511505215053150541505515056150571505815059150601506115062150631506415065150661506715068150691507015071150721507315074150751507615077150781507915080150811508215083150841508515086150871508815089150901509115092150931509415095150961509715098150991510015101151021510315104151051510615107151081510915110151111511215113151141511515116151171511815119151201512115122151231512415125151261512715128151291513015131151321513315134151351513615137151381513915140151411514215143151441514515146151471514815149151501515115152151531515415155151561515715158151591516015161151621516315164151651516615167151681516915170151711517215173151741517515176151771517815179151801518115182151831518415185151861518715188151891519015191151921519315194151951519615197151981519915200152011520215203152041520515206152071520815209152101521115212152131521415215152161521715218152191522015221152221522315224152251522615227152281522915230152311523215233152341523515236152371523815239152401524115242152431524415245152461524715248152491525015251152521525315254152551525615257152581525915260152611526215263152641526515266152671526815269152701527115272152731527415275152761527715278152791528015281152821528315284152851528615287152881528915290152911529215293152941529515296152971529815299153001530115302153031530415305153061530715308153091531015311153121531315314153151531615317153181531915320153211532215323153241532515326153271532815329153301533115332153331533415335153361533715338153391534015341153421534315344153451534615347153481534915350153511535215353153541535515356153571535815359153601536115362153631536415365153661536715368153691537015371153721537315374153751537615377153781537915380153811538215383153841538515386153871538815389153901539115392153931539415395153961539715398153991540015401154021540315404154051540615407154081540915410154111541215413154141541515416154171541815419154201542115422154231542415425154261542715428154291543015431154321543315434154351543615437154381543915440154411544215443154441544515446154471544815449154501545115452154531545415455154561545715458154591546015461154621546315464154651546615467154681546915470154711547215473154741547515476154771547815479154801548115482154831548415485154861548715488154891549015491154921549315494154951549615497154981549915500155011550215503155041550515506155071550815509155101551115512155131551415515155161551715518155191552015521155221552315524155251552615527155281552915530155311553215533155341553515536155371553815539155401554115542155431554415545155461554715548155491555015551155521555315554155551555615557155581555915560155611556215563155641556515566155671556815569155701557115572155731557415575155761557715578155791558015581155821558315584155851558615587155881558915590155911559215593155941559515596155971559815599156001560115602156031560415605156061560715608156091561015611156121561315614156151561615617156181561915620156211562215623156241562515626156271562815629156301563115632156331563415635156361563715638156391564015641156421564315644156451564615647156481564915650156511565215653156541565515656156571565815659156601566115662156631566415665156661566715668156691567015671156721567315674156751567615677156781567915680156811568215683156841568515686156871568815689156901569115692156931569415695156961569715698156991570015701157021570315704157051570615707157081570915710157111571215713157141571515716157171571815719157201572115722157231572415725157261572715728157291573015731157321573315734157351573615737157381573915740157411574215743157441574515746157471574815749157501575115752157531575415755157561575715758157591576015761157621576315764157651576615767157681576915770157711577215773157741577515776157771577815779157801578115782157831578415785157861578715788157891579015791157921579315794157951579615797157981579915800158011580215803158041580515806158071580815809158101581115812158131581415815158161581715818158191582015821158221582315824158251582615827158281582915830158311583215833158341583515836158371583815839158401584115842158431584415845158461584715848158491585015851158521585315854158551585615857158581585915860158611586215863158641586515866158671586815869158701587115872158731587415875158761587715878158791588015881158821588315884158851588615887158881588915890158911589215893158941589515896158971589815899159001590115902159031590415905159061590715908159091591015911159121591315914159151591615917159181591915920159211592215923159241592515926159271592815929159301593115932159331593415935159361593715938159391594015941159421594315944159451594615947159481594915950159511595215953159541595515956159571595815959159601596115962159631596415965159661596715968159691597015971159721597315974159751597615977159781597915980159811598215983159841598515986159871598815989159901599115992159931599415995159961599715998159991600016001160021600316004160051600616007160081600916010160111601216013160141601516016160171601816019160201602116022160231602416025160261602716028160291603016031160321603316034160351603616037160381603916040160411604216043160441604516046160471604816049160501605116052160531605416055160561605716058160591606016061160621606316064160651606616067160681606916070160711607216073160741607516076160771607816079160801608116082160831608416085160861608716088160891609016091160921609316094160951609616097160981609916100161011610216103161041610516106161071610816109161101611116112161131611416115161161611716118161191612016121161221612316124161251612616127161281612916130161311613216133161341613516136161371613816139161401614116142161431614416145161461614716148161491615016151161521615316154161551615616157161581615916160161611616216163161641616516166161671616816169161701617116172161731617416175161761617716178161791618016181161821618316184161851618616187161881618916190161911619216193161941619516196161971619816199162001620116202162031620416205162061620716208162091621016211162121621316214162151621616217162181621916220162211622216223162241622516226162271622816229162301623116232162331623416235162361623716238162391624016241162421624316244162451624616247162481624916250162511625216253162541625516256162571625816259162601626116262162631626416265162661626716268162691627016271162721627316274162751627616277162781627916280162811628216283162841628516286162871628816289162901629116292162931629416295162961629716298162991630016301163021630316304163051630616307163081630916310163111631216313163141631516316163171631816319163201632116322163231632416325163261632716328163291633016331163321633316334163351633616337163381633916340163411634216343163441634516346163471634816349163501635116352163531635416355163561635716358163591636016361163621636316364163651636616367163681636916370163711637216373163741637516376163771637816379163801638116382163831638416385163861638716388163891639016391163921639316394163951639616397163981639916400164011640216403164041640516406164071640816409164101641116412164131641416415164161641716418164191642016421164221642316424164251642616427164281642916430164311643216433164341643516436164371643816439164401644116442164431644416445164461644716448164491645016451164521645316454164551645616457164581645916460164611646216463164641646516466164671646816469164701647116472164731647416475164761647716478164791648016481164821648316484164851648616487164881648916490164911649216493164941649516496164971649816499165001650116502165031650416505165061650716508165091651016511165121651316514165151651616517165181651916520165211652216523165241652516526165271652816529165301653116532165331653416535165361653716538165391654016541165421654316544165451654616547165481654916550165511655216553165541655516556165571655816559165601656116562165631656416565165661656716568165691657016571165721657316574165751657616577165781657916580165811658216583165841658516586165871658816589165901659116592165931659416595165961659716598165991660016601166021660316604166051660616607166081660916610166111661216613166141661516616166171661816619166201662116622166231662416625166261662716628166291663016631166321663316634166351663616637166381663916640166411664216643166441664516646166471664816649166501665116652166531665416655166561665716658166591666016661166621666316664166651666616667166681666916670166711667216673166741667516676166771667816679166801668116682166831668416685166861668716688166891669016691166921669316694166951669616697166981669916700167011670216703167041670516706167071670816709167101671116712167131671416715167161671716718167191672016721167221672316724167251672616727167281672916730167311673216733167341673516736167371673816739167401674116742167431674416745167461674716748167491675016751167521675316754167551675616757167581675916760167611676216763167641676516766167671676816769167701677116772167731677416775167761677716778167791678016781167821678316784167851678616787167881678916790167911679216793167941679516796167971679816799168001680116802168031680416805168061680716808168091681016811168121681316814168151681616817168181681916820168211682216823168241682516826168271682816829168301683116832168331683416835168361683716838168391684016841168421684316844168451684616847168481684916850168511685216853168541685516856168571685816859168601686116862168631686416865168661686716868168691687016871168721687316874168751687616877168781687916880168811688216883168841688516886168871688816889168901689116892168931689416895168961689716898168991690016901169021690316904169051690616907169081690916910169111691216913169141691516916169171691816919169201692116922169231692416925169261692716928169291693016931169321693316934169351693616937169381693916940169411694216943169441694516946169471694816949169501695116952169531695416955169561695716958169591696016961169621696316964169651696616967169681696916970169711697216973169741697516976169771697816979169801698116982169831698416985169861698716988169891699016991169921699316994169951699616997169981699917000170011700217003170041700517006170071700817009170101701117012170131701417015170161701717018170191702017021170221702317024170251702617027170281702917030170311703217033170341703517036170371703817039170401704117042170431704417045170461704717048170491705017051170521705317054170551705617057170581705917060170611706217063170641706517066170671706817069170701707117072170731707417075170761707717078170791708017081170821708317084170851708617087170881708917090170911709217093170941709517096170971709817099171001710117102171031710417105171061710717108171091711017111171121711317114171151711617117171181711917120171211712217123171241712517126171271712817129171301713117132171331713417135171361713717138171391714017141171421714317144171451714617147171481714917150171511715217153171541715517156171571715817159171601716117162171631716417165171661716717168171691717017171171721717317174171751717617177171781717917180171811718217183171841718517186171871718817189171901719117192171931719417195171961719717198171991720017201172021720317204172051720617207172081720917210172111721217213172141721517216172171721817219172201722117222172231722417225172261722717228172291723017231172321723317234172351723617237172381723917240172411724217243172441724517246172471724817249172501725117252172531725417255172561725717258172591726017261172621726317264172651726617267172681726917270172711727217273172741727517276172771727817279172801728117282172831728417285172861728717288172891729017291172921729317294172951729617297172981729917300173011730217303173041730517306173071730817309173101731117312173131731417315173161731717318173191732017321173221732317324173251732617327173281732917330173311733217333173341733517336173371733817339173401734117342173431734417345173461734717348173491735017351173521735317354173551735617357173581735917360173611736217363173641736517366173671736817369173701737117372173731737417375173761737717378173791738017381173821738317384173851738617387173881738917390173911739217393173941739517396173971739817399174001740117402174031740417405174061740717408174091741017411174121741317414174151741617417174181741917420174211742217423174241742517426174271742817429174301743117432174331743417435174361743717438174391744017441174421744317444174451744617447174481744917450174511745217453174541745517456174571745817459174601746117462174631746417465174661746717468174691747017471174721747317474174751747617477174781747917480174811748217483174841748517486174871748817489174901749117492174931749417495174961749717498174991750017501175021750317504175051750617507175081750917510175111751217513175141751517516175171751817519175201752117522175231752417525175261752717528175291753017531175321753317534175351753617537175381753917540175411754217543175441754517546175471754817549175501755117552175531755417555175561755717558175591756017561175621756317564175651756617567175681756917570175711757217573175741757517576175771757817579175801758117582175831758417585175861758717588175891759017591175921759317594175951759617597175981759917600176011760217603176041760517606176071760817609176101761117612176131761417615176161761717618176191762017621176221762317624176251762617627176281762917630176311763217633176341763517636176371763817639176401764117642176431764417645176461764717648176491765017651176521765317654176551765617657176581765917660176611766217663176641766517666176671766817669176701767117672176731767417675176761767717678176791768017681176821768317684176851768617687176881768917690176911769217693176941769517696176971769817699177001770117702177031770417705177061770717708177091771017711177121771317714177151771617717177181771917720177211772217723177241772517726177271772817729177301773117732177331773417735177361773717738177391774017741177421774317744177451774617747177481774917750177511775217753177541775517756177571775817759177601776117762177631776417765177661776717768177691777017771177721777317774177751777617777177781777917780177811778217783177841778517786177871778817789177901779117792177931779417795177961779717798177991780017801178021780317804178051780617807178081780917810178111781217813178141781517816178171781817819178201782117822178231782417825178261782717828178291783017831178321783317834178351783617837178381783917840178411784217843178441784517846178471784817849178501785117852178531785417855178561785717858178591786017861178621786317864178651786617867178681786917870178711787217873178741787517876178771787817879178801788117882178831788417885178861788717888178891789017891178921789317894178951789617897178981789917900179011790217903179041790517906179071790817909179101791117912179131791417915179161791717918179191792017921179221792317924179251792617927179281792917930179311793217933179341793517936179371793817939179401794117942179431794417945179461794717948179491795017951179521795317954179551795617957179581795917960179611796217963179641796517966179671796817969179701797117972179731797417975179761797717978179791798017981179821798317984179851798617987179881798917990179911799217993179941799517996179971799817999180001800118002180031800418005180061800718008180091801018011180121801318014180151801618017180181801918020180211802218023180241802518026180271802818029180301803118032180331803418035180361803718038180391804018041180421804318044180451804618047180481804918050180511805218053180541805518056180571805818059180601806118062180631806418065180661806718068180691807018071180721807318074180751807618077180781807918080180811808218083180841808518086180871808818089180901809118092180931809418095180961809718098180991810018101181021810318104181051810618107181081810918110181111811218113181141811518116181171811818119181201812118122181231812418125181261812718128181291813018131181321813318134181351813618137181381813918140181411814218143181441814518146181471814818149181501815118152181531815418155181561815718158181591816018161181621816318164181651816618167181681816918170181711817218173181741817518176181771817818179181801818118182181831818418185181861818718188181891819018191181921819318194181951819618197181981819918200182011820218203182041820518206182071820818209182101821118212182131821418215182161821718218182191822018221182221822318224182251822618227182281822918230182311823218233182341823518236182371823818239182401824118242182431824418245182461824718248182491825018251182521825318254182551825618257182581825918260182611826218263182641826518266182671826818269182701827118272182731827418275182761827718278182791828018281182821828318284182851828618287182881828918290182911829218293182941829518296182971829818299183001830118302183031830418305183061830718308183091831018311183121831318314183151831618317183181831918320183211832218323183241832518326183271832818329183301833118332183331833418335183361833718338183391834018341183421834318344183451834618347183481834918350183511835218353183541835518356183571835818359183601836118362183631836418365183661836718368183691837018371183721837318374183751837618377183781837918380183811838218383183841838518386183871838818389183901839118392183931839418395183961839718398183991840018401184021840318404184051840618407184081840918410184111841218413184141841518416184171841818419184201842118422184231842418425184261842718428184291843018431184321843318434184351843618437184381843918440184411844218443184441844518446184471844818449184501845118452184531845418455184561845718458184591846018461184621846318464184651846618467184681846918470184711847218473184741847518476184771847818479184801848118482184831848418485184861848718488184891849018491184921849318494184951849618497184981849918500185011850218503185041850518506185071850818509185101851118512185131851418515185161851718518185191852018521185221852318524185251852618527185281852918530185311853218533185341853518536185371853818539185401854118542185431854418545185461854718548185491855018551185521855318554185551855618557185581855918560185611856218563185641856518566185671856818569185701857118572185731857418575185761857718578185791858018581185821858318584185851858618587185881858918590185911859218593185941859518596185971859818599186001860118602186031860418605186061860718608186091861018611186121861318614186151861618617186181861918620186211862218623186241862518626186271862818629186301863118632186331863418635186361863718638186391864018641186421864318644186451864618647186481864918650186511865218653186541865518656186571865818659186601866118662186631866418665186661866718668186691867018671186721867318674186751867618677186781867918680186811868218683186841868518686186871868818689186901869118692186931869418695186961869718698186991870018701187021870318704187051870618707187081870918710187111871218713187141871518716187171871818719187201872118722187231872418725187261872718728187291873018731187321873318734187351873618737187381873918740187411874218743187441874518746187471874818749187501875118752187531875418755187561875718758187591876018761187621876318764187651876618767187681876918770187711877218773187741877518776187771877818779187801878118782187831878418785187861878718788187891879018791187921879318794187951879618797187981879918800188011880218803188041880518806188071880818809188101881118812188131881418815188161881718818188191882018821188221882318824188251882618827188281882918830188311883218833188341883518836188371883818839188401884118842188431884418845188461884718848188491885018851188521885318854188551885618857188581885918860188611886218863188641886518866188671886818869188701887118872188731887418875188761887718878188791888018881188821888318884188851888618887188881888918890188911889218893188941889518896188971889818899189001890118902189031890418905189061890718908189091891018911189121891318914189151891618917189181891918920189211892218923189241892518926189271892818929189301893118932189331893418935189361893718938189391894018941189421894318944189451894618947189481894918950189511895218953189541895518956189571895818959189601896118962189631896418965189661896718968189691897018971189721897318974189751897618977189781897918980189811898218983189841898518986189871898818989189901899118992189931899418995189961899718998189991900019001190021900319004190051900619007190081900919010190111901219013190141901519016190171901819019190201902119022190231902419025190261902719028190291903019031190321903319034190351903619037190381903919040190411904219043190441904519046190471904819049190501905119052190531905419055190561905719058190591906019061190621906319064190651906619067190681906919070190711907219073190741907519076190771907819079190801908119082190831908419085190861908719088190891909019091190921909319094190951909619097190981909919100191011910219103191041910519106191071910819109191101911119112191131911419115191161911719118191191912019121191221912319124191251912619127191281912919130191311913219133191341913519136191371913819139191401914119142191431914419145191461914719148191491915019151191521915319154191551915619157191581915919160191611916219163191641916519166191671916819169191701917119172191731917419175191761917719178191791918019181191821918319184191851918619187191881918919190191911919219193191941919519196191971919819199192001920119202192031920419205192061920719208192091921019211192121921319214192151921619217192181921919220192211922219223192241922519226192271922819229192301923119232192331923419235192361923719238192391924019241192421924319244192451924619247192481924919250192511925219253192541925519256192571925819259192601926119262192631926419265192661926719268192691927019271192721927319274192751927619277192781927919280192811928219283192841928519286192871928819289192901929119292192931929419295192961929719298192991930019301193021930319304193051930619307193081930919310193111931219313193141931519316193171931819319193201932119322193231932419325193261932719328193291933019331193321933319334193351933619337193381933919340193411934219343193441934519346193471934819349193501935119352193531935419355193561935719358193591936019361193621936319364193651936619367193681936919370193711937219373193741937519376193771937819379193801938119382193831938419385193861938719388193891939019391193921939319394193951939619397193981939919400194011940219403194041940519406194071940819409194101941119412194131941419415194161941719418194191942019421194221942319424194251942619427194281942919430194311943219433194341943519436194371943819439194401944119442194431944419445194461944719448194491945019451194521945319454194551945619457194581945919460194611946219463194641946519466194671946819469194701947119472194731947419475194761947719478194791948019481194821948319484194851948619487194881948919490194911949219493194941949519496194971949819499195001950119502195031950419505195061950719508195091951019511195121951319514195151951619517195181951919520195211952219523195241952519526195271952819529195301953119532195331953419535195361953719538195391954019541195421954319544195451954619547195481954919550195511955219553195541955519556195571955819559195601956119562195631956419565195661956719568195691957019571195721957319574195751957619577195781957919580195811958219583195841958519586195871958819589195901959119592195931959419595195961959719598195991960019601196021960319604196051960619607196081960919610196111961219613196141961519616196171961819619196201962119622196231962419625196261962719628196291963019631196321963319634196351963619637196381963919640196411964219643196441964519646196471964819649196501965119652196531965419655196561965719658196591966019661196621966319664196651966619667196681966919670196711967219673196741967519676196771967819679196801968119682196831968419685196861968719688196891969019691196921969319694196951969619697196981969919700197011970219703197041970519706197071970819709197101971119712197131971419715197161971719718197191972019721197221972319724197251972619727197281972919730197311973219733197341973519736197371973819739197401974119742197431974419745197461974719748197491975019751197521975319754197551975619757197581975919760197611976219763197641976519766197671976819769197701977119772197731977419775197761977719778197791978019781197821978319784197851978619787197881978919790197911979219793197941979519796197971979819799198001980119802198031980419805198061980719808198091981019811198121981319814198151981619817198181981919820198211982219823198241982519826198271982819829198301983119832198331983419835198361983719838198391984019841198421984319844198451984619847198481984919850198511985219853198541985519856198571985819859198601986119862198631986419865198661986719868198691987019871198721987319874198751987619877198781987919880198811988219883198841988519886198871988819889198901989119892198931989419895198961989719898198991990019901199021990319904199051990619907199081990919910199111991219913199141991519916199171991819919199201992119922199231992419925199261992719928199291993019931199321993319934199351993619937199381993919940199411994219943199441994519946199471994819949199501995119952199531995419955199561995719958199591996019961199621996319964199651996619967199681996919970199711997219973199741997519976199771997819979199801998119982199831998419985199861998719988199891999019991199921999319994199951999619997199981999920000200012000220003200042000520006200072000820009200102001120012200132001420015200162001720018200192002020021200222002320024200252002620027200282002920030200312003220033200342003520036200372003820039200402004120042200432004420045200462004720048200492005020051200522005320054200552005620057200582005920060200612006220063200642006520066200672006820069200702007120072200732007420075200762007720078200792008020081200822008320084200852008620087200882008920090200912009220093200942009520096200972009820099201002010120102201032010420105201062010720108201092011020111201122011320114201152011620117201182011920120201212012220123201242012520126201272012820129201302013120132201332013420135201362013720138201392014020141201422014320144201452014620147201482014920150201512015220153201542015520156201572015820159201602016120162201632016420165201662016720168201692017020171201722017320174201752017620177201782017920180201812018220183201842018520186201872018820189201902019120192201932019420195201962019720198201992020020201202022020320204202052020620207202082020920210202112021220213202142021520216202172021820219202202022120222202232022420225202262022720228202292023020231202322023320234202352023620237202382023920240202412024220243202442024520246202472024820249202502025120252202532025420255202562025720258202592026020261202622026320264202652026620267202682026920270202712027220273202742027520276202772027820279202802028120282202832028420285202862028720288202892029020291202922029320294202952029620297202982029920300203012030220303203042030520306203072030820309203102031120312203132031420315203162031720318203192032020321203222032320324203252032620327203282032920330203312033220333203342033520336203372033820339203402034120342203432034420345203462034720348203492035020351203522035320354203552035620357203582035920360203612036220363203642036520366203672036820369203702037120372203732037420375203762037720378203792038020381203822038320384203852038620387203882038920390203912039220393203942039520396203972039820399204002040120402204032040420405204062040720408204092041020411204122041320414204152041620417204182041920420204212042220423204242042520426204272042820429204302043120432204332043420435204362043720438204392044020441204422044320444204452044620447204482044920450204512045220453204542045520456204572045820459204602046120462204632046420465204662046720468204692047020471204722047320474204752047620477204782047920480204812048220483204842048520486204872048820489204902049120492204932049420495204962049720498204992050020501205022050320504205052050620507205082050920510205112051220513205142051520516205172051820519205202052120522205232052420525205262052720528205292053020531205322053320534205352053620537205382053920540205412054220543205442054520546205472054820549205502055120552205532055420555205562055720558205592056020561205622056320564205652056620567205682056920570205712057220573205742057520576205772057820579205802058120582205832058420585205862058720588205892059020591205922059320594205952059620597205982059920600206012060220603206042060520606206072060820609206102061120612206132061420615206162061720618206192062020621206222062320624206252062620627206282062920630206312063220633206342063520636206372063820639206402064120642206432064420645206462064720648206492065020651206522065320654206552065620657206582065920660206612066220663206642066520666206672066820669206702067120672206732067420675206762067720678206792068020681206822068320684206852068620687206882068920690206912069220693206942069520696206972069820699207002070120702207032070420705207062070720708207092071020711207122071320714207152071620717207182071920720207212072220723207242072520726207272072820729207302073120732207332073420735207362073720738207392074020741207422074320744207452074620747207482074920750207512075220753207542075520756207572075820759207602076120762207632076420765207662076720768207692077020771207722077320774207752077620777207782077920780207812078220783207842078520786207872078820789207902079120792207932079420795207962079720798207992080020801208022080320804208052080620807208082080920810208112081220813208142081520816208172081820819208202082120822208232082420825208262082720828208292083020831208322083320834208352083620837208382083920840208412084220843208442084520846208472084820849208502085120852208532085420855208562085720858208592086020861208622086320864208652086620867208682086920870208712087220873208742087520876208772087820879208802088120882208832088420885208862088720888208892089020891208922089320894208952089620897208982089920900209012090220903209042090520906209072090820909209102091120912209132091420915209162091720918209192092020921209222092320924209252092620927209282092920930209312093220933209342093520936209372093820939209402094120942209432094420945209462094720948209492095020951209522095320954209552095620957209582095920960209612096220963209642096520966209672096820969209702097120972209732097420975209762097720978209792098020981209822098320984209852098620987209882098920990209912099220993209942099520996209972099820999210002100121002210032100421005210062100721008210092101021011210122101321014210152101621017210182101921020210212102221023210242102521026210272102821029210302103121032210332103421035210362103721038210392104021041210422104321044210452104621047210482104921050210512105221053210542105521056210572105821059210602106121062210632106421065210662106721068210692107021071210722107321074210752107621077210782107921080210812108221083210842108521086210872108821089210902109121092210932109421095210962109721098210992110021101211022110321104211052110621107211082110921110211112111221113211142111521116211172111821119211202112121122211232112421125211262112721128211292113021131211322113321134211352113621137211382113921140211412114221143211442114521146211472114821149211502115121152211532115421155211562115721158211592116021161211622116321164211652116621167211682116921170211712117221173211742117521176211772117821179211802118121182211832118421185211862118721188211892119021191211922119321194211952119621197211982119921200212012120221203212042120521206212072120821209212102121121212212132121421215212162121721218212192122021221212222122321224212252122621227212282122921230212312123221233212342123521236212372123821239212402124121242212432124421245212462124721248212492125021251212522125321254212552125621257212582125921260212612126221263212642126521266212672126821269212702127121272212732127421275212762127721278212792128021281212822128321284212852128621287212882128921290212912129221293212942129521296212972129821299213002130121302213032130421305213062130721308213092131021311213122131321314213152131621317213182131921320213212132221323213242132521326213272132821329213302133121332213332133421335213362133721338213392134021341213422134321344213452134621347213482134921350213512135221353213542135521356213572135821359213602136121362213632136421365213662136721368213692137021371213722137321374213752137621377213782137921380213812138221383213842138521386213872138821389213902139121392213932139421395213962139721398213992140021401214022140321404214052140621407214082140921410214112141221413214142141521416214172141821419214202142121422214232142421425214262142721428214292143021431214322143321434214352143621437214382143921440214412144221443214442144521446214472144821449214502145121452214532145421455214562145721458214592146021461214622146321464214652146621467214682146921470214712147221473214742147521476214772147821479214802148121482214832148421485214862148721488214892149021491214922149321494214952149621497214982149921500215012150221503215042150521506215072150821509215102151121512215132151421515215162151721518215192152021521215222152321524215252152621527215282152921530215312153221533215342153521536215372153821539215402154121542215432154421545215462154721548215492155021551215522155321554215552155621557215582155921560215612156221563215642156521566215672156821569215702157121572215732157421575215762157721578215792158021581215822158321584215852158621587215882158921590215912159221593215942159521596215972159821599216002160121602216032160421605216062160721608216092161021611216122161321614216152161621617216182161921620216212162221623216242162521626216272162821629216302163121632216332163421635216362163721638216392164021641216422164321644216452164621647216482164921650216512165221653216542165521656216572165821659216602166121662216632166421665216662166721668216692167021671216722167321674216752167621677216782167921680216812168221683216842168521686216872168821689216902169121692216932169421695216962169721698216992170021701217022170321704217052170621707217082170921710217112171221713217142171521716217172171821719217202172121722217232172421725217262172721728217292173021731217322173321734217352173621737217382173921740217412174221743217442174521746217472174821749217502175121752217532175421755217562175721758217592176021761217622176321764217652176621767217682176921770217712177221773217742177521776217772177821779217802178121782217832178421785217862178721788217892179021791217922179321794217952179621797217982179921800218012180221803218042180521806218072180821809218102181121812218132181421815218162181721818218192182021821218222182321824218252182621827218282182921830218312183221833218342183521836218372183821839218402184121842218432184421845218462184721848218492185021851218522185321854218552185621857218582185921860218612186221863218642186521866218672186821869218702187121872218732187421875218762187721878218792188021881218822188321884218852188621887218882188921890218912189221893218942189521896218972189821899219002190121902219032190421905219062190721908219092191021911219122191321914219152191621917219182191921920219212192221923219242192521926219272192821929219302193121932219332193421935219362193721938219392194021941219422194321944219452194621947219482194921950219512195221953219542195521956219572195821959219602196121962219632196421965219662196721968219692197021971219722197321974219752197621977219782197921980219812198221983219842198521986219872198821989219902199121992219932199421995219962199721998219992200022001220022200322004220052200622007220082200922010220112201222013220142201522016220172201822019220202202122022220232202422025220262202722028220292203022031220322203322034220352203622037220382203922040220412204222043220442204522046220472204822049220502205122052220532205422055220562205722058220592206022061220622206322064220652206622067220682206922070220712207222073220742207522076220772207822079220802208122082220832208422085220862208722088220892209022091220922209322094220952209622097220982209922100221012210222103221042210522106221072210822109221102211122112221132211422115221162211722118221192212022121221222212322124221252212622127221282212922130221312213222133221342213522136221372213822139221402214122142221432214422145221462214722148221492215022151221522215322154221552215622157221582215922160221612216222163221642216522166221672216822169221702217122172221732217422175221762217722178221792218022181221822218322184221852218622187221882218922190221912219222193221942219522196221972219822199222002220122202222032220422205222062220722208222092221022211222122221322214222152221622217222182221922220222212222222223222242222522226222272222822229222302223122232222332223422235222362223722238222392224022241222422224322244222452224622247222482224922250222512225222253222542225522256222572225822259222602226122262222632226422265222662226722268222692227022271222722227322274222752227622277222782227922280222812228222283222842228522286222872228822289222902229122292222932229422295222962229722298222992230022301223022230322304223052230622307223082230922310223112231222313223142231522316223172231822319223202232122322223232232422325223262232722328223292233022331223322233322334223352233622337223382233922340223412234222343223442234522346223472234822349223502235122352223532235422355223562235722358223592236022361223622236322364223652236622367223682236922370223712237222373223742237522376223772237822379223802238122382223832238422385223862238722388223892239022391223922239322394223952239622397223982239922400224012240222403224042240522406224072240822409224102241122412224132241422415224162241722418224192242022421224222242322424224252242622427224282242922430224312243222433224342243522436224372243822439224402244122442224432244422445224462244722448224492245022451224522245322454224552245622457224582245922460224612246222463224642246522466224672246822469224702247122472224732247422475224762247722478224792248022481224822248322484224852248622487224882248922490224912249222493224942249522496224972249822499225002250122502225032250422505225062250722508225092251022511225122251322514225152251622517225182251922520225212252222523225242252522526225272252822529225302253122532225332253422535225362253722538225392254022541225422254322544225452254622547225482254922550225512255222553225542255522556225572255822559225602256122562225632256422565225662256722568225692257022571225722257322574225752257622577225782257922580225812258222583225842258522586225872258822589225902259122592225932259422595225962259722598225992260022601226022260322604226052260622607226082260922610226112261222613226142261522616226172261822619226202262122622226232262422625226262262722628226292263022631226322263322634226352263622637226382263922640226412264222643226442264522646226472264822649226502265122652226532265422655226562265722658226592266022661226622266322664226652266622667226682266922670226712267222673226742267522676226772267822679226802268122682226832268422685226862268722688226892269022691226922269322694226952269622697226982269922700227012270222703227042270522706227072270822709227102271122712227132271422715227162271722718227192272022721227222272322724227252272622727227282272922730227312273222733227342273522736227372273822739227402274122742227432274422745227462274722748227492275022751227522275322754227552275622757227582275922760227612276222763227642276522766227672276822769227702277122772227732277422775227762277722778227792278022781227822278322784227852278622787227882278922790227912279222793227942279522796227972279822799228002280122802228032280422805228062280722808228092281022811228122281322814228152281622817228182281922820228212282222823228242282522826228272282822829228302283122832228332283422835228362283722838228392284022841228422284322844228452284622847228482284922850228512285222853228542285522856228572285822859228602286122862228632286422865228662286722868228692287022871228722287322874228752287622877228782287922880228812288222883228842288522886228872288822889228902289122892228932289422895228962289722898228992290022901229022290322904229052290622907229082290922910229112291222913229142291522916229172291822919229202292122922229232292422925229262292722928229292293022931229322293322934229352293622937229382293922940229412294222943229442294522946229472294822949229502295122952229532295422955229562295722958229592296022961229622296322964229652296622967229682296922970229712297222973229742297522976229772297822979229802298122982229832298422985229862298722988229892299022991229922299322994229952299622997229982299923000230012300223003230042300523006230072300823009230102301123012230132301423015230162301723018230192302023021230222302323024230252302623027230282302923030230312303223033230342303523036230372303823039230402304123042230432304423045230462304723048230492305023051230522305323054230552305623057230582305923060230612306223063230642306523066230672306823069230702307123072230732307423075230762307723078230792308023081230822308323084230852308623087230882308923090230912309223093230942309523096230972309823099231002310123102231032310423105231062310723108231092311023111231122311323114231152311623117231182311923120231212312223123231242312523126231272312823129231302313123132231332313423135231362313723138231392314023141231422314323144231452314623147231482314923150231512315223153231542315523156231572315823159231602316123162231632316423165231662316723168231692317023171231722317323174231752317623177231782317923180231812318223183231842318523186231872318823189231902319123192231932319423195231962319723198231992320023201232022320323204232052320623207232082320923210232112321223213232142321523216232172321823219232202322123222232232322423225232262322723228232292323023231232322323323234232352323623237232382323923240232412324223243232442324523246232472324823249232502325123252232532325423255232562325723258232592326023261232622326323264232652326623267232682326923270232712327223273232742327523276232772327823279232802328123282232832328423285232862328723288232892329023291232922329323294232952329623297232982329923300233012330223303233042330523306233072330823309233102331123312233132331423315233162331723318233192332023321233222332323324233252332623327233282332923330233312333223333233342333523336233372333823339233402334123342233432334423345233462334723348233492335023351233522335323354233552335623357233582335923360233612336223363233642336523366233672336823369233702337123372233732337423375233762337723378233792338023381233822338323384233852338623387233882338923390233912339223393233942339523396233972339823399234002340123402234032340423405234062340723408234092341023411234122341323414234152341623417234182341923420234212342223423234242342523426234272342823429234302343123432234332343423435234362343723438234392344023441234422344323444234452344623447234482344923450234512345223453234542345523456234572345823459234602346123462234632346423465234662346723468234692347023471234722347323474234752347623477234782347923480234812348223483234842348523486234872348823489234902349123492234932349423495234962349723498234992350023501235022350323504235052350623507235082350923510235112351223513235142351523516235172351823519235202352123522235232352423525235262352723528235292353023531235322353323534235352353623537235382353923540235412354223543235442354523546235472354823549235502355123552235532355423555235562355723558235592356023561235622356323564235652356623567235682356923570235712357223573235742357523576235772357823579235802358123582235832358423585235862358723588235892359023591235922359323594235952359623597235982359923600236012360223603236042360523606236072360823609236102361123612236132361423615236162361723618236192362023621236222362323624236252362623627236282362923630236312363223633236342363523636236372363823639236402364123642236432364423645236462364723648236492365023651236522365323654236552365623657236582365923660236612366223663236642366523666236672366823669236702367123672236732367423675236762367723678236792368023681236822368323684236852368623687236882368923690236912369223693236942369523696236972369823699237002370123702237032370423705237062370723708237092371023711237122371323714237152371623717237182371923720237212372223723237242372523726237272372823729237302373123732237332373423735237362373723738237392374023741237422374323744237452374623747237482374923750237512375223753237542375523756237572375823759237602376123762237632376423765237662376723768237692377023771237722377323774237752377623777237782377923780237812378223783237842378523786237872378823789237902379123792237932379423795237962379723798237992380023801238022380323804238052380623807238082380923810238112381223813238142381523816238172381823819238202382123822238232382423825238262382723828238292383023831238322383323834238352383623837238382383923840238412384223843238442384523846238472384823849238502385123852238532385423855238562385723858238592386023861238622386323864238652386623867238682386923870238712387223873238742387523876238772387823879238802388123882238832388423885238862388723888238892389023891238922389323894238952389623897238982389923900239012390223903239042390523906239072390823909239102391123912239132391423915239162391723918239192392023921239222392323924239252392623927239282392923930239312393223933239342393523936239372393823939239402394123942239432394423945239462394723948239492395023951239522395323954239552395623957239582395923960239612396223963239642396523966239672396823969239702397123972239732397423975239762397723978239792398023981239822398323984239852398623987239882398923990239912399223993239942399523996239972399823999240002400124002240032400424005240062400724008240092401024011240122401324014240152401624017240182401924020240212402224023240242402524026240272402824029240302403124032240332403424035240362403724038240392404024041240422404324044240452404624047240482404924050240512405224053240542405524056240572405824059240602406124062240632406424065240662406724068240692407024071240722407324074240752407624077240782407924080240812408224083240842408524086240872408824089240902409124092240932409424095240962409724098240992410024101241022410324104241052410624107241082410924110241112411224113241142411524116241172411824119241202412124122241232412424125241262412724128241292413024131241322413324134241352413624137241382413924140241412414224143241442414524146241472414824149241502415124152241532415424155241562415724158241592416024161241622416324164241652416624167241682416924170241712417224173241742417524176241772417824179241802418124182241832418424185241862418724188241892419024191241922419324194241952419624197241982419924200242012420224203242042420524206242072420824209242102421124212242132421424215242162421724218242192422024221242222422324224242252422624227242282422924230242312423224233242342423524236242372423824239242402424124242242432424424245242462424724248242492425024251242522425324254242552425624257242582425924260242612426224263242642426524266242672426824269242702427124272242732427424275242762427724278242792428024281242822428324284242852428624287242882428924290242912429224293242942429524296242972429824299243002430124302243032430424305243062430724308243092431024311243122431324314243152431624317243182431924320243212432224323243242432524326243272432824329243302433124332243332433424335243362433724338243392434024341243422434324344243452434624347243482434924350243512435224353243542435524356243572435824359243602436124362243632436424365243662436724368243692437024371243722437324374243752437624377243782437924380243812438224383243842438524386243872438824389243902439124392243932439424395243962439724398243992440024401244022440324404244052440624407244082440924410244112441224413244142441524416244172441824419244202442124422244232442424425244262442724428244292443024431244322443324434244352443624437244382443924440244412444224443244442444524446244472444824449244502445124452244532445424455244562445724458244592446024461244622446324464244652446624467244682446924470244712447224473244742447524476244772447824479244802448124482244832448424485244862448724488244892449024491244922449324494244952449624497244982449924500245012450224503245042450524506245072450824509245102451124512245132451424515245162451724518245192452024521245222452324524245252452624527245282452924530245312453224533245342453524536245372453824539245402454124542245432454424545245462454724548245492455024551245522455324554245552455624557245582455924560245612456224563245642456524566245672456824569245702457124572245732457424575245762457724578245792458024581245822458324584245852458624587245882458924590245912459224593245942459524596245972459824599246002460124602246032460424605246062460724608246092461024611246122461324614246152461624617246182461924620246212462224623246242462524626246272462824629246302463124632246332463424635246362463724638246392464024641246422464324644246452464624647246482464924650246512465224653246542465524656246572465824659246602466124662246632466424665246662466724668246692467024671246722467324674246752467624677246782467924680246812468224683246842468524686246872468824689246902469124692246932469424695246962469724698246992470024701247022470324704247052470624707247082470924710247112471224713247142471524716247172471824719247202472124722247232472424725247262472724728247292473024731247322473324734247352473624737247382473924740247412474224743247442474524746247472474824749247502475124752247532475424755247562475724758247592476024761247622476324764247652476624767247682476924770247712477224773247742477524776247772477824779247802478124782247832478424785247862478724788247892479024791247922479324794247952479624797247982479924800248012480224803248042480524806248072480824809248102481124812248132481424815248162481724818248192482024821248222482324824248252482624827248282482924830248312483224833248342483524836248372483824839248402484124842248432484424845248462484724848248492485024851248522485324854248552485624857248582485924860248612486224863248642486524866248672486824869248702487124872248732487424875248762487724878248792488024881248822488324884248852488624887248882488924890248912489224893248942489524896248972489824899249002490124902249032490424905249062490724908249092491024911249122491324914249152491624917249182491924920249212492224923249242492524926249272492824929249302493124932249332493424935249362493724938249392494024941249422494324944249452494624947249482494924950249512495224953249542495524956249572495824959249602496124962249632496424965249662496724968249692497024971249722497324974249752497624977249782497924980249812498224983249842498524986249872498824989249902499124992249932499424995249962499724998249992500025001250022500325004250052500625007250082500925010250112501225013250142501525016250172501825019250202502125022250232502425025250262502725028250292503025031250322503325034250352503625037250382503925040250412504225043250442504525046250472504825049250502505125052250532505425055250562505725058250592506025061250622506325064250652506625067250682506925070250712507225073250742507525076250772507825079250802508125082250832508425085250862508725088250892509025091250922509325094250952509625097250982509925100251012510225103251042510525106251072510825109251102511125112251132511425115251162511725118251192512025121251222512325124251252512625127251282512925130251312513225133251342513525136251372513825139251402514125142251432514425145251462514725148251492515025151251522515325154251552515625157251582515925160251612516225163251642516525166251672516825169251702517125172251732517425175251762517725178251792518025181251822518325184251852518625187251882518925190251912519225193251942519525196251972519825199252002520125202252032520425205252062520725208252092521025211252122521325214252152521625217252182521925220252212522225223252242522525226252272522825229252302523125232252332523425235252362523725238252392524025241252422524325244252452524625247252482524925250252512525225253252542525525256252572525825259252602526125262252632526425265252662526725268252692527025271252722527325274252752527625277252782527925280252812528225283252842528525286252872528825289252902529125292252932529425295252962529725298252992530025301253022530325304253052530625307253082530925310253112531225313253142531525316253172531825319253202532125322253232532425325253262532725328253292533025331253322533325334253352533625337253382533925340253412534225343253442534525346253472534825349253502535125352253532535425355253562535725358253592536025361253622536325364253652536625367253682536925370253712537225373253742537525376253772537825379253802538125382253832538425385253862538725388253892539025391253922539325394253952539625397253982539925400254012540225403254042540525406254072540825409254102541125412254132541425415254162541725418254192542025421254222542325424254252542625427254282542925430254312543225433254342543525436254372543825439254402544125442254432544425445254462544725448254492545025451254522545325454254552545625457254582545925460254612546225463254642546525466254672546825469254702547125472254732547425475254762547725478254792548025481254822548325484254852548625487254882548925490254912549225493254942549525496254972549825499255002550125502255032550425505255062550725508255092551025511255122551325514255152551625517255182551925520255212552225523255242552525526255272552825529255302553125532255332553425535255362553725538255392554025541255422554325544255452554625547255482554925550255512555225553255542555525556255572555825559255602556125562255632556425565255662556725568255692557025571255722557325574255752557625577255782557925580255812558225583255842558525586255872558825589255902559125592255932559425595255962559725598255992560025601256022560325604256052560625607256082560925610256112561225613256142561525616256172561825619256202562125622256232562425625256262562725628256292563025631256322563325634256352563625637256382563925640256412564225643256442564525646256472564825649256502565125652256532565425655256562565725658256592566025661256622566325664256652566625667256682566925670256712567225673256742567525676256772567825679256802568125682256832568425685256862568725688256892569025691256922569325694256952569625697256982569925700257012570225703257042570525706257072570825709257102571125712257132571425715257162571725718257192572025721257222572325724257252572625727257282572925730257312573225733257342573525736257372573825739257402574125742257432574425745257462574725748257492575025751257522575325754257552575625757257582575925760257612576225763257642576525766257672576825769257702577125772257732577425775257762577725778257792578025781257822578325784257852578625787257882578925790257912579225793257942579525796257972579825799258002580125802258032580425805258062580725808258092581025811258122581325814258152581625817258182581925820258212582225823258242582525826258272582825829258302583125832258332583425835258362583725838258392584025841258422584325844258452584625847258482584925850258512585225853258542585525856258572585825859258602586125862258632586425865258662586725868258692587025871258722587325874258752587625877258782587925880258812588225883258842588525886258872588825889258902589125892258932589425895258962589725898258992590025901259022590325904259052590625907259082590925910259112591225913259142591525916259172591825919259202592125922259232592425925259262592725928259292593025931259322593325934259352593625937259382593925940259412594225943259442594525946259472594825949259502595125952259532595425955259562595725958259592596025961259622596325964259652596625967259682596925970259712597225973259742597525976259772597825979259802598125982259832598425985259862598725988259892599025991259922599325994259952599625997259982599926000260012600226003260042600526006260072600826009260102601126012260132601426015260162601726018260192602026021260222602326024260252602626027260282602926030260312603226033260342603526036260372603826039260402604126042260432604426045260462604726048260492605026051260522605326054260552605626057260582605926060260612606226063260642606526066260672606826069260702607126072260732607426075260762607726078260792608026081260822608326084260852608626087260882608926090260912609226093260942609526096260972609826099261002610126102261032610426105261062610726108261092611026111261122611326114261152611626117261182611926120261212612226123261242612526126261272612826129261302613126132261332613426135261362613726138261392614026141261422614326144261452614626147261482614926150261512615226153261542615526156261572615826159261602616126162261632616426165261662616726168261692617026171261722617326174261752617626177261782617926180261812618226183261842618526186261872618826189261902619126192261932619426195261962619726198261992620026201262022620326204262052620626207262082620926210262112621226213262142621526216262172621826219262202622126222262232622426225262262622726228262292623026231262322623326234262352623626237262382623926240262412624226243262442624526246262472624826249262502625126252262532625426255262562625726258262592626026261262622626326264262652626626267262682626926270262712627226273262742627526276262772627826279262802628126282262832628426285262862628726288262892629026291262922629326294262952629626297262982629926300263012630226303263042630526306263072630826309263102631126312263132631426315263162631726318263192632026321263222632326324263252632626327263282632926330263312633226333263342633526336263372633826339263402634126342263432634426345263462634726348263492635026351263522635326354263552635626357263582635926360263612636226363263642636526366263672636826369263702637126372263732637426375263762637726378263792638026381263822638326384263852638626387263882638926390263912639226393263942639526396263972639826399264002640126402264032640426405264062640726408264092641026411264122641326414264152641626417264182641926420264212642226423264242642526426264272642826429264302643126432264332643426435264362643726438264392644026441264422644326444264452644626447264482644926450264512645226453264542645526456264572645826459264602646126462264632646426465264662646726468264692647026471264722647326474264752647626477264782647926480264812648226483264842648526486264872648826489264902649126492264932649426495264962649726498264992650026501265022650326504265052650626507265082650926510265112651226513265142651526516265172651826519265202652126522265232652426525265262652726528265292653026531265322653326534265352653626537265382653926540265412654226543265442654526546265472654826549265502655126552265532655426555265562655726558265592656026561265622656326564265652656626567265682656926570265712657226573265742657526576265772657826579265802658126582265832658426585265862658726588265892659026591265922659326594265952659626597265982659926600266012660226603266042660526606266072660826609266102661126612266132661426615266162661726618266192662026621266222662326624266252662626627266282662926630266312663226633266342663526636266372663826639266402664126642266432664426645266462664726648266492665026651266522665326654266552665626657266582665926660266612666226663266642666526666266672666826669266702667126672266732667426675266762667726678266792668026681266822668326684266852668626687266882668926690266912669226693266942669526696266972669826699267002670126702267032670426705267062670726708267092671026711267122671326714267152671626717267182671926720267212672226723267242672526726267272672826729267302673126732267332673426735267362673726738267392674026741267422674326744267452674626747267482674926750267512675226753267542675526756267572675826759267602676126762267632676426765267662676726768267692677026771267722677326774267752677626777267782677926780267812678226783267842678526786267872678826789267902679126792267932679426795267962679726798267992680026801268022680326804268052680626807268082680926810268112681226813268142681526816268172681826819268202682126822268232682426825268262682726828268292683026831268322683326834268352683626837268382683926840268412684226843268442684526846268472684826849268502685126852268532685426855268562685726858268592686026861268622686326864268652686626867268682686926870268712687226873268742687526876268772687826879268802688126882268832688426885268862688726888268892689026891268922689326894268952689626897268982689926900269012690226903269042690526906269072690826909269102691126912269132691426915269162691726918269192692026921269222692326924269252692626927269282692926930269312693226933269342693526936269372693826939269402694126942269432694426945269462694726948269492695026951269522695326954269552695626957269582695926960269612696226963269642696526966269672696826969269702697126972269732697426975269762697726978269792698026981269822698326984269852698626987269882698926990269912699226993269942699526996269972699826999270002700127002270032700427005270062700727008270092701027011270122701327014270152701627017270182701927020270212702227023270242702527026270272702827029270302703127032270332703427035270362703727038270392704027041270422704327044270452704627047270482704927050270512705227053270542705527056270572705827059270602706127062270632706427065270662706727068270692707027071270722707327074270752707627077270782707927080270812708227083270842708527086270872708827089270902709127092270932709427095270962709727098270992710027101271022710327104271052710627107271082710927110271112711227113271142711527116271172711827119271202712127122271232712427125271262712727128271292713027131271322713327134271352713627137271382713927140271412714227143271442714527146271472714827149271502715127152271532715427155271562715727158271592716027161271622716327164271652716627167271682716927170271712717227173271742717527176271772717827179271802718127182271832718427185271862718727188271892719027191271922719327194271952719627197271982719927200272012720227203272042720527206272072720827209272102721127212272132721427215272162721727218272192722027221272222722327224272252722627227272282722927230272312723227233272342723527236272372723827239272402724127242272432724427245272462724727248272492725027251272522725327254272552725627257272582725927260272612726227263272642726527266272672726827269272702727127272272732727427275272762727727278272792728027281272822728327284272852728627287272882728927290272912729227293272942729527296272972729827299273002730127302273032730427305273062730727308273092731027311273122731327314273152731627317273182731927320273212732227323273242732527326273272732827329273302733127332273332733427335273362733727338273392734027341273422734327344273452734627347273482734927350273512735227353273542735527356273572735827359273602736127362273632736427365273662736727368273692737027371273722737327374273752737627377273782737927380273812738227383273842738527386273872738827389273902739127392273932739427395273962739727398273992740027401274022740327404274052740627407274082740927410274112741227413274142741527416274172741827419274202742127422274232742427425274262742727428274292743027431274322743327434274352743627437274382743927440274412744227443274442744527446274472744827449274502745127452274532745427455274562745727458274592746027461274622746327464274652746627467274682746927470274712747227473274742747527476274772747827479274802748127482274832748427485274862748727488274892749027491274922749327494274952749627497274982749927500275012750227503275042750527506275072750827509275102751127512275132751427515275162751727518275192752027521275222752327524275252752627527275282752927530275312753227533275342753527536275372753827539275402754127542275432754427545275462754727548275492755027551275522755327554275552755627557275582755927560275612756227563275642756527566275672756827569275702757127572275732757427575275762757727578275792758027581275822758327584275852758627587275882758927590275912759227593275942759527596275972759827599276002760127602276032760427605276062760727608276092761027611276122761327614276152761627617276182761927620276212762227623276242762527626276272762827629276302763127632276332763427635276362763727638276392764027641276422764327644276452764627647276482764927650276512765227653276542765527656276572765827659276602766127662276632766427665276662766727668276692767027671276722767327674276752767627677276782767927680276812768227683276842768527686276872768827689276902769127692276932769427695276962769727698276992770027701277022770327704277052770627707277082770927710277112771227713277142771527716277172771827719277202772127722277232772427725277262772727728277292773027731277322773327734277352773627737277382773927740277412774227743277442774527746277472774827749277502775127752277532775427755277562775727758277592776027761277622776327764277652776627767277682776927770277712777227773277742777527776277772777827779277802778127782277832778427785277862778727788277892779027791277922779327794277952779627797277982779927800278012780227803278042780527806278072780827809278102781127812278132781427815278162781727818278192782027821278222782327824278252782627827278282782927830278312783227833278342783527836278372783827839278402784127842278432784427845278462784727848278492785027851278522785327854278552785627857278582785927860278612786227863278642786527866278672786827869278702787127872278732787427875278762787727878278792788027881278822788327884278852788627887278882788927890278912789227893278942789527896278972789827899279002790127902279032790427905279062790727908279092791027911279122791327914279152791627917279182791927920279212792227923279242792527926279272792827929279302793127932279332793427935279362793727938279392794027941279422794327944279452794627947279482794927950279512795227953279542795527956279572795827959279602796127962279632796427965279662796727968279692797027971279722797327974279752797627977279782797927980279812798227983279842798527986279872798827989279902799127992279932799427995279962799727998279992800028001280022800328004280052800628007280082800928010280112801228013280142801528016280172801828019280202802128022280232802428025280262802728028280292803028031280322803328034280352803628037280382803928040280412804228043280442804528046280472804828049280502805128052280532805428055280562805728058280592806028061280622806328064280652806628067280682806928070280712807228073280742807528076280772807828079280802808128082280832808428085280862808728088280892809028091280922809328094280952809628097280982809928100281012810228103281042810528106281072810828109281102811128112281132811428115281162811728118281192812028121281222812328124281252812628127281282812928130281312813228133281342813528136281372813828139281402814128142281432814428145281462814728148281492815028151281522815328154281552815628157281582815928160281612816228163281642816528166281672816828169281702817128172281732817428175281762817728178281792818028181281822818328184281852818628187281882818928190281912819228193281942819528196281972819828199282002820128202282032820428205282062820728208282092821028211282122821328214282152821628217282182821928220282212822228223282242822528226282272822828229282302823128232282332823428235282362823728238282392824028241282422824328244282452824628247282482824928250282512825228253282542825528256282572825828259282602826128262282632826428265282662826728268282692827028271282722827328274282752827628277282782827928280282812828228283282842828528286282872828828289282902829128292282932829428295282962829728298282992830028301283022830328304283052830628307283082830928310283112831228313283142831528316283172831828319283202832128322283232832428325283262832728328283292833028331283322833328334283352833628337283382833928340283412834228343283442834528346283472834828349283502835128352283532835428355283562835728358283592836028361283622836328364283652836628367283682836928370283712837228373283742837528376283772837828379283802838128382283832838428385283862838728388283892839028391283922839328394283952839628397283982839928400284012840228403284042840528406284072840828409284102841128412284132841428415284162841728418284192842028421284222842328424284252842628427284282842928430284312843228433284342843528436284372843828439284402844128442284432844428445284462844728448284492845028451284522845328454284552845628457284582845928460284612846228463284642846528466284672846828469284702847128472284732847428475284762847728478284792848028481284822848328484284852848628487284882848928490284912849228493284942849528496284972849828499285002850128502285032850428505285062850728508285092851028511285122851328514285152851628517285182851928520285212852228523285242852528526285272852828529285302853128532285332853428535285362853728538285392854028541285422854328544285452854628547285482854928550285512855228553285542855528556285572855828559285602856128562285632856428565285662856728568285692857028571285722857328574285752857628577285782857928580285812858228583285842858528586285872858828589285902859128592285932859428595285962859728598285992860028601286022860328604286052860628607286082860928610286112861228613286142861528616286172861828619286202862128622286232862428625286262862728628286292863028631286322863328634286352863628637286382863928640286412864228643286442864528646286472864828649286502865128652286532865428655286562865728658286592866028661286622866328664286652866628667286682866928670286712867228673286742867528676286772867828679286802868128682286832868428685286862868728688286892869028691286922869328694286952869628697286982869928700287012870228703287042870528706287072870828709287102871128712287132871428715287162871728718287192872028721287222872328724287252872628727287282872928730287312873228733287342873528736287372873828739287402874128742287432874428745287462874728748287492875028751287522875328754287552875628757287582875928760287612876228763287642876528766287672876828769287702877128772287732877428775287762877728778287792878028781287822878328784287852878628787287882878928790287912879228793287942879528796287972879828799288002880128802288032880428805288062880728808288092881028811288122881328814288152881628817288182881928820288212882228823288242882528826288272882828829288302883128832288332883428835288362883728838288392884028841288422884328844288452884628847288482884928850288512885228853288542885528856288572885828859288602886128862288632886428865288662886728868288692887028871288722887328874288752887628877288782887928880288812888228883288842888528886288872888828889288902889128892288932889428895288962889728898288992890028901289022890328904289052890628907289082890928910289112891228913289142891528916289172891828919289202892128922289232892428925289262892728928289292893028931289322893328934289352893628937289382893928940289412894228943289442894528946289472894828949289502895128952289532895428955289562895728958289592896028961289622896328964289652896628967289682896928970289712897228973289742897528976289772897828979289802898128982289832898428985289862898728988289892899028991289922899328994289952899628997289982899929000290012900229003290042900529006290072900829009290102901129012290132901429015290162901729018290192902029021290222902329024290252902629027290282902929030290312903229033290342903529036290372903829039290402904129042290432904429045290462904729048290492905029051290522905329054290552905629057290582905929060290612906229063290642906529066290672906829069290702907129072290732907429075290762907729078290792908029081290822908329084290852908629087290882908929090290912909229093290942909529096290972909829099291002910129102291032910429105291062910729108291092911029111291122911329114291152911629117291182911929120291212912229123291242912529126291272912829129291302913129132291332913429135291362913729138291392914029141291422914329144291452914629147291482914929150291512915229153291542915529156291572915829159291602916129162291632916429165291662916729168291692917029171291722917329174291752917629177291782917929180291812918229183291842918529186291872918829189291902919129192291932919429195291962919729198291992920029201292022920329204292052920629207292082920929210292112921229213292142921529216292172921829219292202922129222292232922429225292262922729228292292923029231292322923329234292352923629237292382923929240292412924229243292442924529246292472924829249292502925129252292532925429255292562925729258292592926029261292622926329264292652926629267292682926929270292712927229273292742927529276292772927829279292802928129282292832928429285292862928729288292892929029291292922929329294292952929629297292982929929300293012930229303293042930529306293072930829309293102931129312293132931429315293162931729318293192932029321293222932329324293252932629327293282932929330293312933229333293342933529336293372933829339293402934129342293432934429345293462934729348293492935029351293522935329354293552935629357293582935929360293612936229363293642936529366293672936829369293702937129372293732937429375293762937729378293792938029381293822938329384293852938629387293882938929390293912939229393293942939529396293972939829399294002940129402294032940429405294062940729408294092941029411294122941329414294152941629417294182941929420294212942229423294242942529426294272942829429294302943129432294332943429435294362943729438294392944029441294422944329444294452944629447294482944929450294512945229453294542945529456294572945829459294602946129462294632946429465294662946729468294692947029471294722947329474294752947629477294782947929480294812948229483294842948529486294872948829489294902949129492294932949429495294962949729498294992950029501295022950329504295052950629507295082950929510295112951229513295142951529516295172951829519295202952129522295232952429525295262952729528295292953029531295322953329534295352953629537295382953929540295412954229543295442954529546295472954829549295502955129552295532955429555295562955729558295592956029561295622956329564295652956629567295682956929570295712957229573295742957529576295772957829579295802958129582295832958429585295862958729588295892959029591295922959329594295952959629597295982959929600296012960229603296042960529606296072960829609296102961129612296132961429615296162961729618296192962029621296222962329624296252962629627296282962929630296312963229633296342963529636296372963829639296402964129642296432964429645296462964729648296492965029651296522965329654296552965629657296582965929660296612966229663296642966529666296672966829669296702967129672296732967429675296762967729678296792968029681296822968329684296852968629687296882968929690296912969229693296942969529696296972969829699297002970129702297032970429705297062970729708297092971029711297122971329714297152971629717297182971929720297212972229723297242972529726297272972829729297302973129732297332973429735297362973729738297392974029741297422974329744297452974629747297482974929750297512975229753297542975529756297572975829759297602976129762297632976429765297662976729768297692977029771297722977329774297752977629777297782977929780297812978229783297842978529786297872978829789297902979129792297932979429795297962979729798297992980029801298022980329804298052980629807298082980929810298112981229813298142981529816298172981829819298202982129822298232982429825298262982729828298292983029831298322983329834298352983629837298382983929840298412984229843298442984529846298472984829849298502985129852298532985429855298562985729858298592986029861298622986329864298652986629867298682986929870298712987229873298742987529876298772987829879298802988129882298832988429885298862988729888298892989029891298922989329894298952989629897298982989929900299012990229903299042990529906299072990829909299102991129912299132991429915299162991729918299192992029921299222992329924299252992629927299282992929930299312993229933299342993529936299372993829939299402994129942299432994429945299462994729948299492995029951299522995329954299552995629957299582995929960299612996229963299642996529966299672996829969299702997129972299732997429975299762997729978299792998029981299822998329984299852998629987299882998929990299912999229993299942999529996299972999829999300003000130002300033000430005300063000730008300093001030011300123001330014300153001630017300183001930020300213002230023300243002530026300273002830029300303003130032300333003430035300363003730038300393004030041300423004330044300453004630047300483004930050300513005230053300543005530056300573005830059300603006130062300633006430065300663006730068300693007030071300723007330074300753007630077300783007930080300813008230083300843008530086300873008830089300903009130092300933009430095300963009730098300993010030101301023010330104301053010630107301083010930110301113011230113301143011530116301173011830119301203012130122301233012430125301263012730128301293013030131301323013330134301353013630137301383013930140301413014230143301443014530146301473014830149301503015130152301533015430155301563015730158301593016030161301623016330164301653016630167301683016930170301713017230173301743017530176301773017830179301803018130182301833018430185301863018730188301893019030191301923019330194301953019630197301983019930200302013020230203302043020530206302073020830209302103021130212302133021430215302163021730218302193022030221302223022330224302253022630227302283022930230302313023230233302343023530236302373023830239302403024130242302433024430245302463024730248302493025030251302523025330254302553025630257302583025930260302613026230263302643026530266302673026830269302703027130272302733027430275302763027730278302793028030281302823028330284302853028630287302883028930290302913029230293302943029530296302973029830299303003030130302303033030430305303063030730308303093031030311303123031330314303153031630317303183031930320303213032230323303243032530326303273032830329303303033130332303333033430335303363033730338303393034030341303423034330344303453034630347303483034930350303513035230353303543035530356303573035830359303603036130362303633036430365303663036730368303693037030371303723037330374303753037630377303783037930380303813038230383303843038530386303873038830389303903039130392303933039430395303963039730398303993040030401304023040330404304053040630407304083040930410304113041230413304143041530416304173041830419304203042130422304233042430425304263042730428304293043030431304323043330434304353043630437304383043930440304413044230443304443044530446304473044830449304503045130452304533045430455304563045730458304593046030461304623046330464304653046630467304683046930470304713047230473304743047530476304773047830479304803048130482304833048430485304863048730488304893049030491304923049330494304953049630497304983049930500305013050230503305043050530506305073050830509305103051130512305133051430515305163051730518305193052030521305223052330524305253052630527305283052930530305313053230533305343053530536305373053830539305403054130542305433054430545305463054730548305493055030551305523055330554305553055630557305583055930560305613056230563305643056530566305673056830569305703057130572305733057430575305763057730578305793058030581305823058330584305853058630587305883058930590305913059230593305943059530596305973059830599306003060130602306033060430605306063060730608306093061030611306123061330614306153061630617306183061930620306213062230623306243062530626306273062830629306303063130632306333063430635306363063730638306393064030641306423064330644306453064630647306483064930650306513065230653306543065530656306573065830659306603066130662306633066430665306663066730668306693067030671306723067330674306753067630677306783067930680306813068230683306843068530686306873068830689306903069130692306933069430695306963069730698306993070030701307023070330704307053070630707307083070930710307113071230713307143071530716307173071830719307203072130722307233072430725307263072730728307293073030731307323073330734307353073630737307383073930740307413074230743307443074530746307473074830749307503075130752307533075430755307563075730758307593076030761307623076330764307653076630767307683076930770307713077230773307743077530776307773077830779307803078130782307833078430785307863078730788307893079030791307923079330794307953079630797307983079930800308013080230803308043080530806308073080830809308103081130812308133081430815308163081730818308193082030821308223082330824308253082630827308283082930830308313083230833308343083530836308373083830839308403084130842308433084430845308463084730848308493085030851308523085330854308553085630857308583085930860308613086230863308643086530866308673086830869308703087130872308733087430875308763087730878308793088030881308823088330884308853088630887308883088930890308913089230893308943089530896308973089830899309003090130902309033090430905309063090730908309093091030911309123091330914309153091630917309183091930920309213092230923309243092530926309273092830929309303093130932309333093430935309363093730938309393094030941309423094330944309453094630947309483094930950309513095230953309543095530956309573095830959309603096130962309633096430965309663096730968309693097030971309723097330974309753097630977309783097930980309813098230983309843098530986309873098830989309903099130992309933099430995309963099730998309993100031001310023100331004310053100631007310083100931010310113101231013310143101531016310173101831019310203102131022310233102431025310263102731028310293103031031310323103331034310353103631037310383103931040310413104231043310443104531046310473104831049310503105131052310533105431055310563105731058310593106031061310623106331064310653106631067310683106931070310713107231073310743107531076310773107831079310803108131082310833108431085310863108731088310893109031091310923109331094310953109631097310983109931100311013110231103311043110531106311073110831109311103111131112311133111431115311163111731118311193112031121311223112331124311253112631127311283112931130311313113231133311343113531136311373113831139311403114131142311433114431145311463114731148311493115031151311523115331154311553115631157311583115931160311613116231163311643116531166311673116831169311703117131172311733117431175311763117731178311793118031181311823118331184311853118631187311883118931190311913119231193311943119531196311973119831199312003120131202312033120431205312063120731208312093121031211312123121331214312153121631217312183121931220312213122231223312243122531226312273122831229312303123131232312333123431235312363123731238312393124031241312423124331244312453124631247312483124931250312513125231253312543125531256312573125831259312603126131262312633126431265312663126731268312693127031271312723127331274312753127631277312783127931280312813128231283312843128531286312873128831289312903129131292312933129431295312963129731298312993130031301313023130331304313053130631307313083130931310313113131231313313143131531316313173131831319313203132131322313233132431325313263132731328313293133031331313323133331334313353133631337313383133931340313413134231343313443134531346313473134831349313503135131352313533135431355313563135731358313593136031361313623136331364313653136631367313683136931370313713137231373313743137531376313773137831379313803138131382313833138431385313863138731388313893139031391313923139331394313953139631397313983139931400314013140231403314043140531406314073140831409314103141131412314133141431415314163141731418314193142031421314223142331424314253142631427314283142931430314313143231433314343143531436314373143831439314403144131442314433144431445314463144731448314493145031451314523145331454314553145631457314583145931460314613146231463314643146531466314673146831469314703147131472314733147431475314763147731478314793148031481314823148331484314853148631487314883148931490314913149231493314943149531496314973149831499315003150131502315033150431505315063150731508315093151031511315123151331514315153151631517315183151931520315213152231523315243152531526315273152831529315303153131532315333153431535315363153731538315393154031541315423154331544315453154631547315483154931550315513155231553315543155531556315573155831559315603156131562315633156431565315663156731568315693157031571315723157331574315753157631577315783157931580315813158231583315843158531586315873158831589315903159131592315933159431595315963159731598315993160031601316023160331604316053160631607316083160931610316113161231613316143161531616316173161831619316203162131622316233162431625316263162731628316293163031631316323163331634316353163631637316383163931640316413164231643316443164531646316473164831649316503165131652316533165431655316563165731658316593166031661316623166331664316653166631667316683166931670316713167231673316743167531676316773167831679316803168131682316833168431685316863168731688316893169031691316923169331694316953169631697316983169931700317013170231703317043170531706317073170831709317103171131712317133171431715317163171731718317193172031721317223172331724317253172631727317283172931730317313173231733317343173531736317373173831739317403174131742317433174431745317463174731748317493175031751317523175331754317553175631757317583175931760317613176231763317643176531766317673176831769317703177131772317733177431775317763177731778317793178031781317823178331784317853178631787317883178931790317913179231793317943179531796317973179831799318003180131802318033180431805318063180731808318093181031811318123181331814318153181631817318183181931820318213182231823318243182531826318273182831829318303183131832318333183431835318363183731838318393184031841318423184331844318453184631847318483184931850318513185231853318543185531856318573185831859318603186131862318633186431865318663186731868318693187031871318723187331874318753187631877318783187931880318813188231883318843188531886318873188831889318903189131892318933189431895318963189731898318993190031901319023190331904319053190631907319083190931910319113191231913319143191531916319173191831919319203192131922319233192431925319263192731928319293193031931319323193331934319353193631937319383193931940319413194231943319443194531946319473194831949319503195131952319533195431955319563195731958319593196031961319623196331964319653196631967319683196931970319713197231973319743197531976319773197831979319803198131982319833198431985319863198731988319893199031991319923199331994319953199631997319983199932000320013200232003320043200532006320073200832009320103201132012320133201432015320163201732018320193202032021320223202332024320253202632027320283202932030320313203232033320343203532036320373203832039320403204132042320433204432045320463204732048320493205032051320523205332054320553205632057320583205932060320613206232063320643206532066320673206832069320703207132072320733207432075320763207732078320793208032081320823208332084320853208632087320883208932090320913209232093320943209532096320973209832099321003210132102321033210432105321063210732108321093211032111321123211332114321153211632117321183211932120321213212232123321243212532126321273212832129321303213132132321333213432135321363213732138321393214032141321423214332144321453214632147321483214932150321513215232153321543215532156321573215832159321603216132162321633216432165321663216732168321693217032171321723217332174321753217632177321783217932180321813218232183321843218532186321873218832189321903219132192321933219432195321963219732198321993220032201322023220332204322053220632207322083220932210322113221232213322143221532216322173221832219322203222132222322233222432225322263222732228322293223032231322323223332234322353223632237322383223932240322413224232243322443224532246322473224832249322503225132252322533225432255322563225732258322593226032261322623226332264322653226632267322683226932270322713227232273322743227532276322773227832279322803228132282322833228432285322863228732288322893229032291322923229332294322953229632297322983229932300323013230232303323043230532306323073230832309323103231132312323133231432315323163231732318323193232032321323223232332324323253232632327323283232932330323313233232333323343233532336323373233832339323403234132342323433234432345323463234732348323493235032351323523235332354323553235632357323583235932360323613236232363323643236532366323673236832369323703237132372323733237432375323763237732378323793238032381323823238332384323853238632387323883238932390323913239232393323943239532396323973239832399324003240132402324033240432405324063240732408324093241032411324123241332414324153241632417324183241932420324213242232423324243242532426324273242832429324303243132432324333243432435324363243732438324393244032441324423244332444324453244632447324483244932450324513245232453324543245532456324573245832459324603246132462324633246432465324663246732468324693247032471324723247332474324753247632477324783247932480324813248232483324843248532486324873248832489324903249132492324933249432495324963249732498324993250032501325023250332504325053250632507325083250932510325113251232513325143251532516325173251832519325203252132522325233252432525325263252732528325293253032531325323253332534325353253632537325383253932540325413254232543325443254532546325473254832549325503255132552325533255432555325563255732558325593256032561325623256332564325653256632567325683256932570325713257232573325743257532576325773257832579325803258132582325833258432585325863258732588325893259032591325923259332594325953259632597325983259932600326013260232603326043260532606326073260832609326103261132612326133261432615326163261732618326193262032621326223262332624326253262632627326283262932630326313263232633326343263532636326373263832639326403264132642326433264432645326463264732648326493265032651326523265332654326553265632657326583265932660326613266232663326643266532666326673266832669326703267132672326733267432675326763267732678326793268032681326823268332684326853268632687326883268932690326913269232693326943269532696326973269832699327003270132702327033270432705327063270732708327093271032711327123271332714327153271632717327183271932720327213272232723327243272532726327273272832729327303273132732327333273432735327363273732738327393274032741327423274332744327453274632747327483274932750327513275232753327543275532756327573275832759327603276132762327633276432765327663276732768327693277032771327723277332774327753277632777327783277932780327813278232783327843278532786327873278832789327903279132792327933279432795327963279732798327993280032801328023280332804328053280632807328083280932810328113281232813328143281532816328173281832819328203282132822328233282432825328263282732828328293283032831328323283332834328353283632837328383283932840328413284232843328443284532846328473284832849328503285132852328533285432855328563285732858328593286032861328623286332864328653286632867328683286932870328713287232873328743287532876328773287832879328803288132882328833288432885328863288732888328893289032891328923289332894328953289632897328983289932900329013290232903329043290532906329073290832909329103291132912329133291432915329163291732918329193292032921329223292332924329253292632927329283292932930329313293232933329343293532936329373293832939329403294132942329433294432945329463294732948329493295032951329523295332954329553295632957329583295932960329613296232963329643296532966329673296832969329703297132972329733297432975329763297732978329793298032981329823298332984329853298632987329883298932990329913299232993329943299532996329973299832999330003300133002330033300433005330063300733008330093301033011330123301333014330153301633017330183301933020330213302233023330243302533026330273302833029330303303133032330333303433035330363303733038330393304033041330423304333044330453304633047330483304933050330513305233053330543305533056330573305833059330603306133062330633306433065330663306733068330693307033071330723307333074330753307633077330783307933080330813308233083330843308533086330873308833089330903309133092330933309433095330963309733098330993310033101331023310333104331053310633107331083310933110331113311233113331143311533116331173311833119331203312133122331233312433125331263312733128331293313033131331323313333134331353313633137331383313933140331413314233143331443314533146331473314833149331503315133152331533315433155331563315733158331593316033161331623316333164331653316633167331683316933170331713317233173331743317533176331773317833179331803318133182331833318433185331863318733188331893319033191331923319333194331953319633197331983319933200332013320233203332043320533206332073320833209332103321133212332133321433215332163321733218332193322033221332223322333224332253322633227332283322933230332313323233233332343323533236332373323833239332403324133242332433324433245332463324733248332493325033251332523325333254332553325633257332583325933260332613326233263332643326533266332673326833269332703327133272332733327433275332763327733278332793328033281332823328333284332853328633287332883328933290332913329233293332943329533296332973329833299333003330133302333033330433305333063330733308333093331033311333123331333314333153331633317333183331933320333213332233323333243332533326333273332833329333303333133332333333333433335333363333733338333393334033341333423334333344333453334633347333483334933350333513335233353333543335533356333573335833359333603336133362333633336433365333663336733368333693337033371333723337333374333753337633377333783337933380333813338233383333843338533386333873338833389333903339133392333933339433395333963339733398333993340033401334023340333404334053340633407334083340933410334113341233413334143341533416334173341833419334203342133422334233342433425334263342733428334293343033431334323343333434334353343633437334383343933440334413344233443334443344533446334473344833449334503345133452334533345433455334563345733458334593346033461334623346333464334653346633467334683346933470334713347233473334743347533476334773347833479334803348133482334833348433485334863348733488334893349033491334923349333494334953349633497334983349933500335013350233503335043350533506335073350833509335103351133512335133351433515335163351733518335193352033521335223352333524335253352633527335283352933530335313353233533335343353533536335373353833539335403354133542335433354433545335463354733548335493355033551335523355333554335553355633557335583355933560335613356233563335643356533566335673356833569335703357133572335733357433575335763357733578335793358033581335823358333584335853358633587335883358933590335913359233593335943359533596335973359833599336003360133602336033360433605336063360733608336093361033611336123361333614336153361633617336183361933620336213362233623336243362533626336273362833629336303363133632336333363433635336363363733638336393364033641336423364333644336453364633647336483364933650336513365233653336543365533656336573365833659336603366133662336633366433665336663366733668336693367033671336723367333674336753367633677336783367933680336813368233683336843368533686336873368833689336903369133692336933369433695336963369733698336993370033701337023370333704337053370633707337083370933710337113371233713337143371533716337173371833719337203372133722337233372433725337263372733728337293373033731337323373333734337353373633737337383373933740337413374233743337443374533746337473374833749337503375133752337533375433755337563375733758337593376033761337623376333764337653376633767337683376933770337713377233773337743377533776337773377833779337803378133782337833378433785337863378733788337893379033791337923379333794337953379633797337983379933800338013380233803338043380533806338073380833809338103381133812338133381433815338163381733818338193382033821338223382333824338253382633827338283382933830338313383233833338343383533836338373383833839338403384133842338433384433845338463384733848338493385033851338523385333854338553385633857338583385933860338613386233863338643386533866338673386833869338703387133872338733387433875338763387733878338793388033881338823388333884338853388633887338883388933890338913389233893338943389533896338973389833899339003390133902339033390433905339063390733908339093391033911339123391333914339153391633917339183391933920339213392233923339243392533926339273392833929339303393133932339333393433935339363393733938339393394033941339423394333944339453394633947339483394933950339513395233953339543395533956339573395833959339603396133962339633396433965339663396733968339693397033971339723397333974339753397633977339783397933980339813398233983339843398533986339873398833989339903399133992339933399433995339963399733998339993400034001340023400334004340053400634007340083400934010340113401234013340143401534016340173401834019340203402134022340233402434025340263402734028340293403034031340323403334034340353403634037340383403934040340413404234043340443404534046340473404834049340503405134052340533405434055340563405734058340593406034061340623406334064340653406634067340683406934070340713407234073340743407534076340773407834079340803408134082340833408434085340863408734088340893409034091340923409334094340953409634097340983409934100341013410234103341043410534106341073410834109341103411134112341133411434115341163411734118341193412034121341223412334124341253412634127341283412934130341313413234133341343413534136341373413834139341403414134142341433414434145341463414734148341493415034151341523415334154341553415634157341583415934160341613416234163341643416534166341673416834169341703417134172341733417434175341763417734178341793418034181341823418334184341853418634187341883418934190341913419234193341943419534196341973419834199342003420134202342033420434205342063420734208342093421034211342123421334214342153421634217342183421934220342213422234223342243422534226342273422834229342303423134232342333423434235342363423734238342393424034241342423424334244342453424634247342483424934250342513425234253342543425534256342573425834259342603426134262342633426434265342663426734268342693427034271342723427334274342753427634277342783427934280342813428234283342843428534286342873428834289342903429134292342933429434295342963429734298342993430034301343023430334304343053430634307343083430934310343113431234313343143431534316343173431834319343203432134322343233432434325343263432734328343293433034331343323433334334343353433634337343383433934340343413434234343343443434534346343473434834349343503435134352343533435434355343563435734358343593436034361343623436334364343653436634367343683436934370343713437234373343743437534376343773437834379343803438134382343833438434385343863438734388343893439034391343923439334394343953439634397343983439934400344013440234403344043440534406344073440834409344103441134412344133441434415344163441734418344193442034421344223442334424344253442634427344283442934430344313443234433344343443534436344373443834439344403444134442344433444434445344463444734448344493445034451344523445334454344553445634457344583445934460344613446234463344643446534466344673446834469344703447134472344733447434475344763447734478344793448034481344823448334484344853448634487344883448934490344913449234493344943449534496344973449834499345003450134502345033450434505345063450734508345093451034511345123451334514345153451634517345183451934520345213452234523345243452534526345273452834529345303453134532345333453434535345363453734538345393454034541345423454334544345453454634547345483454934550345513455234553345543455534556345573455834559345603456134562345633456434565345663456734568345693457034571345723457334574345753457634577345783457934580345813458234583345843458534586345873458834589345903459134592345933459434595345963459734598345993460034601346023460334604346053460634607346083460934610346113461234613346143461534616346173461834619346203462134622346233462434625346263462734628346293463034631346323463334634346353463634637346383463934640346413464234643346443464534646346473464834649346503465134652346533465434655346563465734658346593466034661346623466334664346653466634667346683466934670346713467234673346743467534676346773467834679346803468134682346833468434685346863468734688346893469034691346923469334694346953469634697346983469934700347013470234703347043470534706347073470834709347103471134712347133471434715347163471734718347193472034721347223472334724347253472634727347283472934730347313473234733347343473534736347373473834739347403474134742347433474434745347463474734748347493475034751347523475334754347553475634757347583475934760347613476234763347643476534766347673476834769347703477134772347733477434775347763477734778347793478034781347823478334784347853478634787347883478934790347913479234793347943479534796347973479834799348003480134802348033480434805348063480734808348093481034811348123481334814348153481634817348183481934820348213482234823348243482534826348273482834829348303483134832348333483434835348363483734838348393484034841348423484334844348453484634847348483484934850348513485234853348543485534856348573485834859348603486134862348633486434865348663486734868348693487034871348723487334874348753487634877348783487934880348813488234883348843488534886348873488834889348903489134892348933489434895348963489734898348993490034901349023490334904349053490634907349083490934910349113491234913349143491534916349173491834919349203492134922349233492434925349263492734928349293493034931349323493334934349353493634937349383493934940349413494234943349443494534946349473494834949349503495134952349533495434955349563495734958349593496034961349623496334964349653496634967349683496934970349713497234973349743497534976349773497834979349803498134982349833498434985349863498734988349893499034991349923499334994349953499634997349983499935000350013500235003350043500535006350073500835009350103501135012350133501435015350163501735018350193502035021350223502335024350253502635027350283502935030350313503235033350343503535036350373503835039350403504135042350433504435045350463504735048350493505035051350523505335054350553505635057350583505935060350613506235063350643506535066350673506835069350703507135072350733507435075350763507735078350793508035081350823508335084350853508635087350883508935090350913509235093350943509535096350973509835099351003510135102351033510435105351063510735108351093511035111351123511335114351153511635117351183511935120351213512235123351243512535126351273512835129351303513135132351333513435135351363513735138351393514035141351423514335144351453514635147351483514935150351513515235153351543515535156351573515835159351603516135162351633516435165351663516735168351693517035171351723517335174351753517635177351783517935180351813518235183351843518535186351873518835189351903519135192351933519435195351963519735198351993520035201352023520335204352053520635207352083520935210352113521235213352143521535216352173521835219352203522135222352233522435225352263522735228352293523035231352323523335234352353523635237352383523935240352413524235243352443524535246352473524835249352503525135252352533525435255352563525735258352593526035261352623526335264352653526635267352683526935270352713527235273352743527535276352773527835279352803528135282352833528435285352863528735288352893529035291352923529335294352953529635297352983529935300353013530235303353043530535306353073530835309353103531135312353133531435315353163531735318353193532035321353223532335324353253532635327353283532935330353313533235333353343533535336353373533835339353403534135342353433534435345353463534735348353493535035351353523535335354353553535635357353583535935360353613536235363353643536535366353673536835369353703537135372353733537435375353763537735378353793538035381353823538335384353853538635387353883538935390353913539235393353943539535396353973539835399354003540135402354033540435405354063540735408354093541035411354123541335414354153541635417354183541935420354213542235423354243542535426354273542835429354303543135432354333543435435354363543735438354393544035441354423544335444354453544635447354483544935450354513545235453354543545535456354573545835459354603546135462354633546435465354663546735468354693547035471354723547335474354753547635477354783547935480354813548235483354843548535486354873548835489354903549135492354933549435495354963549735498354993550035501355023550335504355053550635507355083550935510355113551235513355143551535516355173551835519355203552135522355233552435525355263552735528355293553035531355323553335534355353553635537355383553935540355413554235543355443554535546355473554835549355503555135552355533555435555355563555735558355593556035561355623556335564355653556635567355683556935570355713557235573355743557535576355773557835579355803558135582355833558435585355863558735588355893559035591355923559335594355953559635597355983559935600356013560235603356043560535606356073560835609356103561135612356133561435615356163561735618356193562035621356223562335624356253562635627356283562935630356313563235633356343563535636356373563835639356403564135642356433564435645356463564735648356493565035651356523565335654356553565635657356583565935660356613566235663356643566535666356673566835669356703567135672356733567435675356763567735678356793568035681356823568335684356853568635687356883568935690356913569235693356943569535696356973569835699357003570135702357033570435705357063570735708357093571035711357123571335714357153571635717357183571935720357213572235723357243572535726357273572835729357303573135732357333573435735357363573735738357393574035741357423574335744357453574635747357483574935750357513575235753357543575535756357573575835759357603576135762357633576435765357663576735768357693577035771357723577335774357753577635777357783577935780357813578235783357843578535786357873578835789357903579135792357933579435795357963579735798357993580035801358023580335804358053580635807358083580935810358113581235813358143581535816358173581835819358203582135822358233582435825358263582735828358293583035831358323583335834358353583635837358383583935840358413584235843358443584535846358473584835849358503585135852358533585435855358563585735858358593586035861358623586335864358653586635867358683586935870358713587235873358743587535876358773587835879358803588135882358833588435885358863588735888358893589035891358923589335894358953589635897358983589935900359013590235903359043590535906359073590835909359103591135912359133591435915359163591735918359193592035921359223592335924359253592635927359283592935930359313593235933359343593535936359373593835939359403594135942359433594435945359463594735948359493595035951359523595335954359553595635957359583595935960359613596235963359643596535966359673596835969359703597135972359733597435975359763597735978359793598035981359823598335984359853598635987359883598935990359913599235993359943599535996359973599835999360003600136002360033600436005360063600736008360093601036011360123601336014360153601636017360183601936020360213602236023360243602536026360273602836029360303603136032360333603436035360363603736038360393604036041360423604336044360453604636047360483604936050360513605236053360543605536056360573605836059360603606136062360633606436065360663606736068360693607036071360723607336074360753607636077360783607936080360813608236083360843608536086360873608836089360903609136092360933609436095360963609736098360993610036101361023610336104361053610636107361083610936110361113611236113361143611536116361173611836119361203612136122361233612436125361263612736128361293613036131361323613336134361353613636137361383613936140361413614236143361443614536146361473614836149361503615136152361533615436155361563615736158361593616036161361623616336164361653616636167361683616936170361713617236173361743617536176361773617836179361803618136182361833618436185361863618736188361893619036191361923619336194361953619636197361983619936200362013620236203362043620536206362073620836209362103621136212362133621436215362163621736218362193622036221362223622336224362253622636227362283622936230362313623236233362343623536236362373623836239362403624136242362433624436245362463624736248362493625036251362523625336254362553625636257362583625936260362613626236263362643626536266362673626836269362703627136272362733627436275362763627736278362793628036281362823628336284362853628636287362883628936290362913629236293362943629536296362973629836299363003630136302363033630436305363063630736308363093631036311363123631336314363153631636317363183631936320363213632236323363243632536326363273632836329363303633136332363333633436335363363633736338363393634036341363423634336344363453634636347363483634936350363513635236353363543635536356363573635836359363603636136362363633636436365363663636736368363693637036371363723637336374363753637636377363783637936380363813638236383363843638536386363873638836389363903639136392363933639436395363963639736398363993640036401364023640336404364053640636407364083640936410364113641236413364143641536416364173641836419364203642136422364233642436425364263642736428364293643036431364323643336434364353643636437364383643936440364413644236443364443644536446364473644836449364503645136452364533645436455364563645736458364593646036461364623646336464364653646636467364683646936470364713647236473364743647536476364773647836479364803648136482364833648436485364863648736488364893649036491364923649336494364953649636497364983649936500365013650236503365043650536506365073650836509365103651136512365133651436515365163651736518365193652036521365223652336524365253652636527365283652936530365313653236533365343653536536365373653836539365403654136542365433654436545365463654736548365493655036551365523655336554365553655636557365583655936560365613656236563365643656536566365673656836569365703657136572365733657436575365763657736578365793658036581365823658336584365853658636587365883658936590365913659236593365943659536596365973659836599366003660136602366033660436605366063660736608366093661036611366123661336614366153661636617366183661936620366213662236623366243662536626366273662836629366303663136632366333663436635366363663736638366393664036641366423664336644366453664636647366483664936650366513665236653366543665536656366573665836659366603666136662366633666436665366663666736668366693667036671366723667336674366753667636677366783667936680366813668236683366843668536686366873668836689366903669136692366933669436695366963669736698366993670036701367023670336704367053670636707367083670936710367113671236713367143671536716367173671836719367203672136722367233672436725367263672736728367293673036731367323673336734367353673636737367383673936740367413674236743367443674536746367473674836749367503675136752367533675436755367563675736758367593676036761367623676336764367653676636767367683676936770367713677236773367743677536776367773677836779367803678136782367833678436785367863678736788367893679036791367923679336794367953679636797367983679936800368013680236803368043680536806368073680836809368103681136812368133681436815368163681736818368193682036821368223682336824368253682636827368283682936830368313683236833368343683536836368373683836839368403684136842368433684436845368463684736848368493685036851368523685336854368553685636857368583685936860368613686236863368643686536866368673686836869368703687136872368733687436875368763687736878368793688036881368823688336884368853688636887368883688936890368913689236893368943689536896368973689836899369003690136902369033690436905369063690736908369093691036911369123691336914369153691636917369183691936920369213692236923369243692536926369273692836929369303693136932369333693436935369363693736938369393694036941369423694336944369453694636947369483694936950369513695236953369543695536956369573695836959369603696136962369633696436965369663696736968369693697036971369723697336974369753697636977369783697936980369813698236983369843698536986369873698836989369903699136992369933699436995369963699736998369993700037001370023700337004370053700637007370083700937010370113701237013370143701537016370173701837019370203702137022370233702437025370263702737028370293703037031370323703337034370353703637037370383703937040370413704237043370443704537046370473704837049370503705137052370533705437055370563705737058370593706037061370623706337064370653706637067370683706937070370713707237073370743707537076370773707837079370803708137082370833708437085370863708737088370893709037091370923709337094370953709637097370983709937100371013710237103371043710537106371073710837109371103711137112371133711437115371163711737118371193712037121371223712337124371253712637127371283712937130371313713237133371343713537136371373713837139371403714137142371433714437145371463714737148371493715037151371523715337154371553715637157371583715937160371613716237163371643716537166371673716837169371703717137172371733717437175371763717737178371793718037181371823718337184371853718637187371883718937190371913719237193371943719537196371973719837199372003720137202372033720437205372063720737208372093721037211372123721337214372153721637217372183721937220372213722237223372243722537226372273722837229372303723137232372333723437235372363723737238372393724037241372423724337244372453724637247372483724937250372513725237253372543725537256372573725837259372603726137262372633726437265372663726737268372693727037271372723727337274372753727637277372783727937280372813728237283372843728537286372873728837289372903729137292372933729437295372963729737298372993730037301373023730337304373053730637307373083730937310373113731237313373143731537316373173731837319373203732137322373233732437325373263732737328373293733037331373323733337334373353733637337373383733937340373413734237343373443734537346373473734837349373503735137352373533735437355373563735737358373593736037361373623736337364373653736637367373683736937370373713737237373373743737537376373773737837379373803738137382373833738437385373863738737388373893739037391373923739337394373953739637397373983739937400374013740237403374043740537406374073740837409374103741137412374133741437415374163741737418374193742037421374223742337424374253742637427374283742937430374313743237433374343743537436374373743837439374403744137442374433744437445374463744737448374493745037451374523745337454374553745637457374583745937460374613746237463374643746537466374673746837469374703747137472374733747437475374763747737478374793748037481374823748337484374853748637487374883748937490374913749237493374943749537496374973749837499375003750137502375033750437505375063750737508375093751037511375123751337514375153751637517375183751937520375213752237523375243752537526375273752837529375303753137532375333753437535375363753737538375393754037541375423754337544375453754637547375483754937550375513755237553375543755537556375573755837559375603756137562375633756437565375663756737568375693757037571375723757337574375753757637577375783757937580375813758237583375843758537586375873758837589375903759137592375933759437595375963759737598375993760037601376023760337604376053760637607376083760937610376113761237613376143761537616376173761837619376203762137622376233762437625376263762737628376293763037631376323763337634376353763637637376383763937640376413764237643376443764537646376473764837649376503765137652376533765437655376563765737658376593766037661376623766337664376653766637667376683766937670376713767237673376743767537676376773767837679376803768137682376833768437685376863768737688376893769037691376923769337694376953769637697376983769937700377013770237703377043770537706377073770837709377103771137712377133771437715377163771737718377193772037721377223772337724377253772637727377283772937730377313773237733377343773537736377373773837739377403774137742377433774437745377463774737748377493775037751377523775337754377553775637757377583775937760377613776237763377643776537766377673776837769377703777137772377733777437775377763777737778377793778037781377823778337784377853778637787377883778937790377913779237793377943779537796377973779837799378003780137802378033780437805378063780737808378093781037811378123781337814378153781637817378183781937820378213782237823378243782537826378273782837829378303783137832378333783437835378363783737838378393784037841378423784337844378453784637847378483784937850378513785237853378543785537856378573785837859378603786137862378633786437865378663786737868378693787037871378723787337874378753787637877378783787937880378813788237883378843788537886378873788837889378903789137892378933789437895378963789737898378993790037901379023790337904379053790637907379083790937910379113791237913379143791537916379173791837919379203792137922379233792437925379263792737928379293793037931379323793337934379353793637937379383793937940379413794237943379443794537946379473794837949379503795137952379533795437955379563795737958379593796037961379623796337964379653796637967379683796937970379713797237973379743797537976379773797837979379803798137982379833798437985379863798737988379893799037991379923799337994379953799637997379983799938000380013800238003380043800538006380073800838009380103801138012380133801438015380163801738018380193802038021380223802338024380253802638027380283802938030380313803238033380343803538036380373803838039380403804138042380433804438045380463804738048380493805038051380523805338054380553805638057380583805938060380613806238063380643806538066380673806838069380703807138072380733807438075380763807738078380793808038081380823808338084380853808638087380883808938090380913809238093380943809538096380973809838099381003810138102381033810438105381063810738108381093811038111381123811338114381153811638117381183811938120381213812238123381243812538126381273812838129381303813138132381333813438135381363813738138381393814038141381423814338144381453814638147381483814938150381513815238153381543815538156381573815838159381603816138162381633816438165381663816738168381693817038171381723817338174381753817638177381783817938180381813818238183381843818538186381873818838189381903819138192381933819438195381963819738198381993820038201382023820338204382053820638207382083820938210382113821238213382143821538216382173821838219382203822138222382233822438225382263822738228382293823038231382323823338234382353823638237382383823938240382413824238243382443824538246382473824838249382503825138252382533825438255382563825738258382593826038261382623826338264382653826638267382683826938270382713827238273382743827538276382773827838279382803828138282382833828438285382863828738288382893829038291382923829338294382953829638297382983829938300383013830238303383043830538306383073830838309383103831138312383133831438315383163831738318383193832038321383223832338324383253832638327383283832938330383313833238333383343833538336383373833838339383403834138342383433834438345383463834738348383493835038351383523835338354383553835638357383583835938360383613836238363383643836538366383673836838369383703837138372383733837438375383763837738378383793838038381383823838338384383853838638387383883838938390383913839238393383943839538396383973839838399384003840138402384033840438405384063840738408384093841038411384123841338414384153841638417384183841938420384213842238423384243842538426384273842838429384303843138432384333843438435384363843738438384393844038441384423844338444384453844638447384483844938450384513845238453384543845538456384573845838459384603846138462384633846438465384663846738468384693847038471384723847338474384753847638477384783847938480384813848238483384843848538486384873848838489384903849138492384933849438495384963849738498384993850038501385023850338504385053850638507385083850938510385113851238513385143851538516385173851838519385203852138522385233852438525385263852738528385293853038531385323853338534385353853638537385383853938540385413854238543385443854538546385473854838549385503855138552385533855438555385563855738558385593856038561385623856338564385653856638567385683856938570385713857238573385743857538576385773857838579385803858138582385833858438585385863858738588385893859038591385923859338594385953859638597385983859938600386013860238603386043860538606386073860838609386103861138612386133861438615386163861738618386193862038621386223862338624386253862638627386283862938630386313863238633386343863538636386373863838639386403864138642386433864438645386463864738648386493865038651386523865338654386553865638657386583865938660386613866238663386643866538666386673866838669386703867138672386733867438675386763867738678386793868038681386823868338684386853868638687386883868938690386913869238693386943869538696386973869838699387003870138702387033870438705387063870738708387093871038711387123871338714387153871638717387183871938720387213872238723387243872538726387273872838729387303873138732387333873438735387363873738738387393874038741387423874338744387453874638747387483874938750387513875238753387543875538756387573875838759387603876138762387633876438765387663876738768387693877038771387723877338774387753877638777387783877938780387813878238783387843878538786387873878838789387903879138792387933879438795387963879738798387993880038801388023880338804388053880638807388083880938810388113881238813388143881538816388173881838819388203882138822388233882438825388263882738828388293883038831388323883338834388353883638837388383883938840388413884238843388443884538846388473884838849388503885138852388533885438855388563885738858388593886038861388623886338864388653886638867388683886938870388713887238873388743887538876388773887838879388803888138882388833888438885388863888738888388893889038891388923889338894388953889638897388983889938900389013890238903389043890538906389073890838909389103891138912389133891438915389163891738918389193892038921389223892338924389253892638927389283892938930389313893238933389343893538936389373893838939389403894138942389433894438945389463894738948389493895038951389523895338954389553895638957389583895938960389613896238963389643896538966389673896838969389703897138972389733897438975389763897738978389793898038981389823898338984389853898638987389883898938990389913899238993389943899538996389973899838999390003900139002390033900439005390063900739008390093901039011390123901339014390153901639017390183901939020390213902239023390243902539026390273902839029390303903139032390333903439035390363903739038390393904039041390423904339044390453904639047390483904939050390513905239053390543905539056390573905839059390603906139062390633906439065390663906739068390693907039071390723907339074390753907639077390783907939080390813908239083390843908539086390873908839089390903909139092390933909439095390963909739098390993910039101391023910339104391053910639107391083910939110391113911239113391143911539116391173911839119391203912139122391233912439125391263912739128391293913039131391323913339134391353913639137391383913939140391413914239143391443914539146391473914839149391503915139152391533915439155391563915739158391593916039161391623916339164391653916639167391683916939170391713917239173391743917539176391773917839179391803918139182391833918439185391863918739188391893919039191391923919339194391953919639197391983919939200392013920239203392043920539206392073920839209392103921139212392133921439215392163921739218392193922039221392223922339224392253922639227392283922939230392313923239233392343923539236392373923839239392403924139242392433924439245392463924739248392493925039251392523925339254392553925639257392583925939260392613926239263392643926539266392673926839269392703927139272392733927439275392763927739278392793928039281392823928339284392853928639287392883928939290392913929239293392943929539296392973929839299393003930139302393033930439305393063930739308393093931039311393123931339314393153931639317393183931939320393213932239323393243932539326393273932839329393303933139332393333933439335393363933739338393393934039341393423934339344393453934639347393483934939350393513935239353393543935539356393573935839359393603936139362393633936439365393663936739368393693937039371393723937339374393753937639377393783937939380393813938239383393843938539386393873938839389393903939139392393933939439395393963939739398393993940039401394023940339404394053940639407394083940939410394113941239413394143941539416394173941839419394203942139422394233942439425394263942739428394293943039431394323943339434394353943639437394383943939440394413944239443394443944539446394473944839449394503945139452394533945439455394563945739458394593946039461394623946339464394653946639467394683946939470394713947239473394743947539476394773947839479394803948139482394833948439485394863948739488394893949039491394923949339494394953949639497394983949939500395013950239503395043950539506395073950839509395103951139512395133951439515395163951739518395193952039521395223952339524395253952639527395283952939530395313953239533395343953539536395373953839539395403954139542395433954439545395463954739548395493955039551395523955339554395553955639557395583955939560395613956239563395643956539566395673956839569395703957139572395733957439575395763957739578395793958039581395823958339584395853958639587395883958939590395913959239593395943959539596395973959839599396003960139602396033960439605396063960739608396093961039611396123961339614396153961639617396183961939620396213962239623396243962539626396273962839629396303963139632396333963439635396363963739638396393964039641396423964339644396453964639647396483964939650396513965239653396543965539656396573965839659396603966139662396633966439665396663966739668396693967039671396723967339674396753967639677396783967939680396813968239683396843968539686396873968839689396903969139692396933969439695396963969739698396993970039701397023970339704397053970639707397083970939710397113971239713397143971539716397173971839719397203972139722397233972439725397263972739728397293973039731397323973339734397353973639737397383973939740397413974239743397443974539746397473974839749397503975139752397533975439755397563975739758397593976039761397623976339764397653976639767397683976939770397713977239773397743977539776397773977839779397803978139782397833978439785397863978739788397893979039791397923979339794397953979639797397983979939800398013980239803398043980539806398073980839809398103981139812398133981439815398163981739818398193982039821398223982339824398253982639827398283982939830398313983239833398343983539836398373983839839398403984139842398433984439845398463984739848398493985039851398523985339854398553985639857398583985939860398613986239863398643986539866398673986839869398703987139872398733987439875398763987739878398793988039881398823988339884398853988639887398883988939890398913989239893398943989539896398973989839899399003990139902399033990439905399063990739908399093991039911399123991339914399153991639917399183991939920399213992239923399243992539926399273992839929399303993139932399333993439935399363993739938399393994039941399423994339944399453994639947399483994939950399513995239953399543995539956399573995839959399603996139962399633996439965399663996739968399693997039971399723997339974399753997639977399783997939980399813998239983399843998539986399873998839989399903999139992399933999439995399963999739998399994000040001400024000340004400054000640007400084000940010400114001240013400144001540016400174001840019400204002140022400234002440025400264002740028400294003040031400324003340034400354003640037400384003940040400414004240043400444004540046400474004840049400504005140052400534005440055400564005740058400594006040061400624006340064400654006640067400684006940070400714007240073400744007540076400774007840079400804008140082400834008440085400864008740088400894009040091400924009340094400954009640097400984009940100401014010240103401044010540106401074010840109401104011140112401134011440115401164011740118401194012040121401224012340124401254012640127401284012940130401314013240133401344013540136401374013840139401404014140142401434014440145401464014740148401494015040151401524015340154401554015640157401584015940160401614016240163401644016540166401674016840169401704017140172401734017440175401764017740178401794018040181401824018340184401854018640187401884018940190401914019240193401944019540196401974019840199402004020140202402034020440205402064020740208402094021040211402124021340214402154021640217402184021940220402214022240223402244022540226402274022840229402304023140232402334023440235402364023740238402394024040241402424024340244402454024640247402484024940250402514025240253402544025540256402574025840259402604026140262402634026440265402664026740268402694027040271402724027340274402754027640277402784027940280402814028240283402844028540286402874028840289402904029140292402934029440295402964029740298402994030040301403024030340304403054030640307403084030940310403114031240313403144031540316403174031840319403204032140322403234032440325403264032740328403294033040331403324033340334403354033640337403384033940340403414034240343403444034540346403474034840349403504035140352403534035440355403564035740358403594036040361403624036340364403654036640367403684036940370403714037240373403744037540376403774037840379403804038140382403834038440385403864038740388403894039040391403924039340394403954039640397403984039940400404014040240403404044040540406404074040840409404104041140412404134041440415404164041740418404194042040421404224042340424404254042640427404284042940430404314043240433404344043540436404374043840439404404044140442404434044440445404464044740448404494045040451404524045340454404554045640457404584045940460404614046240463404644046540466404674046840469404704047140472404734047440475404764047740478404794048040481404824048340484404854048640487404884048940490404914049240493404944049540496404974049840499405004050140502405034050440505405064050740508405094051040511405124051340514405154051640517405184051940520405214052240523405244052540526405274052840529405304053140532405334053440535405364053740538405394054040541405424054340544405454054640547405484054940550405514055240553405544055540556405574055840559405604056140562405634056440565405664056740568405694057040571405724057340574405754057640577405784057940580405814058240583405844058540586405874058840589405904059140592405934059440595405964059740598405994060040601406024060340604406054060640607406084060940610406114061240613406144061540616406174061840619406204062140622406234062440625406264062740628406294063040631406324063340634406354063640637406384063940640406414064240643406444064540646406474064840649406504065140652406534065440655406564065740658406594066040661406624066340664406654066640667406684066940670406714067240673406744067540676406774067840679406804068140682406834068440685406864068740688406894069040691406924069340694406954069640697406984069940700407014070240703407044070540706407074070840709407104071140712407134071440715407164071740718407194072040721407224072340724407254072640727407284072940730407314073240733407344073540736407374073840739407404074140742407434074440745407464074740748407494075040751407524075340754407554075640757407584075940760407614076240763407644076540766407674076840769407704077140772407734077440775407764077740778407794078040781407824078340784407854078640787407884078940790407914079240793407944079540796407974079840799408004080140802408034080440805408064080740808408094081040811408124081340814408154081640817408184081940820408214082240823408244082540826408274082840829408304083140832408334083440835408364083740838408394084040841408424084340844408454084640847408484084940850408514085240853408544085540856408574085840859408604086140862408634086440865408664086740868408694087040871408724087340874408754087640877408784087940880408814088240883408844088540886408874088840889408904089140892408934089440895408964089740898408994090040901409024090340904409054090640907409084090940910409114091240913409144091540916409174091840919409204092140922409234092440925409264092740928409294093040931409324093340934409354093640937409384093940940409414094240943409444094540946409474094840949409504095140952409534095440955409564095740958409594096040961409624096340964409654096640967409684096940970409714097240973409744097540976409774097840979409804098140982409834098440985409864098740988409894099040991409924099340994409954099640997409984099941000410014100241003410044100541006410074100841009410104101141012410134101441015410164101741018410194102041021410224102341024410254102641027410284102941030410314103241033410344103541036410374103841039410404104141042410434104441045410464104741048410494105041051410524105341054410554105641057410584105941060410614106241063410644106541066410674106841069410704107141072410734107441075410764107741078410794108041081410824108341084410854108641087410884108941090410914109241093410944109541096410974109841099411004110141102411034110441105411064110741108411094111041111411124111341114411154111641117411184111941120411214112241123411244112541126411274112841129411304113141132411334113441135411364113741138411394114041141411424114341144411454114641147411484114941150411514115241153411544115541156411574115841159411604116141162411634116441165411664116741168411694117041171411724117341174411754117641177411784117941180411814118241183411844118541186411874118841189411904119141192411934119441195411964119741198411994120041201412024120341204412054120641207412084120941210412114121241213412144121541216412174121841219412204122141222412234122441225412264122741228412294123041231412324123341234412354123641237412384123941240412414124241243412444124541246412474124841249412504125141252412534125441255412564125741258412594126041261412624126341264412654126641267412684126941270412714127241273412744127541276412774127841279412804128141282412834128441285412864128741288412894129041291412924129341294412954129641297412984129941300413014130241303413044130541306413074130841309413104131141312413134131441315413164131741318413194132041321413224132341324413254132641327413284132941330413314133241333413344133541336413374133841339413404134141342413434134441345413464134741348413494135041351413524135341354413554135641357413584135941360413614136241363413644136541366413674136841369413704137141372413734137441375413764137741378413794138041381413824138341384413854138641387413884138941390413914139241393413944139541396413974139841399414004140141402414034140441405414064140741408414094141041411414124141341414414154141641417414184141941420414214142241423414244142541426414274142841429414304143141432414334143441435414364143741438414394144041441414424144341444414454144641447414484144941450414514145241453414544145541456414574145841459414604146141462414634146441465414664146741468414694147041471414724147341474414754147641477414784147941480414814148241483414844148541486414874148841489414904149141492414934149441495414964149741498414994150041501415024150341504415054150641507415084150941510415114151241513415144151541516415174151841519415204152141522415234152441525415264152741528415294153041531415324153341534415354153641537415384153941540415414154241543415444154541546415474154841549415504155141552415534155441555415564155741558415594156041561415624156341564415654156641567415684156941570415714157241573415744157541576415774157841579415804158141582415834158441585415864158741588415894159041591415924159341594415954159641597415984159941600416014160241603416044160541606416074160841609416104161141612416134161441615416164161741618416194162041621416224162341624416254162641627416284162941630416314163241633416344163541636416374163841639416404164141642416434164441645416464164741648416494165041651416524165341654416554165641657416584165941660416614166241663416644166541666416674166841669416704167141672416734167441675416764167741678416794168041681416824168341684416854168641687416884168941690416914169241693416944169541696416974169841699417004170141702417034170441705417064170741708417094171041711417124171341714417154171641717417184171941720417214172241723417244172541726417274172841729417304173141732417334173441735417364173741738417394174041741417424174341744417454174641747417484174941750417514175241753417544175541756417574175841759417604176141762417634176441765417664176741768417694177041771417724177341774417754177641777417784177941780417814178241783417844178541786417874178841789417904179141792417934179441795417964179741798417994180041801418024180341804418054180641807418084180941810418114181241813418144181541816418174181841819418204182141822418234182441825418264182741828418294183041831418324183341834418354183641837418384183941840418414184241843418444184541846418474184841849418504185141852418534185441855418564185741858418594186041861418624186341864418654186641867418684186941870418714187241873418744187541876418774187841879418804188141882418834188441885418864188741888418894189041891418924189341894418954189641897418984189941900419014190241903419044190541906419074190841909419104191141912419134191441915419164191741918419194192041921419224192341924419254192641927419284192941930419314193241933419344193541936419374193841939419404194141942419434194441945419464194741948419494195041951419524195341954419554195641957419584195941960419614196241963419644196541966419674196841969419704197141972419734197441975419764197741978419794198041981419824198341984419854198641987419884198941990419914199241993419944199541996419974199841999420004200142002420034200442005420064200742008420094201042011420124201342014420154201642017420184201942020420214202242023420244202542026420274202842029420304203142032420334203442035420364203742038420394204042041420424204342044420454204642047420484204942050420514205242053420544205542056420574205842059420604206142062420634206442065420664206742068420694207042071420724207342074420754207642077420784207942080420814208242083420844208542086420874208842089420904209142092420934209442095420964209742098420994210042101421024210342104421054210642107421084210942110421114211242113421144211542116421174211842119421204212142122421234212442125421264212742128421294213042131421324213342134421354213642137421384213942140421414214242143421444214542146421474214842149421504215142152421534215442155421564215742158421594216042161421624216342164421654216642167421684216942170421714217242173421744217542176421774217842179421804218142182421834218442185421864218742188421894219042191421924219342194421954219642197421984219942200422014220242203422044220542206422074220842209422104221142212422134221442215422164221742218422194222042221422224222342224422254222642227422284222942230422314223242233422344223542236422374223842239422404224142242422434224442245422464224742248422494225042251422524225342254422554225642257422584225942260422614226242263422644226542266422674226842269422704227142272422734227442275422764227742278422794228042281422824228342284422854228642287422884228942290422914229242293422944229542296422974229842299423004230142302423034230442305423064230742308423094231042311423124231342314423154231642317423184231942320423214232242323423244232542326423274232842329423304233142332423334233442335423364233742338423394234042341423424234342344423454234642347423484234942350423514235242353423544235542356423574235842359423604236142362423634236442365423664236742368423694237042371423724237342374423754237642377423784237942380423814238242383423844238542386423874238842389423904239142392423934239442395423964239742398423994240042401424024240342404424054240642407424084240942410424114241242413424144241542416424174241842419424204242142422424234242442425424264242742428424294243042431424324243342434424354243642437424384243942440424414244242443424444244542446424474244842449424504245142452424534245442455424564245742458424594246042461424624246342464424654246642467424684246942470424714247242473424744247542476424774247842479424804248142482424834248442485424864248742488424894249042491424924249342494424954249642497424984249942500425014250242503425044250542506425074250842509425104251142512425134251442515425164251742518425194252042521425224252342524425254252642527425284252942530425314253242533425344253542536425374253842539425404254142542425434254442545425464254742548425494255042551425524255342554425554255642557425584255942560425614256242563425644256542566425674256842569425704257142572425734257442575425764257742578425794258042581425824258342584425854258642587425884258942590425914259242593425944259542596425974259842599426004260142602426034260442605426064260742608426094261042611426124261342614426154261642617426184261942620426214262242623426244262542626426274262842629426304263142632426334263442635426364263742638426394264042641426424264342644426454264642647426484264942650426514265242653426544265542656426574265842659426604266142662426634266442665426664266742668426694267042671426724267342674426754267642677426784267942680426814268242683426844268542686426874268842689426904269142692426934269442695426964269742698426994270042701427024270342704427054270642707427084270942710427114271242713427144271542716427174271842719427204272142722427234272442725427264272742728427294273042731427324273342734427354273642737427384273942740427414274242743427444274542746427474274842749427504275142752427534275442755427564275742758427594276042761427624276342764427654276642767427684276942770427714277242773427744277542776427774277842779427804278142782427834278442785427864278742788427894279042791427924279342794427954279642797427984279942800428014280242803428044280542806428074280842809428104281142812428134281442815428164281742818428194282042821428224282342824428254282642827428284282942830428314283242833428344283542836428374283842839428404284142842428434284442845428464284742848428494285042851428524285342854428554285642857428584285942860428614286242863428644286542866428674286842869428704287142872428734287442875428764287742878428794288042881428824288342884428854288642887428884288942890428914289242893428944289542896428974289842899429004290142902429034290442905429064290742908429094291042911429124291342914429154291642917429184291942920429214292242923429244292542926429274292842929429304293142932429334293442935429364293742938429394294042941429424294342944429454294642947429484294942950429514295242953429544295542956429574295842959429604296142962429634296442965429664296742968429694297042971429724297342974429754297642977429784297942980429814298242983429844298542986429874298842989429904299142992429934299442995429964299742998429994300043001430024300343004430054300643007430084300943010430114301243013430144301543016430174301843019430204302143022430234302443025430264302743028430294303043031430324303343034430354303643037430384303943040430414304243043430444304543046430474304843049430504305143052430534305443055430564305743058430594306043061430624306343064430654306643067430684306943070430714307243073430744307543076430774307843079430804308143082430834308443085430864308743088430894309043091430924309343094430954309643097430984309943100431014310243103431044310543106431074310843109431104311143112431134311443115431164311743118431194312043121431224312343124431254312643127431284312943130431314313243133431344313543136431374313843139431404314143142431434314443145431464314743148431494315043151431524315343154431554315643157431584315943160431614316243163431644316543166431674316843169431704317143172431734317443175431764317743178431794318043181431824318343184431854318643187431884318943190431914319243193431944319543196431974319843199432004320143202432034320443205432064320743208432094321043211432124321343214432154321643217432184321943220432214322243223432244322543226432274322843229432304323143232432334323443235432364323743238432394324043241432424324343244432454324643247432484324943250432514325243253432544325543256432574325843259432604326143262432634326443265432664326743268432694327043271432724327343274432754327643277432784327943280432814328243283432844328543286432874328843289432904329143292432934329443295432964329743298432994330043301433024330343304433054330643307433084330943310433114331243313433144331543316433174331843319433204332143322433234332443325433264332743328433294333043331433324333343334433354333643337433384333943340433414334243343433444334543346433474334843349433504335143352433534335443355433564335743358433594336043361433624336343364433654336643367433684336943370433714337243373433744337543376433774337843379433804338143382433834338443385433864338743388433894339043391433924339343394433954339643397433984339943400434014340243403434044340543406434074340843409434104341143412434134341443415434164341743418434194342043421434224342343424434254342643427434284342943430434314343243433434344343543436434374343843439434404344143442434434344443445434464344743448434494345043451434524345343454434554345643457434584345943460434614346243463434644346543466434674346843469434704347143472434734347443475434764347743478434794348043481434824348343484434854348643487434884348943490434914349243493434944349543496434974349843499435004350143502435034350443505435064350743508435094351043511435124351343514435154351643517435184351943520435214352243523435244352543526435274352843529435304353143532435334353443535435364353743538435394354043541435424354343544435454354643547435484354943550435514355243553435544355543556435574355843559435604356143562435634356443565435664356743568435694357043571435724357343574435754357643577435784357943580435814358243583435844358543586435874358843589435904359143592435934359443595435964359743598435994360043601436024360343604436054360643607436084360943610436114361243613436144361543616436174361843619436204362143622436234362443625436264362743628436294363043631436324363343634436354363643637436384363943640436414364243643436444364543646436474364843649436504365143652436534365443655436564365743658436594366043661436624366343664436654366643667436684366943670436714367243673436744367543676436774367843679436804368143682436834368443685436864368743688436894369043691436924369343694436954369643697436984369943700437014370243703437044370543706437074370843709437104371143712437134371443715437164371743718437194372043721437224372343724437254372643727437284372943730437314373243733437344373543736437374373843739437404374143742437434374443745437464374743748437494375043751437524375343754437554375643757437584375943760437614376243763437644376543766437674376843769437704377143772437734377443775437764377743778437794378043781437824378343784437854378643787437884378943790437914379243793437944379543796437974379843799438004380143802438034380443805438064380743808438094381043811438124381343814438154381643817438184381943820438214382243823438244382543826438274382843829438304383143832438334383443835438364383743838438394384043841438424384343844438454384643847438484384943850438514385243853438544385543856438574385843859438604386143862438634386443865438664386743868438694387043871438724387343874438754387643877438784387943880438814388243883438844388543886438874388843889438904389143892438934389443895438964389743898438994390043901439024390343904439054390643907439084390943910439114391243913439144391543916439174391843919439204392143922439234392443925439264392743928439294393043931439324393343934439354393643937439384393943940439414394243943439444394543946439474394843949439504395143952439534395443955439564395743958439594396043961439624396343964439654396643967439684396943970439714397243973439744397543976439774397843979439804398143982439834398443985439864398743988439894399043991439924399343994439954399643997439984399944000440014400244003440044400544006440074400844009440104401144012440134401444015440164401744018440194402044021440224402344024440254402644027440284402944030440314403244033440344403544036440374403844039440404404144042440434404444045440464404744048440494405044051440524405344054440554405644057440584405944060440614406244063440644406544066440674406844069440704407144072440734407444075440764407744078440794408044081440824408344084440854408644087440884408944090440914409244093440944409544096440974409844099441004410144102441034410444105441064410744108441094411044111441124411344114441154411644117441184411944120441214412244123441244412544126441274412844129441304413144132441334413444135441364413744138441394414044141441424414344144441454414644147441484414944150441514415244153441544415544156441574415844159441604416144162441634416444165441664416744168441694417044171441724417344174441754417644177441784417944180441814418244183441844418544186441874418844189441904419144192441934419444195441964419744198441994420044201442024420344204442054420644207442084420944210442114421244213442144421544216442174421844219442204422144222442234422444225442264422744228442294423044231442324423344234442354423644237442384423944240442414424244243442444424544246442474424844249442504425144252442534425444255442564425744258442594426044261442624426344264442654426644267442684426944270442714427244273442744427544276442774427844279442804428144282442834428444285442864428744288442894429044291442924429344294442954429644297442984429944300443014430244303443044430544306443074430844309443104431144312443134431444315443164431744318443194432044321443224432344324443254432644327443284432944330443314433244333443344433544336443374433844339443404434144342443434434444345443464434744348443494435044351443524435344354443554435644357443584435944360443614436244363443644436544366443674436844369443704437144372443734437444375443764437744378443794438044381443824438344384443854438644387443884438944390443914439244393443944439544396443974439844399444004440144402444034440444405444064440744408444094441044411444124441344414444154441644417444184441944420444214442244423444244442544426444274442844429444304443144432444334443444435444364443744438444394444044441444424444344444444454444644447444484444944450444514445244453444544445544456444574445844459444604446144462444634446444465444664446744468444694447044471444724447344474444754447644477444784447944480444814448244483444844448544486444874448844489444904449144492444934449444495444964449744498444994450044501445024450344504445054450644507445084450944510445114451244513445144451544516445174451844519445204452144522445234452444525445264452744528445294453044531445324453344534445354453644537445384453944540445414454244543445444454544546445474454844549445504455144552445534455444555445564455744558445594456044561445624456344564445654456644567445684456944570445714457244573445744457544576445774457844579445804458144582445834458444585445864458744588445894459044591445924459344594445954459644597445984459944600446014460244603446044460544606446074460844609446104461144612446134461444615446164461744618446194462044621446224462344624446254462644627446284462944630446314463244633446344463544636446374463844639446404464144642446434464444645446464464744648446494465044651446524465344654446554465644657446584465944660446614466244663446644466544666446674466844669446704467144672446734467444675446764467744678446794468044681446824468344684446854468644687446884468944690446914469244693446944469544696446974469844699447004470144702447034470444705447064470744708447094471044711447124471344714447154471644717447184471944720447214472244723447244472544726447274472844729447304473144732447334473444735447364473744738447394474044741447424474344744447454474644747447484474944750447514475244753447544475544756447574475844759447604476144762447634476444765447664476744768447694477044771447724477344774447754477644777447784477944780447814478244783447844478544786447874478844789447904479144792447934479444795447964479744798447994480044801448024480344804448054480644807448084480944810448114481244813448144481544816448174481844819448204482144822448234482444825448264482744828448294483044831448324483344834448354483644837448384483944840448414484244843448444484544846448474484844849448504485144852448534485444855448564485744858448594486044861448624486344864448654486644867448684486944870448714487244873448744487544876448774487844879448804488144882448834488444885448864488744888448894489044891448924489344894448954489644897448984489944900449014490244903449044490544906449074490844909449104491144912449134491444915449164491744918449194492044921449224492344924449254492644927449284492944930449314493244933449344493544936449374493844939449404494144942449434494444945449464494744948449494495044951449524495344954449554495644957449584495944960449614496244963449644496544966449674496844969449704497144972449734497444975449764497744978449794498044981449824498344984449854498644987449884498944990449914499244993449944499544996449974499844999450004500145002450034500445005450064500745008450094501045011450124501345014450154501645017450184501945020450214502245023450244502545026450274502845029450304503145032450334503445035450364503745038450394504045041450424504345044450454504645047450484504945050450514505245053450544505545056450574505845059450604506145062450634506445065450664506745068450694507045071450724507345074450754507645077450784507945080450814508245083450844508545086450874508845089450904509145092450934509445095450964509745098450994510045101451024510345104451054510645107451084510945110451114511245113451144511545116451174511845119451204512145122451234512445125451264512745128451294513045131451324513345134451354513645137451384513945140451414514245143451444514545146451474514845149451504515145152451534515445155451564515745158451594516045161451624516345164451654516645167451684516945170451714517245173451744517545176451774517845179451804518145182451834518445185451864518745188451894519045191451924519345194451954519645197451984519945200452014520245203452044520545206452074520845209452104521145212452134521445215452164521745218452194522045221452224522345224452254522645227452284522945230452314523245233452344523545236452374523845239452404524145242452434524445245452464524745248452494525045251452524525345254452554525645257452584525945260452614526245263452644526545266452674526845269452704527145272452734527445275452764527745278452794528045281452824528345284452854528645287452884528945290452914529245293452944529545296452974529845299453004530145302453034530445305453064530745308453094531045311453124531345314453154531645317453184531945320453214532245323453244532545326453274532845329453304533145332453334533445335453364533745338453394534045341453424534345344453454534645347453484534945350453514535245353453544535545356453574535845359453604536145362453634536445365453664536745368453694537045371453724537345374453754537645377453784537945380453814538245383453844538545386453874538845389453904539145392453934539445395453964539745398453994540045401454024540345404454054540645407454084540945410454114541245413454144541545416454174541845419454204542145422454234542445425454264542745428454294543045431454324543345434454354543645437454384543945440454414544245443454444544545446454474544845449454504545145452454534545445455454564545745458454594546045461454624546345464454654546645467454684546945470454714547245473454744547545476454774547845479454804548145482454834548445485454864548745488454894549045491454924549345494454954549645497454984549945500455014550245503455044550545506455074550845509455104551145512455134551445515455164551745518455194552045521455224552345524455254552645527455284552945530455314553245533455344553545536455374553845539455404554145542455434554445545455464554745548455494555045551455524555345554455554555645557455584555945560455614556245563455644556545566455674556845569455704557145572455734557445575455764557745578455794558045581455824558345584455854558645587455884558945590455914559245593455944559545596455974559845599456004560145602456034560445605456064560745608456094561045611456124561345614456154561645617456184561945620456214562245623456244562545626456274562845629456304563145632456334563445635456364563745638456394564045641456424564345644456454564645647456484564945650456514565245653456544565545656456574565845659456604566145662456634566445665456664566745668456694567045671456724567345674456754567645677456784567945680456814568245683456844568545686456874568845689456904569145692456934569445695456964569745698456994570045701457024570345704457054570645707457084570945710457114571245713457144571545716457174571845719457204572145722457234572445725457264572745728457294573045731457324573345734457354573645737457384573945740457414574245743457444574545746457474574845749457504575145752457534575445755457564575745758457594576045761457624576345764457654576645767457684576945770457714577245773457744577545776457774577845779457804578145782457834578445785457864578745788457894579045791457924579345794457954579645797457984579945800458014580245803458044580545806458074580845809458104581145812458134581445815458164581745818458194582045821458224582345824458254582645827458284582945830458314583245833458344583545836458374583845839458404584145842458434584445845458464584745848458494585045851458524585345854458554585645857458584585945860458614586245863458644586545866458674586845869458704587145872458734587445875458764587745878458794588045881458824588345884458854588645887458884588945890458914589245893458944589545896458974589845899459004590145902459034590445905459064590745908459094591045911459124591345914459154591645917459184591945920459214592245923459244592545926459274592845929459304593145932459334593445935459364593745938459394594045941459424594345944459454594645947459484594945950459514595245953459544595545956459574595845959459604596145962459634596445965459664596745968459694597045971459724597345974459754597645977459784597945980459814598245983459844598545986459874598845989459904599145992459934599445995459964599745998459994600046001460024600346004460054600646007460084600946010460114601246013460144601546016460174601846019460204602146022460234602446025460264602746028460294603046031460324603346034460354603646037460384603946040460414604246043460444604546046460474604846049460504605146052460534605446055460564605746058460594606046061460624606346064460654606646067460684606946070460714607246073460744607546076460774607846079460804608146082460834608446085460864608746088460894609046091460924609346094460954609646097460984609946100461014610246103461044610546106461074610846109461104611146112461134611446115461164611746118461194612046121461224612346124461254612646127461284612946130461314613246133461344613546136461374613846139461404614146142461434614446145461464614746148461494615046151461524615346154461554615646157461584615946160461614616246163461644616546166461674616846169461704617146172461734617446175461764617746178461794618046181461824618346184461854618646187461884618946190461914619246193461944619546196461974619846199462004620146202462034620446205462064620746208462094621046211462124621346214462154621646217462184621946220462214622246223462244622546226462274622846229462304623146232462334623446235462364623746238462394624046241462424624346244462454624646247462484624946250462514625246253462544625546256462574625846259462604626146262462634626446265462664626746268462694627046271462724627346274462754627646277462784627946280462814628246283462844628546286462874628846289462904629146292462934629446295462964629746298462994630046301463024630346304463054630646307463084630946310463114631246313463144631546316463174631846319463204632146322463234632446325463264632746328463294633046331463324633346334463354633646337463384633946340463414634246343463444634546346463474634846349463504635146352463534635446355463564635746358463594636046361463624636346364463654636646367463684636946370463714637246373463744637546376463774637846379463804638146382463834638446385463864638746388463894639046391463924639346394463954639646397463984639946400464014640246403464044640546406464074640846409464104641146412464134641446415464164641746418464194642046421464224642346424464254642646427464284642946430464314643246433464344643546436464374643846439464404644146442464434644446445464464644746448464494645046451464524645346454464554645646457464584645946460464614646246463464644646546466464674646846469464704647146472464734647446475464764647746478464794648046481464824648346484464854648646487464884648946490464914649246493464944649546496464974649846499465004650146502465034650446505465064650746508465094651046511465124651346514465154651646517465184651946520465214652246523465244652546526465274652846529465304653146532465334653446535465364653746538465394654046541465424654346544465454654646547465484654946550465514655246553465544655546556465574655846559465604656146562465634656446565465664656746568465694657046571465724657346574465754657646577465784657946580465814658246583465844658546586465874658846589465904659146592465934659446595465964659746598465994660046601466024660346604466054660646607466084660946610466114661246613466144661546616466174661846619466204662146622466234662446625466264662746628466294663046631466324663346634466354663646637466384663946640466414664246643466444664546646466474664846649466504665146652466534665446655466564665746658466594666046661466624666346664466654666646667466684666946670466714667246673466744667546676466774667846679466804668146682466834668446685466864668746688466894669046691466924669346694466954669646697466984669946700467014670246703467044670546706467074670846709467104671146712467134671446715467164671746718467194672046721467224672346724467254672646727467284672946730467314673246733467344673546736467374673846739467404674146742467434674446745467464674746748467494675046751467524675346754467554675646757467584675946760467614676246763467644676546766467674676846769467704677146772467734677446775467764677746778467794678046781467824678346784467854678646787467884678946790467914679246793467944679546796467974679846799468004680146802468034680446805468064680746808468094681046811468124681346814468154681646817468184681946820468214682246823468244682546826468274682846829468304683146832468334683446835468364683746838468394684046841468424684346844468454684646847468484684946850468514685246853468544685546856468574685846859468604686146862468634686446865468664686746868468694687046871468724687346874468754687646877468784687946880468814688246883468844688546886468874688846889468904689146892468934689446895468964689746898468994690046901469024690346904469054690646907469084690946910469114691246913469144691546916469174691846919469204692146922469234692446925469264692746928469294693046931469324693346934469354693646937469384693946940469414694246943469444694546946469474694846949469504695146952469534695446955469564695746958469594696046961469624696346964469654696646967469684696946970469714697246973469744697546976469774697846979469804698146982469834698446985469864698746988469894699046991469924699346994469954699646997469984699947000470014700247003470044700547006470074700847009470104701147012470134701447015470164701747018470194702047021470224702347024470254702647027470284702947030470314703247033470344703547036470374703847039470404704147042470434704447045470464704747048470494705047051470524705347054470554705647057470584705947060470614706247063470644706547066470674706847069470704707147072470734707447075470764707747078470794708047081470824708347084470854708647087470884708947090470914709247093470944709547096470974709847099471004710147102471034710447105471064710747108471094711047111471124711347114471154711647117471184711947120471214712247123471244712547126471274712847129471304713147132471334713447135471364713747138471394714047141471424714347144471454714647147471484714947150471514715247153471544715547156471574715847159471604716147162471634716447165471664716747168471694717047171471724717347174471754717647177471784717947180471814718247183471844718547186471874718847189471904719147192471934719447195471964719747198471994720047201472024720347204472054720647207472084720947210472114721247213472144721547216472174721847219472204722147222472234722447225472264722747228472294723047231472324723347234472354723647237472384723947240472414724247243472444724547246472474724847249472504725147252472534725447255472564725747258472594726047261472624726347264472654726647267472684726947270472714727247273472744727547276472774727847279472804728147282472834728447285472864728747288472894729047291472924729347294472954729647297472984729947300473014730247303473044730547306473074730847309473104731147312473134731447315473164731747318473194732047321473224732347324473254732647327473284732947330473314733247333473344733547336473374733847339473404734147342473434734447345473464734747348473494735047351473524735347354473554735647357473584735947360473614736247363473644736547366473674736847369473704737147372473734737447375473764737747378473794738047381473824738347384473854738647387473884738947390473914739247393473944739547396473974739847399474004740147402474034740447405474064740747408474094741047411474124741347414474154741647417474184741947420474214742247423474244742547426474274742847429474304743147432474334743447435474364743747438474394744047441474424744347444474454744647447474484744947450474514745247453474544745547456474574745847459474604746147462474634746447465474664746747468474694747047471474724747347474474754747647477474784747947480474814748247483474844748547486474874748847489474904749147492474934749447495474964749747498474994750047501475024750347504475054750647507475084750947510475114751247513475144751547516475174751847519475204752147522475234752447525475264752747528475294753047531475324753347534475354753647537475384753947540475414754247543475444754547546475474754847549475504755147552475534755447555475564755747558475594756047561475624756347564475654756647567475684756947570475714757247573475744757547576475774757847579475804758147582475834758447585475864758747588475894759047591475924759347594475954759647597475984759947600476014760247603476044760547606476074760847609476104761147612476134761447615476164761747618476194762047621476224762347624476254762647627476284762947630476314763247633476344763547636476374763847639476404764147642476434764447645476464764747648476494765047651476524765347654476554765647657476584765947660476614766247663476644766547666476674766847669476704767147672476734767447675476764767747678476794768047681476824768347684476854768647687476884768947690476914769247693476944769547696476974769847699477004770147702477034770447705477064770747708477094771047711477124771347714477154771647717477184771947720477214772247723477244772547726477274772847729477304773147732477334773447735477364773747738477394774047741477424774347744477454774647747477484774947750477514775247753477544775547756477574775847759477604776147762477634776447765477664776747768477694777047771477724777347774477754777647777477784777947780477814778247783477844778547786477874778847789477904779147792477934779447795477964779747798477994780047801478024780347804478054780647807478084780947810478114781247813478144781547816478174781847819478204782147822478234782447825478264782747828478294783047831478324783347834478354783647837478384783947840478414784247843478444784547846478474784847849478504785147852478534785447855478564785747858478594786047861478624786347864478654786647867478684786947870478714787247873478744787547876478774787847879478804788147882478834788447885478864788747888478894789047891478924789347894478954789647897478984789947900479014790247903479044790547906479074790847909479104791147912479134791447915479164791747918479194792047921479224792347924479254792647927479284792947930479314793247933479344793547936479374793847939479404794147942479434794447945479464794747948479494795047951479524795347954479554795647957479584795947960479614796247963479644796547966479674796847969479704797147972479734797447975479764797747978479794798047981479824798347984479854798647987479884798947990479914799247993479944799547996479974799847999480004800148002480034800448005480064800748008480094801048011480124801348014480154801648017480184801948020480214802248023480244802548026480274802848029480304803148032480334803448035480364803748038480394804048041480424804348044480454804648047480484804948050480514805248053480544805548056480574805848059480604806148062480634806448065480664806748068480694807048071480724807348074480754807648077480784807948080480814808248083480844808548086480874808848089480904809148092480934809448095480964809748098480994810048101481024810348104481054810648107481084810948110481114811248113481144811548116481174811848119481204812148122481234812448125481264812748128481294813048131481324813348134481354813648137481384813948140481414814248143481444814548146481474814848149481504815148152481534815448155481564815748158481594816048161481624816348164481654816648167481684816948170481714817248173481744817548176481774817848179481804818148182481834818448185481864818748188481894819048191481924819348194481954819648197481984819948200482014820248203482044820548206482074820848209482104821148212482134821448215482164821748218482194822048221482224822348224482254822648227482284822948230482314823248233482344823548236482374823848239482404824148242482434824448245482464824748248482494825048251482524825348254482554825648257482584825948260482614826248263482644826548266482674826848269482704827148272482734827448275482764827748278482794828048281482824828348284482854828648287482884828948290482914829248293482944829548296482974829848299483004830148302483034830448305483064830748308483094831048311483124831348314483154831648317483184831948320483214832248323483244832548326483274832848329483304833148332483334833448335483364833748338483394834048341483424834348344483454834648347483484834948350483514835248353483544835548356483574835848359483604836148362483634836448365483664836748368483694837048371483724837348374483754837648377483784837948380483814838248383483844838548386483874838848389483904839148392483934839448395483964839748398483994840048401484024840348404484054840648407484084840948410484114841248413484144841548416484174841848419484204842148422484234842448425484264842748428484294843048431484324843348434484354843648437484384843948440484414844248443484444844548446484474844848449484504845148452484534845448455484564845748458484594846048461484624846348464484654846648467484684846948470484714847248473484744847548476484774847848479484804848148482484834848448485484864848748488484894849048491484924849348494484954849648497484984849948500485014850248503485044850548506485074850848509485104851148512485134851448515485164851748518485194852048521485224852348524485254852648527485284852948530485314853248533485344853548536485374853848539485404854148542485434854448545485464854748548485494855048551485524855348554485554855648557485584855948560485614856248563485644856548566485674856848569485704857148572485734857448575485764857748578485794858048581485824858348584485854858648587485884858948590485914859248593485944859548596485974859848599486004860148602486034860448605486064860748608486094861048611486124861348614486154861648617486184861948620486214862248623486244862548626486274862848629486304863148632486334863448635486364863748638486394864048641486424864348644486454864648647486484864948650486514865248653486544865548656486574865848659486604866148662486634866448665486664866748668486694867048671486724867348674486754867648677486784867948680486814868248683486844868548686486874868848689486904869148692486934869448695486964869748698486994870048701487024870348704487054870648707487084870948710487114871248713487144871548716487174871848719487204872148722487234872448725487264872748728487294873048731487324873348734487354873648737487384873948740487414874248743487444874548746487474874848749487504875148752487534875448755487564875748758487594876048761487624876348764487654876648767487684876948770487714877248773487744877548776487774877848779487804878148782487834878448785487864878748788487894879048791487924879348794487954879648797487984879948800488014880248803488044880548806488074880848809488104881148812488134881448815488164881748818488194882048821488224882348824488254882648827488284882948830488314883248833488344883548836488374883848839488404884148842488434884448845488464884748848488494885048851488524885348854488554885648857488584885948860488614886248863488644886548866488674886848869488704887148872488734887448875488764887748878488794888048881488824888348884488854888648887488884888948890488914889248893488944889548896488974889848899489004890148902489034890448905489064890748908489094891048911489124891348914489154891648917489184891948920489214892248923489244892548926489274892848929489304893148932489334893448935489364893748938489394894048941489424894348944489454894648947489484894948950489514895248953489544895548956489574895848959489604896148962489634896448965489664896748968489694897048971489724897348974489754897648977489784897948980489814898248983489844898548986489874898848989489904899148992489934899448995489964899748998489994900049001490024900349004490054900649007490084900949010490114901249013490144901549016490174901849019490204902149022490234902449025490264902749028490294903049031490324903349034490354903649037490384903949040490414904249043490444904549046490474904849049490504905149052490534905449055490564905749058490594906049061490624906349064490654906649067490684906949070490714907249073490744907549076490774907849079490804908149082490834908449085490864908749088490894909049091490924909349094490954909649097490984909949100491014910249103491044910549106491074910849109491104911149112491134911449115491164911749118491194912049121491224912349124491254912649127491284912949130491314913249133491344913549136491374913849139491404914149142491434914449145491464914749148491494915049151491524915349154491554915649157491584915949160491614916249163491644916549166491674916849169491704917149172491734917449175491764917749178491794918049181491824918349184491854918649187491884918949190491914919249193491944919549196491974919849199492004920149202492034920449205492064920749208492094921049211492124921349214492154921649217492184921949220492214922249223492244922549226492274922849229492304923149232492334923449235492364923749238492394924049241492424924349244492454924649247492484924949250492514925249253492544925549256492574925849259492604926149262492634926449265492664926749268492694927049271492724927349274492754927649277492784927949280492814928249283492844928549286492874928849289492904929149292492934929449295492964929749298492994930049301493024930349304493054930649307493084930949310493114931249313493144931549316493174931849319493204932149322493234932449325493264932749328493294933049331493324933349334493354933649337493384933949340493414934249343493444934549346493474934849349493504935149352493534935449355493564935749358493594936049361493624936349364493654936649367493684936949370493714937249373493744937549376493774937849379493804938149382493834938449385493864938749388493894939049391493924939349394493954939649397493984939949400494014940249403494044940549406494074940849409494104941149412494134941449415494164941749418494194942049421494224942349424494254942649427494284942949430494314943249433494344943549436494374943849439494404944149442494434944449445494464944749448494494945049451494524945349454494554945649457494584945949460494614946249463494644946549466494674946849469494704947149472494734947449475494764947749478494794948049481494824948349484494854948649487494884948949490494914949249493494944949549496494974949849499495004950149502495034950449505495064950749508495094951049511495124951349514495154951649517495184951949520495214952249523495244952549526495274952849529495304953149532495334953449535495364953749538495394954049541495424954349544495454954649547495484954949550495514955249553495544955549556495574955849559495604956149562495634956449565495664956749568495694957049571495724957349574495754957649577495784957949580495814958249583495844958549586495874958849589495904959149592495934959449595495964959749598495994960049601496024960349604496054960649607496084960949610496114961249613496144961549616496174961849619496204962149622496234962449625496264962749628496294963049631496324963349634496354963649637496384963949640496414964249643496444964549646496474964849649496504965149652496534965449655496564965749658496594966049661496624966349664496654966649667496684966949670496714967249673496744967549676496774967849679496804968149682496834968449685496864968749688496894969049691496924969349694496954969649697496984969949700497014970249703497044970549706497074970849709497104971149712497134971449715497164971749718497194972049721497224972349724497254972649727497284972949730497314973249733497344973549736497374973849739497404974149742497434974449745497464974749748497494975049751497524975349754497554975649757497584975949760497614976249763497644976549766497674976849769497704977149772497734977449775497764977749778497794978049781497824978349784497854978649787497884978949790497914979249793497944979549796497974979849799498004980149802498034980449805498064980749808498094981049811498124981349814498154981649817498184981949820498214982249823498244982549826498274982849829498304983149832498334983449835498364983749838498394984049841498424984349844498454984649847498484984949850498514985249853498544985549856498574985849859498604986149862498634986449865498664986749868498694987049871498724987349874498754987649877498784987949880498814988249883498844988549886498874988849889498904989149892498934989449895498964989749898498994990049901499024990349904499054990649907499084990949910499114991249913499144991549916499174991849919499204992149922499234992449925499264992749928499294993049931499324993349934499354993649937499384993949940499414994249943499444994549946499474994849949499504995149952499534995449955499564995749958499594996049961499624996349964499654996649967499684996949970499714997249973499744997549976499774997849979499804998149982499834998449985499864998749988499894999049991499924999349994499954999649997499984999950000500015000250003500045000550006500075000850009500105001150012500135001450015500165001750018500195002050021500225002350024500255002650027500285002950030500315003250033500345003550036500375003850039500405004150042500435004450045500465004750048500495005050051500525005350054500555005650057500585005950060500615006250063500645006550066500675006850069500705007150072500735007450075500765007750078500795008050081500825008350084500855008650087500885008950090500915009250093500945009550096500975009850099501005010150102501035010450105501065010750108501095011050111501125011350114501155011650117501185011950120501215012250123501245012550126501275012850129501305013150132501335013450135501365013750138501395014050141501425014350144501455014650147501485014950150501515015250153501545015550156501575015850159501605016150162501635016450165501665016750168501695017050171501725017350174501755017650177501785017950180501815018250183501845018550186501875018850189501905019150192501935019450195501965019750198501995020050201502025020350204502055020650207502085020950210502115021250213502145021550216502175021850219502205022150222502235022450225502265022750228502295023050231502325023350234502355023650237502385023950240502415024250243502445024550246502475024850249502505025150252502535025450255502565025750258502595026050261502625026350264502655026650267502685026950270502715027250273502745027550276502775027850279502805028150282502835028450285502865028750288502895029050291502925029350294502955029650297502985029950300503015030250303503045030550306503075030850309503105031150312503135031450315503165031750318503195032050321503225032350324503255032650327503285032950330503315033250333503345033550336503375033850339503405034150342503435034450345503465034750348503495035050351503525035350354503555035650357503585035950360503615036250363503645036550366503675036850369503705037150372503735037450375503765037750378503795038050381503825038350384503855038650387503885038950390503915039250393503945039550396503975039850399504005040150402504035040450405504065040750408504095041050411504125041350414504155041650417504185041950420504215042250423504245042550426504275042850429504305043150432504335043450435504365043750438504395044050441504425044350444504455044650447504485044950450504515045250453504545045550456504575045850459504605046150462504635046450465504665046750468504695047050471504725047350474504755047650477504785047950480504815048250483504845048550486504875048850489504905049150492504935049450495504965049750498504995050050501505025050350504505055050650507505085050950510505115051250513505145051550516505175051850519505205052150522505235052450525505265052750528505295053050531505325053350534505355053650537505385053950540505415054250543505445054550546505475054850549505505055150552505535055450555505565055750558505595056050561505625056350564505655056650567505685056950570505715057250573505745057550576505775057850579505805058150582505835058450585505865058750588505895059050591505925059350594505955059650597505985059950600506015060250603506045060550606506075060850609506105061150612506135061450615506165061750618506195062050621506225062350624506255062650627506285062950630506315063250633506345063550636506375063850639506405064150642506435064450645506465064750648506495065050651506525065350654506555065650657506585065950660506615066250663506645066550666506675066850669506705067150672506735067450675506765067750678506795068050681506825068350684506855068650687506885068950690506915069250693506945069550696506975069850699507005070150702507035070450705507065070750708507095071050711507125071350714507155071650717507185071950720507215072250723507245072550726507275072850729507305073150732507335073450735507365073750738507395074050741507425074350744507455074650747507485074950750507515075250753507545075550756507575075850759507605076150762507635076450765507665076750768507695077050771507725077350774507755077650777507785077950780507815078250783507845078550786507875078850789507905079150792507935079450795507965079750798507995080050801508025080350804508055080650807508085080950810508115081250813508145081550816508175081850819508205082150822508235082450825508265082750828508295083050831508325083350834508355083650837508385083950840508415084250843508445084550846508475084850849508505085150852508535085450855508565085750858508595086050861508625086350864508655086650867508685086950870508715087250873508745087550876508775087850879508805088150882508835088450885508865088750888508895089050891508925089350894508955089650897508985089950900509015090250903509045090550906509075090850909509105091150912509135091450915509165091750918509195092050921509225092350924509255092650927509285092950930509315093250933509345093550936509375093850939509405094150942509435094450945509465094750948509495095050951509525095350954509555095650957509585095950960509615096250963509645096550966509675096850969509705097150972509735097450975509765097750978509795098050981509825098350984509855098650987509885098950990509915099250993509945099550996509975099850999510005100151002510035100451005510065100751008510095101051011510125101351014510155101651017510185101951020510215102251023510245102551026510275102851029510305103151032510335103451035510365103751038510395104051041510425104351044510455104651047510485104951050510515105251053510545105551056510575105851059510605106151062510635106451065510665106751068510695107051071510725107351074510755107651077510785107951080510815108251083510845108551086510875108851089510905109151092510935109451095510965109751098510995110051101511025110351104511055110651107511085110951110511115111251113511145111551116511175111851119511205112151122511235112451125511265112751128511295113051131511325113351134511355113651137511385113951140511415114251143511445114551146511475114851149511505115151152511535115451155511565115751158511595116051161511625116351164511655116651167511685116951170511715117251173511745117551176511775117851179511805118151182511835118451185511865118751188511895119051191511925119351194511955119651197511985119951200512015120251203512045120551206512075120851209512105121151212512135121451215512165121751218512195122051221512225122351224512255122651227512285122951230512315123251233512345123551236512375123851239512405124151242512435124451245512465124751248512495125051251512525125351254512555125651257512585125951260512615126251263512645126551266512675126851269512705127151272512735127451275512765127751278512795128051281512825128351284512855128651287512885128951290512915129251293512945129551296512975129851299513005130151302513035130451305513065130751308513095131051311513125131351314513155131651317513185131951320513215132251323513245132551326513275132851329513305133151332513335133451335513365133751338513395134051341513425134351344513455134651347513485134951350513515135251353513545135551356513575135851359513605136151362513635136451365513665136751368513695137051371513725137351374513755137651377513785137951380513815138251383513845138551386513875138851389513905139151392513935139451395513965139751398513995140051401514025140351404514055140651407514085140951410514115141251413514145141551416514175141851419514205142151422514235142451425514265142751428514295143051431514325143351434514355143651437514385143951440514415144251443514445144551446514475144851449514505145151452514535145451455514565145751458514595146051461514625146351464514655146651467514685146951470514715147251473514745147551476514775147851479514805148151482514835148451485514865148751488514895149051491514925149351494514955149651497514985149951500515015150251503515045150551506515075150851509515105151151512515135151451515515165151751518515195152051521515225152351524515255152651527515285152951530515315153251533515345153551536515375153851539515405154151542515435154451545515465154751548515495155051551515525155351554515555155651557515585155951560515615156251563515645156551566515675156851569515705157151572515735157451575515765157751578515795158051581515825158351584515855158651587515885158951590515915159251593515945159551596515975159851599516005160151602516035160451605516065160751608516095161051611516125161351614516155161651617516185161951620516215162251623516245162551626516275162851629516305163151632516335163451635516365163751638516395164051641516425164351644516455164651647516485164951650516515165251653516545165551656516575165851659516605166151662516635166451665516665166751668516695167051671516725167351674516755167651677516785167951680516815168251683516845168551686516875168851689516905169151692516935169451695516965169751698516995170051701517025170351704517055170651707517085170951710517115171251713517145171551716517175171851719517205172151722517235172451725517265172751728517295173051731517325173351734517355173651737517385173951740517415174251743517445174551746517475174851749517505175151752517535175451755517565175751758517595176051761517625176351764517655176651767517685176951770517715177251773517745177551776517775177851779517805178151782517835178451785517865178751788517895179051791517925179351794517955179651797517985179951800518015180251803518045180551806518075180851809518105181151812518135181451815518165181751818518195182051821518225182351824518255182651827518285182951830518315183251833518345183551836518375183851839518405184151842518435184451845518465184751848518495185051851518525185351854518555185651857518585185951860518615186251863518645186551866518675186851869518705187151872518735187451875518765187751878518795188051881518825188351884518855188651887518885188951890518915189251893518945189551896518975189851899519005190151902519035190451905519065190751908519095191051911519125191351914519155191651917519185191951920519215192251923519245192551926519275192851929519305193151932519335193451935519365193751938519395194051941519425194351944519455194651947519485194951950519515195251953519545195551956519575195851959519605196151962519635196451965519665196751968519695197051971519725197351974519755197651977519785197951980519815198251983519845198551986519875198851989519905199151992519935199451995519965199751998519995200052001520025200352004520055200652007520085200952010520115201252013520145201552016520175201852019520205202152022520235202452025520265202752028520295203052031520325203352034520355203652037520385203952040520415204252043520445204552046520475204852049520505205152052520535205452055520565205752058520595206052061520625206352064520655206652067520685206952070520715207252073520745207552076520775207852079520805208152082520835208452085520865208752088520895209052091520925209352094520955209652097520985209952100521015210252103521045210552106521075210852109521105211152112521135211452115521165211752118521195212052121521225212352124521255212652127521285212952130521315213252133521345213552136521375213852139521405214152142521435214452145521465214752148521495215052151521525215352154521555215652157521585215952160521615216252163521645216552166521675216852169521705217152172521735217452175521765217752178521795218052181521825218352184521855218652187521885218952190521915219252193521945219552196521975219852199522005220152202522035220452205522065220752208522095221052211522125221352214522155221652217522185221952220522215222252223522245222552226522275222852229522305223152232522335223452235522365223752238522395224052241522425224352244522455224652247522485224952250522515225252253522545225552256522575225852259522605226152262522635226452265522665226752268522695227052271522725227352274522755227652277522785227952280522815228252283522845228552286522875228852289522905229152292522935229452295522965229752298522995230052301523025230352304523055230652307523085230952310523115231252313523145231552316523175231852319523205232152322523235232452325523265232752328523295233052331523325233352334523355233652337523385233952340523415234252343523445234552346523475234852349523505235152352523535235452355523565235752358523595236052361523625236352364523655236652367523685236952370523715237252373523745237552376523775237852379523805238152382523835238452385523865238752388523895239052391523925239352394523955239652397523985239952400524015240252403524045240552406524075240852409524105241152412524135241452415524165241752418524195242052421524225242352424524255242652427524285242952430524315243252433524345243552436524375243852439524405244152442524435244452445524465244752448524495245052451524525245352454524555245652457524585245952460524615246252463524645246552466524675246852469524705247152472524735247452475524765247752478524795248052481524825248352484524855248652487524885248952490524915249252493524945249552496524975249852499525005250152502525035250452505525065250752508525095251052511525125251352514525155251652517525185251952520525215252252523525245252552526525275252852529525305253152532525335253452535525365253752538525395254052541525425254352544525455254652547525485254952550525515255252553525545255552556525575255852559525605256152562525635256452565525665256752568525695257052571525725257352574525755257652577525785257952580525815258252583525845258552586525875258852589525905259152592525935259452595525965259752598525995260052601526025260352604526055260652607526085260952610526115261252613526145261552616526175261852619526205262152622526235262452625526265262752628526295263052631526325263352634526355263652637526385263952640526415264252643526445264552646526475264852649526505265152652526535265452655526565265752658526595266052661526625266352664526655266652667526685266952670526715267252673526745267552676526775267852679526805268152682526835268452685526865268752688526895269052691526925269352694526955269652697526985269952700527015270252703527045270552706527075270852709527105271152712527135271452715527165271752718527195272052721527225272352724527255272652727527285272952730527315273252733527345273552736527375273852739527405274152742527435274452745527465274752748527495275052751527525275352754527555275652757527585275952760527615276252763527645276552766527675276852769527705277152772527735277452775527765277752778527795278052781527825278352784527855278652787527885278952790527915279252793527945279552796527975279852799528005280152802528035280452805528065280752808528095281052811528125281352814528155281652817528185281952820528215282252823528245282552826528275282852829528305283152832528335283452835528365283752838528395284052841528425284352844528455284652847528485284952850528515285252853528545285552856528575285852859528605286152862528635286452865528665286752868528695287052871528725287352874528755287652877528785287952880528815288252883528845288552886528875288852889528905289152892528935289452895528965289752898528995290052901529025290352904529055290652907529085290952910529115291252913529145291552916529175291852919529205292152922529235292452925529265292752928529295293052931529325293352934529355293652937529385293952940529415294252943529445294552946529475294852949529505295152952529535295452955529565295752958529595296052961529625296352964529655296652967529685296952970529715297252973529745297552976529775297852979529805298152982529835298452985529865298752988529895299052991529925299352994529955299652997529985299953000530015300253003530045300553006530075300853009530105301153012530135301453015530165301753018530195302053021530225302353024530255302653027530285302953030530315303253033530345303553036530375303853039530405304153042530435304453045530465304753048530495305053051530525305353054530555305653057530585305953060530615306253063530645306553066530675306853069530705307153072530735307453075530765307753078530795308053081530825308353084530855308653087530885308953090530915309253093530945309553096530975309853099531005310153102531035310453105531065310753108531095311053111531125311353114531155311653117531185311953120531215312253123531245312553126531275312853129531305313153132531335313453135531365313753138531395314053141531425314353144531455314653147531485314953150531515315253153531545315553156531575315853159531605316153162531635316453165531665316753168531695317053171531725317353174531755317653177531785317953180531815318253183531845318553186531875318853189531905319153192531935319453195531965319753198531995320053201532025320353204532055320653207532085320953210532115321253213532145321553216532175321853219532205322153222532235322453225532265322753228532295323053231532325323353234532355323653237532385323953240532415324253243532445324553246532475324853249532505325153252532535325453255532565325753258532595326053261532625326353264532655326653267532685326953270532715327253273532745327553276532775327853279532805328153282532835328453285532865328753288532895329053291532925329353294532955329653297532985329953300533015330253303533045330553306533075330853309533105331153312533135331453315533165331753318533195332053321533225332353324533255332653327533285332953330533315333253333533345333553336533375333853339533405334153342533435334453345533465334753348533495335053351533525335353354533555335653357533585335953360533615336253363533645336553366533675336853369533705337153372533735337453375533765337753378533795338053381533825338353384533855338653387533885338953390533915339253393533945339553396533975339853399534005340153402534035340453405534065340753408534095341053411534125341353414534155341653417534185341953420534215342253423534245342553426534275342853429534305343153432534335343453435534365343753438534395344053441534425344353444534455344653447534485344953450534515345253453534545345553456534575345853459534605346153462534635346453465534665346753468534695347053471534725347353474534755347653477534785347953480534815348253483534845348553486534875348853489534905349153492534935349453495534965349753498534995350053501535025350353504535055350653507535085350953510535115351253513535145351553516535175351853519535205352153522535235352453525535265352753528535295353053531535325353353534535355353653537535385353953540535415354253543535445354553546535475354853549535505355153552535535355453555535565355753558535595356053561535625356353564535655356653567535685356953570535715357253573535745357553576535775357853579535805358153582535835358453585535865358753588535895359053591535925359353594535955359653597535985359953600536015360253603536045360553606536075360853609536105361153612536135361453615536165361753618536195362053621536225362353624536255362653627536285362953630536315363253633536345363553636536375363853639536405364153642536435364453645536465364753648536495365053651536525365353654536555365653657536585365953660536615366253663536645366553666536675366853669536705367153672536735367453675536765367753678536795368053681536825368353684536855368653687536885368953690536915369253693536945369553696536975369853699537005370153702537035370453705537065370753708537095371053711537125371353714537155371653717537185371953720537215372253723537245372553726537275372853729537305373153732537335373453735537365373753738537395374053741537425374353744537455374653747537485374953750537515375253753537545375553756537575375853759537605376153762537635376453765537665376753768537695377053771537725377353774537755377653777537785377953780537815378253783537845378553786537875378853789537905379153792537935379453795537965379753798537995380053801538025380353804538055380653807538085380953810538115381253813538145381553816538175381853819538205382153822538235382453825538265382753828538295383053831538325383353834538355383653837538385383953840538415384253843538445384553846538475384853849538505385153852538535385453855538565385753858538595386053861538625386353864538655386653867538685386953870538715387253873538745387553876538775387853879538805388153882538835388453885538865388753888538895389053891538925389353894538955389653897538985389953900539015390253903539045390553906539075390853909539105391153912539135391453915539165391753918539195392053921539225392353924539255392653927539285392953930539315393253933539345393553936539375393853939539405394153942539435394453945539465394753948539495395053951539525395353954539555395653957539585395953960539615396253963539645396553966539675396853969539705397153972539735397453975539765397753978539795398053981539825398353984539855398653987539885398953990539915399253993539945399553996539975399853999540005400154002540035400454005540065400754008540095401054011540125401354014540155401654017540185401954020540215402254023540245402554026540275402854029540305403154032540335403454035540365403754038540395404054041540425404354044540455404654047540485404954050540515405254053540545405554056540575405854059540605406154062540635406454065540665406754068540695407054071540725407354074540755407654077540785407954080540815408254083540845408554086540875408854089540905409154092540935409454095540965409754098540995410054101541025410354104541055410654107541085410954110541115411254113541145411554116541175411854119541205412154122541235412454125541265412754128541295413054131541325413354134541355413654137541385413954140541415414254143541445414554146541475414854149541505415154152541535415454155541565415754158541595416054161541625416354164541655416654167541685416954170541715417254173541745417554176541775417854179541805418154182541835418454185541865418754188541895419054191541925419354194541955419654197541985419954200542015420254203542045420554206542075420854209542105421154212542135421454215542165421754218542195422054221542225422354224542255422654227542285422954230542315423254233542345423554236542375423854239542405424154242542435424454245542465424754248542495425054251542525425354254542555425654257542585425954260542615426254263542645426554266542675426854269542705427154272542735427454275542765427754278542795428054281542825428354284542855428654287542885428954290542915429254293542945429554296542975429854299543005430154302543035430454305543065430754308543095431054311543125431354314543155431654317543185431954320543215432254323543245432554326543275432854329543305433154332543335433454335543365433754338543395434054341543425434354344543455434654347543485434954350543515435254353543545435554356543575435854359543605436154362543635436454365543665436754368543695437054371543725437354374543755437654377543785437954380543815438254383543845438554386543875438854389543905439154392543935439454395543965439754398543995440054401544025440354404544055440654407544085440954410544115441254413544145441554416544175441854419544205442154422544235442454425544265442754428544295443054431544325443354434544355443654437544385443954440544415444254443544445444554446544475444854449544505445154452544535445454455544565445754458544595446054461544625446354464544655446654467544685446954470544715447254473544745447554476544775447854479544805448154482544835448454485544865448754488544895449054491544925449354494544955449654497544985449954500545015450254503545045450554506545075450854509545105451154512545135451454515545165451754518545195452054521545225452354524545255452654527545285452954530545315453254533545345453554536545375453854539545405454154542545435454454545545465454754548545495455054551545525455354554545555455654557545585455954560545615456254563545645456554566545675456854569545705457154572545735457454575545765457754578545795458054581545825458354584545855458654587545885458954590545915459254593545945459554596545975459854599546005460154602546035460454605546065460754608546095461054611546125461354614546155461654617546185461954620546215462254623546245462554626546275462854629546305463154632546335463454635546365463754638546395464054641546425464354644546455464654647546485464954650546515465254653546545465554656546575465854659546605466154662546635466454665546665466754668546695467054671546725467354674546755467654677546785467954680546815468254683546845468554686546875468854689546905469154692546935469454695546965469754698546995470054701547025470354704547055470654707547085470954710547115471254713547145471554716547175471854719547205472154722547235472454725547265472754728547295473054731547325473354734547355473654737547385473954740547415474254743547445474554746547475474854749547505475154752547535475454755547565475754758547595476054761547625476354764547655476654767547685476954770547715477254773547745477554776547775477854779547805478154782547835478454785547865478754788547895479054791547925479354794547955479654797547985479954800548015480254803548045480554806548075480854809548105481154812548135481454815548165481754818548195482054821548225482354824548255482654827548285482954830548315483254833548345483554836548375483854839548405484154842548435484454845548465484754848548495485054851548525485354854548555485654857548585485954860548615486254863548645486554866548675486854869548705487154872548735487454875548765487754878548795488054881548825488354884548855488654887548885488954890548915489254893548945489554896548975489854899549005490154902549035490454905549065490754908549095491054911549125491354914549155491654917549185491954920549215492254923549245492554926549275492854929549305493154932549335493454935549365493754938549395494054941549425494354944549455494654947549485494954950549515495254953549545495554956549575495854959549605496154962549635496454965549665496754968549695497054971549725497354974549755497654977549785497954980549815498254983549845498554986549875498854989549905499154992549935499454995549965499754998549995500055001550025500355004550055500655007550085500955010550115501255013550145501555016550175501855019550205502155022550235502455025550265502755028550295503055031550325503355034550355503655037550385503955040550415504255043550445504555046550475504855049550505505155052550535505455055550565505755058550595506055061550625506355064550655506655067550685506955070550715507255073550745507555076550775507855079550805508155082550835508455085550865508755088550895509055091550925509355094550955509655097550985509955100551015510255103551045510555106551075510855109551105511155112551135511455115551165511755118551195512055121551225512355124551255512655127551285512955130551315513255133551345513555136551375513855139551405514155142551435514455145551465514755148551495515055151551525515355154551555515655157551585515955160551615516255163551645516555166551675516855169551705517155172551735517455175551765517755178551795518055181551825518355184551855518655187551885518955190551915519255193551945519555196551975519855199552005520155202552035520455205552065520755208552095521055211552125521355214552155521655217552185521955220552215522255223552245522555226552275522855229552305523155232552335523455235552365523755238552395524055241552425524355244552455524655247552485524955250552515525255253552545525555256552575525855259552605526155262552635526455265552665526755268552695527055271552725527355274552755527655277552785527955280552815528255283552845528555286552875528855289552905529155292552935529455295552965529755298552995530055301553025530355304553055530655307553085530955310553115531255313553145531555316553175531855319553205532155322553235532455325553265532755328553295533055331553325533355334553355533655337553385533955340553415534255343553445534555346553475534855349553505535155352553535535455355553565535755358553595536055361553625536355364553655536655367553685536955370553715537255373553745537555376553775537855379553805538155382553835538455385553865538755388553895539055391553925539355394553955539655397553985539955400554015540255403554045540555406554075540855409554105541155412554135541455415554165541755418554195542055421554225542355424554255542655427554285542955430554315543255433554345543555436554375543855439554405544155442554435544455445554465544755448554495545055451554525545355454554555545655457554585545955460554615546255463554645546555466554675546855469554705547155472554735547455475554765547755478554795548055481554825548355484554855548655487554885548955490554915549255493554945549555496554975549855499555005550155502555035550455505555065550755508555095551055511555125551355514555155551655517555185551955520555215552255523555245552555526555275552855529555305553155532555335553455535555365553755538555395554055541555425554355544555455554655547555485554955550555515555255553555545555555556555575555855559555605556155562555635556455565555665556755568555695557055571555725557355574555755557655577555785557955580555815558255583555845558555586555875558855589555905559155592555935559455595555965559755598555995560055601556025560355604556055560655607556085560955610556115561255613556145561555616556175561855619556205562155622556235562455625556265562755628556295563055631556325563355634556355563655637556385563955640556415564255643556445564555646556475564855649556505565155652556535565455655556565565755658556595566055661556625566355664556655566655667556685566955670556715567255673556745567555676556775567855679556805568155682556835568455685556865568755688556895569055691556925569355694556955569655697556985569955700557015570255703557045570555706557075570855709557105571155712557135571455715557165571755718557195572055721557225572355724557255572655727557285572955730557315573255733557345573555736557375573855739557405574155742557435574455745557465574755748557495575055751557525575355754557555575655757557585575955760557615576255763557645576555766557675576855769557705577155772557735577455775557765577755778557795578055781557825578355784557855578655787557885578955790557915579255793557945579555796557975579855799558005580155802558035580455805558065580755808558095581055811558125581355814558155581655817558185581955820558215582255823558245582555826558275582855829558305583155832558335583455835558365583755838558395584055841558425584355844558455584655847558485584955850558515585255853558545585555856558575585855859558605586155862558635586455865558665586755868558695587055871558725587355874558755587655877558785587955880558815588255883558845588555886558875588855889558905589155892558935589455895558965589755898558995590055901559025590355904559055590655907559085590955910559115591255913559145591555916559175591855919559205592155922559235592455925559265592755928559295593055931559325593355934559355593655937559385593955940559415594255943559445594555946559475594855949559505595155952559535595455955559565595755958559595596055961559625596355964559655596655967559685596955970559715597255973559745597555976559775597855979559805598155982559835598455985559865598755988559895599055991559925599355994559955599655997559985599956000560015600256003560045600556006560075600856009560105601156012560135601456015560165601756018560195602056021560225602356024560255602656027560285602956030560315603256033560345603556036560375603856039560405604156042560435604456045560465604756048560495605056051560525605356054560555605656057560585605956060560615606256063560645606556066560675606856069560705607156072560735607456075560765607756078560795608056081560825608356084560855608656087560885608956090560915609256093560945609556096560975609856099561005610156102561035610456105561065610756108561095611056111561125611356114561155611656117561185611956120561215612256123561245612556126561275612856129561305613156132561335613456135561365613756138561395614056141561425614356144561455614656147561485614956150561515615256153561545615556156561575615856159561605616156162561635616456165561665616756168561695617056171561725617356174561755617656177561785617956180561815618256183561845618556186561875618856189561905619156192561935619456195561965619756198561995620056201562025620356204562055620656207562085620956210562115621256213562145621556216562175621856219562205622156222562235622456225562265622756228562295623056231562325623356234562355623656237562385623956240562415624256243562445624556246562475624856249562505625156252562535625456255562565625756258562595626056261562625626356264562655626656267562685626956270562715627256273562745627556276562775627856279562805628156282562835628456285562865628756288562895629056291562925629356294562955629656297562985629956300563015630256303563045630556306563075630856309563105631156312563135631456315563165631756318563195632056321563225632356324563255632656327563285632956330563315633256333563345633556336563375633856339563405634156342563435634456345563465634756348563495635056351563525635356354563555635656357563585635956360563615636256363563645636556366563675636856369563705637156372563735637456375563765637756378563795638056381563825638356384563855638656387563885638956390563915639256393563945639556396563975639856399564005640156402564035640456405564065640756408564095641056411564125641356414564155641656417564185641956420564215642256423564245642556426564275642856429564305643156432564335643456435564365643756438564395644056441564425644356444564455644656447564485644956450564515645256453564545645556456564575645856459564605646156462564635646456465564665646756468564695647056471564725647356474564755647656477564785647956480564815648256483564845648556486564875648856489564905649156492564935649456495564965649756498564995650056501565025650356504565055650656507565085650956510565115651256513565145651556516565175651856519565205652156522565235652456525565265652756528565295653056531565325653356534565355653656537565385653956540565415654256543565445654556546565475654856549565505655156552565535655456555565565655756558565595656056561565625656356564565655656656567565685656956570565715657256573565745657556576565775657856579565805658156582565835658456585565865658756588565895659056591565925659356594565955659656597565985659956600566015660256603566045660556606566075660856609566105661156612566135661456615566165661756618566195662056621566225662356624566255662656627566285662956630566315663256633566345663556636566375663856639566405664156642566435664456645566465664756648566495665056651566525665356654566555665656657566585665956660566615666256663566645666556666566675666856669566705667156672566735667456675566765667756678566795668056681566825668356684566855668656687566885668956690566915669256693566945669556696566975669856699567005670156702567035670456705567065670756708567095671056711567125671356714567155671656717567185671956720567215672256723567245672556726567275672856729567305673156732567335673456735567365673756738567395674056741567425674356744567455674656747567485674956750567515675256753567545675556756567575675856759567605676156762567635676456765567665676756768567695677056771567725677356774567755677656777567785677956780567815678256783567845678556786567875678856789567905679156792567935679456795567965679756798567995680056801568025680356804568055680656807568085680956810568115681256813568145681556816568175681856819568205682156822568235682456825568265682756828568295683056831568325683356834568355683656837568385683956840568415684256843568445684556846568475684856849568505685156852568535685456855568565685756858568595686056861568625686356864568655686656867568685686956870568715687256873568745687556876568775687856879568805688156882568835688456885568865688756888568895689056891568925689356894568955689656897568985689956900569015690256903569045690556906569075690856909569105691156912569135691456915569165691756918569195692056921569225692356924569255692656927569285692956930569315693256933569345693556936569375693856939569405694156942569435694456945569465694756948569495695056951569525695356954569555695656957569585695956960569615696256963569645696556966569675696856969569705697156972569735697456975569765697756978569795698056981569825698356984569855698656987569885698956990569915699256993569945699556996569975699856999570005700157002570035700457005570065700757008570095701057011570125701357014570155701657017570185701957020570215702257023570245702557026570275702857029570305703157032570335703457035570365703757038570395704057041570425704357044570455704657047570485704957050570515705257053570545705557056570575705857059570605706157062570635706457065570665706757068570695707057071570725707357074570755707657077570785707957080570815708257083570845708557086570875708857089570905709157092570935709457095570965709757098570995710057101571025710357104571055710657107571085710957110571115711257113571145711557116571175711857119571205712157122571235712457125571265712757128571295713057131571325713357134571355713657137571385713957140571415714257143571445714557146571475714857149571505715157152571535715457155571565715757158571595716057161571625716357164571655716657167571685716957170571715717257173571745717557176571775717857179571805718157182571835718457185571865718757188571895719057191571925719357194571955719657197571985719957200572015720257203572045720557206572075720857209572105721157212572135721457215572165721757218572195722057221572225722357224572255722657227572285722957230572315723257233572345723557236572375723857239572405724157242572435724457245572465724757248572495725057251572525725357254572555725657257572585725957260572615726257263572645726557266572675726857269572705727157272572735727457275572765727757278572795728057281572825728357284572855728657287572885728957290572915729257293572945729557296572975729857299573005730157302573035730457305573065730757308573095731057311573125731357314573155731657317573185731957320573215732257323573245732557326573275732857329573305733157332573335733457335573365733757338573395734057341573425734357344573455734657347573485734957350573515735257353573545735557356573575735857359573605736157362573635736457365573665736757368573695737057371573725737357374573755737657377573785737957380573815738257383573845738557386573875738857389573905739157392573935739457395573965739757398573995740057401574025740357404574055740657407574085740957410574115741257413574145741557416574175741857419574205742157422574235742457425574265742757428574295743057431574325743357434574355743657437574385743957440574415744257443574445744557446574475744857449574505745157452574535745457455574565745757458574595746057461574625746357464574655746657467574685746957470574715747257473574745747557476574775747857479574805748157482574835748457485574865748757488574895749057491574925749357494574955749657497574985749957500575015750257503575045750557506575075750857509575105751157512575135751457515575165751757518575195752057521575225752357524575255752657527575285752957530575315753257533575345753557536575375753857539575405754157542575435754457545575465754757548575495755057551575525755357554575555755657557575585755957560575615756257563575645756557566575675756857569575705757157572575735757457575575765757757578575795758057581575825758357584575855758657587575885758957590575915759257593575945759557596575975759857599576005760157602576035760457605576065760757608576095761057611576125761357614576155761657617576185761957620576215762257623576245762557626576275762857629576305763157632576335763457635576365763757638576395764057641576425764357644576455764657647576485764957650576515765257653576545765557656576575765857659576605766157662576635766457665576665766757668576695767057671576725767357674576755767657677576785767957680576815768257683576845768557686576875768857689576905769157692576935769457695576965769757698576995770057701577025770357704577055770657707577085770957710577115771257713577145771557716577175771857719577205772157722577235772457725577265772757728577295773057731577325773357734577355773657737577385773957740577415774257743577445774557746577475774857749577505775157752577535775457755577565775757758577595776057761577625776357764577655776657767577685776957770577715777257773577745777557776577775777857779577805778157782577835778457785577865778757788577895779057791577925779357794577955779657797577985779957800578015780257803578045780557806578075780857809578105781157812578135781457815578165781757818578195782057821578225782357824578255782657827578285782957830578315783257833578345783557836578375783857839578405784157842578435784457845578465784757848578495785057851578525785357854578555785657857578585785957860578615786257863578645786557866578675786857869578705787157872578735787457875578765787757878578795788057881578825788357884578855788657887578885788957890578915789257893578945789557896578975789857899579005790157902579035790457905579065790757908579095791057911579125791357914579155791657917579185791957920579215792257923579245792557926579275792857929579305793157932579335793457935579365793757938579395794057941579425794357944579455794657947579485794957950579515795257953579545795557956579575795857959579605796157962579635796457965579665796757968579695797057971579725797357974579755797657977579785797957980579815798257983579845798557986579875798857989579905799157992579935799457995579965799757998579995800058001580025800358004580055800658007580085800958010580115801258013580145801558016580175801858019580205802158022580235802458025580265802758028580295803058031580325803358034580355803658037580385803958040580415804258043580445804558046580475804858049580505805158052580535805458055580565805758058580595806058061580625806358064580655806658067580685806958070580715807258073580745807558076580775807858079580805808158082580835808458085580865808758088580895809058091580925809358094580955809658097580985809958100581015810258103581045810558106581075810858109581105811158112581135811458115581165811758118581195812058121581225812358124581255812658127581285812958130581315813258133581345813558136581375813858139581405814158142581435814458145581465814758148581495815058151581525815358154581555815658157581585815958160581615816258163581645816558166581675816858169581705817158172581735817458175581765817758178581795818058181581825818358184581855818658187581885818958190581915819258193581945819558196581975819858199582005820158202582035820458205582065820758208582095821058211582125821358214582155821658217582185821958220582215822258223582245822558226582275822858229582305823158232582335823458235582365823758238582395824058241582425824358244582455824658247582485824958250582515825258253582545825558256582575825858259582605826158262582635826458265582665826758268582695827058271582725827358274582755827658277582785827958280582815828258283582845828558286582875828858289582905829158292582935829458295582965829758298582995830058301583025830358304583055830658307583085830958310583115831258313583145831558316583175831858319583205832158322583235832458325583265832758328583295833058331583325833358334583355833658337583385833958340583415834258343583445834558346583475834858349583505835158352583535835458355583565835758358583595836058361583625836358364583655836658367583685836958370583715837258373583745837558376583775837858379583805838158382583835838458385583865838758388583895839058391583925839358394583955839658397583985839958400584015840258403584045840558406584075840858409584105841158412584135841458415584165841758418584195842058421584225842358424584255842658427584285842958430584315843258433584345843558436584375843858439584405844158442584435844458445584465844758448584495845058451584525845358454584555845658457584585845958460584615846258463584645846558466584675846858469584705847158472584735847458475584765847758478584795848058481584825848358484584855848658487584885848958490584915849258493584945849558496584975849858499585005850158502585035850458505585065850758508585095851058511585125851358514585155851658517585185851958520585215852258523585245852558526585275852858529585305853158532585335853458535585365853758538585395854058541585425854358544585455854658547585485854958550585515855258553585545855558556585575855858559585605856158562585635856458565585665856758568585695857058571585725857358574585755857658577585785857958580585815858258583585845858558586585875858858589585905859158592585935859458595585965859758598585995860058601586025860358604586055860658607586085860958610586115861258613586145861558616586175861858619586205862158622586235862458625586265862758628586295863058631586325863358634586355863658637586385863958640586415864258643586445864558646586475864858649586505865158652586535865458655586565865758658586595866058661586625866358664586655866658667586685866958670586715867258673586745867558676586775867858679586805868158682586835868458685586865868758688586895869058691586925869358694586955869658697586985869958700587015870258703587045870558706587075870858709587105871158712587135871458715587165871758718587195872058721587225872358724587255872658727587285872958730587315873258733587345873558736587375873858739587405874158742587435874458745587465874758748587495875058751587525875358754587555875658757587585875958760587615876258763587645876558766587675876858769587705877158772587735877458775587765877758778587795878058781587825878358784587855878658787587885878958790587915879258793587945879558796587975879858799588005880158802588035880458805588065880758808588095881058811588125881358814588155881658817588185881958820588215882258823588245882558826588275882858829588305883158832588335883458835588365883758838588395884058841588425884358844588455884658847588485884958850588515885258853588545885558856588575885858859588605886158862588635886458865588665886758868588695887058871588725887358874588755887658877588785887958880588815888258883588845888558886588875888858889588905889158892588935889458895588965889758898588995890058901589025890358904589055890658907589085890958910589115891258913589145891558916589175891858919589205892158922589235892458925589265892758928589295893058931589325893358934589355893658937589385893958940589415894258943589445894558946589475894858949589505895158952589535895458955589565895758958589595896058961589625896358964589655896658967589685896958970589715897258973589745897558976589775897858979589805898158982589835898458985589865898758988589895899058991589925899358994589955899658997589985899959000590015900259003590045900559006590075900859009590105901159012590135901459015590165901759018590195902059021590225902359024590255902659027590285902959030590315903259033590345903559036590375903859039590405904159042590435904459045590465904759048590495905059051590525905359054590555905659057590585905959060590615906259063590645906559066590675906859069590705907159072590735907459075590765907759078590795908059081590825908359084590855908659087590885908959090590915909259093590945909559096590975909859099591005910159102591035910459105591065910759108591095911059111591125911359114591155911659117591185911959120591215912259123591245912559126591275912859129591305913159132591335913459135591365913759138591395914059141591425914359144591455914659147591485914959150591515915259153591545915559156591575915859159591605916159162591635916459165591665916759168591695917059171591725917359174591755917659177591785917959180591815918259183591845918559186591875918859189591905919159192591935919459195591965919759198591995920059201592025920359204592055920659207592085920959210592115921259213592145921559216592175921859219592205922159222592235922459225592265922759228592295923059231592325923359234592355923659237592385923959240592415924259243592445924559246592475924859249592505925159252592535925459255592565925759258592595926059261592625926359264592655926659267592685926959270592715927259273592745927559276592775927859279592805928159282592835928459285592865928759288592895929059291592925929359294592955929659297592985929959300593015930259303593045930559306593075930859309593105931159312593135931459315593165931759318593195932059321593225932359324593255932659327593285932959330593315933259333593345933559336593375933859339593405934159342593435934459345593465934759348593495935059351593525935359354593555935659357593585935959360593615936259363593645936559366593675936859369593705937159372593735937459375593765937759378593795938059381593825938359384593855938659387593885938959390593915939259393593945939559396593975939859399594005940159402594035940459405594065940759408594095941059411594125941359414594155941659417594185941959420594215942259423594245942559426594275942859429594305943159432594335943459435594365943759438594395944059441594425944359444594455944659447594485944959450594515945259453594545945559456594575945859459594605946159462594635946459465594665946759468594695947059471594725947359474594755947659477594785947959480594815948259483594845948559486594875948859489594905949159492594935949459495594965949759498594995950059501595025950359504595055950659507595085950959510595115951259513595145951559516595175951859519595205952159522595235952459525595265952759528595295953059531595325953359534595355953659537595385953959540595415954259543595445954559546595475954859549595505955159552595535955459555595565955759558595595956059561595625956359564595655956659567595685956959570595715957259573595745957559576595775957859579595805958159582595835958459585595865958759588595895959059591595925959359594595955959659597595985959959600596015960259603596045960559606596075960859609596105961159612596135961459615596165961759618596195962059621596225962359624596255962659627596285962959630596315963259633596345963559636596375963859639596405964159642596435964459645596465964759648596495965059651596525965359654596555965659657596585965959660596615966259663596645966559666596675966859669596705967159672596735967459675596765967759678596795968059681596825968359684596855968659687596885968959690596915969259693596945969559696596975969859699597005970159702597035970459705597065970759708597095971059711597125971359714597155971659717597185971959720597215972259723597245972559726597275972859729597305973159732597335973459735597365973759738597395974059741597425974359744597455974659747597485974959750597515975259753597545975559756597575975859759597605976159762597635976459765597665976759768597695977059771597725977359774597755977659777597785977959780597815978259783597845978559786597875978859789597905979159792597935979459795597965979759798597995980059801598025980359804598055980659807598085980959810598115981259813598145981559816598175981859819598205982159822598235982459825598265982759828598295983059831598325983359834598355983659837598385983959840598415984259843598445984559846598475984859849598505985159852598535985459855598565985759858598595986059861598625986359864598655986659867598685986959870598715987259873598745987559876598775987859879598805988159882598835988459885598865988759888598895989059891598925989359894598955989659897598985989959900599015990259903599045990559906599075990859909599105991159912599135991459915599165991759918599195992059921599225992359924599255992659927599285992959930599315993259933599345993559936599375993859939599405994159942599435994459945599465994759948599495995059951599525995359954599555995659957599585995959960599615996259963599645996559966599675996859969599705997159972599735997459975599765997759978599795998059981599825998359984599855998659987599885998959990599915999259993599945999559996599975999859999600006000160002600036000460005600066000760008600096001060011600126001360014600156001660017600186001960020600216002260023600246002560026600276002860029600306003160032600336003460035600366003760038600396004060041600426004360044600456004660047600486004960050600516005260053600546005560056600576005860059600606006160062600636006460065600666006760068600696007060071600726007360074600756007660077600786007960080600816008260083600846008560086600876008860089600906009160092600936009460095600966009760098600996010060101601026010360104601056010660107601086010960110601116011260113601146011560116601176011860119601206012160122601236012460125601266012760128601296013060131601326013360134601356013660137601386013960140601416014260143601446014560146601476014860149601506015160152601536015460155601566015760158601596016060161601626016360164601656016660167601686016960170601716017260173601746017560176601776017860179601806018160182601836018460185601866018760188601896019060191601926019360194601956019660197601986019960200602016020260203602046020560206602076020860209602106021160212602136021460215602166021760218602196022060221602226022360224602256022660227602286022960230602316023260233602346023560236602376023860239602406024160242602436024460245602466024760248602496025060251602526025360254602556025660257602586025960260602616026260263602646026560266602676026860269602706027160272602736027460275602766027760278602796028060281602826028360284602856028660287602886028960290602916029260293602946029560296602976029860299603006030160302603036030460305603066030760308603096031060311603126031360314603156031660317603186031960320603216032260323603246032560326603276032860329603306033160332603336033460335603366033760338603396034060341603426034360344603456034660347603486034960350603516035260353603546035560356603576035860359603606036160362603636036460365603666036760368603696037060371603726037360374603756037660377603786037960380603816038260383603846038560386603876038860389603906039160392603936039460395603966039760398603996040060401604026040360404604056040660407604086040960410604116041260413604146041560416604176041860419604206042160422604236042460425604266042760428604296043060431604326043360434604356043660437604386043960440604416044260443604446044560446604476044860449604506045160452604536045460455604566045760458604596046060461604626046360464604656046660467604686046960470604716047260473604746047560476604776047860479604806048160482604836048460485604866048760488604896049060491604926049360494604956049660497604986049960500605016050260503605046050560506605076050860509605106051160512605136051460515605166051760518605196052060521605226052360524605256052660527605286052960530605316053260533605346053560536605376053860539605406054160542605436054460545605466054760548605496055060551605526055360554605556055660557605586055960560605616056260563605646056560566605676056860569605706057160572605736057460575605766057760578605796058060581605826058360584605856058660587605886058960590605916059260593605946059560596605976059860599606006060160602606036060460605606066060760608606096061060611606126061360614606156061660617606186061960620606216062260623606246062560626606276062860629606306063160632606336063460635606366063760638606396064060641606426064360644606456064660647606486064960650606516065260653606546065560656606576065860659606606066160662606636066460665606666066760668606696067060671606726067360674606756067660677606786067960680606816068260683606846068560686606876068860689606906069160692606936069460695606966069760698606996070060701607026070360704607056070660707607086070960710607116071260713607146071560716607176071860719607206072160722607236072460725607266072760728607296073060731607326073360734607356073660737607386073960740607416074260743607446074560746607476074860749607506075160752607536075460755607566075760758607596076060761607626076360764607656076660767607686076960770607716077260773607746077560776607776077860779607806078160782607836078460785607866078760788607896079060791607926079360794607956079660797607986079960800608016080260803608046080560806608076080860809608106081160812608136081460815608166081760818608196082060821608226082360824608256082660827608286082960830608316083260833608346083560836608376083860839608406084160842608436084460845608466084760848608496085060851608526085360854608556085660857608586085960860608616086260863608646086560866608676086860869608706087160872608736087460875608766087760878608796088060881608826088360884608856088660887608886088960890608916089260893608946089560896608976089860899609006090160902609036090460905609066090760908609096091060911609126091360914609156091660917609186091960920609216092260923609246092560926609276092860929609306093160932609336093460935609366093760938609396094060941609426094360944609456094660947609486094960950609516095260953609546095560956609576095860959609606096160962609636096460965609666096760968609696097060971609726097360974609756097660977609786097960980609816098260983609846098560986609876098860989609906099160992609936099460995609966099760998609996100061001610026100361004610056100661007610086100961010610116101261013610146101561016610176101861019610206102161022610236102461025610266102761028610296103061031610326103361034610356103661037610386103961040610416104261043610446104561046610476104861049610506105161052610536105461055610566105761058610596106061061610626106361064610656106661067
  1. /* 许钟文修改的 标记 xzw
  2. 另外 所有"matter"字样已被我删除 原因:删除matterport信息
  3. */
  4. const dontStopTourWhenClickItem = false
  5. let highMapAddColor = 0//true
  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),// C是 "wheel.sly" 滚动监听
  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. $('#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, ratio) {
  3378. let defaultRatio = 1.2 , absoluteScale
  3379. if(_settings.floorPlanAngle){//指定了角度的话,就和browser.aspectRatio()无关,总使用纵向
  3380. var angle = parseFloat(_settings.floorPlanAngle)
  3381. modelSize = modelSize.clone().applyEuler(new THREE.Euler(0, angle, 0))
  3382. var n = Math.max(Math.abs(modelSize.x), Math.abs(modelSize.z) * this.camera.aspect) //视口宽高比 >= 1 情况下,模型所占最大视口尺寸
  3383. var screenSize = Math.min($("#player").width(), $("#player").height())
  3384. var maxSize = 800;//模型最大占据像素
  3385. ratio = ratio != void 0 ? ratio : Math.max(screenSize * defaultRatio / maxSize, defaultRatio) ;
  3386. absoluteScale = n / 2 / o.orthoBase * ratio; //根据模型所占最大视口尺寸调整缩放
  3387. }else{
  3388. var t = Math.max(modelSize.x, modelSize.z)
  3389. , i = Math.min(modelSize.x, modelSize.z)
  3390. , n = Math.max(t, i * this.camera.aspect)
  3391. , r = Math.max(i, t * this.camera.aspect);
  3392. absoluteScale = (h.aspectRatio() < 1 ? r : n) / 2 / o.orthoBase * defaultRatio
  3393. }
  3394. return absoluteScale
  3395. },
  3396. /* n.prototype.rotateToView = function(e, t) {
  3397. var i = 0
  3398. , n = h.aspectRatio() < 1
  3399. , r = e.x < e.z;
  3400. n === r ? t.z > 0 && (i = Math.PI) : i = t.x > 0 ? Math.PI / 2 : -Math.PI / 2,
  3401. this.rotateLeft(i),
  3402. this.update(0)
  3403. },
  3404. */
  3405. n.prototype.rotateToView = function(modelSize, direction) {
  3406. let i = 0, n = h.aspectRatio() < 1 //是否模型尺寸显“细长”
  3407. if(_settings.floorPlanAngle ){//规定了cadImage旋转值的话 (0是无效的,将不设置)
  3408. i = parseFloat(_settings.floorPlanAngle)
  3409. }else{
  3410. let r = modelSize.x < modelSize.z; //是否视口为“窄屏”
  3411. if(n === r) //“细长” 且 “窄屏”,说明模型尺寸比例与视口比例匹配,相机坐标只需要调转“前”“后”
  3412. {
  3413. if(direction.z > 0) //(第一种情况)相机是否位于背面。 注:在默认情况下webgl的相机朝向-z, direction.z > 0 说明相机视野已经偏向+z,说明相机位于模型“背面”
  3414. {
  3415. i = Math.PI; //经度上做180度轨道角位移,使相机移到静止模型的“前面”
  3416. }
  3417. //(第二种情况) 不做处理
  3418. }
  3419. else if(direction.x > 0)
  3420. {
  3421. i = Math.PI / 2;
  3422. }
  3423. else
  3424. {
  3425. i = -Math.PI / 2;
  3426. }
  3427. }
  3428. if(_settings.angleShift2d){
  3429. i += THREE.Math.degToRad(_settings.angleShift2d)
  3430. }
  3431. this.rotateLeft(i);
  3432. this.update(0);
  3433. }
  3434. ,
  3435. n.prototype.rotateToAngle = function(angle){//add 旋转到特定角度
  3436. this.rotateLeft(angle + this.lon);
  3437. this.update(0);
  3438. }
  3439. ,
  3440. n.prototype.pan = function(e, t) {
  3441. this.camera.updateMatrix(),
  3442. this.panLeft(e * (this.camera.right - this.camera.left) / $("#player").width()),
  3443. this.panUp(-t * (this.camera.top - this.camera.bottom) / $("#player").height())
  3444. }
  3445. ,
  3446. n.prototype.updateZoom = function() {
  3447. return this.absoluteScale *= this.scale - .03 * this.keyboardZoomSpeed,
  3448. this.absoluteScale = Math.max(o.zoomNearLimit, Math.min(this.absoluteScale, o.zoomFarLimit)),
  3449. this.currentScale = .8 * this.currentScale + .2 * this.absoluteScale,
  3450. this.camera.left = -o.orthoBase * this.currentScale,
  3451. this.camera.right = o.orthoBase * this.currentScale,
  3452. this.camera.top = o.orthoBase * this.currentScale / this.camera.aspect,
  3453. this.camera.bottom = -o.orthoBase * this.currentScale / this.camera.aspect,
  3454. this.camera.updateProjectionMatrix(),
  3455. this.offset.length()
  3456. }
  3457. ,
  3458. n.prototype.toJSON = function() {
  3459. var e = new r.Quaternion
  3460. , t = (new r.Quaternion).setFromAxisAngle(new r.Vector3(0,1,0), r.Math.degToRad(90))
  3461. , i = new r.Quaternion;
  3462. return function() {
  3463. var n = a.prototype.toJSON.call(this);
  3464. return e.copy(n.camera_quaternion),
  3465. i.copy(t),
  3466. i.multiply(e),
  3467. n.camera_quaternion.x = c.toPrecision(i.x, 4),
  3468. n.camera_quaternion.y = c.toPrecision(i.y, 4),
  3469. n.camera_quaternion.z = c.toPrecision(i.z, 4),
  3470. n.camera_quaternion.w = c.toPrecision(i.w, 4),
  3471. n.ortho_zoom = c.toPrecision(this.currentScale * this.camera.aspect, 4),
  3472. n
  3473. }
  3474. }(),
  3475. t.exports = n
  3476. }
  3477. , {
  3478. "../enum/ControlActions": 20,
  3479. "../enum/MouseButton": 34,
  3480. "../settings": 166,
  3481. "../util/browser": 182,
  3482. "../util/math": 190,
  3483. "./OutsideControls": 12,
  3484. three: 217
  3485. }],
  3486. 12: [function(e, t, i) {
  3487. "use strict";
  3488. function n(e) {
  3489. this.camera = e,
  3490. this.camera.controls = this,
  3491. this.enabled = !1,
  3492. this.target = new r.Vector3,
  3493. this.targetBounds = new r.Box3,
  3494. this.zoomSpeed = 1,
  3495. this.minDistance = 0,
  3496. this.maxDistance = 1 / 0,
  3497. this.noRotateUpDown = !1,
  3498. this.rotateSpeed = 1,
  3499. this.keyboardZoomSpeed = 0,
  3500. this.keyPanSpeed = 7,
  3501. this.autoRotate = !1,
  3502. this.autoRotateSpeed = 2,
  3503. this.autoPan = !1,
  3504. this.autoPanPosition = new r.Vector3,
  3505. this.minPolarAngle = r.Math.degToRad(25),
  3506. this.maxPolarAngle = r.Math.degToRad(65),
  3507. this.rotationAcceleration = new r.Vector2,
  3508. this.rotationSpeed = new r.Vector2,
  3509. this.panAcceleration = new r.Vector2,
  3510. this.panSpeed = new r.Vector2,
  3511. this.rotateStart = new r.Vector2,
  3512. this.rotateEnd = new r.Vector2,
  3513. this.rotateDelta = new r.Vector2,
  3514. this.panStart = new r.Vector2,
  3515. this.panEnd = new r.Vector2,
  3516. this.panDelta = new r.Vector2,
  3517. this.panOffset = new r.Vector3,
  3518. this.offset = new r.Vector3,
  3519. this.dollyStart = new r.Vector2,
  3520. this.dollyEnd = new r.Vector2,
  3521. this.dollyDelta = new r.Vector2,
  3522. this.phiDelta = 0,
  3523. this.thetaDelta = 0,
  3524. this.scale = 1,
  3525. this.panVector = new r.Vector3,
  3526. this.lastPosition = new r.Vector3,
  3527. this.state = c.NONE,
  3528. this.mouseActions = {},
  3529. this.mouseActions[h.LEFT] = c.ROTATE,
  3530. this.mouseActions[h.MIDDLE] = c.DOLLY,
  3531. this.mouseActions[h.RIGHT] = c.PAN,
  3532. this.touchActions = {},
  3533. this.touchActions[1] = c.ROTATE,
  3534. this.touchActions[2] = c.PAN_DOLLY,
  3535. this.lastMoveTime = 0,
  3536. this.pointersLimit = 2,
  3537. this.pointers = []
  3538. }
  3539. var r = e("three")
  3540. , o = e("../settings")
  3541. , a = e("../util/common")
  3542. , s = e("../util/math")
  3543. , l = e("../enum/Vectors")
  3544. , c = e("../enum/ControlActions")
  3545. , h = e("../enum/MouseButton")
  3546. , u = e("../enum/Keys")
  3547. , d = e("../enum/ControlEvents")
  3548. , p = e("events").EventEmitter
  3549. , f = 1e-6;
  3550. n.prototype = Object.create(p.prototype),
  3551. n.prototype.setBounds = function(e) {
  3552. this.targetBounds = e
  3553. }
  3554. ,
  3555. n.prototype.isEngaged = function() {
  3556. return this.state !== c.NONE
  3557. }
  3558. ,
  3559. n.prototype.rotateLeft = function(e) {
  3560. void 0 === e && (e = this.getAutoRotationAngle()),
  3561. this.thetaDelta -= e
  3562. }
  3563. ,
  3564. n.prototype.rotateUp = function(e) {
  3565. this.noRotateUpDown || (void 0 === e && (e = this.getAutoRotationAngle()),
  3566. this.phiDelta -= e)
  3567. }
  3568. ,
  3569. n.prototype.panLeft = function(e) {
  3570. var t = this.camera.matrix.elements;
  3571. this.panOffset.set(t[0], 0, t[2]).normalize(),
  3572. this.panOffset.multiplyScalar(-e),
  3573. this.panVector.add(this.panOffset)
  3574. }
  3575. ,
  3576. n.prototype.panUp = function(e) {
  3577. var t = this.camera.matrix.elements;
  3578. this.panOffset.set(t[4], 0, t[6]).normalize(),
  3579. this.panOffset.multiplyScalar(-e),
  3580. this.panVector.add(this.panOffset)
  3581. }
  3582. ,
  3583. n.prototype.startRotating = function(e, t) {
  3584. e && this.navRotationAcc("x", e),
  3585. t && this.navRotationAcc("y", t)
  3586. }
  3587. ,
  3588. n.prototype.stopRotating = function(e) {
  3589. e && (this.rotationSpeed.x = this.rotationSpeed.y = 0),
  3590. this.navRotationAcc("x", 0),
  3591. this.navRotationAcc("y", 0)
  3592. }
  3593. ,
  3594. n.prototype.setAutoPanPosition = function(e, t) {
  3595. var i = new r.Vector3
  3596. , n = new r.Vector3;
  3597. return function(e, t) {
  3598. i.copy(this.camera.position),
  3599. void 0 === e && null === e || i.setX(e),
  3600. void 0 === t && null === t || i.setZ(t);
  3601. var r = this.camera.position.distanceTo(this.target)
  3602. , o = l.FORWARD.clone().applyQuaternion(this.camera.quaternion);
  3603. this.targetClamped = !1,
  3604. n.copy(i).addScaledVector(o, r),
  3605. this.targetBounds.containsPoint(n) || (this.targetBounds.clampPoint(n, n),
  3606. i.copy(n).addScaledVector(o, -r),
  3607. this.targetClamped = !0),
  3608. this.autoPanPosition.x = i.x,
  3609. this.autoPanPosition.z = i.z,
  3610. this.autoPan && this.stopAutoPanning()
  3611. }
  3612. }(),
  3613. n.prototype.stopAutoPanning = function() {
  3614. var e = this.autoPan;
  3615. this.autoPan = !1,
  3616. this.emit(this.targetClamped ? d.AutoPanClamped : e ? d.AutoPanInterrupt : d.AutoPanComplete)
  3617. }
  3618. ,
  3619. n.prototype.dollyIn = function(e) {
  3620. void 0 === e && (e = this.getZoomScale()),
  3621. this.scale /= e
  3622. }
  3623. ,
  3624. n.prototype.dollyOut = function(e) {
  3625. void 0 === e && (e = this.getZoomScale()),
  3626. this.scale *= e
  3627. }
  3628. ,
  3629. n.prototype.updatePan = function(e) {
  3630. if (this.panSpeed.multiplyScalar(1 - o.panFriction).addScaledVector(this.panAcceleration, o.panAccelerationOutside * e),
  3631. this.pan(-this.panSpeed.x, this.panSpeed.y),
  3632. this.autoPan) {
  3633. var t = (new r.Vector3).copy(this.autoPanPosition).sub(this.camera.position);
  3634. t.setY(0).clampLength(0, 50 * e),
  3635. this.target.add(t),
  3636. this.camera.position.add(t),
  3637. this.autoPanPosition.x === this.camera.position.x && this.autoPanPosition.z === this.camera.position.z && (this.autoPan = !1,
  3638. this.stopAutoPanning())
  3639. }
  3640. }
  3641. ,
  3642. n.prototype.update = function(e) {
  3643. e || (e = 1 / 60)
  3644. var friction = Math.min(1, o.rotationFriction * e * 60) //add 如果deltaTime > 1/ 60 (比较卡),就增加rotationFriction, 以防止转动过久
  3645. this.rotationSpeed.multiplyScalar(1 - friction).addScaledVector(this.rotationAcceleration, o.rotationAccelerationOutside * e),
  3646. this.rotateLeft(-this.rotationSpeed.x),
  3647. this.noRotateUpDown || this.rotateUp(this.rotationSpeed.y),
  3648. this.updatePan(e);
  3649. var t = this.camera.position;
  3650. this.offset.copy(t).sub(this.target);
  3651. var i = Math.atan2(this.offset.x, this.offset.z)
  3652. , n = Math.atan2(Math.sqrt(this.offset.x * this.offset.x + this.offset.z * this.offset.z), this.offset.y);
  3653. this.autoRotate && this.rotateLeft(this.getAutoRotationAngle()),
  3654. i += this.thetaDelta,
  3655. n += this.phiDelta,
  3656. n = Math.max(this.minPolarAngle, Math.min(this.maxPolarAngle, n)),
  3657. n = Math.max(f, Math.min(Math.PI - f, n));
  3658. this.lon = i, this.lat = n//add
  3659. var r = this.updateZoom();
  3660. r = Math.max(this.minDistance, Math.min(this.maxDistance, r)),
  3661. this.target.add(this.panVector),
  3662. this.targetBounds.clampPoint(this.target, this.target),
  3663. this.offset.x = r * Math.sin(n) * Math.sin(i),
  3664. this.offset.y = r * Math.cos(n),
  3665. this.offset.z = r * Math.sin(n) * Math.cos(i),
  3666. t.copy(this.target).add(this.offset),
  3667. this.camera.lookAt(this.target),
  3668. this.thetaDelta = 0,
  3669. this.phiDelta = 0,
  3670. this.scale = 1,
  3671. this.panVector.set(0, 0, 0),
  3672. this.lastPosition.distanceTo(this.camera.position) > 0 && this.lastPosition.copy(this.camera.position)
  3673. }
  3674. ,
  3675. n.prototype.getAutoRotationAngle = function() {
  3676. return 2 * Math.PI / 60 / 60 * this.autoRotateSpeed
  3677. }
  3678. ,
  3679. n.prototype.getZoomScale = function() {
  3680. return Math.pow(.95, this.zoomSpeed)
  3681. }
  3682. ,
  3683. n.prototype.onMouseDown = function(e) {
  3684. if (this.enabled) {
  3685. switch (e.preventDefault(),
  3686. this.stopAutoPanning(),
  3687. this.mouseDown = !0,
  3688. this.state = this.mouseActions[e.button],
  3689. this.state) {
  3690. case c.ROTATE:
  3691. this.rotateStart.set(e.clientX, this.noRotateUpDown ? 0 : e.clientY),
  3692. this.rotationSpeed.set(0, 0);
  3693. break;
  3694. case c.DOLLY:
  3695. this.dollyStart.set(e.clientX, e.clientY);
  3696. break;
  3697. case c.PAN:
  3698. this.panStart.set(e.clientX, e.clientY)
  3699. }
  3700. this.emit(d.InputStart, "mouse")
  3701. }
  3702. }
  3703. ,
  3704. n.prototype.onMouseMove = function(e) {
  3705. if (this.enabled && this.mouseDown && 0 !== e.buttons) {
  3706. switch (e.preventDefault(),
  3707. this.state) {
  3708. case c.ROTATE:
  3709. this.rotateEnd.set(e.clientX, this.noRotateUpDown ? 0 : e.clientY),
  3710. this.rotateDelta.subVectors(this.rotateEnd, this.rotateStart),
  3711. this.rotateLeft(2 * Math.PI * this.rotateDelta.x / $("#player").width() * this.rotateSpeed),
  3712. this.rotateUp(2 * Math.PI * this.rotateDelta.y / $("#player").height() * this.rotateSpeed),
  3713. this.rotateStart.copy(this.rotateEnd);
  3714. break;
  3715. case c.DOLLY:
  3716. this.dollyEnd.set(e.clientX, e.clientY),
  3717. this.dollyDelta.subVectors(this.dollyEnd, this.dollyStart);
  3718. var t = this.dollyDelta.y > 0 ? this.dollyIn : this.dollyOut;
  3719. t.call(this),
  3720. this.dollyStart.copy(this.dollyEnd);
  3721. break;
  3722. case c.PAN:
  3723. this.panEnd.set(e.clientX, e.clientY),
  3724. this.panDelta.subVectors(this.panEnd, this.panStart),
  3725. this.pan(this.panDelta.x, this.panDelta.y),
  3726. this.panStart.copy(this.panEnd)
  3727. }
  3728. this.emit(d.Move, "mouse"),
  3729. this.lastMoveTime = e.timeStamp,
  3730. this.update()
  3731. }
  3732. }
  3733. ,
  3734. n.prototype.onMouseUp = function(e) {
  3735. this.enabled && (this.mouseDown = !1,
  3736. this.state = c.NONE,
  3737. "mouseover" !== e.type && (e.timeStamp > this.lastMoveTime + 100 ? (this.rotationSpeed.set(0, 0),
  3738. this.rotationAcceleration.set(0, 0)) : this.rotationAcceleration.set(-this.rotateDelta.x, this.rotateDelta.y),
  3739. this.update(),
  3740. this.rotationAcceleration.set(0, 0),
  3741. this.rotateDelta.set(0, 0)))
  3742. }
  3743. ,
  3744. n.prototype.onMouseOver = function(e) {
  3745. 0 !== e.which && 0 !== e.buttons || this.onMouseUp(e)
  3746. }
  3747. ,
  3748. n.prototype.onMouseWheel = function(e) {
  3749. if (this.enabled && o.useWheel) {
  3750. this.emit(d.Move, "wheel");
  3751. var t = e.wheelDelta || -e.detail
  3752. , i = t > 0 ? this.dollyOut : this.dollyIn;
  3753. i.call(this),
  3754. this.update()
  3755. }
  3756. }
  3757. ,
  3758. n.prototype.onKeyDown = function(e) {
  3759. this.enabled && (e.metaKey || e.ctrlKey || (e.preventDefault(),
  3760. this.handleKeyDown(e.which)))
  3761. }
  3762. ,
  3763. n.prototype.navRotationAcc = function(e, t) {
  3764. "y" === e ? this.noRotateUpDown ? this.keyboardZoomSpeed = t : this.rotationAcceleration.y = t : this.rotationAcceleration.x = t
  3765. }
  3766. ,
  3767. n.prototype.navPanAcc = function(e, t) {
  3768. this.stopAutoPanning(),
  3769. this.panAcceleration[e] = t
  3770. }
  3771. ,
  3772. n.prototype.handleKeyDown = function(e) {
  3773. var t = !0;
  3774. switch (e) {
  3775. case u.UPARROW:
  3776. case u.I:
  3777. this.navRotationAcc("y", 1);
  3778. break;
  3779. case u.DOWNARROW:
  3780. case u.K:
  3781. this.navRotationAcc("y", -1);
  3782. break;
  3783. case u.LEFTARROW:
  3784. case u.J:
  3785. this.navRotationAcc("x", -1);
  3786. break;
  3787. case u.RIGHTARROW:
  3788. case u.L:
  3789. this.navRotationAcc("x", 1);
  3790. break;
  3791. case u.W:
  3792. this.navPanAcc("y", 1);
  3793. break;
  3794. case u.S:
  3795. this.navPanAcc("y", -1);
  3796. break;
  3797. case u.A:
  3798. this.navPanAcc("x", -1);
  3799. break;
  3800. case u.D:
  3801. this.navPanAcc("x", 1);
  3802. break;
  3803. default:
  3804. t = !1
  3805. }
  3806. t && this.emit(d.Move, "key")
  3807. }
  3808. ,
  3809. n.prototype.onKeyUp = function(e) {
  3810. this.enabled && (e.preventDefault(),
  3811. e.stopPropagation(),
  3812. this.handleKeyUp(e.which))
  3813. }
  3814. ,
  3815. n.prototype.handleKeyUp = function(e) {
  3816. switch (e) {
  3817. case u.I:
  3818. case u.K:
  3819. case u.UPARROW:
  3820. case u.DOWNARROW:
  3821. this.keyboardZoomSpeed = 0,
  3822. this.rotationAcceleration.y = 0;
  3823. break;
  3824. case u.J:
  3825. case u.L:
  3826. case u.LEFTARROW:
  3827. case u.RIGHTARROW:
  3828. this.rotationAcceleration.x = 0;
  3829. break;
  3830. case u.S:
  3831. case u.W:
  3832. this.panAcceleration.y = 0;
  3833. break;
  3834. case u.A:
  3835. case u.D:
  3836. this.panAcceleration.x = 0
  3837. }
  3838. }
  3839. ,
  3840. n.prototype.onTouchStart = function(e) {
  3841. if (this.enabled || this.state === c.NONE) {
  3842. e.preventDefault(),
  3843. e.stopPropagation(),
  3844. this.stopAutoPanning();
  3845. var t = function() {
  3846. if (2 === e.touches.length) {
  3847. var t = e.touches[0].pageX - e.touches[1].pageX
  3848. , i = e.touches[0].pageY - e.touches[1].pageY;
  3849. this.dollyStart.set(t, i)
  3850. }
  3851. }
  3852. .bind(this)
  3853. , i = function() {
  3854. this.panStart.set(a.average(e.touches, "pageX"), a.average(e.touches, "pageY"))
  3855. }
  3856. .bind(this)
  3857. , n = function() {
  3858. this.rotateStart.set(a.average(e.touches, "pageX"), a.average(e.touches, "pageY"))
  3859. }
  3860. .bind(this);
  3861. switch (this.state = this.touchActions[e.touches.length],
  3862. this.state) {
  3863. case c.PAN_DOLLY:
  3864. t();
  3865. case c.PAN:
  3866. i();
  3867. break;
  3868. case c.ROTATE_DOLLY:
  3869. t();
  3870. case c.ROTATE:
  3871. n()
  3872. }
  3873. this.rotationSpeed.set(0, 0),
  3874. this.emit(d.InputStart, "touch")
  3875. }
  3876. }
  3877. ,
  3878. n.prototype.onTouchMove = function(e) {
  3879. if (this.enabled && this.state !== c.NONE) {
  3880. e.preventDefault(),
  3881. e.stopPropagation();
  3882. var t = function() {
  3883. var t = e.touches[0].pageX - e.touches[1].pageX
  3884. , i = e.touches[0].pageY - e.touches[1].pageY;
  3885. this.dollyEnd.set(t, i);
  3886. var n = this.dollyStart.length() - this.dollyEnd.length();
  3887. n > 0 ? this.dollyOut(1 + n / 500) : this.dollyIn(1 - n / 500),
  3888. this.dollyStart.copy(this.dollyEnd)
  3889. }
  3890. .bind(this)
  3891. , i = function() {
  3892. this.panEnd.set(a.average(e.touches, "pageX"), a.average(e.touches, "pageY")),
  3893. this.panDelta.subVectors(this.panEnd, this.panStart),
  3894. this.pan(this.panDelta.x, this.panDelta.y),
  3895. this.panStart.copy(this.panEnd),
  3896. this.rotateDelta.set(0, 0)
  3897. }
  3898. .bind(this)
  3899. , n = function() {
  3900. this.rotateEnd.set(a.average(e.touches, "pageX"), a.average(e.touches, "pageY")),
  3901. this.rotateDelta.subVectors(this.rotateEnd, this.rotateStart),
  3902. this.rotateLeft(2 * Math.PI * this.rotateDelta.x / $("#player").width() * this.rotateSpeed),
  3903. this.rotateUp(2 * Math.PI * this.rotateDelta.y / $("#player").height() * this.rotateSpeed),
  3904. this.rotateStart.copy(this.rotateEnd)
  3905. }
  3906. .bind(this)
  3907. , r = function() {
  3908. if (2 === e.touches.length) {
  3909. var i = window.devicePixelRatio || 1
  3910. , r = e.touches[1].pageX - e.touches[0].pageX
  3911. , s = e.touches[1].pageY - e.touches[0].pageY
  3912. , l = Math.sqrt(r * r + s * s)
  3913. , h = Math.abs(this.dollyStart.length() - l);
  3914. if (h > o.input.touchMoveThreshold * i)
  3915. this.state = c.DOLLY,
  3916. t();
  3917. else {
  3918. var u = a.average(e.touches, "pageX")
  3919. , d = a.average(e.touches, "pageY")
  3920. , p = this.rotateDelta.set(u, d).sub(this.rotateStart).length();
  3921. p > o.input.touchMoveThreshold && (this.state = c.ROTATE,
  3922. this.rotateStart.set(u, d),
  3923. n())
  3924. }
  3925. }
  3926. }
  3927. .bind(this);
  3928. switch (this.state) {
  3929. case c.PAN_DOLLY:
  3930. t();
  3931. case c.PAN:
  3932. i();
  3933. break;
  3934. case c.ROTATE_DOLLY:
  3935. r();
  3936. break;
  3937. case c.DOLLY:
  3938. t();
  3939. break;
  3940. case c.ROTATE:
  3941. n();
  3942. break;
  3943. default:
  3944. this.state = c.NONE
  3945. }
  3946. this.lastMoveTime = e.timeStamp,
  3947. this.emit(d.Move, "touch")
  3948. }
  3949. }
  3950. ,
  3951. n.prototype.onTouchEnd = function(e) {
  3952. this.enabled && (this.state === c.ROTATE && (e.timeStamp > this.lastMoveTime + 100 ? (this.rotationSpeed.set(0, 0),
  3953. this.rotationAcceleration.set(0, 0)) : this.rotationAcceleration.set(-this.rotateDelta.x, this.rotateDelta.y)),
  3954. this.state = c.NONE,
  3955. this.update(),
  3956. this.rotationAcceleration.set(0, 0),
  3957. this.rotateDelta.set(0, 0))
  3958. }
  3959. ,
  3960. n.prototype.onPointerDown = function(e) {
  3961. this.enabled && ("touch" === e.pointerType && (this.pointers.length < this.pointersLimit && this.pointers.push({
  3962. id: e.pointerId,
  3963. pageX: e.pageX,
  3964. pageY: e.pageY
  3965. }),
  3966. e.touches = this.pointers,
  3967. this.onTouchStart(e)),
  3968. this.emit(d.InputStart, "pointer"))
  3969. }
  3970. ,
  3971. n.prototype.onPointerMove = function(e) {
  3972. this.enabled && "touch" === e.pointerType && (this.pointers.forEach(function(t) {
  3973. e.pointerId === t.id && (t.pageX = e.pageX,
  3974. t.pageY = e.pageY)
  3975. }),
  3976. e.touches = this.pointers,
  3977. this.onTouchMove(e))
  3978. }
  3979. ,
  3980. n.prototype.onPointerUp = function(e) {
  3981. this.enabled && "touch" === e.pointerType && (this.pointers.forEach(function(t, i) {
  3982. e.pointerId === t.id && this.pointers.splice(i, 1)
  3983. }
  3984. .bind(this)),
  3985. e.touches = this.pointers,
  3986. this.onTouchEnd(e))
  3987. }
  3988. ,
  3989. n.prototype.reset = function() {
  3990. this.state = c.NONE,
  3991. this.stopAutoPanning(),
  3992. this.rotationSpeed.set(0, 0),
  3993. this.rotationAcceleration.set(0, 0),
  3994. this.panSpeed.set(0, 0),
  3995. this.panAcceleration.set(0, 0)
  3996. }
  3997. ,
  3998. n.prototype.toJSON = function() {
  3999. var e = {
  4000. camera_position: {
  4001. x: s.toPrecision(this.camera.position.x, 4),
  4002. y: s.toPrecision(this.camera.position.y, 4),
  4003. z: s.toPrecision(this.camera.position.z, 4)
  4004. },
  4005. camera_quaternion: {
  4006. x: s.toPrecision(this.camera.quaternion.x, 4),
  4007. y: s.toPrecision(this.camera.quaternion.y, 4),
  4008. z: s.toPrecision(this.camera.quaternion.z, 4),
  4009. w: s.toPrecision(this.camera.quaternion.w, 4)
  4010. }
  4011. };
  4012. return e
  4013. }
  4014. ,
  4015. t.exports = n
  4016. }
  4017. , {
  4018. "../enum/ControlActions": 20,
  4019. "../enum/ControlEvents": 21,
  4020. "../enum/Keys": 30,
  4021. "../enum/MouseButton": 34,
  4022. "../enum/Vectors": 50,
  4023. "../settings": 166,
  4024. "../util/common": 185,
  4025. "../util/math": 190,
  4026. events: 202,
  4027. three: 217
  4028. }],
  4029. 13: [function(e, t, i) {
  4030. (function(i) {
  4031. "use strict";
  4032. function n(e) {
  4033. this.camera = e,
  4034. this.camera.controls = this,
  4035. this.target = new r.Vector3(0,0,0),
  4036. this.lookVector = new r.Vector3,
  4037. this.lookSpeed = .05,
  4038. this.rotationAcc = new r.Vector2,
  4039. this.rotationSpeed = new r.Vector2,
  4040. this.lat = 0,
  4041. this.lon = 0,
  4042. this.phi = 0,
  4043. this.theta = 0,
  4044. this.enabled = !1,
  4045. this.locked = !1,
  4046. this.pointer = new r.Vector2(0,0),
  4047. this.rotationHistory = [],
  4048. this.rotationDifference = new r.Vector2,
  4049. this.pointerDragOn = !1,
  4050. this.pointerDragStart = new r.Vector2(0,0),
  4051. this.pinchDistance = 0,
  4052. this.moveStart = new r.Vector2,
  4053. this.moveTolerance = .01,
  4054. this.pointersLimit = 2,
  4055. this.pointers = []
  4056. }
  4057. var r = e("three")
  4058. , o = e("../util/logger")
  4059. , a = e("../settings")
  4060. , s = e("../util/common")
  4061. , l = e("../util/math")
  4062. , c = (e("../enum/Vectors"),
  4063. e("../enum/MouseButton"))
  4064. , h = e("../enum/Keys")
  4065. , u = e("../enum/ControlEvents")
  4066. , d = e("events").EventEmitter;
  4067. new o(i);
  4068. n.prototype = Object.create(d.prototype),
  4069. n.prototype.usable = function() {
  4070. return this.enabled && !this.locked
  4071. }
  4072. ,
  4073. /* n.prototype.lookAt = function(e) {
  4074. var t = this.camera.position.clone().sub(e)
  4075. , i = Math.atan(t.z / t.x);
  4076. i += t.x < 0 ? Math.PI : 0,
  4077. i += t.x > 0 && t.z < 0 ? 2 * Math.PI : 0,
  4078. this.lon = r.Math.radToDeg(i) + 180;
  4079. var n = Math.sqrt(t.x * t.x + t.z * t.z)
  4080. , o = Math.atan(t.y / n);
  4081. this.lat = -r.Math.radToDeg(o)
  4082. }
  4083. */
  4084. n.prototype.lookAt = function(aim, dir) {
  4085. var t = dir || this.camera.position.clone().sub(aim); //aim所指点的笛卡尔坐标系
  4086. var i = Math.atan(t.z / t.x);
  4087. i += t.x < 0 ? Math.PI : 0;
  4088. i += t.x > 0 && t.z < 0 ? 2 * Math.PI : 0;
  4089. this.lon = r.Math.radToDeg(i) + 180;
  4090. var n = Math.sqrt(t.x * t.x + t.z * t.z),
  4091. o = Math.atan(t.y / n);
  4092. this.lat = -r.Math.radToDeg(o);
  4093. }
  4094. ,
  4095. n.prototype.startRotationFrom = function(e, t) {
  4096. l.convertScreenPositionToNDC(e, t, this.pointer),
  4097. this.pointerDragOn = !0,
  4098. this.pointerDragStart.copy(this.pointer),
  4099. this.moveStart.copy(this.pointer),
  4100. this.rotationHistory = [],
  4101. this.rotationSpeed.set(0, 0)
  4102. }
  4103. ,
  4104. n.prototype.onMouseOver = function(e) {
  4105. !this.pointerDragOn || 0 !== e.which && 0 !== e.buttons || this.onMouseUp(e)
  4106. }
  4107. ,
  4108. n.prototype.onTouchStart = function(e) {
  4109. if (this.usable()) {
  4110. switch (e.preventDefault(),
  4111. e.stopPropagation(),
  4112. e.touches.length) {
  4113. case 1:
  4114. this.startRotationFrom(e.touches[0].clientX, e.touches[0].clientY);
  4115. break;
  4116. case 2:
  4117. var t = (e.touches[0].clientX - e.touches[1].clientX) / $("#player").width()
  4118. , i = (e.touches[0].clientY - e.touches[1].clientY) / $("#player").height();
  4119. this.pinchDistance = Math.sqrt(t * t + i * i)
  4120. }
  4121. this.emit(u.InputStart, "touch")
  4122. }
  4123. }
  4124. ,
  4125. n.prototype.onPointerDown = function(e) {
  4126. this.usable() && "touch" === e.pointerType && (this.pointers.length < this.pointersLimit && this.pointers.push({
  4127. id: e.pointerId,
  4128. clientX: e.clientX,
  4129. clientY: e.clientY
  4130. }),
  4131. e.touches = this.pointers,
  4132. this.onTouchStart(e),
  4133. this.emit(u.InputStart, "pointer"))
  4134. }
  4135. ,
  4136. n.prototype.onMouseDown = function(e) {
  4137. if (this.usable()) {
  4138. switch (e.preventDefault(),
  4139. e.stopPropagation(),
  4140. e.button) {
  4141. case c.LEFT:
  4142. this.startRotationFrom(e.clientX, e.clientY)
  4143. }
  4144. SoundManager.pause('tour',true) // zeg 点击场景时停止语音
  4145. this.emit(u.InputStart, "mouse")
  4146. }
  4147. }
  4148. ,
  4149. n.prototype.updateRotation = function() {
  4150. if (this.usable() && this.pointerDragOn) {
  4151. var e = new r.Vector3(this.pointerDragStart.x,this.pointerDragStart.y,-1).unproject(this.camera)
  4152. , t = new r.Vector3(this.pointer.x,this.pointer.y,-1).unproject(this.camera)
  4153. , i = Math.sqrt(e.x * e.x + e.z * e.z)
  4154. , n = Math.sqrt(t.x * t.x + t.z * t.z)
  4155. , o = Math.atan2(e.y, i)
  4156. , a = Math.atan2(t.y, n);
  4157. this.rotationDifference.y = r.Math.radToDeg(o - a),
  4158. e.y = 0,
  4159. t.y = 0;
  4160. var s = Math.acos(e.dot(t) / e.length() / t.length());
  4161. isNaN(s) || (this.rotationDifference.x = r.Math.radToDeg(s),
  4162. this.pointerDragStart.x < this.pointer.x && (this.rotationDifference.x *= -1)),
  4163. this.pointerDragStart.copy(this.pointer)
  4164. }
  4165. }
  4166. ,
  4167. n.prototype.onMouseMove = function(e) {
  4168. this.usable() && (l.convertScreenPositionToNDC(e.clientX, e.clientY, this.pointer),
  4169. 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"))
  4170. }
  4171. ,
  4172. n.prototype.onTouchMove = function(e) {
  4173. if (this.usable())
  4174. switch (this.emit(u.Move, "touch"),
  4175. e.touches.length) {
  4176. case 1:
  4177. l.convertScreenPositionToNDC(e.touches[0].clientX, e.touches[0].clientY, this.pointer);
  4178. break;
  4179. case 2:
  4180. var t = (e.touches[0].clientX - e.touches[1].clientX) / $("#player").width()
  4181. , i = (e.touches[0].clientY - e.touches[1].clientY) / $("#player").height()
  4182. , n = this.pinchDistance - Math.sqrt(t * t + i * i);
  4183. Math.abs(n) > .01 && (this.emit(u.InteractionDirect),
  4184. this.emit(u.Pinch, n),
  4185. this.pinchDistance -= n)
  4186. }
  4187. }
  4188. ,
  4189. n.prototype.onPointerMove = function(e) {
  4190. this.usable() && "touch" === e.pointerType && (this.pointers.forEach(function(t) {
  4191. e.pointerId === t.id && (t.clientX = e.clientX,
  4192. t.clientY = e.clientY)
  4193. }),
  4194. e.touches = this.pointers,
  4195. this.onTouchMove(e))
  4196. }
  4197. ,
  4198. n.prototype.endRotation = function() {
  4199. this.pointerDragOn = !1;
  4200. var e = s.averageVectors(this.rotationHistory);
  4201. this.rotationSpeed.set(e.x * a.rotationAfterMoveMultiplier, e.y * a.rotationAfterMoveMultiplier)
  4202. }
  4203. ,
  4204. n.prototype.onTouchEnd = function(e) {
  4205. this.usable() && (e.preventDefault(),
  4206. e.stopPropagation(),
  4207. this.endRotation())
  4208. }
  4209. ,
  4210. n.prototype.onMouseUp = function(e) {
  4211. //if(window.vrEnabled && !browser.isMobile() )return //xzw add
  4212. this.usable() && (e.preventDefault(),
  4213. e.stopPropagation(),
  4214. this.endRotation())
  4215. }
  4216. ,
  4217. n.prototype.onPointerUp = function(e) {
  4218. this.usable() && "touch" === e.pointerType && (this.pointers.forEach(function(t, i) {
  4219. e.pointerId === t.id && this.pointers.splice(i, 1)
  4220. }
  4221. .bind(this)),
  4222. e.touches = this.pointers,
  4223. this.onTouchEnd(e))
  4224. }
  4225. ,
  4226. /* n.prototype.getLimitAngleAtPano = function(defaultAngle, pano){
  4227. let limitUpAtPano = a.upDownAngleLimitPanos?.[pano.id]
  4228. let insideLookLimitUp = limitUpAtPano?.up != void 0 ? limitUpAtPano?.up : defaultAngle
  4229. return insideLookLimitUp
  4230. } */
  4231. n.prototype.update = function(e) {
  4232. this.lon,
  4233. this.lat;
  4234. for (this.updateRotation(),
  4235. this.rotationHistory.push(this.rotationDifference.clone()); this.rotationHistory.length > a.rotationAfterMoveHistoryCount; )
  4236. this.rotationHistory.shift();
  4237. this.lon += this.rotationDifference.x,
  4238. this.lat += this.rotationDifference.y,
  4239. this.rotationDifference.set(0, 0)
  4240. //改
  4241. var friction = Math.min(1, a.rotationFriction * e * 60) //如果deltaTime > 1/ 60 (比较卡),就增加rotationFriction, 以防止转动过久
  4242. this.rotationSpeed.x = this.rotationSpeed.x * (1 - friction) + this.rotationAcc.x * a.rotationAccelerationInside,
  4243. this.rotationSpeed.y = this.rotationSpeed.y * (1 - friction) + this.rotationAcc.y * a.rotationAccelerationInside,
  4244. this.lon += this.rotationSpeed.x * e,
  4245. this.lat += this.rotationSpeed.y * e
  4246. let insideLookLimitDown = this.insideLookLimitDown != void 0 ? this.insideLookLimitDown : a.insideLookLimitDown
  4247. let insideLookLimitUp = this.insideLookLimitUp != void 0 ? this.insideLookLimitUp : a.insideLookLimitUp
  4248. /* insideLookLimitUp = this.getLimitAngleAtPano(insideLookLimitUp, player.currentPano)
  4249. if(player.flying && player.nextPano){//过渡渐变
  4250. let insideLookLimitUp2 = this.getLimitAngleAtPano(insideLookLimitUp, player.nextPano)
  4251. if(insideLookLimitUp2 != insideLookLimitUp){
  4252. let object = transitions.funcs.find(e=>e.name == 'camFly')
  4253. if(object){
  4254. let r = object.current / object.duration
  4255. insideLookLimitUp = math.linearClamp(r,[0,1],[insideLookLimitUp,insideLookLimitUp2])
  4256. }else{
  4257. console.error('?????????????')
  4258. //insideLookLimitUp = insideLookLimitUp2
  4259. }
  4260. }
  4261. } */
  4262. insideLookLimitDown = insideLookLimitDown - a.insideFOV/2 + this.camera.fov / 2
  4263. insideLookLimitUp = insideLookLimitUp + a.insideFOV/2 - this.camera.fov / 2
  4264. 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 );
  4265. this.phi = r.Math.degToRad(90 - this.lat),
  4266. this.theta = r.Math.degToRad(this.lon),
  4267. this.lookVector.x = Math.sin(this.phi) * Math.cos(this.theta),
  4268. this.lookVector.y = Math.cos(this.phi),
  4269. this.lookVector.z = Math.sin(this.phi) * Math.sin(this.theta),
  4270. this.target.copy(this.lookVector).add(this.camera.position),
  4271. this.camera.lookAt(this.target)
  4272. }
  4273. ,
  4274. n.prototype.onMouseWheel = function(e) {
  4275. if (this.usable()) {
  4276. var t = e.wheelDelta || -e.detail;
  4277. this.emit(u.InteractionDirect),
  4278. this.emit(u.Scroll, t)
  4279. }
  4280. }
  4281. ,
  4282. n.prototype.onKeyDown = function(e) {
  4283. this.usable() && (e.metaKey || e.ctrlKey || (e.preventDefault(),
  4284. this.handleKeyDown(e.which)))
  4285. }
  4286. ,
  4287. n.prototype.handleKeyDown = function(e) {
  4288. var t = function(e, t) {
  4289. this.rotationAcc[e] = t
  4290. }
  4291. .bind(this);
  4292. this.emit(u.InteractionKey);
  4293. var i = !0;
  4294. switch (e) {
  4295. case h.LEFTARROW:
  4296. case h.J:
  4297. t("x", -1);
  4298. break;
  4299. case h.RIGHTARROW:
  4300. case h.L:
  4301. t("x", 1);
  4302. break;
  4303. case h.I:
  4304. t("y", 1);
  4305. break;
  4306. case h.K:
  4307. t("y", -1);
  4308. break;
  4309. default:
  4310. i = !1
  4311. }
  4312. i && this.emit(u.Move, "key")
  4313. }
  4314. ,
  4315. n.prototype.onKeyUp = function(e) {
  4316. this.usable() && (e.preventDefault(),
  4317. e.stopPropagation(),
  4318. this.handleKeyUp(e.which))
  4319. }
  4320. ,
  4321. n.prototype.handleKeyUp = function(e) {
  4322. switch (e) {
  4323. case h.LEFTARROW:
  4324. case h.J:
  4325. case h.RIGHTARROW:
  4326. case h.L:
  4327. this.rotationAcc.x = 0;
  4328. break;
  4329. case h.I:
  4330. case h.K:
  4331. this.rotationAcc.y = 0
  4332. }
  4333. }
  4334. ,
  4335. n.prototype.startRotating = function(e, t) {
  4336. e && (this.rotationAcc.x = e),
  4337. t && (this.rotationAcc.y = t)
  4338. }
  4339. ,
  4340. n.prototype.stopRotating = function(e) {
  4341. e && (this.rotationSpeed.x = this.rotationSpeed.y = 0),
  4342. this.rotationAcc.set(0, 0)
  4343. }
  4344. ,
  4345. n.prototype.reset = function() {
  4346. this.pointerDragOn = !1,
  4347. this.rotationAcc.set(0, 0),
  4348. this.rotationSpeed.set(0, 0),
  4349. this.pointers = []
  4350. }
  4351. ,
  4352. n.prototype.toJSON = function() {
  4353. var e = {
  4354. camera_position: {
  4355. x: l.toPrecision(this.camera.position.x, 4),
  4356. y: l.toPrecision(this.camera.position.y, 4),
  4357. z: l.toPrecision(this.camera.position.z, 4)
  4358. },
  4359. camera_quaternion: {
  4360. x: l.toPrecision(this.camera.quaternion.x, 4),
  4361. y: l.toPrecision(this.camera.quaternion.y, 4),
  4362. z: l.toPrecision(this.camera.quaternion.z, 4),
  4363. w: l.toPrecision(this.camera.quaternion.w, 4)
  4364. }
  4365. };
  4366. return e
  4367. }
  4368. ,
  4369. n.prototype.setStateFromJSON = function(e) {
  4370. this.camera.position.copy(e.camera_position),
  4371. this.camera.quaternion.copy(e.camera_quaternion)
  4372. }
  4373. ,
  4374. t.exports = n
  4375. }
  4376. ).call(this, "/js/controls/PanoramaControls.js")
  4377. }
  4378. , {
  4379. "../enum/ControlEvents": 21,
  4380. "../enum/Keys": 30,
  4381. "../enum/MouseButton": 34,
  4382. "../enum/Vectors": 50,
  4383. "../settings": 166,
  4384. "../util/common": 185,
  4385. "../util/logger": 189,
  4386. "../util/math": 190,
  4387. events: 202,
  4388. three: 217
  4389. }],
  4390. 14: [function(e, t, i) {
  4391. (function(i) {
  4392. "use strict";
  4393. var n = e("three")
  4394. , r = e("../enum/Viewmode")
  4395. , o = e("../util/logger")
  4396. , a = new o(i);
  4397. t.exports = {
  4398. serialize: function(e) {
  4399. return encodeURI(JSON.stringify(e))
  4400. },
  4401. deserialize: function(e) {
  4402. function t(e) {
  4403. function t(e, t) {
  4404. return e && "number" == typeof t && !isNaN(t)
  4405. }
  4406. return e.reduce(t, !0)
  4407. }
  4408. try {
  4409. var i = JSON.parse(decodeURI(e))
  4410. , o = {
  4411. mode: r.fromInt(i.camera_mode),
  4412. panoId: i.scan_id,
  4413. position: (new n.Vector3).copy(i.camera_position),
  4414. quaternion: (new n.Quaternion).copy(i.camera_quaternion),
  4415. zoom: i.ortho_zoom,
  4416. floorVisibility: i.floor_visibility
  4417. }
  4418. , s = o.position;
  4419. t([s.x, s.y, s.z]) || o.position.set(0, 0, 0);
  4420. var l = o.quaternion;
  4421. return t([l.x, l.y, l.z, l.w]) || o.quaternion.set(0, 0, 0, 1),
  4422. o
  4423. } catch (i) {
  4424. a.debug("Not able to parse start location as JSON; falling back to old array style parsing");
  4425. try {
  4426. var c = e.split(",")
  4427. , h = {
  4428. x: parseFloat(c[2]),
  4429. y: parseFloat(c[3]),
  4430. z: parseFloat(c[4])
  4431. }
  4432. , u = {
  4433. x: parseFloat(c[5]),
  4434. y: parseFloat(c[6]),
  4435. z: parseFloat(c[7]),
  4436. w: parseFloat(c[8])
  4437. };
  4438. return t([h.x, h.y, h.z]) || (h.x = 0,
  4439. h.y = 0,
  4440. h.z = 0),
  4441. t([u.x, u.y, u.z, u.w]) || (u.x = 0,
  4442. u.y = 0,
  4443. u.z = 0,
  4444. u.w = 1),
  4445. {
  4446. mode: r.fromInt(c[0]),
  4447. panoId: c[1],
  4448. position: (new n.Vector3).copy(h),
  4449. quaternion: (new n.Quaternion).copy(u)
  4450. }
  4451. } catch (t) {
  4452. a.warn('Invalid start override, ignoring: "' + e + '"', t.message)
  4453. }
  4454. }
  4455. return null
  4456. }
  4457. }
  4458. }
  4459. ).call(this, "/js/controls/serializer.js")
  4460. }
  4461. , {
  4462. "../enum/Viewmode": 51,
  4463. "../util/logger": 189,
  4464. three: 217
  4465. }],
  4466. 15: [function(e, t, i) {
  4467. (function(i) {
  4468. "use strict";
  4469. function n() {
  4470. this.endlessLoop = a.warp.loop,
  4471. this.clock = new r.Clock(!0),
  4472. this.model = null,
  4473. this.player = null,
  4474. this.currentItem = null,
  4475. this.destinationItem = null,
  4476. this.tourIsPlaying = !1,
  4477. this.transitionStage = y.None,
  4478. this.nextFunc = null,
  4479. this.onTheBus = !1,
  4480. this.tourInProgress = !1,
  4481. this.reachSource = null,
  4482. this.interrupted = !1,
  4483. this.nItems = 0,
  4484. this.walkingSectionPaused = !1
  4485. }
  4486. var r = e("three")
  4487. , o = e("./util/logger")
  4488. , a = e("./settings")
  4489. , s = e("./util/transitions")
  4490. , l = e("events").EventEmitter
  4491. , c = e("./enum/Viewmode")
  4492. , h = e("./analytics")
  4493. , u = e("./enum/WarpStyle")
  4494. , s = e("./util/transitions")
  4495. , d = (e("./model/ModelManager"),
  4496. e("./enum/ModelManagerEvents"))
  4497. , p = e("./enum/DirectorEvents")
  4498. , f = e("./enum/PlayerEvents")
  4499. , g = (e("./enum/ControlEvents"),
  4500. e("./enum/BlackoutStyle"))
  4501. , m = e("./enum/PathDiscardMode")
  4502. , v = e("./enum/PathDisplayMode")
  4503. , A = (e("./player"),
  4504. new o(i))
  4505. , y = Object.freeze({
  4506. None: 0,
  4507. Moving: 1,
  4508. Aiming: 2,
  4509. Interlude: 3
  4510. })
  4511. , C = Object.freeze({
  4512. Forward: 1,
  4513. NoChange: 0,
  4514. Backwards: -1
  4515. })
  4516. , I = s.getUniqueId();
  4517. n.prototype = Object.create(l.prototype),
  4518. n.prototype.init = function(e, t) {
  4519. this.player = e,
  4520. this.modelManager = t,
  4521. this.updateModel(),
  4522. this.resetAll(),
  4523. this.bindEvents()
  4524. // // zeg 查询pano对应的导览片段
  4525. // if(!this.panoIdMap) {
  4526. // this.panoIdMap = new Map()
  4527. // this.model.heroLocations.forEach( (value, index) => {
  4528. // // value.heroLocations.forEach( hl => {
  4529. // if(!value.heroLocations) return
  4530. // let hl = value.heroLocations[0]
  4531. // let arr = this.panoIdMap.get(hl.panoId)
  4532. // if(arr){
  4533. // this.panoIdMap.set(hl.panoId, [...arr, index])
  4534. // } else {
  4535. // this.panoIdMap.set(hl.panoId, [index])
  4536. // }
  4537. // // })
  4538. // })
  4539. // }
  4540. }
  4541. ,
  4542. n.prototype.resetAll = function() {
  4543. if (this.currentItem = null,
  4544. this.destinationItem = null,
  4545. this.tourIsPlaying = !1,
  4546. //this.bgmReplay(),//xzw
  4547. this.transitionStage = y.None,
  4548. this.nextFunc = null,
  4549. this.onTheBus = !1,
  4550. this.reachSource = null,
  4551. this.interrupted = !1,
  4552. this.model) {
  4553. var e = a.path.typ === u.WALK ? u.WALK : u.STD;
  4554. this.defaultWarpStyle = this.model.data.hasOwnProperty("player_options") && this.model.data.player_options && this.model.data.player_options.fast_transitions === !1 ? e : u.BLACK
  4555. } else
  4556. this.defaultWarpStyle = u.BLACK,
  4557. A.warn('No model yet, choosing "' + this.defaultWarpStyle + '" transitions');
  4558. this.resetSpecialTransition()
  4559. }
  4560. ,
  4561. n.prototype.updateModel = function() {
  4562. this.model = this.modelManager.getActiveModel(),
  4563. this.nItems = this.model.heroLocations.length
  4564. }
  4565. ,
  4566. n.prototype.bindEvents = function() {
  4567. this.modelManager.on(d.ActiveModelChanged, this.updateModel.bind(this)),
  4568. this.player.on(f.WarpInterruptedWithFlyTo, this.checkAndHandleWalkingtourInterruption.bind(this)),
  4569. this.player.on(f.Move, this.handlePlayerMove.bind(this)),
  4570. this.player.on(f.PanoChosen, this.handlePlayerPanoChosen.bind(this)),
  4571. this.player.on(f.ModeChanged, this.handlePlayerModeChanged.bind(this)),
  4572. this.player.on(f.InputStart, this.handlePlayerInputStart.bind(this)),
  4573. this.player.on(f.FlyingStarted, this.handlePlayerFlyingStarted.bind(this)),
  4574. this.player.once(f.Move, function() {
  4575. s.cancelById(I)
  4576. })
  4577. }
  4578. ,
  4579. n.prototype.checkAndHandleWalkingtourInterruption = function(e) {//快速停止。 改:去掉判断nextWarpStyle,因为这个属性改乱了,导致点击停止按钮不执行
  4580. return /* e === u.WALK && ( */this.interrupt(g.NONE),
  4581. this.pauseWalkingSection(),
  4582. this.player.fastForwardActivePanoFlight(),
  4583. !0/* ) */
  4584. }
  4585. ,
  4586. n.prototype.handlePlayerMove = function(e) {
  4587. this.transitionStage === y.Interlude && this.interrupt(g.NONE),
  4588. this.emit("update.controls")
  4589. }
  4590. ,
  4591. n.prototype.handlePlayerPanoChosen = function(e, t) {
  4592. this.intermediateState() || e.id === t.id || (this.onTheBus = !1,
  4593. this.emit("update.controls"))
  4594. }
  4595. ,
  4596. n.prototype.handlePlayerModeChanged = function(e, t) {
  4597. this.intermediateState() || e === t || (this.onTheBus = !1,
  4598. this.emit("update.controls"))
  4599. }
  4600. ,
  4601. n.prototype.handlePlayerInputStart = function(e) {
  4602. this.transitionStage === y.Interlude && this.interrupt(g.NONE)
  4603. }
  4604. ,
  4605. n.prototype.handlePlayerFlyingStarted = function() {
  4606. this.clearWalkingSectionPaused()
  4607. }
  4608. ,
  4609. n.prototype.describe = function() {
  4610. return {
  4611. nItems: this.nItems,
  4612. currentItem: this.currentItem,
  4613. destinationItem: this.destinationItem,
  4614. tourIsPlaying: this.tourIsPlaying,
  4615. onTheBus: this.onTheBus,
  4616. endlessLoop: this.endlessLoop,
  4617. viewMode: this.player.mode,
  4618. inTransition: this._inTransition(),
  4619. transitionStage: this.transitionStage,
  4620. tourInProgress: this.tourInProgress
  4621. }
  4622. }
  4623. ,
  4624. n.prototype._inTransition = function() {
  4625. return this.player.flying || this.player.isWarping() || this.player.isWaitingToWarp() || this.player.mode === c.TRANSITIONING || this.tourIsPlaying
  4626. }
  4627. ,
  4628. n.prototype.bounceable = function() {
  4629. var e = this.clock.getDelta();
  4630. return this.isInterrupted() || e < .9 && e > .01 || this.player.flying && !this.player.isWarping()
  4631. }
  4632. ,
  4633. n.prototype.itemCompare = function(item1, item2, type){//add
  4634. if(type == 'equal'){//==
  4635. return item1 && item2 && item1[0] == item2[0] && item1[1] == item2[1]
  4636. }else if(type == 'less'){//<
  4637. return item1 && item2 && (item1[0] < item2[0]) || (item1[0] == item2[0] && item1[1] < item2[1])
  4638. }
  4639. }
  4640. n.prototype.currentMoveDirection = function() {
  4641. //return null === this.currentItem || void 0 === this.currentItem ? y.Forward : this.destinationItem === this.currentItem ? y.NoChange : this.destinationItem > this.currentItem ? y.Forward : y.Backwards
  4642. 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
  4643. }
  4644. ,
  4645. n.prototype.clearPath = function() {
  4646. this._inTransition() || this.player.path.discardPathObject()
  4647. }
  4648. ,
  4649. n.prototype.allFloors = function() {
  4650. this.model.toggleAllFloors()
  4651. }
  4652. ,
  4653. n.prototype.actionComplete = function(e) {
  4654. if (this.interrupted = !1,
  4655. this.transitionStage = y.None,
  4656. this.resetSpecialTransition(),
  4657. null !== this.destinationItem && this.setCurrentItem(this.destinationItem),
  4658. this.tourIsPlaying || (this.player.disablePreRendering(),
  4659. this.player.mode === c.PANORAMA && this.player.currentPano.isAligned() && this.model.fadePanoMarkers()),
  4660. this.emit("update.controls"),
  4661. this.nextFunc) {
  4662. var t = this.nextFunc;
  4663. this.nextFunc = null,
  4664. t()
  4665. }
  4666. }
  4667. ,
  4668. n.prototype.awaitCompletion = function(e, t) {
  4669. this.nextFunc = t,
  4670. e()
  4671. }
  4672. ,
  4673. n.prototype.updateSuccessFunction = function(e) {
  4674. this.nextFunc = e
  4675. }
  4676. ,
  4677. n.prototype.interrupt = function(e, t) {//滑动屏幕或按下键盘等
  4678. return !!this.wouldInterrupt() && (this.tourIsPlaying && (this.player.zoomEnabled = this.wasZoomEnabled),
  4679. this.tourIsPlaying = !1,
  4680. //this.bgmReplay(),//xzw
  4681. this.interrupted = !0,
  4682. this.nextFunc = null,
  4683. this.emit(p.ActionInterrupted),
  4684. null !== e && void 0 !== e || (e = g.BEGINNING),
  4685. this.player.interruptAndFastForward(e, t),
  4686. !0)
  4687. }
  4688. ,
  4689. n.prototype.wouldInterrupt = function() {
  4690. return this.transitionStage !== y.None
  4691. }
  4692. ,
  4693. n.prototype.intermediateState = function() {
  4694. return this.transitionStage !== y.None
  4695. }
  4696. ,
  4697. n.prototype.isInterrupted = function() {
  4698. return this.interrupted
  4699. }
  4700. ,
  4701. n.prototype.pauseWalkingSection = function() {
  4702. this.walkingSectionPaused = !0
  4703. }
  4704. ,
  4705. n.prototype.clearWalkingSectionPaused = function() {
  4706. this.walkingSectionPaused = !1
  4707. }
  4708. ,
  4709. n.prototype.autoTour = function() {
  4710. var e = Date.now();
  4711. this.model.auxDataPromise.then(function() {
  4712. e = Date.now() - e;
  4713. var t = a.warp.auto
  4714. , i = this.model.data && this.model.data.player_options /* && this.model.data.player_options.highlight_reel */;
  4715. t >= 0 && this.model.heroCount() > 1 && i && s.trigger({
  4716. duration: Math.max(1e3 * Math.min(300, t) - e, 0),
  4717. done: function() {
  4718. this.playTour()
  4719. }
  4720. .bind(this),
  4721. name: "_atr",
  4722. id: I
  4723. })
  4724. }
  4725. .bind(this))
  4726. }
  4727. ,
  4728. n.prototype.atDestinationPano = function(pano) {
  4729. if(null === this.destinationItem)return !1;
  4730. pano = pano || this.player.currentPano
  4731. if(!pano){
  4732. return !1;
  4733. }
  4734. var destination = this.destinationItem && this.model.getHeroDescriptorByIndex(this.destinationItem)
  4735. return destination && destination.panoId == pano.id
  4736. }
  4737. ,
  4738. n.prototype.redirectToItem = function(e, t) {
  4739. if (null === e || void 0 === e)
  4740. return void A.warn("Director.redirectToItem() -> Redirecting to null item.");
  4741. if (!this.wouldInterrupt())
  4742. return void A.warn("Director.redirectToItem() -> Director cannot redirect if there is nothing to interrupt.");
  4743. if (this.player.mode === c.TRANSITIONING)
  4744. return void A.debug("Director.redirectToItem() -> Cannot redirect while transitioning.");
  4745. A.debug("Director.redirectToItem() -> Redirecting to " + e + " via " + t);
  4746. var i = function() {
  4747. s.setTimeout(function() {
  4748. this.setDestinationItem(e),
  4749. this.goToDestination(!0, g.BEGINNING, a.warp.warpInterruptionRedirectTime, !1)
  4750. }
  4751. .bind(this), 0)
  4752. }
  4753. .bind(this);
  4754. this.interrupt(g.END, 0),
  4755. this.updateSuccessFunction(i)
  4756. }
  4757. ,
  4758. n.prototype.useSpecialTransition = function(e) {
  4759. void 0 !== e && this.defaultWarpStyle !== u.BLACK && A.debug("useSpecialTransition(): " + e),
  4760. this.nextWarpStyle = u.BLACK
  4761. }
  4762. ,
  4763. n.prototype.resetSpecialTransition = function() {
  4764. this.nextWarpStyle = this.defaultWarpStyle
  4765. }
  4766. ,
  4767. n.prototype.arrivedAtDestination = function(e) {
  4768. if (this.player.flying || this.player.isWarping())
  4769. A.warn("Cannot advance to interlude or aiming while player is flying or warping.");
  4770. else {
  4771. this.transitionStage = y.Aiming;
  4772. var t = this.tourIsPlaying ? this.tourInterlude.bind(this, this.nextItem(this.currentItem)) : null;
  4773. this.player.model.fadePanoMarkers(0),
  4774. this.awaitCompletion(function() {
  4775. this.resetSpecialTransition(),
  4776. e ? this.player.aimTourCamera(this.destinationItem, v.Retain, v.Slow, this.actionComplete.bind(this)) : this.actionComplete()
  4777. }
  4778. .bind(this), t)
  4779. }
  4780. }
  4781. ,
  4782. n.prototype.goToDestination = function(e, t, i, n) {
  4783. //音频
  4784. var musicInfo = this.model.heroLocations[this.destinationItem[0]].musicInfo
  4785. // zeg 手动导览不播放音频
  4786. if(musicInfo && musicInfo.music && !e){
  4787. let musicType = localStorage.getItem('xunirole') || 'male'
  4788. let isMale = musicType.indexOf('female') < 0
  4789. let fixMusic = isMale?musicInfo.music:(musicInfo.fmusic||musicInfo.music)
  4790. // let src = musicInfo.music.includes(g_Prefix.slice(-10)) ? musicInfo.music : g_Prefix + musicInfo.music;
  4791. let src = fixMusic
  4792. let audioObj = SoundManager.list.find(e=>e.name == 'tour')
  4793. let audioSrc1 = common.getFileNameFromUrl(audioObj.src);
  4794. let audioSrc2 = common.getFileNameFromUrl(src)
  4795. if(audioSrc1 == audioSrc2){//应该是继续播放该folder
  4796. if(this.destinationItem[1] == 0){//从头开始播放 因为可能暂停后然后再点该缩略图播
  4797. SoundManager.play('tour',null,0) // currentTime = 0;
  4798. }else if( audioObj.audio.paused && audioObj.audio.currentTime < audioObj.audio.duration ){//未播完
  4799. SoundManager.play('tour')//继续播。为什么会有暂停的情况?如果手动切换到bgm了呢?
  4800. }
  4801. }else{//很可能是该folder的起始
  4802. SoundManager.play('tour', manage.dealURL(src))
  4803. }
  4804. }
  4805. let oldPos = this.player.position.clone();
  4806. let oldPano = this.player.currentPano
  4807. if (this.onTheBus = !0,
  4808. this.emit("update.controls"),
  4809. this.player.updateLastView(),
  4810. !n && this.atDestinationPano()){
  4811. /*
  4812. // 原地旋转时, 写到_warpCameraAim里,因那有时间
  4813. var r = this.model.getHeroDescriptorByIndex(this.destinationItem)
  4814. if(r.zoom && r.zoom != this.player.zoomLevel){//add
  4815. this.player.smoothZoomFovTo(null, r.zoom, a.warp.teleportTime) //瞬间过渡的时间
  4816. } */
  4817. return void this.arrivedAtDestination(!0);
  4818. }
  4819. if (this.player.flying || this.player.isWarping())
  4820. A.warn("Cannot go to new destination while player is flying or warping.");
  4821. else {
  4822. var r = this.model.getHeroDescriptorByIndex(this.destinationItem)
  4823. , o = null
  4824. , a1 = null;
  4825. if (r.isPano()) {
  4826. //var s = 0 === this.destinationItem || e ? u.BLACK : this.nextWarpStyle;
  4827. //var walk = window.DATA.black ? 'black' : 'walk';
  4828. //若是点击item,直接瞬间过渡。
  4829. var s = e ? 'black' : this.getMomentTour(this.destinationItem) //window.DATA.momentTour || "walk";
  4830. if(this.destinationItem[0] == 0 && this.destinationItem[1] == 0) s = 'black' // 周恩光加 返回最初导览点是瞬间过渡
  4831. a1 = this.player.warpToPanoByHeroIndex.bind(this.player, this.destinationItem, v.Show, m.Slow, s, true, i, this.actionComplete.bind(this)),
  4832. o = this.arrivedAtDestination.bind(this, !0)
  4833. if(s=='black' && r.zoom && r.zoom != this.player.zoomLevel){//add
  4834. this.player.smoothZoomFovTo(null, r.zoom, a.warp.teleportTime) //瞬间过渡的时间
  4835. }
  4836. } else{
  4837. a1 = this.player.warpToNonPanoByHeroIndex.bind(this.player, this.destinationItem, this.actionComplete.bind(this)),
  4838. o = this.arrivedAtDestination.bind(this, !1);
  4839. }
  4840. this.transitionStage = y.Moving,
  4841. this.model.fadePanoMarkers(0),
  4842. this.awaitCompletion(function() {
  4843. a1();
  4844. }
  4845. .bind(this), o),
  4846. this.emit("update.controls")
  4847. }
  4848. }
  4849. ,
  4850. n.prototype.tourInterlude = function() {
  4851. if (h.trackAlways("reach_highlight", {
  4852. reach_source: this.reachSource
  4853. }),
  4854. this.model.fadePanoMarkers(0),
  4855. this.emit("update.controls"),
  4856. this.tourIsPlaying)
  4857. return this.atEndOfTour() && !this.endlessLoop ? (this.tourInProgress = !1,
  4858. void this.awaitCompletion(function() {
  4859. this.transitionStage = y.Interlude,
  4860. this.player.tourInterlude(this.nextItem(this.currentItem),this.actionComplete.bind(this))
  4861. }
  4862. .bind(this), function(){
  4863. this.currentItem = [0,0],
  4864. this.stopTour(true),
  4865. this.emit(p.TourEnd)
  4866. }.bind(this)),
  4867. void (this.player.mode === c.PANORAMA && this.model.fadePanoMarkers(a.panorama.markerOpacity))) : void this.awaitCompletion(function() {
  4868. this.transitionStage = y.Interlude,
  4869. this.player.tourInterlude(this.nextItem(this.currentItem),this.actionComplete.bind(this))
  4870. }
  4871. .bind(this), this.goNext.bind(this))
  4872. }
  4873. ,
  4874. n.prototype.findNearestItem = function(endToStart=true, searchEvery){//找到离currentPano最近的导览
  4875. /* if(this.atDestinationPano(this.player.currentPano)){//在终点直接从头。但有的场景可能不希望如此,就想跳到所属的展区开始。
  4876. return [0,0] //2023.7.7发现在点击item后播放会从头开始
  4877. } */
  4878. //注:没有判断此刻是否在panorama模式,就使用currentPano
  4879. var result = {item:[0,0], dis:Infinity};
  4880. var compare = (location, item)=>{
  4881. if(location.panoId != void 0 && location.panoId!= "outside"){
  4882. var pano = this.model.panos.index[location.panoId];
  4883. var dis = pano.position.distanceTo(this.player.currentPano.position)
  4884. if(dis<result.dis){
  4885. result.item = item, result.dis = dis, result.location = location, result.angle = null
  4886. }else if(dis == result.dis){
  4887. if(this.currentItem){
  4888. if(result.angle == void 0){
  4889. result.angle = result.location.quaternion.angleTo(player.quaternion)
  4890. }//用角度最接近的那一个
  4891. let angle = location.quaternion.angleTo(player.quaternion)
  4892. if(angle < result.angle){
  4893. result.item = item, result.dis = dis, result.location = location, result.angle = angle
  4894. }
  4895. /* //如果两个位置相同,优先播放在导览条上离激活的最近的那段导览
  4896. let dis1 = [Math.abs(item[0] - this.currentItem[0]), Math.abs(item[1] - this.currentItem[1])] //当前差距
  4897. let dis2 = [Math.abs(result.item[0] - this.currentItem[0]), Math.abs(result.item[1] - this.currentItem[1])]
  4898. if( this.itemCompare(dis1, dis2, 'less')){
  4899. result.item = item, result.dis = dis
  4900. } */
  4901. }
  4902. }
  4903. }
  4904. }
  4905. this.model.heroLocations.forEach((e,i)=>{
  4906. if(e.heroLocations){
  4907. if(searchEvery){
  4908. e.heroLocations.forEach((a,j)=>{
  4909. compare(a, [i,j])
  4910. })
  4911. }else{
  4912. var location = e.heroLocations.find(e=>e.panoId != void 0)
  4913. location && compare(location, [i,0]) //跳到此区域开头
  4914. }
  4915. }else{
  4916. compare(e, [i,0])
  4917. }
  4918. })
  4919. if(endToStart && this.atEndOfTour(result.item)){ //如果是最后一个点,直接跳到开头,否则导览开始就在终点的话不会从头开始
  4920. return [0,0] //但注意最后是区域的话result.item是区域开头,除非站在最末最末尾的位置,上面的atDestinationPano直接返回
  4921. }
  4922. return result.item
  4923. }
  4924. n.prototype.playTour = function() {
  4925. if (!this.bounceable() && this.model.heroLocations.length) {
  4926. // ------------这部分处理逻辑目前已由playTourNearBy()取代------------------------------------
  4927. // if(!this.currentItem) this.currentItem = []
  4928. // if(this.currentItem[0] != 0 || this.destinationItem[0]!= this.nItems-1){
  4929. // // zeg 从当前pano进行自动导览
  4930. // let currentPanoDestinations = this.panoIdMap.get(this.player.currentPano.id)
  4931. // // this.model.heroLocations.forEach( (value, index) => {
  4932. // // if(value.heroLocations.find( hl => hl.panoId == this.player.currentPano.id )) {
  4933. // // currentPanoDestinations.push(index)
  4934. // // }
  4935. // // })
  4936. // if(!currentPanoDestinations) {
  4937. // // let panoIndex = this.model.panos.list.findIndex( pano => pano.id == this.player.currentPano.id )
  4938. // let panoIndex = this.model.panos.list.indexOf( this.player.currentPano )
  4939. // let neighbourIndex = [ panoIndex + 1, panoIndex - 1, panoIndex + 2, panoIndex - 2, panoIndex + 3, panoIndex - 3 ]
  4940. // for(var i = 0; i < neighbourIndex.length; i++) {
  4941. // currentPanoDestinations = this.panoIdMap.get(this.model.panos.list[neighbourIndex[i]]&&this.model.panos.list[neighbourIndex[i]].id)
  4942. // if(currentPanoDestinations && currentPanoDestinations[0] != 0) break
  4943. // }
  4944. // if(!currentPanoDestinations) currentPanoDestinations = [0];
  4945. // }
  4946. // if(currentPanoDestinations.indexOf(this.currentItem[0]) == -1) {
  4947. // this.currentItem[0] = currentPanoDestinations[0]
  4948. // }
  4949. // }
  4950. return this.tourIsPlaying ? void A.info("tour is already playing") : void (this.wouldInterrupt() || (this.player.emit("tour_auto", this.defaultWarpStyle),
  4951. this.tourInProgress = !0,
  4952. this.reachSource = "play",
  4953. this.tourIsPlaying = !0,
  4954. this.wasZoomEnabled = this.player.zoomEnabled,
  4955. this.player.zoomEnabled = !1,
  4956. this.resetSpecialTransition(),
  4957. this.emit("update.controls"),
  4958. this.emit(p.TourStart),
  4959. this.player.enablePreRendering(),
  4960. // this.currentItem[1] = null,
  4961. this.walkingSectionPaused ? (this.clearWalkingSectionPaused(),
  4962. this.goToDestination()) : /* this.goNext() */(this.tourAdvance(0) ,this.goToDestination()))) //xzw: 不要直接跳到下一个点开始,从当前点开始,否则当一段区域内只有一个导览时播放会立刻跳到下一个缩略图进行。
  4963. }
  4964. }
  4965. n.prototype.playTourNearBy = function() {//就近导览
  4966. if (!this.bounceable()){
  4967. return this.tourIsPlaying ? void A.info("tour is already playing") : void (this.wouldInterrupt() || (this.player.emit("tour_auto", this.defaultWarpStyle),
  4968. this.tourInProgress = !0,
  4969. this.reachSource = "play",
  4970. this.tourIsPlaying = !0,
  4971. this.wasZoomEnabled = this.player.zoomEnabled,
  4972. this.player.zoomEnabled = !1,
  4973. this.resetSpecialTransition(),
  4974. this.emit("update.controls"),
  4975. this.emit(p.TourStart),
  4976. this.player.enablePreRendering(),
  4977. /* this.walkingSectionPaused ? (this.clearWalkingSectionPaused(),
  4978. this.goToDestination()) : this.goNext())) */
  4979. this.setDestinationItem(this.findNearestItem()) , this.goToDestination()) )
  4980. }
  4981. }
  4982. ,
  4983. /* n.prototype.bgmReplay = function() {//xzw add 结束tour后可能要继续播放背景音乐
  4984. } */
  4985. n.prototype.stopTour = function(isAutoStop) {//停止导览 isAutoStop 希望仅在飞完结束自动停止时的stopTour不停止tourSound, 这样才能完整播放tourSound. 不过似乎会在倒数第二个片段点击按钮停止导览时也视作自动结束的(执行this.interrupt() )。
  4986. SoundManager.pause('tour',true), // zeg 自动导览暂停时同时停止语音
  4987. this.isInterrupted() || this.transitionStage === y.Moving && this.checkAndHandleWalkingtourInterruption(this.nextWarpStyle) || (this.tourIsPlaying && (this.player.zoomEnabled = this.wasZoomEnabled),
  4988. this.tourIsPlaying = !1,
  4989. this.interrupt(),
  4990. this.clearWalkingSectionPaused(),
  4991. this.resetSpecialTransition(),
  4992. this.emit("update.controls"))
  4993. }
  4994. ,
  4995. n.prototype.endTourProgress = function() {
  4996. this.tourInProgress = !1,
  4997. this.emit("update.controls"),
  4998. this.emit(p.TourEnd)
  4999. }
  5000. ,
  5001. n.prototype.goToHighlight_old = function(e) {
  5002. if (this.wouldInterrupt())
  5003. this.itemCompare(this.destinationItem,e,'equal') ? this.interrupt() : this.redirectToItem(e, "goToHighlight");
  5004. else {
  5005. if (A.debug("<tour.goto " + e + ">"),
  5006. this.isInterrupted())
  5007. return;
  5008. this.clearWalkingSectionPaused(),
  5009. this.setDestinationItem(e),
  5010. this.useSpecialTransition("Hilight")
  5011. this.goToDestination(true),//add true
  5012. h.trackAlways("reach_highlight", {
  5013. reach_source: "thumb"
  5014. })
  5015. }
  5016. },
  5017. n.prototype.goToHighlight = function(e) { // 切换导览时(点击列表item),不要停止导览 (故宫项目)
  5018. if (this.wouldInterrupt()){
  5019. if(dontStopTourWhenClickItem){
  5020. this.waitHighlight = e //add
  5021. let soon
  5022. if(this.itemCompare(this.destinationItem,e,'equal') ){
  5023. this.interrupt()
  5024. soon = true
  5025. }else{
  5026. this.redirectToItem(e, "goToHighlight")
  5027. }
  5028. setTimeout(()=>{
  5029. this.once(soon ? "tour.end" : "warp.end",()=>{
  5030. console.log(this.currentItem)
  5031. setTimeout(()=>{
  5032. this.waitHighlight = null
  5033. this.playTour() // 切换导览时(点击列表item),不要停止导览
  5034. },700)
  5035. })
  5036. },10)
  5037. }else{
  5038. this.itemCompare(this.destinationItem,e,'equal') ? this.interrupt() : this.redirectToItem(e, "goToHighlight");
  5039. }
  5040. }else {
  5041. if (A.debug("<tour.goto " + e + ">"),
  5042. this.isInterrupted())
  5043. return;
  5044. this.clearWalkingSectionPaused(),
  5045. this.setDestinationItem(e),
  5046. this.useSpecialTransition("Hilight")
  5047. this.goToDestination(true),//add true
  5048. h.trackAlways("reach_highlight", {
  5049. reach_source: "thumb"
  5050. })
  5051. this.once('warp.end',()=>{
  5052. this.waitHighlight = null //add
  5053. })
  5054. }
  5055. }
  5056. n.prototype.prevHighlight = function() {
  5057. this.bounceable() || (this.player.emit("tour_manual", "prev"),
  5058. this.interrupt(g.BEGINNING) || this.isInterrupted() || (this.clearWalkingSectionPaused(),
  5059. this.reachSource = "prev",
  5060. this.goPrev()))
  5061. }
  5062. ,
  5063. n.prototype.nextHighlight = function() {
  5064. this.bounceable() || (this.player.emit("tour_manual", "next"),
  5065. this.interrupt(g.BEGINNING) || this.isInterrupted() || (this.clearWalkingSectionPaused(),
  5066. this.reachSource = "next",
  5067. this.goNext()))
  5068. }
  5069. ,
  5070. n.prototype.changeMode = function(e) {
  5071. var t = $.Deferred()
  5072. , i = t.resolve.bind(t)
  5073. , n = t.reject.bind(t);
  5074. this.emit(p.StartModeChange);
  5075. var r = function() {
  5076. return this.clearWalkingSectionPaused(),
  5077. !!this.wouldInterrupt() && (this.interrupt(),
  5078. !0)
  5079. }
  5080. .bind(this);
  5081. if (!r()) {
  5082. switch (e) {
  5083. case c.PANORAMA:
  5084. 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);
  5085. break;
  5086. case c.DOLLHOUSE:
  5087. case c.FLOORPLAN:
  5088. this.player.flyToNewMode({
  5089. mode: e
  5090. }).done(i).fail(n);
  5091. break;
  5092. case c.OUTDOOR:
  5093. 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)
  5094. }
  5095. return t.promise()
  5096. }
  5097. }
  5098. ,
  5099. n.prototype.atEndOfTour = function(currentItem=this.currentItem) {
  5100. var end = currentItem && currentItem[0] >= this.nItems - 1;
  5101. if(end){
  5102. var heroLocations = this.model.heroLocations[this.nItems-1].heroLocations
  5103. if(heroLocations){
  5104. end = currentItem[1] >= heroLocations.length - 1
  5105. }
  5106. }
  5107. return end;
  5108. }
  5109. ,
  5110. n.prototype.firstDestination = function() {
  5111. //return 0 < this.nItems ? 0 : null
  5112. return 0 < this.nItems ? [0,0]: null
  5113. }
  5114. ,
  5115. n.prototype.finalDestination = function() {
  5116. //return 0 < this.nItems ? this.nItems - 1 : null
  5117. return 0 < this.nItems ? [this.nItems - 1,0]: null
  5118. }
  5119. ,
  5120. n.prototype.goPrev = function() {
  5121. this.tourAdvance(-1)
  5122. }
  5123. ,
  5124. n.prototype.goNext = function() {
  5125. this.tourAdvance(1)
  5126. }
  5127. ,
  5128. n.prototype.setDestinationItem = function(e) {
  5129. this.destinationItem = e,
  5130. this.emit("update.controls")
  5131. }
  5132. ,
  5133. n.prototype.setCurrentItem = function(e) {
  5134. this.currentItem = e,
  5135. this.emit("update.controls")
  5136. }
  5137. ,
  5138. n.prototype.nextItem = function(currentItem) {
  5139. //return null === e ? this.firstDestination() : e >= this.nItems - 1 ? this.endlessLoop ? this.firstDestination() : null : e + 1
  5140. if(currentItem == void 0)return this.firstDestination()
  5141. var currentLocation = this.model.heroLocations[currentItem[0]];
  5142. var currentChildNum = currentLocation.heroLocations ? currentLocation.heroLocations.length : 1
  5143. var item;
  5144. if(this.currentItem[1] >= currentChildNum - 1){//子目录中最后一个
  5145. item = [currentItem[0] + 1, 0] //结果可能超出nItems
  5146. }else{
  5147. item = [currentItem[0] , currentItem[1]+1]
  5148. }
  5149. if(item[0] >= this.nItems ){
  5150. item = this.firstDestination()
  5151. }
  5152. return item;
  5153. //暂时不理会endlessLoop,默认为false
  5154. }
  5155. ,
  5156. n.prototype.prevItem = function(currentItem) {
  5157. //return null === e ? this.firstDestination() : e < 0 ? this.endlessLoop ? this.lastDestination() : null : e - 1
  5158. if(currentItem == void 0)return this.firstDestination()
  5159. var item;
  5160. var lastLocation = this.model.heroLocations[currentItem[0]-1];
  5161. if(!lastLocation) return this.finalDestination()//[-1, 0]//this.setDestinationItem([-1, 0]) //结果小于0
  5162. else{
  5163. var lastChildNum = lastLocation.heroLocations ? lastLocation.heroLocations.length : 1
  5164. if(this.currentItem[1] == 0){//子目录中第一个
  5165. return [currentItem[0] - 1, lastChildNum-1]
  5166. }else{
  5167. return [currentItem[0], currentItem[1]-1]
  5168. }
  5169. }
  5170. }
  5171. ,
  5172. n.prototype.tourAdvance = function(e) {//e是1或-1 或 0
  5173. A.debug("tourAdvance(" + e + ")")
  5174. if(null === this.currentItem || void 0 === this.currentItem){
  5175. this.setDestinationItem(this.firstDestination())
  5176. // this.setDestinationItem([currentPanoDestinations[0], 0])
  5177. }else{
  5178. var item = this.currentItem
  5179. if(e == 1){
  5180. item = this.nextItem(this.currentItem)
  5181. }else if(e == -1){
  5182. item = this.prevItem(this.currentItem)
  5183. }
  5184. this.setDestinationItem(item)
  5185. }
  5186. if(this.itemCompare(this.destinationItem, this.finalDestination(), 'equal')/* [0] < 0 */){
  5187. this.useSpecialTransition("reverse-looping to end")
  5188. }else if(this.itemCompare(this.destinationItem, this.firstDestination(), 'equal')){
  5189. this.useSpecialTransition("looping back to start")
  5190. }
  5191. /* var momentTour = this.getMomentTour(this.destinationItem);
  5192. if ( "black" === momentTour) { // 方奕卓 瞬间过渡, 相机缩放至1
  5193. var zoomLevel = this.player.zoomLevel;
  5194. this.player.zoomEnabled = true;
  5195. var zoom = function(e, d) {
  5196. this.player.zoomTo((1-e)*zoomLevel, true)
  5197. }.bind(this)
  5198. s.start(zoom, 1500, function(){
  5199. }, 0, d.easeOutQuad, "zoom")
  5200. } */
  5201. this.goToDestination()
  5202. }
  5203. ,
  5204. n.prototype.getMomentTour = function(destinationItem) {//add
  5205. var wholeMomentTour = window.DATA.momentTour || "walk"; //最外层 还有一种是'std'
  5206. if(!destinationItem) return wholeMomentTour
  5207. else{
  5208. var currentLocation = this.model.getHeroDescriptorByIndex(destinationItem)//最内层。 如果有使用最内层
  5209. if(currentLocation.momentTour)return currentLocation.momentTour;
  5210. var currentLocation_ = this.model.heroLocations[destinationItem[0]];
  5211. return currentLocation_.momentTour || wholeMomentTour; //若中间层或最内层有就使用,否则使用最外层
  5212. }
  5213. }
  5214. ,
  5215. t.exports = n
  5216. }
  5217. ).call(this, "/js/director.js")
  5218. }
  5219. , {
  5220. "./analytics": 4,
  5221. "./enum/BlackoutStyle": 18,
  5222. "./enum/ControlEvents": 21,
  5223. "./enum/DirectorEvents": 23,
  5224. "./enum/ModelManagerEvents": 33,
  5225. "./enum/PathDiscardMode": 38,
  5226. "./enum/PathDisplayMode": 39,
  5227. "./enum/PlayerEvents": 40,
  5228. "./enum/Viewmode": 51,
  5229. "./enum/WarpStyle": 52,
  5230. "./model/ModelManager": 140,
  5231. "./player": 155,
  5232. "./settings": 166,
  5233. "./util/logger": 189,
  5234. "./util/transitions": 195,
  5235. events: 202,
  5236. three: 217
  5237. }],
  5238. 16: [function(e, t, i) {
  5239. "use strict";
  5240. var n = e("three")
  5241. , r = e("./enum/Viewmode")
  5242. , o = (e("./settings"),
  5243. e("./util/transitions"))
  5244. , a = e("./enum/PlayerEvents")
  5245. , s = new n.ShaderPass(n.HorizontalBlurShader)
  5246. , l = new n.ShaderPass(n.VerticalBlurShader);
  5247. l.renderToScreen = !0;
  5248. var c = $("#player").width() / $("#player").height();
  5249. isNaN(c) && (c = 1);
  5250. var h = {
  5251. currentBlur: 0,
  5252. aspect: c,
  5253. blurStrength: 1,
  5254. hblurPass: s,
  5255. vblurPass: l,
  5256. fastTranMaskPass : new n.TransitionPass()
  5257. ,
  5258. bindEvents: function(e) {
  5259. e.on(a.ModeChanged, function(e, t) {
  5260. e === r.PANORAMA && (o.cancel(h.blur),
  5261. o.cancel(h.addBlur),
  5262. o.start(h.removeBlur, 500, null, 0, null, "deblur"))
  5263. })
  5264. },
  5265. blur: function(e) {
  5266. h.currentBlur = e;
  5267. var t = e * h.blurStrength;
  5268. l.uniforms.v.value = t / 512 * h.aspect,
  5269. s.uniforms.h.value = t / 512
  5270. },
  5271. addBlur: function(e) {
  5272. e = Math.max(e, h.currentBlur),
  5273. h.blur(e)
  5274. },
  5275. removeBlur: function(e) {
  5276. e = Math.min(1 - e, h.currentBlur),
  5277. h.blur(e)
  5278. }
  5279. };
  5280. h.blur(0),
  5281. t.exports = h
  5282. }
  5283. , {
  5284. "./enum/PlayerEvents": 40,
  5285. "./enum/Viewmode": 51,
  5286. "./settings": 166,
  5287. "./util/transitions": 195,
  5288. three: 217
  5289. }],
  5290. 17: [function(e, t, i) {
  5291. "use strict";
  5292. t.exports = {
  5293. UNKNOWN: 0,
  5294. ALIGNED: 1,
  5295. UNALIGNED: 2,
  5296. PLACED: 3
  5297. }
  5298. }
  5299. , {}],
  5300. 18: [function(e, t, i) {
  5301. "use strict";
  5302. t.exports = {
  5303. NONE: 0,
  5304. MIDDLE: 1,
  5305. END: 2,
  5306. BEGINNING: 3,
  5307. FADEIN: 4
  5308. }
  5309. }
  5310. , {}],
  5311. 19: [function(e, t, i) {
  5312. "use strict";
  5313. var n = e("three");
  5314. t.exports = {
  5315. newBlue: new n.Color(4967932),
  5316. altBlue: new n.Color(47355),
  5317. tagDefault: new n.Color(223357),
  5318. classicBlue: new n.Color(53759),
  5319. mpYellow: new n.Color(16502016),
  5320. mpOrange: new n.Color(16428055),
  5321. mpBlue: new n.Color(12096),
  5322. mpLtGrey: new n.Color(13751252),
  5323. mpDkGrey: new n.Color(10000019),
  5324. mpRed: new n.Color(12525854),
  5325. mpOrangeDesat: new n.Color(16764529),
  5326. mpBlueDesat: new n.Color(4034734),
  5327. mpRedDesat: new n.Color(14705505),
  5328. white: new n.Color(16777215),
  5329. black: new n.Color(0),
  5330. _desat: function(e, t) {
  5331. var i = t || .3
  5332. , r = (new n.Color).copy(e).getHSL();
  5333. return (new n.Color).setHSL(r.h, r.s * (1 - i), r.l)
  5334. },
  5335. _darken: function(e, t) {
  5336. var i = t || .2
  5337. , r = e.getHSL();
  5338. return (new n.Color).setHSL(r.h, r.s, r.l * (1 - i))
  5339. }
  5340. }
  5341. }
  5342. , {
  5343. three: 217
  5344. }],
  5345. 20: [function(e, t, i) {
  5346. "use strict";
  5347. t.exports = {
  5348. NONE: -1,
  5349. ROTATE: 0,
  5350. DOLLY: 1,
  5351. PAN: 2,
  5352. ROTATE_DOLLY: 3,
  5353. PAN_DOLLY: 4
  5354. }
  5355. }
  5356. , {}],
  5357. 21: [function(e, t, i) {
  5358. "use strict";
  5359. t.exports = {
  5360. Move: "move",
  5361. InteractionDirect: "interaction.direct",
  5362. InteractionKey: "interaction.key",
  5363. InteractionGui: "interaction.gui",
  5364. FlyInDirection: "fly.direction",
  5365. InputStart: "input.start",
  5366. Pinch: "input.pinch",
  5367. Scroll: "input.scroll",
  5368. AutoPanInterrupt: "autopan.interrupt",
  5369. AutoPanComplete: "autopan.complete",
  5370. AutoPanClamped: "autopan.clamped",
  5371. LongTap: "longtap"
  5372. }
  5373. }
  5374. , {}],
  5375. 22: [function(e, t, i) {
  5376. "use strict";
  5377. t.exports = Object.freeze({
  5378. FORWARD: "FORWARD",
  5379. LEFT: "LEFT",
  5380. RIGHT: "RIGHT",
  5381. BACK: "BACK",
  5382. UP: "UP",
  5383. DOWN: "DOWN"
  5384. })
  5385. }
  5386. , {}],
  5387. 23: [function(e, t, i) {
  5388. "use strict";
  5389. t.exports = {
  5390. ActionInterrupted: "action.interrupted",
  5391. TourStart: "tour.start",
  5392. TourEnd: "tour.end",
  5393. StartModeChange: "mode.startChange"
  5394. }
  5395. }
  5396. , {}],
  5397. 24: [function(e, t, i) {
  5398. "use strict";
  5399. t.exports = Object.freeze({
  5400. None: 0,
  5401. Queued: 1,
  5402. ForceQueued: 2,
  5403. Downloading: 3,
  5404. Downloaded: 4,
  5405. DownloadFailed: 5
  5406. })
  5407. }
  5408. , {}],
  5409. 25: [function(e, t, i) {
  5410. "use strict";
  5411. t.exports = {
  5412. GL_TEXTURE_CUBE_MAP_POSITIVE_X: 0,
  5413. GL_TEXTURE_CUBE_MAP_NEGATIVE_X: 1,
  5414. GL_TEXTURE_CUBE_MAP_POSITIVE_Y: 2,
  5415. GL_TEXTURE_CUBE_MAP_NEGATIVE_Y: 3,
  5416. GL_TEXTURE_CUBE_MAP_POSITIVE_Z: 4,
  5417. GL_TEXTURE_CUBE_MAP_NEGATIVE_Z: 5
  5418. }
  5419. }
  5420. , {}],
  5421. 26: [function(e, t, i) {
  5422. "use strict";
  5423. t.exports = {
  5424. Texture2D: 0,
  5425. TextureCube: 1
  5426. }
  5427. }
  5428. , {}],
  5429. 27: [function(e, t, i) {
  5430. "use strict";
  5431. t.exports = {
  5432. SMALL: "small",
  5433. LARGE: "large"
  5434. }
  5435. }
  5436. , {}],
  5437. 28: [function(e, t, i) {
  5438. "use strict";
  5439. var n = e("./Viewmode")
  5440. , r = {
  5441. LANDING: {},
  5442. NAVIGATION: "navigation",
  5443. MORE_HELP: "moreHelp",
  5444. TOUR_INTERACTION: {}
  5445. };
  5446. r.LANDING[n.PANORAMA] = "panorama.landing",
  5447. r.LANDING[n.OUTDOOR] = "outdoor.landing",
  5448. r.LANDING[n.DOLLHOUSE] = "dollhouse.landing",
  5449. r.LANDING[n.FLOORPLAN] = "floorplan.landing",
  5450. r.TOUR_INTERACTION.standard = "standard.tour",
  5451. r.TOUR_INTERACTION[n.OUTDOOR] = "outdoor.tour",
  5452. r.TOUR_INTERACTION[n.FLOORPLAN] = "floorplan.tour",
  5453. t.exports = r
  5454. }
  5455. , {
  5456. "./Viewmode": 51
  5457. }],
  5458. 29: [function(e, t, i) {
  5459. "use strict";
  5460. var n = {
  5461. UP: 1,
  5462. DOWN: -1,
  5463. LEFT: "L",
  5464. RIGHT: "R",
  5465. FORWARD: "F",
  5466. BACK: "B",
  5467. reverse: {},
  5468. opposite: function(e) {
  5469. return this.reverse[e.toString()]
  5470. }
  5471. };
  5472. !function() {
  5473. n.reverse[n.UP] = n.DOWN,
  5474. n.reverse[n.DOWN] = n.UP,
  5475. n.reverse[n.LEFT] = n.RIGHT,
  5476. n.reverse[n.RIGHT] = n.LEFT,
  5477. n.reverse[n.FORWARD] = n.BACK,
  5478. n.reverse[n.BACK] = n.FORWARD
  5479. }(),
  5480. t.exports = n
  5481. }
  5482. , {}],
  5483. 30: [function(e, t, i) {
  5484. "use strict";
  5485. var n = e("../util/browser")
  5486. , r = {
  5487. ZERO: 48,
  5488. ONE: 49,
  5489. TWO: 50,
  5490. THREE: 51,
  5491. FOUR: 52,
  5492. FIVE: 53,
  5493. SIX: 54,
  5494. SEVEN: 55,
  5495. EIGHT: 56,
  5496. NINE: 57,
  5497. LEFTARROW: 37,
  5498. UPARROW: 38,
  5499. RIGHTARROW: 39,
  5500. DOWNARROW: 40,
  5501. A: 65,
  5502. B: 66,
  5503. C: 67,
  5504. D: 68,
  5505. E: 69,
  5506. F: 70,
  5507. G: 71,
  5508. H: 72,
  5509. I: 73,
  5510. J: 74,
  5511. K: 75,
  5512. L: 76,
  5513. M: 77,
  5514. N: 78,
  5515. O: 79,
  5516. P: 80,
  5517. Q: 81,
  5518. R: 82,
  5519. S: 83,
  5520. T: 84,
  5521. U: 85,
  5522. V: 86,
  5523. W: 87,
  5524. X: 88,
  5525. Y: 89,
  5526. Z: 90,
  5527. SPACE: 32,
  5528. RETURN: 13,
  5529. SEMICOLON: 186,
  5530. PLUSEQUALS: 187,
  5531. DASHUNDERSCORE: 189,
  5532. OPENBRACKET: 219
  5533. };
  5534. n.detectFirefox() && (r.SEMICOLON = 59,
  5535. r.PLUSEQUALS = 61,
  5536. r.DASHUNDERSCORE = 173),
  5537. t.exports = r
  5538. }
  5539. , {
  5540. "../util/browser": 182
  5541. }],
  5542. 31: [function(e, t, i) {
  5543. "use strict";
  5544. t.exports = {
  5545. EN_US: "en-US",
  5546. ES_MX: "es-MX",
  5547. FR_FR: "fr-FR",
  5548. DE_DE: "de-DE",
  5549. RU_RU: "ru-RU",
  5550. CN_CN: "cn-CN",
  5551. JP_JP: "jp-JP"
  5552. }
  5553. }
  5554. , {}],
  5555. 32: [function(e, t, i) {
  5556. "use strict";
  5557. t.exports = {
  5558. TagActivated: "tag.activated",
  5559. TagDismissed: "tag.dismissed",
  5560. TagNavigation: "tag.navigation"
  5561. }
  5562. }
  5563. , {}],
  5564. 33: [function(e, t, i) {
  5565. "use strict";
  5566. t.exports = {
  5567. ModelAdded: "model-added",
  5568. ActiveModelChanged: "active-model-changed"
  5569. }
  5570. }
  5571. , {}],
  5572. 34: [function(e, t, i) {
  5573. "use strict";
  5574. t.exports = {
  5575. LEFT: 0,
  5576. MIDDLE: 1,
  5577. RIGHT: 2
  5578. }
  5579. }
  5580. , {}],
  5581. 35: [function(e, t, i) {
  5582. "use strict";
  5583. t.exports = {
  5584. PanoRenderComplete: "panorama.render.complete",
  5585. TileRenderFailure: "panorama.tile.render.failed",
  5586. TileRenderSuccess: "panorama.tile.render.success",
  5587. TileUploadAttempted: "panorama.tile.upload.attempted",
  5588. UploadAttemptedForAllTiles: "panorama.upload.attempted.all.tiles",
  5589. ZoomLevelRenderStarted: "panorama.zoom.render.started"
  5590. }
  5591. }
  5592. , {}],
  5593. 36: [function(e, t, i) {
  5594. "use strict";
  5595. t.exports = {
  5596. BASE: 1,
  5597. STANDARD: 2,
  5598. HIGH: 3,
  5599. ULTRAHIGH: 4
  5600. }
  5601. }
  5602. , {}],
  5603. 37: [function(e, t, i) {
  5604. "use strict";
  5605. t.exports = {
  5606. LoadComplete: "panorama.load.complete",
  5607. LoadFailed: "panorama.load.failed",
  5608. TileLoaded: "panorama.tile.loaded"
  5609. }
  5610. }
  5611. , {}],
  5612. 38: [function(e, t, i) {
  5613. "use strict";
  5614. t.exports = Object.freeze({
  5615. Standard: 0,
  5616. Slow: 1,
  5617. Retain: 2
  5618. })
  5619. }
  5620. , {}],
  5621. 39: [function(e, t, i) {
  5622. "use strict";
  5623. t.exports = Object.freeze({
  5624. Show: 0,
  5625. Hide: 1,
  5626. Retain: 2
  5627. })
  5628. }
  5629. , {}],
  5630. 40: [function(e, t, i) {
  5631. "use strict";
  5632. t.exports = {
  5633. Move: "move",
  5634. MoveComplete: "move.complete",
  5635. ModeChanged: "mode.changed",
  5636. ModeChanging: "mode.changing",
  5637. PanoChosen: "pano.chosen",
  5638. ClosestPanoChanging: "closest.pano.changing",
  5639. WarpStarted: "warp.started",
  5640. WarpInterrupted: "warp.interrupted",
  5641. WarpEnded: "warp.ended",
  5642. FlyinFinished: "flyin.finished",
  5643. FlyingStarted: "flying.started",
  5644. FlyingInterrupted: "flying.interrupted",
  5645. FlyingEnded: "flying.ended",
  5646. Ready: "ready",
  5647. StartInside: "start.inside",
  5648. StartOutside: "start.outside",
  5649. ViewChanged: "view.changed",
  5650. WarpInterruptedWithFlyTo: "warp.interrupted.flyto",
  5651. InputStart: "input.start"
  5652. }
  5653. }
  5654. , {}],
  5655. 41: [function(e, t, i) {
  5656. "use strict";
  5657. t.exports = Object.freeze({
  5658. DEFAULT: 0,
  5659. PANOMARKERS: 1,
  5660. RETICULE: 2,
  5661. TAG: 3
  5662. })
  5663. }
  5664. , {}],
  5665. 42: [function(e, t, i) {
  5666. "use strict";
  5667. t.exports = {
  5668. visibleFloor: 1,
  5669. ghostFloor: 3,
  5670. boundingSkybox: 1,
  5671. panoMarker: 2,
  5672. reticule: 3,
  5673. tagStem: 4,
  5674. tagDisc: 5,
  5675. ribbon: 100
  5676. }
  5677. }
  5678. , {}],
  5679. 43: [function(e, t, i) {
  5680. "use strict";
  5681. t.exports = {
  5682. ContextCreated: "scene-renderer-context-created",
  5683. AfterRender: "after-render",
  5684. MemoryUsageUpdated: "scene-renderer-memory-usage-updated"
  5685. }
  5686. }
  5687. , {}],
  5688. 44: [function(e, t, i) {
  5689. "use strict";
  5690. t.exports = {
  5691. IDLE: "idle",
  5692. BROWSE: "browse",
  5693. EXAMINE: "examine"
  5694. }
  5695. }
  5696. , {}],
  5697. 45: [function(e, t, i) {
  5698. "use strict";
  5699. t.exports = {
  5700. TileDownloadSuccess: "tiledownloader.download.success",
  5701. TileDownloadFailure: "tiledownloader.download.failure",
  5702. PanoDownloadComplete: "tiledownloader.pano.download.complete"
  5703. }
  5704. }
  5705. , {}],
  5706. 46: [function(e, t, i) {
  5707. "use strict";
  5708. t.exports = {
  5709. CardboardAndroid: "googlevr",
  5710. GearVR: "gearvr",
  5711. CardboardIOS: "googlevrios",
  5712. Cardboard: "googlevr"
  5713. }
  5714. }
  5715. , {}],
  5716. 47: [function(e, t, i) {
  5717. "use strict";
  5718. t.exports = {
  5719. NONE: 0,
  5720. CONTEXTUAL: 1,
  5721. ANDROID: 2
  5722. }
  5723. }
  5724. , {}],
  5725. 48: [function(e, t, i) {
  5726. "use strict";
  5727. var n = {
  5728. Title: 0,
  5729. Cardboard: 1
  5730. }
  5731. , r = {
  5732. Title: 0,
  5733. Cardboard: 1,
  5734. Gear: 2
  5735. };
  5736. !function() {
  5737. [n, r].forEach(function(e) {
  5738. e.pageCount = Object.keys(e).length
  5739. })
  5740. }(),
  5741. t.exports.ios = n,
  5742. t.exports.standard = r
  5743. }
  5744. , {}],
  5745. 49: [function(e, t, i) {
  5746. "use strict";
  5747. t.exports = {
  5748. Android: "android",
  5749. IOS: "ios",
  5750. Desktop: "desktop",
  5751. UnsupportedAndroid: "android-unsupported"
  5752. }
  5753. }
  5754. , {}],
  5755. 50: [function(e, t, i) {
  5756. "use strict";
  5757. var n = e("three");
  5758. t.exports = {
  5759. UP: new n.Vector3(0,1,0),
  5760. DOWN: new n.Vector3(0,-1,0),
  5761. LEFT: new n.Vector3(-1,0,0),
  5762. RIGHT: new n.Vector3(1,0,0),
  5763. FORWARD: new n.Vector3(0,0,-1),
  5764. BACK: new n.Vector3(0,0,1)
  5765. }
  5766. }
  5767. , {
  5768. three: 217
  5769. }],
  5770. 51: [function(e, t, i) {
  5771. "use strict";
  5772. var n = e("../exception/ViewmodeConvertException")
  5773. , r = e("./coreViewmodes")
  5774. , o = e("../util/common")
  5775. , a = {
  5776. MESH: "mesh",
  5777. OUTDOOR: "outdoor",
  5778. TRANSITIONING: "transitioning",
  5779. toInt: function(e) {
  5780. switch (e) {
  5781. case this.PANORAMA:
  5782. return 1;
  5783. case this.DOLLHOUSE:
  5784. return 2;
  5785. case this.FLOORPLAN:
  5786. return 3;
  5787. case this.OUTDOOR:
  5788. return 4;
  5789. case this.TRANSITIONING:
  5790. return -1
  5791. }
  5792. throw new n("No known conversion for Viewmode to int for mode: " + e)
  5793. },
  5794. fromInt: function(e) {
  5795. switch (e) {
  5796. case "1":
  5797. case 1:
  5798. return this.PANORAMA;
  5799. case "2":
  5800. case 2:
  5801. return this.DOLLHOUSE;
  5802. case "3":
  5803. case 3:
  5804. return this.FLOORPLAN;
  5805. case "4":
  5806. case 4:
  5807. return this.OUTDOOR
  5808. }
  5809. throw new n("No known conversion for int to viewmode for int: " + e)
  5810. },
  5811. convertWorkshopModeInt: function(e) {
  5812. switch (e) {
  5813. case "0":
  5814. case 0:
  5815. case undefined: //xzw add
  5816. return this.PANORAMA;
  5817. case "1":
  5818. case 1:
  5819. return this.FLOORPLAN;
  5820. case "2":
  5821. case 2:
  5822. return this.DOLLHOUSE;
  5823. case "3":
  5824. case 3:
  5825. return this.MESH
  5826. }
  5827. throw new n("No known conversion for Workshop int to viewmode for int: " + e)
  5828. }
  5829. };
  5830. o.extendObject(a, r),
  5831. t.exports = a
  5832. }
  5833. , {
  5834. "../exception/ViewmodeConvertException": 58,
  5835. "../util/common": 185,
  5836. "./coreViewmodes": 54
  5837. }],
  5838. 52: [function(e, t, i) {
  5839. "use strict";
  5840. t.exports = {
  5841. BLACK: "black",
  5842. STD: "std",
  5843. WALK: "walk"
  5844. }
  5845. }
  5846. , {}],
  5847. 53: [function(e, t, i) {
  5848. "use strict";
  5849. t.exports = {
  5850. ZoomIn: "zoom.in",
  5851. ZoomOut: "zoom.out",
  5852. ZoomMax: "zoom.max",
  5853. ZoomMin: "zoom.min"
  5854. }
  5855. }
  5856. , {}],
  5857. 54: [function(e, t, i) {
  5858. "use strict";
  5859. t.exports = {
  5860. PANORAMA: "panorama",
  5861. DOLLHOUSE: "dollhouse",
  5862. FLOORPLAN: "floorplan"
  5863. }
  5864. }
  5865. , {}],
  5866. 55: [function(e, t, i) {
  5867. "use strict";
  5868. function n(e) {
  5869. this.message = e
  5870. }
  5871. t.exports = n
  5872. }
  5873. , {}],
  5874. 56: [function(e, t, i) {
  5875. "use strict";
  5876. function n(e) {
  5877. r.call(this, e)
  5878. }
  5879. var r = e("./BasicException");
  5880. n.prototype = Object.create(r.prototype),
  5881. t.exports = n
  5882. }
  5883. , {
  5884. "./BasicException": 55
  5885. }],
  5886. 57: [function(e, t, i) {
  5887. "use strict";
  5888. function n(e) {
  5889. r.call(this, e)
  5890. }
  5891. var r = e("./BasicException");
  5892. n.prototype = Object.create(r.prototype),
  5893. t.exports = n
  5894. }
  5895. , {
  5896. "./BasicException": 55
  5897. }],
  5898. 58: [function(e, t, i) {
  5899. "use strict";
  5900. function n(e) {
  5901. r.call(this, e)
  5902. }
  5903. var r = e("./BasicException");
  5904. n.prototype = Object.create(r.prototype),
  5905. t.exports = n
  5906. }
  5907. , {
  5908. "./BasicException": 55
  5909. }],
  5910. 59: [function(e, t, i) {
  5911. (function(i) {
  5912. "use strict";
  5913. function n(e) {
  5914. var t = {};
  5915. if (e) {
  5916. var i = e.flags;
  5917. if (i)
  5918. for (var n in i)
  5919. i.hasOwnProperty(n) && (t[i[n]] = !0);
  5920. return t
  5921. }
  5922. return l.debug("Feature flags -> parseFeatureFlags: rawData is null."),
  5923. null
  5924. }
  5925. var r = e("./util/ajax")
  5926. , o = e("./util/showcase")
  5927. , a = e("./util/logger")
  5928. , s = ""
  5929. , l = new a(i)
  5930. , c = {};
  5931. t.exports = {
  5932. loadFeatureFlags: function(e) {
  5933. var t = $.Deferred();
  5934. return r.get(e.urlBase + s, {
  5935. responseType: "json",
  5936. prefetchFrom: "user",
  5937. auth: o.getAuthorizationHeader()
  5938. }).done(function(e) {
  5939. c = n(e),
  5940. c ? t.resolve(c) : t.reject("loading-failed")
  5941. }).fail(function() {
  5942. l.debug("Retrieval of feature flags failed."),
  5943. t.reject("loading-failed")
  5944. }),
  5945. t.promise()
  5946. },
  5947. getFlags: function() {
  5948. return c
  5949. },
  5950. updateDependentSettings: function(e, t) {
  5951. e = e || c,
  5952. e.labels && (t.labels.enabled = !0),
  5953. e.zooming && !t.zoom.forceOff && (t.zoom.enabled = !0),
  5954. e.showcase_sdk && (t.sdkInit = !0),
  5955. e.mobile_highq_override && (t.tiling.mobileHighQualityOverride = !0),
  5956. e.showcase_webvr && (t.vr.allowWebVR = !0),
  5957. e.uhql && (t.tiling.allowUltraHighResolution = !0),
  5958. e.hide_sc_sharing && (t.share.enabled = !1)
  5959. }
  5960. }
  5961. }
  5962. ).call(this, "/js/featureflags.js")
  5963. }
  5964. , {
  5965. "./util/ajax": 181,
  5966. "./util/logger": 189,
  5967. "./util/showcase": 193
  5968. }],
  5969. 60: [function(e, t, i) {
  5970. "use strict";
  5971. var n = (e("../util/common"),
  5972. {
  5973. status: 0,
  5974. set: function(e) {
  5975. if (isNaN(e))
  5976. return !1;
  5977. var t = $('.progressbar');
  5978. 0 > e && (e = 0);
  5979. e > 100 && (e = 100);
  5980. var width = parseInt(t.css('width').replace("px",""))/100; //获取进度条总长度除以100
  5981. var barperc = e*width;
  5982. var perc = Math.round(e);
  5983. var labelpos = (parseInt(barperc)-15);
  5984. t.find('.bar').css('width',barperc); //已经再跑颜色的百分比
  5985. t.find('.label').css('left', labelpos); //上面跟着的字的百分比
  5986. t.find('.perc').text(perc+'%'); //具体数字的百分比
  5987. this.status = e
  5988. },
  5989. done: function(e) {
  5990. return e || this.status ? (this.status = null,
  5991. this.set(100)) : this
  5992. }
  5993. });
  5994. t.exports.circleLoader = n
  5995. }
  5996. , {
  5997. "../util/common": 185
  5998. }],
  5999. 61: [function(e, t, i) {
  6000. "use strict";
  6001. t.exports = Object.freeze({
  6002. CLOSE: "modal.closer.close"
  6003. })
  6004. }
  6005. , {}],
  6006. 62: [function(e, t, i) {
  6007. "use strict";
  6008. function n(e, t) {
  6009. t && (t.stopPropagation(),
  6010. t.preventDefault()),
  6011. e && this.emit(l.CLOSE, e),
  6012. g.reset()
  6013. }
  6014. function r(e, t) {
  6015. function i() {
  6016. var t = e.offsetHeight >= $("#player").height() && e.offsetWidth >= $("#player").width();
  6017. t !== f && (f = t,
  6018. t ? (e.classList.add("closeByFooter"),
  6019. h.classList.add("closeByFooter")) : (e.classList.remove("closeByFooter"),
  6020. h.classList.remove("closeByFooter")))
  6021. }
  6022. t ? setTimeout(i, o.guiAnimationSpeed) : i()
  6023. }
  6024. var o = e("../../settings")
  6025. , a = (e("../../tag/Media/MediaEvent"),
  6026. e("../../util/browser"))
  6027. , s = e("../../util/common")
  6028. , l = e("./ModalCloserEvent")
  6029. , c = e("events").EventEmitter
  6030. , h = document.getElementsByClassName("footer")[0]
  6031. , u = h.querySelectorAll(".close")[0]
  6032. , d = null
  6033. , p = null
  6034. , f = null
  6035. , g = (a.isMobile(),
  6036. {
  6037. open: function(e) {
  6038. e && (r(e),
  6039. d && u.removeEventListener("click", d, !0),
  6040. d = n.bind(this, e.id),
  6041. u.addEventListener("click", d, !0),
  6042. p && window.removeEventListener("resize", p, !0),
  6043. p = r.bind(this, e),
  6044. window.addEventListener("resize", p, !0))
  6045. },
  6046. reset: function() {
  6047. h.classList.remove("closeByFooter"),
  6048. u.removeEventListener("click", d, !0),
  6049. window.removeEventListener("resize", p, !0),
  6050. d = p = f = null
  6051. }
  6052. });
  6053. s.extendObject(g, c.prototype),
  6054. t.exports = g
  6055. }
  6056. , {
  6057. "../../tag/Media/MediaEvent": 131,
  6058. "../../settings": 166,
  6059. "../../util/browser": 182,
  6060. "../../util/common": 185,
  6061. "./ModalCloserEvent": 61,
  6062. events: 202
  6063. }],
  6064. 63: [function(e, t, i) {
  6065. "use strict";
  6066. function n(e, t, i) {
  6067. var n = new r.GUI({
  6068. width: 400
  6069. })
  6070. , u = n.addFolder("Flydown from Dollhouse");
  6071. u.add(h.flydown, "movementEasing", Object.keys(a)),
  6072. u.add(h.flydown, "movementDelay", 0, 1).step(.01),
  6073. u.add(h.flydown, "rotationEasing", Object.keys(a)),
  6074. u.add(h.flydown, "rotationDelay", 0, 1).step(.01),
  6075. u.add(h.flydown, "modelTextureDelay", 0, 1).step(.01),
  6076. u.add(h.flydown, "skyboxDelay", 0, 1).step(.01),
  6077. u.add(h.dollhouseDefault, "minPolarAngle", 0, o.Math.degToRad(50)),
  6078. u.add(h.dollhouseDefault, "maxPolarAngle", o.Math.degToRad(50), o.Math.degToRad(170));
  6079. var d = n.addFolder("Transition between panos");
  6080. d.add(h.transition, "blur", 0, 10).onFinishChange(function() {}),
  6081. d.add(h.transition, "flySpeed", 0, 10).step(.01).onFinishChange(function() {
  6082. h.transition.flyTime = 0,
  6083. d.__controllers.forEach(function(e) {
  6084. e.updateDisplay()
  6085. })
  6086. }),
  6087. d.add(h.transition, "flyTime", 0, 5e3).onFinishChange(function() {
  6088. h.transition.flySpeed = 0,
  6089. d.__controllers.forEach(function(e) {
  6090. e.updateDisplay()
  6091. })
  6092. }),
  6093. d.add(h.transition, "aimTime", 500, 2500).step(50),
  6094. d.add(h.transition, "aimSlowFactor", 1, 3).step(.1),
  6095. d.add(h.transition, "movementEasing", Object.keys(a));
  6096. var p = n.addFolder("Path Display");
  6097. p.add(h.path, "opacity", 0, 1).step(.01).onFinishChange(function() {}),
  6098. p.add(h.path, "height", 0, .2).step(.01).onFinishChange(function() {}),
  6099. p.add(h.path, "outsideHeight", 0, 2).step(.01).onFinishChange(function() {}),
  6100. p.add(h.path, "ribbonWidth", .01, .35).step(.01).onFinishChange(function() {}),
  6101. p.add(h.path, "waypointRadius", .01, 1.2).step(.01).onFinishChange(function() {}),
  6102. p.add(h.path, "waypointPulse", 0, 3600).step(20).onFinishChange(function() {}),
  6103. p.add(h.path, "waypointIndoorRadius", .01, 1.2).step(.01).onFinishChange(function() {}),
  6104. p.add(h.path, "fadeInTime", 0, 1200).step(10).onFinishChange(function() {}),
  6105. p.add(h.path, "fadeOutTime", 0, 1200).step(10).onFinishChange(function() {}),
  6106. p.add(h.path, "color", Object.keys(l)).onFinishChange(function() {
  6107. h.path.color = l[h.path.color],
  6108. h.path.colorUp = l._desat(h.path.color),
  6109. h.path.colorDown = l.darken(h.path.color)
  6110. }),
  6111. p.add(h, "reticuleColor", Object.keys(l)).onFinishChange(function() {
  6112. h.reticuleColor = l[h.reticuleColor]
  6113. });
  6114. var f = n.addFolder("Warping")
  6115. , g = f.addFolder("Warp/Teleport");
  6116. g.add(h.warp, "softPushDist", 0, 2).onFinishChange(function() {}),
  6117. g.add(h.warp, "softPushEnd", 0, 1).step(.01).onFinishChange(function() {}),
  6118. g.add(h.warp, "softBendAngle", 0, 45).onFinishChange(function() {}),
  6119. g.add(h.warp, "softBendTilt", 0, 45).onFinishChange(function() {}),
  6120. g.add(h.warp, "softBendEnd", 0, 1).step(.01).onFinishChange(function() {}),
  6121. g.add(h.warp, "burnsAngle", 0, 30).onFinishChange(function() {}),
  6122. g.add(h.warp, "minBurnsAngle", 0, 10).onFinishChange(function() {}),
  6123. g.add(h.warp, "brakeStrength", 1, 8).onFinishChange(function() {}),
  6124. g.add(h.warp, "minBrakeAngle", 0, 5).step(.01).onFinishChange(function() {}),
  6125. g.add(h.warp, "maxBrakeAngle", 0, 5).step(.01).onFinishChange(function() {}),
  6126. g.add(h.path, "mapGuides").onFinishChange(function() {}),
  6127. g.add(h.warp, "teleportTime", 0, 5e3).step(10).onFinishChange(function() {}),
  6128. g.add(h.warp, "outsideTime", 0, 5e3).step(10).onFinishChange(function() {}),
  6129. g.add(h.path, "typ", Object.keys(c)).onFinishChange(function() {
  6130. h.path.typ = c[h.path.typ]
  6131. }),
  6132. g.add(h.warp, "loop").onChange(function() {}).onFinishChange(function() {
  6133. t.endlessLoop = h.warp.loop
  6134. }),
  6135. g.add(h.warp, "walkSlideShowThreshhold", 1, 1e4).step(1).onFinishChange(function() {}),
  6136. g.add(h.warp, "walkExtraPanosDistance", 0, 3).step(.1).onFinishChange(function() {}),
  6137. g.add(h.transition, "fastForwardFactor", 1, 10).step(1).onFinishChange(function() {});
  6138. var m = f.addFolder("Long Warp Only");
  6139. m.add(h.warp, "minWarpTime", 0, 5e3).step(10).onFinishChange(function() {
  6140. h.warp.flySpeed = 0,
  6141. m.__controllers.forEach(function(e) {
  6142. e.updateDisplay()
  6143. })
  6144. }),
  6145. m.add(h.warp, "timePerMeter", 0, 5e3).step(10).onFinishChange(function() {}),
  6146. m.add(h.warp, "lookAheadMax", .01, 1).step(.01).onFinishChange(function() {}),
  6147. m.add(h.warp, "lookAheadDist", .01, 4).step(.01).onFinishChange(function() {}),
  6148. m.add(h.warp, "maxTurnPerSec", 0, 720).step(1).onFinishChange(function() {}),
  6149. m.add(h.warp, "maxAimPerSec", 0, 720).step(1).onFinishChange(function() {}),
  6150. m.add(h.warp, "turnFriction", 0, 1).step(.01).onFinishChange(function() {}),
  6151. m.add(h.warp, "walkDelay", 0, 2e3).step(10).onFinishChange(function() {}),
  6152. m.add(h.transition, "flytimeMaxDistanceThreshold", 0, 25).step(10).onFinishChange(function() {}),
  6153. m.add(h.warp, "walkMaxDist", 0, 100).step(1).onFinishChange(function() {});
  6154. var v = n.addFolder("Warp Esoterica");
  6155. v.add(h.warp, "nearPanoDist", .01, 12).step(0).onFinishChange(function() {}),
  6156. v.add(h.warp, "blur", .01, 1).onFinishChange(function() {}),
  6157. v.add(h.warp, "flySpeed", 0, 10).step(.01).onFinishChange(function() {
  6158. h.warp.minWarpTime = 0,
  6159. v.__controllers.forEach(function(e) {
  6160. e.updateDisplay()
  6161. })
  6162. }),
  6163. v.add(h.warp, "showBunny").onFinishChange(function() {}),
  6164. v.add(h.warp, "fastTime", 0, 2500).step(10).onFinishChange(function() {}),
  6165. v.add(h.warp, "movementEasing", Object.keys(a));
  6166. var A = n.addFolder("Misc");
  6167. A.add(h, "dollhouseFOV", 10, 180).onChange(function() {
  6168. i.cameras[s.DOLLHOUSE].fov = h.dollhouseFOV
  6169. }),
  6170. A.add(h, "insideFOV", 10, 180).onChange(function() {
  6171. i.cameras[s.PANORAMA].fov = h.insideFOV
  6172. }),
  6173. A.add(h, "insideLookSpeed", .01, .3).step(.01).onChange(function() {}),
  6174. A.add(h, "rotationAccelerationInside", .1, 10).step(.1).onChange(function() {}),
  6175. A.add(h, "rotationAccelerationOutside", .1, 10).step(.1).onChange(function() {});
  6176. var y = n.addFolder("Navigation");
  6177. y.add(h.navigation, "panoScores").onFinishChange(function() {
  6178. h.navigation.panoScores || e.panos.forEach(function(e) {
  6179. e.floor.remove(e.text3d),
  6180. e.text3d = null
  6181. })
  6182. }),
  6183. y.add(h.navigation, "mouseDirection"),
  6184. y.add(h.navigation, "filterStrictness", 0, 1),
  6185. y.add(h.navigation, "angleFactor", -60, 0),
  6186. y.add(h.navigation, "directionFactor", 1, 20),
  6187. y.add(h.navigation, "distanceFactor", -5, 5),
  6188. y.add(h.navigation, "optionalityFactor", .1, 10);
  6189. var C = n.addFolder("tags")
  6190. , I = C.addFolder("Tag Creation");
  6191. I.add(h.tags.pole, "enabled").name("poleEnabled"),
  6192. I.add(h.tags.pole, "height", 0, 2.5).step(.01).name("poleHeight"),
  6193. I.add(h.tags.pole, "width", 1, 10).step(1).name("poleWidth"),
  6194. I.add(h.tags.pole, "opacity", .1, 1).step(.1).name("poleOpacity");
  6195. var E = C.addFolder("Visibility");
  6196. E.add(h.tags.visibility, "anyDistance"),
  6197. E.add(h.tags.visibility, "visibleDistance", .1, 30).step(.1),
  6198. E.add(h.tags.visibility, "cameraClearance", 0, 1).step(.01),
  6199. E.add(h.tags.visibility, "hideViaFloor"),
  6200. E.add(h.tags.visibility, "hideOffScreenDisc").name("hideEdgeDisc"),
  6201. E.add(h.tags.visibility, "hideOffScreenObject").name("hideEdgeObject");
  6202. var b = C.addFolder("Disc Parameters");
  6203. b.add(h.tags.disc.scale, "nearBound", .1, 10).step(.1),
  6204. b.add(h.tags.disc.scale, "farBound", .1, 20).step(.1).listen(),
  6205. b.add(h.tags.disc.scale, "linkFarBound").onChange(function(e) {
  6206. e && (h.tags.disc.scale.farBound = h.tags.visibility.visibleDistance * (1 - h.tags.disc.scale.linkPercent / 100))
  6207. }),
  6208. b.add(h.tags.disc.scale, "linkPercent", 0, 100).step(1).onChange(function(e) {
  6209. h.tags.disc.scale.linkFarBound && (h.tags.disc.scale.farBound = h.tags.visibility.visibleDistance * (1 - e / 100))
  6210. }),
  6211. b.add(h.tags.disc.scale, "maxSize", 40, 200).step(1),
  6212. b.add(h.tags.disc.scale, "minSize", 20, 100).step(1),
  6213. b.add(h.tags.disc.scale, "responsiveness", 0, 100).step(1);
  6214. var w = C.addFolder("Navigate");
  6215. w.add(h.tags.navigate, "nearestPano").name("nearestPano"),
  6216. w.add(h.tags.navigate, "lineOfSight").name("lineOfSight"),
  6217. w.add(h.tags.navigate, "reactivate").name("reactivate"),
  6218. w.add(h.tags.navigate, "aimAt", ["disc", "object", "pole", "nothing"]).name("aim at"),
  6219. w.add(h.tags.navigate, "tiltTolerance", 0, 50).step(1),
  6220. w.add(h.tags.navigate, "rotateSpeedFactor", 0, 5).step(.1);
  6221. var _ = n.addFolder("Debug");
  6222. _.add(h, "wireframe").onFinishChange(function() {
  6223. e.chunks.forEach(function(t) {
  6224. t.material && (t.wireframeTwin || (t.wireframeTwin = new o.WireframeHelper(t),
  6225. t.wireframeTwin.material.depthWrite = !1,
  6226. t.wireframeTwin.material.depthTest = !1,
  6227. t.wireframeTwin.material.opacity = .5,
  6228. t.wireframeTwin.material.transparent = !0),
  6229. h.wireframe ? e.add(t.wireframeTwin) : e.remove(t.wireframeTwin))
  6230. })
  6231. }),
  6232. _.add(h, "skyboxWireframe").onFinishChange(function() {
  6233. h.skyboxWireframe ? (e.skybox.wireframe = new o.WireframeHelper(e.skybox),
  6234. e.add(e.skybox.wireframe)) : (e.remove(e.skybox.wireframe),
  6235. e.skybox.wireframe = null)
  6236. }),
  6237. _.add(h, "showSweeps").onFinishChange(function() {
  6238. e.setSweepVisibility(h.showSweeps)
  6239. }),
  6240. _.add(h, "showMesh").onFinishChange(function() {
  6241. e.chunks.forEach(function(e) {
  6242. e.visible = h.showMesh
  6243. })
  6244. }),
  6245. _.add(h, "showFloors").onFinishChange(function() {
  6246. e.floors.forEach(function(e) {
  6247. e.collider.children.forEach(function(e) {
  6248. e.material.visible = h.showFloors
  6249. })
  6250. })
  6251. }),
  6252. _.add(h, "showSkyboxes").onFinishChange(function() {
  6253. e.panos.forEach(function(e) {
  6254. e.skyboxMesh.visible = h.showSkyboxes
  6255. })
  6256. }),
  6257. _.add(h, "showNeighbors").onChange(function() {}),
  6258. _.add(e, "alpha", 0, 1)
  6259. }
  6260. var r = e("../lib/dat.gui")
  6261. , o = e("three")
  6262. , a = e("../util/easing")
  6263. , s = e("../enum/Viewmode")
  6264. , l = e("../enum/Colors")
  6265. , c = e("../enum/WarpStyle")
  6266. , h = e("../settings");
  6267. e("../tag/tag");
  6268. r.GUI.prototype.removeFolder = function(e) {
  6269. var t = this.__folders[e];
  6270. t && (t.close(),
  6271. this.__ul.removeChild(t.domElement.parentNode),
  6272. delete this.__folders[e],
  6273. this.onResize())
  6274. }
  6275. ,
  6276. t.exports.toggle = n
  6277. }
  6278. , {
  6279. "../enum/Colors": 19,
  6280. "../enum/Viewmode": 51,
  6281. "../enum/WarpStyle": 52,
  6282. "../lib/dat.gui": 93,
  6283. "../tag/tag": 123,
  6284. "../settings": 166,
  6285. "../util/easing": 186,
  6286. three: 217
  6287. }],
  6288. 64: [function(e, t, i) {
  6289. (function(i) {
  6290. "use strict";
  6291. function n(e, t, i, n) {
  6292. $(".gui-error .error-problem-text").text(e),
  6293. $(".gui-error .error-solution-text").text(t),
  6294. $(".gui-error .error-explanation").text(i),
  6295. $(".gui-error .error-actions").html(n),
  6296. $(window).resize(),
  6297. $(".gui-error").fadeIn(),
  6298. $("#bottom-logo").fadeIn()
  6299. }
  6300. function r(e) {
  6301. var t = ['<div class="browser-tiles">', '<div class="tile">', '<a href="https://www.google.com/chrome/browser/" target="_blank">', '<img class="icon" src="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="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="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="images/icon_MacOSX_Safari.png" ', 'rel="tiletip" title="Safari"></a>', "</div>", "</div>"].join("");
  6302. n(e, h.ERROR_BROWSER_SOLUTION, h.ERROR_BROWSER_EXPLANATION, t),
  6303. s.isMobile() || $("[rel=tiletip]").tooltip({
  6304. placement: "bottom",
  6305. delay: {
  6306. show: 50,
  6307. hide: 0
  6308. },
  6309. trigger: "hover",
  6310. viewport: {
  6311. selector: "body",
  6312. padding: 10
  6313. }
  6314. })
  6315. }
  6316. function o() {
  6317. var e = s.isMobile() ? "" : '<span class="link install-browser">' + h.ERROR_GENERIC_ACTIONS_2 + "</span>" + h.ERROR_GENERIC_ACTIONS_3
  6318. , t = [h.ERROR_GENERIC_ACTIONS_1, e,].join("");
  6319. n(h.ERROR_GENERIC_PROBLEM, h.ERROR_GENERIC_SOLUTION, "", t),
  6320. s.isMobile() || $(".install-browser").on("click touchstart", function(e) {
  6321. e.preventDefault(),
  6322. e.stopPropagation(),
  6323. r(" ")
  6324. })
  6325. }
  6326. function a(e) {
  6327. if ($("head title").text(c.pageTitle),
  6328. $("#gui-message, #gui-loading, #nprogress, #gui-thumb, #bottom-logo").hide(),
  6329. $("#gui-loading").fadeOut(250),
  6330. $("#quick-blackout").hide(),
  6331. l.track("showcase_error", {
  6332. error_key: e
  6333. }),
  6334. h.locale || h.init(),
  6335. "webgl-unsupported" === e)
  6336. s.isMobile() ? o() : r(h.ERROR_WEBGL_UNSUPPORTED_PROBLEM);
  6337. else if ("webgl-ios" === e)
  6338. 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>.");
  6339. else if ("webgl-safari" === e)
  6340. 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>.");
  6341. else if ("webgl-generic" === e)
  6342. o();
  6343. else if ("missing-urls" === e)
  6344. n(h.ERROR_MISSING_URLS_PROBLEM, "", h.ERROR_MISSING_URLS_EXPLANATION);
  6345. else if ("loading-failed" === e)
  6346. 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>.");
  6347. else {
  6348. if ("loading-failed-maintenance" !== e)
  6349. return void d.error("Unhandled error: " + e);
  6350. n(h.ERROR_MAINTENANCE_PROBLEM, h.ERROR_MAINTENANCE_SOLUTION)
  6351. }
  6352. }
  6353. var s = e("./../util/browser")
  6354. , l = e("./../analytics")
  6355. , c = e("./../settings")
  6356. , h = e("../localization/localize")
  6357. , u = e("./../util/logger")
  6358. , d = new u(i)
  6359. , p = '"https://support.port.com/hc/articles/208220058"';
  6360. t.exports.error = a
  6361. }
  6362. ).call(this, "/js/gui/error.js")
  6363. }
  6364. , {
  6365. "../localization/localize": 108,
  6366. "./../analytics": 4,
  6367. "./../settings": 166,
  6368. "./../util/browser": 182,
  6369. "./../util/logger": 189
  6370. }],
  6371. 65: [function(e, t, i) {
  6372. (function(i) {
  6373. "use strict";
  6374. function n() {
  6375. Ue = [],
  6376. je.floors.visible && Ue.push(".gui-floor", ".gui-floor-title"),
  6377. Ue.push(".hideTarget", ".pinTop.right")
  6378. }
  6379. function r() {
  6380. for (var e in je)
  6381. if (je.hasOwnProperty(e)) {
  6382. var t = je[e];
  6383. if (!t.visible)
  6384. for (var i = 0; i < t.elements.length; i++)
  6385. $(t.elements[i]).hide()
  6386. }
  6387. je.highlight.visible && $(".pinBottom").addClass("highlightExists"),
  6388. je.tourControls.visible === !1 && $("#drawer").addClass("fullWidth"),
  6389. n()
  6390. }
  6391. function o(e, t) {
  6392. var i = !K.isMobile() && Q.zoom.enabled && t.mode === _e.PANORAMA && !e.tourIsPlaying;
  6393. $("#gui-zoomin").toggle(i),
  6394. $("#gui-zoomout").toggle(i)
  6395. }
  6396. function a() {
  6397. c(),
  6398. $(".pinBottom").toggleClass("open"),
  6399. $("#drawer").toggleClass("open"),
  6400. $(".footer").toggleClass("open"),
  6401. $("#drawer").hasClass("open") ? ($("#pullTab .icon").attr("data-original-title", Re.CLOSE_HIGHLIGHTS),
  6402. Ze("highlights")) : ($("#pullTab .icon").attr("data-original-title", Re.OPEN_HIGHLIGHTS),
  6403. ie.resetDrawer()),
  6404. setTimeout(function() {
  6405. $("#pullTab").toggleClass("opened");
  6406. }, $("#drawer").hasClass("open") ? 0 : Q.highlightAnimationDuration),
  6407. $(".pinBottom").hasClass("open") && s($(".vr-popup")) && $(".vr-popup").is(":visible") && Ae.dismiss()
  6408. }
  6409. function s(e) {
  6410. var t;
  6411. "none" !== e.css("display") ? t = e.position().top + e.outerHeight() : (e.attr("style", "visibility: hidden"),
  6412. t = e.position().top + e.outerHeight(),
  6413. e.attr("style", "display: none"));
  6414. var i = $("#player").outerHeight()
  6415. , n = i - 130;
  6416. return n < t + 25
  6417. }
  6418. function l(e) {
  6419. "touchstart" === e.type && e.preventDefault(),
  6420. e.stopPropagation()
  6421. }
  6422. function c() {
  6423. W && (W.reload(),
  6424. W.init())
  6425. }
  6426. function h(e) {
  6427. ne.show(e),
  6428. r()
  6429. }
  6430. function u(e) {
  6431. ne.progress(e)
  6432. }
  6433. function d(e, t, i) {
  6434. var n = t.player;
  6435. $("#gui-thumb").fadeOut(2500),
  6436. ne.hide(function() {
  6437. Ge = !1
  6438. }),
  6439. me.init(e, i),
  6440. de.finishSetup(Object.keys(e.tags).length),
  6441. i.on(Te.IMAGE_OPENED, Ze.bind(this, "tag"));
  6442. var s = function() {
  6443. i.dismissExaminedTag(),
  6444. i.disableHovering()
  6445. };
  6446. Ae.on(ye.OPENED, s),
  6447. Ce.on(Me.OPENED, s),
  6448. he.on(ue.OPENED, s),
  6449. fe.on(ge.OPENED, s);
  6450. var l = i.enableHovering.bind(i);
  6451. if (Ae.on(ye.CLOSED, l),
  6452. Ce.on(Me.CLOSED, l),
  6453. he.on(ue.CLOSED, l),
  6454. fe.on(ge.CLOSED, l),
  6455. Q.labels.enabled && Object.keys(e.labels).length,
  6456. (!settings.extractFloor || !settings.extractFloor[number]) && e.floors.length <= 1 || !je.floors.visible ? je.floors.visible = !1 : (y(e, t),
  6457. C(e.currentFloor, n.mode)),
  6458. getQueryVariable('m') === '372'&& (je.floors.visible = 1, y(e,t)),
  6459. r(),
  6460. o(t, t.player),
  6461. $("#gui").fadeIn(1500),
  6462. je.highlight.visible && (2 !== Q.startHighlights || e.has360Views) && setTimeout(function() {
  6463. a(),
  6464. (!e.has360Views && 1 !== Q.startHighlights || e.has360Views && 0 === Q.startHighlights) && setTimeout(a, 2e3)
  6465. }, 2e3),
  6466. !K.isMobile())
  6467. for (var c = ["a", "#title-toggle", ".next-button", ".prev-button", ".gui-floor", ".meta-toggle", ".thumbImg", "logo-button"], h = 0; h < c.length; h++)
  6468. $(c[h]).addClass("hasHover");
  6469. O(e),
  6470. de.setupToggling();
  6471. //xzw:
  6472. window.editHotPanel && editHotPanel();
  6473. //czj
  6474. navBorderRadius(e);
  6475. //czj 编辑界面
  6476. //window.EditingInterface && new EditingInterface(n.sceneRenderer);
  6477. window.EditTools && new EditTools(n.sceneRenderer);
  6478. }
  6479. function navBorderRadius(e){
  6480. var pullTab = $("#pullTab"),
  6481. mobileRadius = {
  6482. "bottom":{"border-bottom-left-radius":"10px","border-bottom-right-radius":"10px"},
  6483. "top":{"border-top-left-radius":"10px","border-top-right-radius":"10px"}
  6484. },
  6485. topRadius = {
  6486. "bottom":{"border-top-right-radius":"10px","border-bottom-right-radius":"10px"},
  6487. "top":{"border-bottom-left-radius":"10px","border-top-left-radius":"10px"}
  6488. };
  6489. function BorderRadius(bottom,top){
  6490. $("#gui-modes-map > div:visible:last").css(bottom);
  6491. if(pullTab.is(':visible')){
  6492. $(".viewContainer > div:visible:first").css(top);
  6493. }else{
  6494. $("#gui-modes-map > div:visible:first").css(top);
  6495. }
  6496. }
  6497. if(/Android|webOS|iPhone|iPod|BlackBerry/i.test(navigator.userAgent)){
  6498. BorderRadius(mobileRadius.bottom,mobileRadius.top);
  6499. }else{
  6500. BorderRadius(topRadius.bottom,topRadius.top);
  6501. }
  6502. //判断someData里面是否有special字段,如果有就会处理这些特殊的大场景
  6503. if(window.DATA.model.special || window.DATA.special){
  6504. window.specialScene && specialScene.special().afterImplement();
  6505. }
  6506. }
  6507. function p(e) {
  6508. e || (e = 0),
  6509. We = !1,
  6510. window.setTimeout(function() {
  6511. We || (ze = !0,
  6512. $("#gui-spinner").stop(!0, !0).show())
  6513. }
  6514. .bind(this), e)
  6515. }
  6516. function f() {
  6517. $("#gui-spinner").stop(!0, !0),
  6518. $("#gui-spinner").fadeOut(1e3),
  6519. We = !0,
  6520. ze = !1
  6521. }
  6522. function g(e, t) {
  6523. var i = e.mode
  6524. , n = t || e.currentPano;
  6525. $("#gui-modes-dollhouse").toggleClass("active", i === _e.DOLLHOUSE),
  6526. $("#gui-modes-floorplan").toggleClass("active", i === _e.FLOORPLAN),
  6527. $("#gui-modes-inside").toggleClass("active", i === _e.PANORAMA),
  6528. i === _e.PANORAMA ? ($("#view-controllers").slideUp(500),
  6529. Q.show360Views.enabled && !n.isAligned() ? (
  6530. $(".gui-floor").addClass("hidden"),
  6531. $("#gui-modes-outside").addClass("desktop-only")) : (
  6532. $(".gui-floor").removeClass("hidden"),
  6533. $("#gui-modes-outside").removeClass("desktop-only")),
  6534. $("#gui-modes-outside").removeClass("hidden")) : i !== _e.TRANSITIONING && (f(),
  6535. Be = i,
  6536. $("#gui-modes-outside").addClass("hidden"),
  6537. e.model.has360Views && $(".gui-floor").removeClass("hidden"),
  6538. $("#view-controllers").is(":visible") || $("#view-controllers").slideDown(Q.guiAnimationSpeed))
  6539. }
  6540. function m(e, t) {
  6541. var i = t.player;
  6542. $("#gui-modes-inside").on("mousedown touchstart", function(e) {
  6543. l(e),
  6544. J.updateInteraction(Se.InteractionGui, "inside-button"),
  6545. J.track("USER", {
  6546. event_type: "showcase_gui",
  6547. gui_action: "click_inside_mode_button"
  6548. }),
  6549. t.changeMode(_e.PANORAMA);
  6550. }),
  6551. $("#gui-modes-outside").find("a").on("click", function(e) {
  6552. l(e),
  6553. J.track("showcase_gui", {
  6554. gui_action: "click_outside_mode_button"
  6555. }),
  6556. t.changeMode(Be)
  6557. }),
  6558. $("#gui-modes-floorplan").on("click", function(e) {
  6559. l(e),
  6560. i.mode !== _e.FLOORPLAN && (J.track("showcase_gui", {
  6561. gui_action: "click_floorplan_mode_button"
  6562. }),
  6563. t.changeMode(_e.FLOORPLAN));
  6564. }),
  6565. $("#gui-modes-dollhouse").on("click", function(e) {
  6566. l(e),
  6567. i.mode !== _e.DOLLHOUSE && (J.track("showcase_gui", {
  6568. gui_action: "click_dollhouse_mode_button"
  6569. }),
  6570. t.changeMode(_e.DOLLHOUSE));
  6571. })
  6572. }
  6573. function v(e, t) {
  6574. function i() {
  6575. document.getElementById("vr").classList.remove("hidden"),
  6576. Q.vr.allowWebVR ? K.getVRDisplay().then(function(e) {
  6577. K.supportsFullscreen() ? n(e) : (De.warn("Unable to use WebVR when full screen is not supported"),
  6578. $(".improper-embed").toggleClass("hidden", !1),
  6579. r())
  6580. }, function(e) {
  6581. r()
  6582. }) : r()
  6583. }
  6584. function n(i) {
  6585. De.info(i.displayName + " detected, VR button activates WebVR experience"),
  6586. Ie.init(e.data, t, i, q),
  6587. Ie.on(Ee.OPENED, Ze.bind(gui, "vr")),
  6588. Ie.on(Ee.SHOW_TERMS, fe.show.bind(fe))
  6589. }
  6590. function r() {
  6591. De.info("WebVR support not found, VR button activates native app VR modal"),
  6592. Ae.init(e.data, q),
  6593. Ae.on(ye.OPENED, function() {
  6594. var e = document.getElementById("vr-modal");
  6595. return function() {
  6596. Ze("vr"),
  6597. le.open(e)
  6598. }
  6599. }()),
  6600. Ae.on(ye.CLOSED, le.reset)
  6601. }
  6602. if (Q.vr.enabled && e.supportsVR && !K.valueFromHash("mls", 0)){
  6603. /*********************** 方奕卓 VR功能事件监听 ********************/
  6604. K.isMobile() && $('#vr').css('display', ''); // 显示vr功能按钮
  6605. switch (Q.vr.option) {
  6606. case Pe.CONTEXTUAL:
  6607. i();
  6608. break;
  6609. case Pe.ANDROID:
  6610. K.detectAndroid() && i();
  6611. break;
  6612. case Pe.NONE:
  6613. }
  6614. }
  6615. }
  6616. function A(e, t) {
  6617. $("#play").on("mousedown touchstart", function(e) {
  6618. l(e);
  6619. Ze("tour");
  6620. ve.play();
  6621. J.trackAlways("showcase_gui", {
  6622. gui_action: "play_highlights"
  6623. })
  6624. }),
  6625. window.startAndPlay = function(e) {
  6626. // l(e);
  6627. Ze("tour");
  6628. ve.play();
  6629. J.trackAlways("showcase_gui", {
  6630. gui_action: "play_highlights"
  6631. })
  6632. };
  6633. $("#pause").on("mousedown touchstart", function(e) {
  6634. l(e),
  6635. ve.pause(),
  6636. J.trackAlways("showcase_gui", {
  6637. gui_action: "pause_highlights"
  6638. })
  6639. }),
  6640. $("#gui-zoomin").find("a").on("click", function(e) {
  6641. l(e),
  6642. t.player.zoomInIncrementally()
  6643. }),
  6644. $("#gui-zoomout").find("a").on("click", function(e) {
  6645. l(e),
  6646. t.player.zoomOutIncrementally()
  6647. })
  6648. }
  6649. function y(e, t) {
  6650. for (var i = $(".gui-floor"), n = 0; n < e.floors.length; n++) {
  6651. if(getQueryVariable('m') === '372') continue;
  6652. var r = $('<div class="floorChoice" data-index="' + n + '"></div>').text(e.floors.get(n).name);
  6653. $(".gui-floor").find(".container").prepend(r)
  6654. //cxz 本来一开始是prepend 后来改了append 按顺序插入
  6655. }
  6656. i.find(".container").prepend('<div class="floorChoice darkGlass allFloorBtn" data-index="all" style="display:none">' + Re.FLOOR_ALL + "</div>"),
  6657. i.on("click", function(e) {
  6658. l(e),
  6659. Ze("floor"),
  6660. i.toggleClass("open")
  6661. }),
  6662. $(".floorChoice").on("click", function(e) {
  6663. l(e);
  6664. var n = $(this).data("index");
  6665. "all" !== n ? (J.updateInteraction(Se.InteractionGui, "floor-control"),
  6666. t.player.gotoFloor(n),
  6667. J.track("showcase_gui", {
  6668. gui_action: "click_floor_select_button",
  6669. interaction_source: "gui"
  6670. })) : (J.updateInteraction(Se.InteractionGui, "floor-control"),
  6671. Ze("move"),
  6672. t.allFloors(),
  6673. J.track("showcase_gui", {
  6674. gui_action: "click_toggle_all_floors_button",
  6675. interaction_source: "gui"
  6676. })),
  6677. i.removeClass("open")
  6678. })
  6679. }
  6680. function C(e, t) {
  6681. 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()),
  6682. e.model.allFloorsVisible ? ($(".gui-floor-title").text(Re.FLOOR_ALL),
  6683. $(".gui-floor-number").text(Re.FLOOR_ALL),
  6684. $(".floorChoice").removeClass("active"),
  6685. $('.floorChoice[data-index="all"]').addClass("active")) : ($(".gui-floor-title").text(e.name),
  6686. $(".gui-floor-number").text(" " + (e.floorIndex + 1)),
  6687. $(".floorChoice").removeClass("active"),
  6688. $(".floorChoice[data-index=" + e.floorIndex + "]").addClass("active")))
  6689. }
  6690. function I(e) {
  6691. return e.describe().inTransition
  6692. }
  6693. function b(e, t, i) {
  6694. Fe = e.heroLocations.length;
  6695. var n = '<li class="thumbImg" data-index=""><img src=""></li>'
  6696. , r = 100 / Fe + "%"
  6697. , o = $("#thumb-container")
  6698. , a = $("#progressBar");
  6699. $("#status").find(".totalSteps").text(Fe);
  6700. for (var s = 0; s < Fe; s++) {
  6701. var c = e.heroLocations[s]
  6702. , h = $(n);
  6703. var thumbUrl
  6704. if(c.heroLocations){//有子项,选第一张截图
  6705. thumbUrl = manage.dealURL(c.heroLocations[0].thumbUrl)//.replace('https://','').replace('http://','')
  6706. }else{
  6707. thumbUrl = manage.dealURL(c.thumbUrl)//.replace('https://','').replace('http://','')
  6708. }
  6709. h.attr("data-index", s)
  6710. je.highlight.visible && h.find("img").attr("src", thumbUrl)
  6711. if (c.name) {
  6712. var u = $('<div class="overlay"></div>').text(c.name);
  6713. h.prepend(u)
  6714. }
  6715. if (e.has360Views && c.cameraMode === _e.PANORAMA) {
  6716. var d = e.panos.get(c.panoId)
  6717. , p = d && !d.isAligned()
  6718. , f = p ? '<div><img class="mark360View" src="images/mark-360-white-v2.png"></div>' : '<div><img class="markInsideView" src="images/mark-inside-white.png"></div>';
  6719. h.prepend(f)
  6720. }
  6721. o.append(h),
  6722. a.append('<div class="step" data-idx="' + s + '" style="width:' + r + '"></div>')
  6723. }
  6724. j = 144 * Fe,
  6725. Y = 111 * Fe,
  6726. $(".thumbImg").on("mouseover", function() {
  6727. I(t) || i.showPathToHeroLocation([$(this).data("index"),0])//改
  6728. }),
  6729. $(".thumbImg").on("mouseout", function() {
  6730. t.clearPath()
  6731. }),
  6732. $(".thumbImg").on("click", function(e) {
  6733. l(e);
  6734. var i = $(this);
  6735. J.updateInteraction(Se.InteractionGui, "thumbnail"),
  6736. J.trackAlways("showcase_gui", {
  6737. gui_action: "click_highlight"
  6738. }),
  6739. t.goToHighlight([i.data("index"),0])//改
  6740. }),
  6741. $(".previous").find("a").on("click", function(e) {
  6742. l(e),
  6743. J.trackAlways("showcase_gui", {
  6744. gui_action: "prev_highlight"
  6745. }),
  6746. t.prevHighlight()
  6747. }),
  6748. $(".next").find("a").on("click", function(e) {
  6749. l(e),
  6750. J.trackAlways("showcase_gui", {
  6751. gui_action: "next_highlight"
  6752. }),
  6753. t.nextHighlight()
  6754. }),
  6755. $("#drawer").on("mouseleave", function(e) {
  6756. l(e);
  6757. var t;
  6758. try {
  6759. t = new MouseEvent("mouseup",{
  6760. clientX: e.clientX,
  6761. clientY: e.clientY,
  6762. screenX: e.screenX,
  6763. screenY: e.screenY
  6764. })
  6765. } catch (i) {
  6766. t = document.createEvent("MouseEvents"),
  6767. 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)
  6768. }
  6769. document.dispatchEvent(t)
  6770. }),
  6771. W = new Sly($("#scrollFrame"),{
  6772. horizontal: !0,
  6773. itemNav: "centered",
  6774. smart: !0,
  6775. scrollTrap: !0,
  6776. scrollBy: 1,
  6777. mouseDragging: !0,
  6778. touchDragging: !0,
  6779. speed: 300,
  6780. dragHandle: !0,
  6781. dynamicHandle: !0,
  6782. clickBar: !0,
  6783. scrollBar: $("#scroller"),
  6784. activateOn: null
  6785. }).init(),
  6786. W.on("active", function(e, t) {
  6787. Ve = t,
  6788. Ze("tour"),
  6789. $(".step").removeClass("active"),
  6790. $("#status").find(".curIdx").text(t + 1);
  6791. for (var i = 0; i <= t; i++)
  6792. $("#progressBar").find("[data-idx='" + i + "']").addClass("active")
  6793. }),
  6794. w()
  6795. //add :
  6796. let scrollFrame = $(W.frame)
  6797. scrollFrame.on("wheel.sly", function() {
  6798. lastMoveScrollTime = Date.now()
  6799. })
  6800. let dragstart
  6801. /* scrollFrame.on("pointerdown", function() {
  6802. dragstart = true
  6803. })
  6804. scrollFrame.on("pointerup", function() {
  6805. dragstart = false
  6806. }) */
  6807. scrollFrame.on("pointermove", function() {
  6808. //if(dragstart){
  6809. lastMoveScrollTime = Date.now()
  6810. //}
  6811. })
  6812. }
  6813. function w() {
  6814. var e = $("#player").width() - 20
  6815. , t = $("#scroller")
  6816. , i = $("#drawer")
  6817. , n = $(".pinBottom");
  6818. if ($("#player").width() < 488 || $("#player").height() < 488)
  6819. t.addClass("hidden"),
  6820. i.addClass("noScroll"),
  6821. n.addClass("noScroll");
  6822. else {
  6823. var r = j > e
  6824. , o = !i.hasClass("noScroll")
  6825. , a = r !== o;
  6826. a && (t.toggleClass("hidden"),
  6827. i.toggleClass("noScroll"),
  6828. n.toggleClass("noScroll"))
  6829. }
  6830. }
  6831. function _(e) {
  6832. je.tourControls.visible = true//e.tour_buttons && K.valueFromHash("gt", 1),
  6833. je.coBrand.visible = e.presented_by && 1 !== Q.specialEdition && Q.brand && !K.valueFromHash("mls", !1),
  6834. je.highlight.visible = /* e.highlight_reel && */ 1 !== Q.specialEdition && Q.showHighlights
  6835. }
  6836. function T(e) {
  6837. function t(t, i) {
  6838. return !!e.player_options[t] && e[i || t]
  6839. }
  6840. $(".model-title").text(e.name);
  6841. var i = Q.pageTitle;
  6842. // 2 !== K.valueFromHash("mls", 0) && (i = e.name + " - " + i),
  6843. 2 !== K.valueFromHash("mls", 0) && e.name && (i = e.name),
  6844. document.title = i ,
  6845. K.isMobile() ? $("#gui-fullscreen").css("display", "none") : ($("[rel=tooltip]").tooltip({
  6846. delay: {
  6847. show: 50,
  6848. hide: 0
  6849. },
  6850. trigger: "hover",
  6851. html: !1,
  6852. viewport: {
  6853. selector: "body",
  6854. padding: 10
  6855. }
  6856. }),
  6857. K.inIframe() && document.getElementsByClassName("pinBottom-container")[0].classList.add("embed")),
  6858. // 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"),
  6859. de.populate({
  6860. name: t("model_name", "name"),
  6861. coBrand: t("presented_by"),
  6862. description: t("model_summary", "summary") || "暂无内容",
  6863. contactName: t("contact_name"),
  6864. address: t("address"),
  6865. phone: t("contact_phone"),
  6866. formattedPhone: e.formatted_contact_phone,
  6867. email: t("contact_email"),
  6868. url: t("external_url"),
  6869. socialSharing: e.enable_social_sharing && e.is_public
  6870. })
  6871. }
  6872. function x(e, t, i, n, r, o) {
  6873. function a() {
  6874. o.setLoadingStartTime(),
  6875. H(),
  6876. r ? (re.showMessage(t, i, je.coBrand.visible),
  6877. l()) : h(l)
  6878. }
  6879. var s = $.Deferred()
  6880. , l = s.resolve.bind(s);
  6881. return Ge = !0,
  6882. O(e),
  6883. e.data.player_options && _(e.data.player_options),
  6884. 1 === Q.specialEdition && $("body").addClass("specialEdition"),
  6885. Re.localizeGUI(),
  6886. T(e.data),
  6887. r || $(".quick").addClass("hidden"),
  6888. //e.data.image && !r && E(e.data.image),
  6889. n ? (J.impression(),
  6890. a()) : (o.setWaitingStartTime(),
  6891. oe.show(r, a)),
  6892. s
  6893. }
  6894. function S(e, t, i, n, r, a, s) {
  6895. q = s,
  6896. e.outsideAllowed() || $("#gui-modes-outside").addClass("invisible"),
  6897. e.supportedModes[_e.PANORAMA] || $("#gui-modes-inside").addClass("invisible"),
  6898. ae.init(),
  6899. re.init(e, a),
  6900. Oe.init(e, t, n),
  6901. $(".icon").on("mouseover", function() {
  6902. t.player && t.player.reticule.hide()
  6903. }),
  6904. m(e, t),
  6905. A(e, t),
  6906. e.data.enable_social_sharing && e.data.is_public && Q.share.enabled && (Ce.init(window.DATA.name/* e.data.name */),
  6907. Ce.on(Me.OPENED, function() {
  6908. var e = document.getElementById("share-modal");
  6909. return function() {
  6910. Ze("share"),
  6911. le.open(e)
  6912. }
  6913. }()),
  6914. Ce.on(Me.CLOSED, le.reset)),
  6915. e.heroLocations.length > 0 ? b(e, t, i) : (je.highlight.visible = !1,
  6916. je.tourControls.visible = !1),
  6917. de.on(pe.OPEN_INFO, Ze.bind(this, "info")),
  6918. z(),
  6919. g(i),
  6920. v(e, r),
  6921. e.on("floor.changed", C),
  6922. e.on("waiting", R.bind(this, e)),
  6923. e.on("waiting-done", P.bind(this, e)),
  6924. i.on(xe.ModeChanged, function(e, n) {
  6925. g(i),
  6926. o(t, i),
  6927. n === _e.PANORAMA && i.currentPano && !i.currentPano.isAligned() && (n = _e.OUTDOOR),
  6928. he.updateMode(n)
  6929. }),
  6930. n.on(Se.Move, Ze.bind(this, "move")),
  6931. i.on(xe.Ready, function() {
  6932. ie.init(n, i, i.tagManager, t),
  6933. i.on(xe.ModeChanged, function(e, t) {
  6934. e !== t && $(".vr-popup").is(":visible") && Ae.dismiss()
  6935. })
  6936. }),
  6937. i.on(xe.PanoChosen, function(e, t) {
  6938. g(i, t),
  6939. he.updateMode(t && !t.isAligned() ? _e.OUTDOOR : _e.PANORAMA)
  6940. }),
  6941. le.on(ce.CLOSE, function(e) {
  6942. switch (e) {
  6943. case "vr-modal":
  6944. Ae.dismiss();
  6945. break;
  6946. case "share-modal":
  6947. Ce.hide();
  6948. break;
  6949. case "terms-modal":
  6950. fe.hide()
  6951. }
  6952. });
  6953. var l = $("#play").eq(0)
  6954. , c = $("#pause").eq(0)
  6955. , h = $(".pinBottom").toArray()
  6956. , u = $("#drawer").eq(0)
  6957. , d = $("#playHead").eq(0)
  6958. , p = $("#progressBar").eq(0)
  6959. , f = $("#thumb-container").eq(0)
  6960. , y = f.children()
  6961. , I = p.children();
  6962. t.on("update.controls", function() {//导览控制
  6963. var n = t.describe();
  6964. if(n.tourIsPlaying || i.isWarping() || t.waitHighlight){
  6965. if(je.tourControls.visible){
  6966. l.hide() //play button
  6967. c.show() //pause button
  6968. }
  6969. if(n.tourInProgress){
  6970. h.forEach(function(e) {
  6971. e.classList.add("playing")
  6972. }),
  6973. u.addClass("playing"),
  6974. d.addClass("playing")
  6975. }
  6976. }else{
  6977. if(je.tourControls.visible){
  6978. l.show(),
  6979. c.hide()
  6980. }
  6981. if(!n.tourInProgress){
  6982. ve.stopTour(),
  6983. h.forEach(function(e) {
  6984. e.classList.remove("playing")
  6985. }),
  6986. u.removeClass("playing"),
  6987. d.removeClass("playing")
  6988. }
  6989. }
  6990. var r, a, s;
  6991. if (null !== n.currentItem) {
  6992. var p, f;
  6993. $("#status").find(".curIdx").text(n.currentItem[0] + 1),
  6994. n.onTheBus ? (p = "active",
  6995. f = "recent") : (f = "active",
  6996. p = "recent");
  6997. var g = null === n.destinationItem || n.currentItem[0] === n.destinationItem[0];
  6998. /* for (r = 0; r < e.heroLocations.length; r += 1)
  6999. s = y.eq(r),
  7000. a = I.eq(r),
  7001. s.removeClass(f),
  7002. a.removeClass(f),
  7003. n.onTheBus && r === n.destinationItem[0] ? (s.addClass(p),
  7004. a.addClass(p),
  7005. W.activate(r)) : n.onTheBus && g && r === n.currentItem[0] ? (s.addClass(p),
  7006. a.addClass(p)) : (s.removeClass(p),
  7007. a.removeClass(p)) */
  7008. for (r = 0; r < e.heroLocations.length; r += 1){
  7009. s = y.eq(r),
  7010. a = I.eq(r),
  7011. s.removeClass(f),
  7012. a.removeClass(f);
  7013. if(n.onTheBus && r === n.destinationItem[0]){
  7014. s.addClass(p)
  7015. a.addClass(p)
  7016. if(Date.now() - lastMoveScrollTime > 2000){ //add 如果一段时间内用户不操作scrollbar,才focus回这个item
  7017. W.activate(r) // scrollbar slide to this
  7018. }
  7019. }else{
  7020. n.onTheBus && g && r === n.currentItem[0] ?
  7021. (s.addClass(p), a.addClass(p)) :
  7022. (s.removeClass(p), a.removeClass(p))
  7023. }
  7024. }
  7025. } else
  7026. for (r = 0; r < e.heroLocations.length; r += 1)
  7027. s = y.eq(r),
  7028. a = I.eq(r),
  7029. s.removeClass("active recent"),
  7030. a.removeClass("active recent");
  7031. o(t, i)
  7032. }),
  7033. document.addEventListener("keydown", function(n) {
  7034. switch (J.updateInteraction(Se.InteractionKey),
  7035. n.which) {
  7036. case we.ZERO:
  7037. Q.debug && e.toggleAlpha();
  7038. break;
  7039. case we.NINE:
  7040. Q.debug && se.toggle();
  7041. break;
  7042. case we.ONE:
  7043. i.isInMode(_e.TRANSITIONING) || t.changeMode(_e.PANORAMA);
  7044. break;
  7045. case we.TWO:
  7046. e.outsideAllowed() && !i.isInMode(_e.DOLLHOUSE, _e.TRANSITIONING) && t.changeMode(_e.DOLLHOUSE);
  7047. break;
  7048. case we.THREE:
  7049. e.outsideAllowed() && !i.isInMode(_e.FLOORPLAN, _e.TRANSITIONING) && t.changeMode(_e.FLOORPLAN);
  7050. break;
  7051. case we.FOUR:
  7052. i.isInMode(_e.TRANSITIONING) || t.changeMode(_e.OUTDOOR);
  7053. break;
  7054. case we.SPACE:
  7055. je.tourControls.visible && ($("#playHead").hasClass("playing") || Ze("tour"));
  7056. break;
  7057. case we.RETURN:
  7058. Q.debug && e.toggleExplodeUp();
  7059. break;
  7060. case we.P:
  7061. k();
  7062. break;
  7063. case we.U:
  7064. B();
  7065. break;
  7066. case we.X:
  7067. Q.debug && e.toggleExplode();
  7068. break;
  7069. case we.PLUSEQUALS:
  7070. t.player.activatePersistentZooming(!0),
  7071. ie.hideUi();
  7072. break;
  7073. case we.DASHUNDERSCORE:
  7074. t.player.activatePersistentZooming(!1),
  7075. ie.hideUi();
  7076. break;
  7077. case we.SEVEN:
  7078. De.info("Zoom level: " + t.player.zoomLevel + ", FOV: " + t.player.zoomFov);
  7079. break;
  7080. case we.EIGHT:
  7081. t.player.decreaseZoomSpeed();
  7082. break;
  7083. case we.NINE:
  7084. t.player.increaseZoomSpeed()
  7085. }
  7086. return i && i.reticule.hide(),
  7087. !0
  7088. }
  7089. .bind(this)),
  7090. document.addEventListener("keyup", function(e) {
  7091. switch (e.which) {
  7092. case we.PLUSEQUALS:
  7093. t.player.deactivatePersistentZooming();
  7094. break;
  7095. case we.DASHUNDERSCORE:
  7096. t.player.deactivatePersistentZooming()
  7097. }
  7098. }
  7099. .bind(this)),
  7100. F(e),
  7101. L(e, t.player),
  7102. M(i),
  7103. te.setAutoPlay(e.heroCount()),
  7104. he.init(i, a.mode),
  7105. he.on(ue.OPENED, Ze.bind(this, "help")),
  7106. fe.init(),
  7107. fe.on(ge.OPENED, function() {
  7108. var e = document.getElementById("terms-modal");
  7109. return function() {
  7110. Ze("terms"),
  7111. le.open(e)
  7112. }
  7113. }()),
  7114. fe.on(ge.CLOSED, le.reset),
  7115. Q.quickstart.enabled || re.delayLanding(a.mode).then(re.showMessage.bind(this, i, t, je.coBrand.visible)),
  7116. (Q.quickstart.enabled || i.model.outsideAllowed()) && ie.init(n, i, i.tagManager, t),
  7117. Q.profiling.enabled && se.show(),
  7118. ve.init(t)
  7119. }
  7120. function M(e) {
  7121. var t = function(e, t) {
  7122. $(e).find("a").each(function(e, i) {
  7123. t ? $(i).removeClass("buttonZoomDisabled").addClass("buttonZoomEnabled") : $(i).addClass("buttonZoomDisabled").removeClass("buttonZoomEnabled"),
  7124. i.style.pointerEvents = t ? "auto" : "none"
  7125. })
  7126. }
  7127. , i = function() {
  7128. e.zoomLevel >= Q.zoom.max ? t("#gui-zoomin", !1) : t("#gui-zoomin", !0),
  7129. e.zoomLevel <= Q.zoom.min ? t("#gui-zoomout", !1) : t("#gui-zoomout", !0)
  7130. };
  7131. e.on(Ne.ZoomMax, function() {
  7132. t("#gui-zoomin", !1),
  7133. t("#gui-zoomout", !0)
  7134. }),
  7135. e.on(Ne.ZoomMin, function() {
  7136. t("#gui-zoomin", !0),
  7137. t("#gui-zoomout", !1)
  7138. }),
  7139. e.on(Ne.ZoomIn, function() {
  7140. t("#gui-zoomout", !0)
  7141. }),
  7142. e.on(Ne.ZoomOut, function() {
  7143. t("#gui-zoomin", !0)
  7144. }),
  7145. i()
  7146. }
  7147. function R(e) {
  7148. O(e)
  7149. }
  7150. function P(e) {
  7151. O(e)
  7152. }
  7153. function O(e) {
  7154. var t = e.waitQueue.length;
  7155. t <= 0 ? f() : Ge || p(Q.modelComponentLoadSpinnerDelay)
  7156. }
  7157. function L(e, t) {
  7158. He = {
  7159. gui: null,
  7160. visible: !1,
  7161. model: e,
  7162. player: t
  7163. }
  7164. }
  7165. function D(e, t) {
  7166. function i() {
  7167. var i = t.toJSON();
  7168. n.linkToLocation = window.location.protocol + "//" + window.location.host + window.location.pathname + "?m=" + e.sid + "&start=" + be.serialize(i),
  7169. t.tagManager.activeTag && (n.linkToLocation += "&tag=" + t.tagManager.activeTag.sid)
  7170. }
  7171. var n = {}
  7172. , r = new Le.GUI({
  7173. autoPlace: !0,
  7174. width: "60%"
  7175. });
  7176. i(),
  7177. t.on(xe.ViewChanged, i),
  7178. r.add(n, "linkToLocation").name(Re.LINK_TO_LOCATION).listen(),
  7179. r.domElement.id = "datLinks";
  7180. var o = [].slice.call(r.domElement.querySelectorAll(".property-name"));
  7181. return o.forEach(function(e) {
  7182. if (!K.detectSafari()) {
  7183. var t = document.createElement("button");
  7184. t.classList.add("btn-deep-link"),
  7185. t.innerText = Re.MENU_COPY,
  7186. e.nextSibling.appendChild(t);
  7187. var i = function() {
  7188. alert(Re.LINK_ALERT_COPY),
  7189. t.hide()
  7190. };
  7191. t.addEventListener("click", function(e) {
  7192. try {
  7193. var t = e.target.parentNode.childNodes[0];
  7194. t.select();
  7195. var n = document.execCommand("copy");
  7196. t.blur(),
  7197. n || i()
  7198. } catch (e) {
  7199. i()
  7200. }
  7201. })
  7202. }
  7203. }),
  7204. $(r.__closeButton).hide(),
  7205. r
  7206. }
  7207. function N(e) {
  7208. He.gui || (He.gui = D(He.model, He.player)),
  7209. He.visible = e,
  7210. e ? $(He.gui.domElement).show() : $(He.gui.domElement).hide()
  7211. }
  7212. function B() {
  7213. N(!He.visible)
  7214. }
  7215. function F(e) {
  7216. ke = {
  7217. gui: null,
  7218. visible: !1,
  7219. model: e
  7220. }
  7221. }
  7222. function V(e) {
  7223. var t = new Le.GUI;
  7224. return t.add(Q, "showSweeps").name("Show sweeps").onFinishChange(function() {
  7225. e.setSweepVisibility(Q.showSweeps)
  7226. }),
  7227. t.add(Q, "rotationAccelerationInside", .1, 10).name("Rotation speed").step(.1),
  7228. t.add(Q.transition, "flyTime", 0, 5e3).name("Transition time").onFinishChange(function() {
  7229. Q.transition.flySpeed = 0,
  7230. t.__controllers.forEach(function(e) {
  7231. e.updateDisplay()
  7232. })
  7233. }),
  7234. t.add(Q.path, "opacity", 0, 1).name("Path opacity"),
  7235. $(t.__closeButton).hide(),
  7236. t
  7237. }
  7238. function U(e) {
  7239. ke.gui || (ke.gui = V(ke.model)),
  7240. ke.visible = e,
  7241. e ? $(ke.gui.domElement).show() : $(ke.gui.domElement).hide()
  7242. }
  7243. function k() {
  7244. U(!ke.visible)
  7245. }
  7246. function H() {
  7247. function e(e) {
  7248. e.target === t || $.contains(t, e.target) || e.target === i || $.contains(i, e.target) || e.target === n || $.contains(n, e.target)/* || e.preventDefault()*/
  7249. }
  7250. $("body").css("touch-action", "none"),
  7251. $("#gui-parent").find("*:not(#tag-billboards)").on("touchmove", function(e) {
  7252. // e.preventDefault()
  7253. });
  7254. var t = document.getElementById("terms-text")
  7255. , i = document.getElementById("more-help-wrapper")
  7256. , n = (document.getElementById("navigation-help-wrapper"),
  7257. document.getElementById("help-dialog"),
  7258. document.getElementById("tag-billboards"));
  7259. Q.useWheel && (document.body.addEventListener("mousewheel", e, { passive: false }),
  7260. document.body.addEventListener("DOMMouseScroll", e)),
  7261. $("#terms-text, #more-help-wrapper, #navigation-help-wrapper").off("touchmove").on("touchmove", function(e) {
  7262. e.stopPropagation()
  7263. })
  7264. }
  7265. function G(e, t) {
  7266. for (var i = []; e; )
  7267. i.push(e),
  7268. e = e.parentNode;
  7269. for (; t && i.indexOf(t) === -1; )
  7270. t = t.parentNode;
  7271. return t
  7272. }
  7273. function z() {
  7274. var e, t = function(t) {
  7275. e = 0 === t.button || 1 === t.which ? t.target : null
  7276. }, i = function(t) {
  7277. e !== t.target && (e = G(e, t.target));
  7278. var i = document.getElementById("gui-parent");
  7279. if (G(i, e) !== i && (e = null),
  7280. e) {
  7281. var n;
  7282. try {
  7283. n = new MouseEvent("click",t)
  7284. } catch (e) {
  7285. n = document.createEvent("MouseEvents"),
  7286. 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)
  7287. }
  7288. n.syntheticClick = !0,
  7289. e.dispatchEvent(n),
  7290. e = null
  7291. }
  7292. };
  7293. document.body.addEventListener("mousedown", t, !0),
  7294. document.body.addEventListener("mouseup", i, !0),
  7295. document.getElementById("gui-parent").addEventListener("click", function(e) {
  7296. e.syntheticClick || (e.stopPropagation(),
  7297. "A" === e.target.nodeName && e.preventDefault())
  7298. }, !0)
  7299. }
  7300. var lastMoveScrollTime = 0;//add
  7301. var W, j, Y, X, Z, q, K = (e("three"),
  7302. e("../util/ajax"),
  7303. e("../util/browser")), Q = e("../settings"), J = e("../analytics"), ee = (e("../util/transitions"),
  7304. e("../util/camera"),
  7305. e("../util/logger")), te = (e("../objects/Snapshot"),
  7306. 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"),
  7307. e("../tag/Media/MediaEvent")), xe = (e("../enum/PathDiscardMode"),
  7308. e("../enum/PathDisplayMode"),
  7309. e("../enum/DirectorEvents"),
  7310. e("../enum/PlayerEvents")), Se = e("../enum/ControlEvents"), Me = e("./sharing/ShareEvents"), Re = e("../localization/localize"), Pe = (e("../enum/Vectors"),
  7311. e("../enum/WarpStyle"),
  7312. e("../enum/AlignmentType"),
  7313. e("../enum/VROption")), Oe = e("./konami"), Le = e("../lib/dat.gui"), De = new ee(i), Ne = (e("../util/showcase"),
  7314. e("../enum/ZoomEvents")), Be = _e.DOLLHOUSE, Fe = 0, Ve = 0, Ue = [".hideTarget"], ke = null, He = null, Ge = !1, ze = !1, We = !1, je = {
  7315. coBrand: {
  7316. visible: !0,
  7317. elements: [".co-brand", "#loaderCoBrand"]
  7318. },
  7319. help: {
  7320. visible: !0,
  7321. elements: [".nav-help", "#nav-help"]
  7322. },
  7323. tourControls: {
  7324. visible: !0,
  7325. elements: [".next", ".previous", "#play"]
  7326. },
  7327. highlight: {
  7328. visible: !0,
  7329. elements: ["#drawer", "#pullTab"]
  7330. },
  7331. share: {
  7332. visible: !0,
  7333. elements: [".socialButton", "#share"]
  7334. },
  7335. fullScreen: {
  7336. visible: !0,
  7337. elements: ["#gui-fullscreen"]
  7338. },
  7339. floors: {
  7340. visible: !0,
  7341. elements: [".gui-floor"]
  7342. }
  7343. }, Ye = function() {
  7344. var e = document.getElementById("drawer");
  7345. return function() {
  7346. $("#player").height() < 400 && e.classList.contains("open") && a()
  7347. }
  7348. }(), Xe = function() {
  7349. var e = document.getElementById("meta-info");
  7350. return function() {
  7351. $("#player").height() < 400 && e.classList.contains("expand") && de.toggleMeta(!0)
  7352. }
  7353. }(), Ze = function(e) {
  7354. function t() {
  7355. u.classList.contains("expand") && de.toggleMeta(!0)
  7356. }
  7357. function i() {
  7358. fe.hide()
  7359. }
  7360. function n() {
  7361. he.close()
  7362. }
  7363. function r() {
  7364. Ae.dismiss()
  7365. }
  7366. function o() {
  7367. p.hasClass("open") && a(!0)
  7368. }
  7369. function l() {
  7370. Ce.hide()
  7371. }
  7372. function c() {
  7373. f.hasClass("open") && f.removeClass("open")
  7374. }
  7375. function h() {
  7376. d.classList.contains("fadeIn") && (d.classList.contains("landing") ? re.dismissModal() : d.classList.contains("tour") && ve.dismissModal())
  7377. }
  7378. var u = document.getElementById("meta-info")
  7379. , d = document.getElementById("interaction-modal")
  7380. , p = $("#drawer").eq(0)
  7381. , f = $(".gui-floor").eq(0)
  7382. , g = $(".vr-popup").eq(0);
  7383. return function(e) {
  7384. switch (e) {
  7385. case "info":
  7386. i(),
  7387. n(),
  7388. Ye(),
  7389. l(),
  7390. c(),
  7391. r(),
  7392. h();
  7393. break;
  7394. case "terms":
  7395. t(),
  7396. n(),
  7397. o(),
  7398. l(),
  7399. c(),
  7400. r(),
  7401. h();
  7402. break;
  7403. case "help":
  7404. t(),
  7405. i(),
  7406. l(),
  7407. c(),
  7408. r(),
  7409. h();
  7410. break;
  7411. case "vr":
  7412. t(),
  7413. i(),
  7414. l(),
  7415. c(),
  7416. n(),
  7417. h(),
  7418. s(g) && o();
  7419. break;
  7420. case "highlights":
  7421. Xe(),
  7422. i(),
  7423. l(),
  7424. c();
  7425. break;
  7426. case "share":
  7427. t(),
  7428. i(),
  7429. n(),
  7430. c(),
  7431. r(),
  7432. h();
  7433. break;
  7434. case "floor":
  7435. i(),
  7436. l(),
  7437. r();
  7438. break;
  7439. case "view":
  7440. c(),
  7441. l(),
  7442. i(),
  7443. r();
  7444. break;
  7445. case "tour":
  7446. i(),
  7447. l(),
  7448. c(),
  7449. r();
  7450. break;
  7451. case "move":
  7452. i(),
  7453. l(),
  7454. c(),
  7455. r();
  7456. break;
  7457. case "resize":
  7458. t(),
  7459. Ye(),
  7460. c();
  7461. break;
  7462. case "tag":
  7463. i(),
  7464. n(),
  7465. l(),
  7466. c(),
  7467. r()
  7468. }
  7469. }
  7470. }();
  7471. $(document).on("fullscreenchange webkitfullscreenchange mozfullscreenchange MSFullscreenChange", function(e) {
  7472. $("#gui-fullscreen").toggle(!K.isFullscreen()),
  7473. $("#gui-fullscreen-exit").toggle(!!K.isFullscreen()),
  7474. setTimeout(function() {
  7475. $(".icon:visible").hide().show(0)
  7476. }, 100)
  7477. }),
  7478. $("#gui-fullscreen").find("a").on("click", function(e) {
  7479. l(e),
  7480. K.requestFullscreen($("body")[0]),
  7481. J.track("showcase_gui", {
  7482. gui_action: "click_enter_fullscreen",
  7483. interaction_source: "gui"
  7484. })
  7485. //czj
  7486. //W.reload()
  7487. }),
  7488. $("#gui-fullscreen-exit").find("a").on("click", function(e) {
  7489. l(e),
  7490. K.exitFullscreen(),
  7491. J.track("showcase_gui", {
  7492. gui_action: "click_exit_fullscreen",
  7493. interaction_source: "gui"
  7494. })
  7495. })
  7496. $(window).on("resize", function(e) {
  7497. var t = e.target.innerHeight
  7498. , i = e.target.innerWidth;
  7499. t === X && i === Z || (je.highlight.visible && w(),
  7500. Ze("resize"),
  7501. $(".pinTop.right").removeClass("hideUnderMeta"),
  7502. c(),
  7503. X = t,
  7504. Z = i)
  7505. }).resize(),
  7506. K.supportsFullscreen() || $("#gui-fullscreen").hide(),
  7507. $("#pullTab").on("click", function(e) {
  7508. l(e),
  7509. $("#drawer").hasClass("open") ? (J.trackAlways("showcase_gui", {
  7510. gui_action: "hide_highlight_reel"
  7511. }),
  7512. $(this).addClass("open").children("img").attr("src","images/auto.png")) : (J.trackAlways("showcase_gui", {
  7513. gui_action: "show_highlight_reel"
  7514. }),
  7515. $(this).removeClass("open").children("img").attr("src","images/auto-suspend.png"));
  7516. a()
  7517. });
  7518. /***********************方奕卓 热点列表事件监听 ************************/
  7519. if(window.DATA.showHotListSta) {
  7520. $('#hotList').css('display', '');
  7521. $('#hotList').on('click',function(e){
  7522. l(e);
  7523. var hotList = $('#hotListWrap')[0];
  7524. var isActive = hotList.classList.contains('hotListActive');
  7525. if(isActive){
  7526. hotList.classList.remove('hotListActive');
  7527. this.classList.remove('active')
  7528. }else{
  7529. hotList.classList.add('hotListActive');
  7530. this.classList.add('active')
  7531. }
  7532. }),
  7533. $('#hotListContent ul').on('mouseover', function(e){
  7534. l(e);
  7535. var target = e.target;
  7536. var hotList = document.getElementById('hotListWrap');
  7537. if(target.tagName === 'SPAN'){
  7538. var targetParent = target.parentElement.parentElement;
  7539. if(target.offsetWidth + 116 >= targetParent.clientWidth){
  7540. hotList.style.width = target.offsetWidth + 116 + 'px';
  7541. }else{
  7542. hotList.style.width = '';
  7543. }
  7544. }else if(target.tagName === 'LI'){
  7545. var targetParent = target.parentElement;
  7546. if(target.children[0].offsetWidth + 116 >= targetParent.clientWidth){
  7547. hotList.style.width = target.children[0].offsetWidth + 116 + 'px';
  7548. }else{
  7549. hotList.style.width = ''
  7550. }
  7551. }else {
  7552. hotList.style.width = '';
  7553. }
  7554. });
  7555. $('#hotListContent ul').on('click', function(e){
  7556. l(e);
  7557. this.preElem && this.preElem.classList.remove('active');
  7558. if(e.target.tagName === 'SPAN'){
  7559. e.target.parentElement.classList.add('active');
  7560. e.target.parentElement.hot && e.target.parentElement.hot.examine( ); // 打开热点
  7561. this.preElem = e.target.parentElement;
  7562. }else{
  7563. e.target.classList.add('active');
  7564. e.target.hot && e.target.hot.examine( ); // 打开热点
  7565. this.preElem = e.target;
  7566. }
  7567. })
  7568. $('#hotListClose').on('click', function(e){
  7569. l(e);
  7570. var hotList = $('#hotListWrap')[0];
  7571. hotList.classList.remove('hotListActive');
  7572. $('#hotListContent ul .active').removeClass('active');
  7573. $('#hotList')[0].classList.remove('active')
  7574. })
  7575. }
  7576. /*****************************************************************/
  7577. $("#more-menu-button").on("click", function(e) {
  7578. l(e);
  7579. var t = $("#more-menu");
  7580. t.toggleClass("open")
  7581. }),
  7582. t.exports.init = S,
  7583. t.exports.startLoading = x,
  7584. t.exports.endLoading = d,
  7585. t.exports.onProgress = u
  7586. }
  7587. ).call(this, "/js/gui/gui.js")
  7588. }
  7589. , {
  7590. "../analytics": 4,
  7591. "../controls/serializer": 14,
  7592. "../enum/AlignmentType": 17,
  7593. "../enum/BlackoutStyle": 18,
  7594. "../enum/ControlEvents": 21,
  7595. "../enum/DirectorEvents": 23,
  7596. "../enum/Keys": 30,
  7597. "../enum/PathDiscardMode": 38,
  7598. "../enum/PathDisplayMode": 39,
  7599. "../enum/PlayerEvents": 40,
  7600. "../enum/VROption": 47,
  7601. "../enum/Vectors": 50,
  7602. "../enum/Viewmode": 51,
  7603. "../enum/WarpStyle": 52,
  7604. "../enum/ZoomEvents": 53,
  7605. "../lib/dat.gui": 93,
  7606. "../localization/localize": 108,
  7607. "../tag/Media/MediaEvent": 131,
  7608. "../objects/Snapshot": 153,
  7609. "../settings": 166,
  7610. "../util/ajax": 181,
  7611. "../util/browser": 182,
  7612. "../util/camera": 183,
  7613. "../util/logger": 189,
  7614. "../util/showcase": 193,
  7615. "../util/transitions": 195,
  7616. "./closer/ModalCloserEvent": 61,
  7617. "./closer/modalCloser": 62,
  7618. "./help/HelpEvent": 66,
  7619. "./help/help": 67,
  7620. "./helpManager": 68,
  7621. "./immersiveMode": 69,
  7622. "./konami": 70,
  7623. "./landingScreen": 71,
  7624. "./loadingScreen": 72,
  7625. "./memoryUsage": 73,
  7626. "./playButton": 74,
  7627. "./populateModal": 75,
  7628. "./sharing/ShareEvents": 76,
  7629. "./sharing/modal": 77,
  7630. "./terms/TermsEvent": 78,
  7631. "./terms/terms": 79,
  7632. "./title/TitleEvents": 80,
  7633. "./title/tagToggle": 81,
  7634. "./title/titleBar": 82,
  7635. "./tourInteraction": 84,
  7636. "./vr/vrEvent": 85,
  7637. "./vr/vrModal": 87,
  7638. "./webvr/WebVrEvent": 88,
  7639. "./webvr/webVRgui": 89,
  7640. three: 217
  7641. }],
  7642. 66: [function(e, t, i) {
  7643. "use strict";
  7644. t.exports = Object.freeze({
  7645. OPENED: "help.opened",
  7646. CLOSED: "help.closed"
  7647. })
  7648. }
  7649. , {}],
  7650. 67: [function(e, t, i) {
  7651. "use strict";
  7652. function n() {
  7653. g.on("click", function(e) {
  7654. if (S && S !== l.TRANSITIONING) {
  7655. var t = window.getComputedStyle(y).getPropertyValue("opacity") > 0;
  7656. t && !M ? R.close() : r()
  7657. }
  7658. }),
  7659. w.on("click", function(e) {
  7660. R.close()
  7661. }),
  7662. E.on("click", function(e) {
  7663. S && S !== l.TRANSITIONING && (s(),
  7664. o())
  7665. }),
  7666. b.on("click", function(e) {
  7667. s(),
  7668. a()
  7669. })
  7670. }
  7671. function r() {
  7672. S && S !== l.TRANSITIONING && (M = !0,
  7673. setTimeout(function() {
  7674. M = !1
  7675. }, d.help.modalStayDuration),
  7676. R.emit(h.OPENED),
  7677. m.addClass("open " + S),
  7678. g.addClass("open"),
  7679. s(),
  7680. o(),
  7681. y.style.removeProperty ? y.style.removeProperty("display") : y.style.removeAttribute("display"),
  7682. y.classList.add("fadeIn"))
  7683. }
  7684. function o() {
  7685. E.addClass("underline-tab"),
  7686. u.fill(_, c.NAVIGATION, S),
  7687. m.addClass(S)
  7688. }
  7689. function a() {
  7690. b.addClass("underline-tab"),
  7691. u.fill(T, c.MORE_HELP),
  7692. m.addClass("more-help")
  7693. }
  7694. function s(e, t) {
  7695. m.removeClass("more-help " + l.PANORAMA + " " + l.DOLLHOUSE + " " + l.FLOORPLAN + " " + l.OUTDOOR),
  7696. I.forEach(function(e) {
  7697. e.classList.remove("underline-tab")
  7698. })
  7699. }
  7700. var l = e("../../enum/Viewmode")
  7701. , c = e("../../enum/HelpModalType")
  7702. , h = e("./HelpEvent")
  7703. , u = (e("../helpManager"),
  7704. e("./../populateModal"))
  7705. , d = e("../../settings")
  7706. , p = e("../../util/common")
  7707. , f = e("events").EventEmitter
  7708. , g = $(".footer-help").eq(0)
  7709. , m = $("#help-dialog").eq(0)
  7710. , v = document.querySelector("#quick-logo")
  7711. , A = document.querySelector("#loaderCoBrand")
  7712. , y = document.querySelector("#help-dialog")
  7713. , C = document.querySelector(".footer")
  7714. , I = $(".help-tabs").children().toArray()
  7715. , E = $(".navigation-tab").eq(0)
  7716. , b = $(".more-help-tab").eq(0)
  7717. , w = ($("#interaction-modal").eq(0).find(".interaction").toArray(),
  7718. m.find(".close").eq(0))
  7719. , _ = m.find(".interactions").toArray()
  7720. , T = m.find(".ui-instructions").toArray()
  7721. , x = l.PANORAMA
  7722. , S = l.PANORAMA
  7723. , M = !1
  7724. , R = {
  7725. init: function(e, t) {
  7726. S = t,
  7727. x = t,
  7728. [y, A, v, C].forEach(function(e) {
  7729. e.classList.add(u.deviceType)
  7730. }),
  7731. n()
  7732. },
  7733. close: function() {
  7734. if (m.hasClass("open") && (this.emit(h.CLOSED),
  7735. g.removeClass("open"),
  7736. m.removeClass("open"),
  7737. y.classList.contains("fadeIn"))) {
  7738. y.classList.remove("fadeIn");
  7739. var e = S === l.TRANSITIONING ? x : S;
  7740. u.clear(_, c.NAVIGATION, e)
  7741. }
  7742. },
  7743. updateMode: function(e) {
  7744. x = S,
  7745. S = e
  7746. }
  7747. };
  7748. p.extendObject(R, f.prototype),
  7749. t.exports = R
  7750. }
  7751. , {
  7752. "../../enum/HelpModalType": 28,
  7753. "../../enum/Viewmode": 51,
  7754. "../../settings": 166,
  7755. "../../util/common": 185,
  7756. "../helpManager": 68,
  7757. "./../populateModal": 75,
  7758. "./HelpEvent": 66,
  7759. events: 202
  7760. }],
  7761. 68: [function(e, t, i) {
  7762. (function(i) {
  7763. "use strict";
  7764. var n = e("../util/browser")
  7765. , r = e("./../util/logger")
  7766. , o = e("./../settings")
  7767. , a = new r(i)
  7768. , s = function() {
  7769. var e;
  7770. try {
  7771. return e = window.localStorage.getItem("visitCount") || "0",
  7772. e = (parseFloat(e) + 1).toString(),
  7773. window.localStorage.setItem("visitCount", e),
  7774. a.debug("visitCount = " + e),
  7775. e
  7776. } catch (t) {
  7777. e = "1",
  7778. a.debug("couldn't set local storage")
  7779. }
  7780. }()
  7781. , l = !1;
  7782. t.exports = {
  7783. isHelpDisabled: function() {
  7784. return "0" === n.valueFromHash("help", null) || l
  7785. },
  7786. isLargeHelpEnabled: function() {
  7787. return ("1" === s || "1" === n.valueFromHash("help", null)) && !this.isHelpDisabled()
  7788. },
  7789. isSmallHelpEnabled: function() {
  7790. return "2" === n.valueFromHash("help", null) && !this.isHelpDisabled()
  7791. },
  7792. isHelpEnabled: function() {
  7793. return this.isLargeHelpEnabled() || this.isSmallHelpEnabled()
  7794. },
  7795. setAutoPlay: function(e) {
  7796. l = o.warp.auto >= 0 && e > 1
  7797. }
  7798. }
  7799. }
  7800. ).call(this, "/js/gui/helpManager.js")
  7801. }
  7802. , {
  7803. "../util/browser": 182,
  7804. "./../settings": 166,
  7805. "./../util/logger": 189
  7806. }],
  7807. 69: [function(e, t, i) {
  7808. "use strict";
  7809. function n(e, t, i, n) {
  7810. F = n,
  7811. r(e, t, i, F),
  7812. o(),
  7813. N = t.mode
  7814. }
  7815. function r(e, t, i, n) {
  7816. [C.PANORAMA, C.DOLLHOUSE, C.FLOORPLAN].forEach(function(t) {
  7817. e.controls[t].on(v.Move, a),
  7818. e.controls[t].on(v.LongTap, c)
  7819. }),
  7820. M.on("mousewheel DOMMouseScroll", a),
  7821. i.on(m.TagActivated, a),
  7822. i.on(m.TagNavigation, a),
  7823. t.on(A.FlyingEnded, s),
  7824. t.on(A.ModeChanging, function(e, t) {
  7825. B = t !== C.PANORAMA && e !== C.PANORAMA
  7826. }),
  7827. t.on(A.ModeChanged, function(e, i) {
  7828. N = t.mode,
  7829. i !== C.TRANSITIONING ? l() : a("modeChange")
  7830. }),
  7831. n.on(y.TourStart, function() {
  7832. L = !0,
  7833. a()
  7834. }),
  7835. n.on(y.TourEnd, function() {
  7836. L = !1,
  7837. l()
  7838. }),
  7839. n.on(y.ActionInterrupted, function() {
  7840. L = !1
  7841. }),
  7842. R.addEventListener("touchend", function() {
  7843. $("#pullTab").hasClass("opened") && !L && l()
  7844. }, !0)
  7845. }
  7846. function o() {
  7847. p.isMobile() ? (b.forEach(function(e) {
  7848. e.classList.add("mobile")
  7849. }),
  7850. w.click(l)) : (b.forEach(function(e) {
  7851. e.addEventListener("mouseleave", function() {
  7852. !M.is(":hover") && b[0].classList.contains("detectHover") && l()
  7853. }, !0)
  7854. }),
  7855. M.mouseleave(function() {
  7856. b[0].classList.contains("detectHover") && l()
  7857. }))
  7858. }
  7859. function a(e) {
  7860. D || d(e) && _.hasClass("playing") || (clearTimeout(O),
  7861. P = !0,
  7862. g.close(),
  7863. h(e),
  7864. N !== C.DOLLHOUSE && N !== C.FLOORPLAN && (x.hasClass("expand") && !S.hasClass("closed") || 2 === p.valueFromHash("title", 1) ,
  7865. _.hasClass("playing") || (b.forEach(function(e) {
  7866. e.classList.add("detectHover")
  7867. }),
  7868. O = setTimeout(l, f.immersive.timeToShowAgain))))
  7869. }
  7870. function s() {
  7871. _.hasClass("playing") || (clearTimeout(O),
  7872. O = setTimeout(l, f.immersive.timeToShowAgain))
  7873. }
  7874. function l() {
  7875. clearTimeout(O),
  7876. P = !1,
  7877. I.forEach(function(e) {
  7878. e.classList.remove("drawerOpen")
  7879. }),
  7880. L || E.forEach(function(e) {
  7881. e.classList.remove("duringTour")
  7882. }),
  7883. b.forEach(function(e) {
  7884. e.classList.remove("detectHover")
  7885. })
  7886. }
  7887. function c() {
  7888. P ? l() : a(),
  7889. D = !0,
  7890. setTimeout(function() {
  7891. D = !1
  7892. }, f.immersive.uiStayDuration)
  7893. }
  7894. function h(e) {
  7895. !d(e) && L ? E.forEach(function(e) {
  7896. e.classList.remove("drawerOpen"),
  7897. e.classList.add("duringTour")
  7898. }) : _.hasClass("open") ? E.forEach(function(e) {
  7899. e.classList.remove("duringTour"),
  7900. e.classList.add("drawerOpen")
  7901. }) : B || N === C.FLOORPLAN || N === C.DOLLHOUSE || E.forEach(function(e) {
  7902. e.classList.add("fadeOut")
  7903. })
  7904. }
  7905. function u() {
  7906. T.hasClass("duringTour") || (L = !1,
  7907. a("gui"),
  7908. l())
  7909. }
  7910. function d(e) {
  7911. return "mouse" === e || "touch" === e || "key" === e || "gui" === e
  7912. }
  7913. var p = e("../util/browser")
  7914. , f = e("../settings")
  7915. , g = e("./help/help")
  7916. , m = e("../enum/tagEvents")
  7917. , v = e("../enum/ControlEvents")
  7918. , A = e("../enum/PlayerEvents")
  7919. , y = e("../enum/DirectorEvents")
  7920. , A = e("../enum/PlayerEvents")
  7921. , C = e("../enum/Viewmode")
  7922. , I = $(".pinTop.left, .pinBottom-container, #drawer-container, #drawer, .footer").toArray()
  7923. , E = $(".pinBottom-container, #drawer-container, .footer").toArray()
  7924. , b = $("#hover-bottom, #hover-top").toArray()
  7925. , w = ($("#pullTab").eq(0),
  7926. $("#playHead").eq(0),
  7927. $(".pinBottom-container").eq(0))
  7928. , _ = $("#drawer").eq(0)
  7929. , T = $("#drawer-container").eq(0)
  7930. , x = $("#meta-info").eq(0)
  7931. , S = $(".pinTop.left").eq(0)
  7932. , M = $("#player").eq(0)
  7933. , R = document.getElementById("pullTab")
  7934. , P = !1
  7935. , O = null
  7936. , L = !1
  7937. , D = !1
  7938. , N = null
  7939. , B = !1
  7940. , F = null;
  7941. t.exports.init = n,
  7942. t.exports.hideUi = a,
  7943. t.exports.resetDrawer = u
  7944. }
  7945. , {
  7946. "../enum/ControlEvents": 21,
  7947. "../enum/DirectorEvents": 23,
  7948. "../enum/tagEvents": 32,
  7949. "../enum/PlayerEvents": 40,
  7950. "../enum/Viewmode": 51,
  7951. "../settings": 166,
  7952. "../util/browser": 182,
  7953. "./help/help": 67
  7954. }],
  7955. 70: [function(e, t, i) {
  7956. (function(i) {
  7957. "use strict";
  7958. function n(e, t, i) {
  7959. l.debug("konami has the modelInstance");
  7960. var n = [];
  7961. $(window).on("keydown", function(e) {
  7962. n.push(e.which),
  7963. n.length > o.secretPanelWord.length && n.shift(),
  7964. s.equalLists(n, o.secretPanelWord) && (l.debug("Developer mode active."),
  7965. o.debug = !0)
  7966. }),
  7967. $(window).on("keydown", function n(r) {
  7968. o.debug && 72 === r.which && (e && i ? (a.toggle(e, t, i),
  7969. $(window).off("keydown", n)) : console.warn("sorry we're not ready yet"))
  7970. })
  7971. }
  7972. var r = e("./../util/logger")
  7973. , o = e("./../settings")
  7974. , a = e("./debug")
  7975. , s = e("./../util/common")
  7976. , l = (e("./gui"),
  7977. new r(i));
  7978. o.console && $("body").append('<div id="debug-console"></div>'),
  7979. t.exports.init = n
  7980. }
  7981. ).call(this, "/js/gui/konami.js")
  7982. }
  7983. , {
  7984. "./../settings": 166,
  7985. "./../util/common": 185,
  7986. "./../util/logger": 189,
  7987. "./debug": 63,
  7988. "./gui": 65
  7989. }],
  7990. 71: [function(e, t, i) {
  7991. "use strict";
  7992. function n(e, t) {
  7993. E = t.mode === p.PANORAMA && t.pano && !t.pano.isAligned() ? p.OUTDOOR : t.mode
  7994. }
  7995. function r(e) {
  7996. var t = $.Deferred();
  7997. e || t.resolve();
  7998. var i = c.startupFlyinDelay;
  7999. return e === p.PANORAMA && (i += c.dollhouse.transitionTime),
  8000. setTimeout(t.resolve.bind(t), i),
  8001. t
  8002. }
  8003. function o(e, t, i) {
  8004. var n = 0;
  8005. c.quickstart.enabled && (a(i),
  8006. n = c.quickstart.showTextDelay + c.quickstart.fadeOutDelay);
  8007. var r = function() {
  8008. e.once(g.Move, l),
  8009. t.once(f.TourStart, l)
  8010. };
  8011. s(n, r)
  8012. }
  8013. function a(e) {
  8014. return /* e && (y.addClass("quick-brand"), //quick-brand样式有问题 会遮住屏幕
  8015. v.before(y),
  8016. A = $(".quick-brand").toArray()),*/
  8017. m.addClass("fadeOut"),
  8018. setTimeout(function() {
  8019. A.forEach(function(e) {
  8020. e.classList.add("fadeIn")
  8021. })
  8022. }, c.quickstart.showTextDelay),
  8023. setTimeout(function() {
  8024. A.forEach(function(e) {
  8025. e.classList.add("fadeOut")
  8026. })
  8027. }, c.quickstart.fadeOutDelay),
  8028. !0
  8029. }
  8030. function s(e, t) {
  8031. setTimeout(function() {
  8032. if (h.isHelpEnabled()) {
  8033. if (t(),
  8034. u.init(),
  8035. C.addClass("fadeIn landing " + u.deviceType),
  8036. h.isSmallHelpEnabled())
  8037. return void C.addClass("small");
  8038. u.fill(I, d.LANDING[E]),
  8039. C.addClass(E)
  8040. }
  8041. }, e)
  8042. //csz 用户引导界面
  8043. var helpData = {
  8044. "pc":["images/pc_step1.png","images/pc_step2.png","images/pc_step3.png"],
  8045. "mobile":["images/phone_step1.png","images/phone_step2.png","images/phone_step3.png"]
  8046. }
  8047. var navIcon = $(".nav-icon .icon");
  8048. if(/Android|webOS|iPhone|iPod|BlackBerry/i.test(navigator.userAgent)) navIcon.attr("src",helpData.mobile[0]);
  8049. function paging(id){
  8050. id.on("click",function(){
  8051. var navPage = null;
  8052. $(this).attr("data-id") == "plus" ? navPage = +navIcon.attr("data-page")+1 : navPage = +navIcon.attr("data-page")-1;
  8053. if(navPage > helpData.length || navPage < 1) return false
  8054. if(/Android|webOS|iPhone|iPod|BlackBerry/i.test(navigator.userAgent)){
  8055. navIcon.attr({"data-page":navPage,"src":helpData.mobile[navPage - 1]});
  8056. }else{
  8057. navIcon.attr({"data-page":navPage,"src":helpData.pc[navPage - 1]});
  8058. }
  8059. })
  8060. };
  8061. paging($(".next-button"));
  8062. paging($(".prev-button"));
  8063. }
  8064. function l() {
  8065. u.clear(I, d.LANDING[E]),
  8066. C.removeClass("fadeIn")
  8067. }
  8068. var c = e("../settings")
  8069. , h = (e("./help/help"),
  8070. e("./helpManager"))
  8071. , u = e("./populateModal")
  8072. , d = e("../enum/HelpModalType")
  8073. , p = e("../enum/Viewmode")
  8074. , f = e("../enum/DirectorEvents")
  8075. , g = e("../enum/PlayerEvents")
  8076. , m = $("#quick-blackout").eq(0)
  8077. , v = $("#quick-logo").eq(0)
  8078. , A = $(".quick-brand").toArray()
  8079. , y = $("#loaderCoBrand").eq(0)
  8080. , C = $("#interaction-modal").eq(0)
  8081. , I = C.find(".interaction").toArray()
  8082. , E = ($("#model-title, .pinBottom-container, #drawer-container, #drawer, .footer").toArray(),
  8083. "");
  8084. t.exports.delayLanding = r,
  8085. t.exports.showMessage = o,
  8086. t.exports.init = n,
  8087. t.exports.dismissModal = l
  8088. }
  8089. , {
  8090. "../enum/DirectorEvents": 23,
  8091. "../enum/HelpModalType": 28,
  8092. "../enum/PlayerEvents": 40,
  8093. "../enum/Viewmode": 51,
  8094. "../settings": 166,
  8095. "./help/help": 67,
  8096. "./helpManager": 68,
  8097. "./populateModal": 75
  8098. }],
  8099. 72: [function(e, t, i) {
  8100. "use strict";
  8101. var n = e("./circleLoader").circleLoader;
  8102. t.exports = {
  8103. element: $("#gui-loading"),
  8104. hide: function(e) {
  8105. n.done(),
  8106. this.element.fadeOut(1500, e)
  8107. },
  8108. show: function(e) {
  8109. this.element.fadeIn(500, function() {
  8110. this.element.css("display", "table"),
  8111. e && e()
  8112. }
  8113. .bind(this))
  8114. },
  8115. progress: function(e) {
  8116. n.set(e)
  8117. }
  8118. }
  8119. }
  8120. , {
  8121. "./circleLoader": 60
  8122. }],
  8123. 73: [function(e, t, i) {
  8124. "use strict";
  8125. var n = e("../settings")
  8126. , r = $("#memory-info")
  8127. , o = r.find("#memory-gpu")
  8128. , a = !1;
  8129. t.exports = {
  8130. show: function() {
  8131. n.profiling.enabled && (r.show(),
  8132. a = !0)
  8133. },
  8134. hide: function() {
  8135. r.hide(),
  8136. a = !1
  8137. },
  8138. toggle: function() {
  8139. a ? this.hide() : this.show()
  8140. },
  8141. update: function(e) {
  8142. n.profiling.enabled && o.text(Math.floor(e / 1e6) + "MB")
  8143. }
  8144. }
  8145. }
  8146. , {
  8147. "../settings": 166
  8148. }],
  8149. 74: [function(e, t, i) {
  8150. "use strict";
  8151. var n = e("../util/browser")
  8152. , r = e("../analytics");
  8153. e("../settings");
  8154. t.exports = {
  8155. show: function(e, t) {
  8156. $("#gui-message").fadeOut(500, function() {
  8157. t()
  8158. })
  8159. }
  8160. }
  8161. }
  8162. , {
  8163. "../analytics": 4,
  8164. "../settings": 166,
  8165. "../util/browser": 182
  8166. }],
  8167. 75: [function(e, t, i) {
  8168. "use strict";
  8169. function n(e, t, i, n) {
  8170. function r(e) {
  8171. return e.classList.contains(a)
  8172. }
  8173. var o = i ? this.assets[t][i][this.deviceType] : this.assets[t][this.deviceType];
  8174. //for (var a in o) {
  8175. //var s = e.find(r);
  8176. //for (var l in o[a]) {
  8177. //var c = o[a][l];
  8178. //if ("top-info" === l || "bottom-info" === l) {
  8179. //var h = n ? c : "";
  8180. //czj 注释掉第一次打开的用户引导
  8181. //s.querySelector("." + l).textContent = h
  8182. //} else {
  8183. //var u = n ? c : "";
  8184. //, d = s.querySelector("." + l);
  8185. //d.src = u,
  8186. //n ? d.classList.remove("hidden") : d.classList.add("hidden")
  8187. //}
  8188. //}
  8189. //}
  8190. //var p = Array.prototype.slice.call(e[0].parentElement.querySelectorAll("hr"));
  8191. // p.forEach(function(e) {
  8192. // n ? e.classList.remove("hidden") : e.classList.add("hidden")
  8193. // })
  8194. }
  8195. var r = e("../util/browser")
  8196. , o = e("../localization/localize")
  8197. , a = e("../enum/HelpModalType")
  8198. , s = (e("../enum/HelpModalSize"),
  8199. e("../enum/Viewmode"));
  8200. t.exports = {
  8201. init: function() {
  8202. if (!this.hasInitialized) {
  8203. this.hasInitialized = !0,
  8204. this.deviceType = r.isMobile() ? "mobile" : "desktop",
  8205. this.assets = {},
  8206. this.assets[a.LANDING[s.PANORAMA]] = {
  8207. desktop: {
  8208. left: {
  8209. "top-info": o.ROTATE,
  8210. "big-image": "images/nav_help_mouse_drag_left.png",
  8211. keyboard: "images/nav_help_keyboard_left_right.png"
  8212. },
  8213. middle: {
  8214. "top-info": o.MOVE,
  8215. "big-image": "images/nav_help_mouse_click.png",
  8216. keyboard: "images/nav_help_keyboard_up_down.png"
  8217. },
  8218. right: {
  8219. "top-info": o.ZOOM,
  8220. "big-image": "images/nav_help_mouse_zoom.png",
  8221. keyboard: "images/nav_help_zoom_keys.png"
  8222. }
  8223. },
  8224. mobile: {
  8225. left: {
  8226. "top-info": o.ROTATE,
  8227. "big-image": "images/nav_help_gesture_drag.png"
  8228. },
  8229. middle: {
  8230. "top-info": o.MOVE,
  8231. "big-image": "images/nav_help_gesture_tap.png"
  8232. },
  8233. right: {
  8234. "top-info": o.ZOOM,
  8235. "big-image": "images/nav_help_gesture_pinch.png"
  8236. }
  8237. }
  8238. },
  8239. this.assets[a.LANDING[s.OUTDOOR]] = JSON.parse(JSON.stringify(this.assets[a.LANDING[s.PANORAMA]])),
  8240. this.assets[a.LANDING[s.DOLLHOUSE]] = {
  8241. desktop: {
  8242. left: {
  8243. "top-info": o.ROTATE,
  8244. "big-image": "images/nav_help_mouse_drag_left.png",
  8245. keyboard: "images/nav_help_keyboard_left_right.png"
  8246. },
  8247. middle: {
  8248. "top-info": o.MOVE,
  8249. "big-image": "images/nav_help_mouse_position_right.png"
  8250. }
  8251. },
  8252. mobile: {
  8253. left: {
  8254. "top-info": o.ROTATE,
  8255. "big-image": "images/nav_help_gesture_drag.png"
  8256. },
  8257. middle: {
  8258. "top-info": o.MOVE,
  8259. "big-image": "images/nav_help_gesture_position_two_finger.png"
  8260. }
  8261. }
  8262. },
  8263. this.assets[a.LANDING[s.FLOORPLAN]] = {
  8264. desktop: {
  8265. left: {
  8266. "top-info": o.MOVE,
  8267. "big-image": "images/nav_help_mouse_position_left.png"
  8268. },
  8269. middle: {
  8270. "top-info": o.ROTATE,
  8271. "big-image": "images/nav_help_mouse_drag_right.png",
  8272. keyboard: "images/nav_help_keyboard_left_right.png"
  8273. }
  8274. },
  8275. mobile: {
  8276. left: {
  8277. "top-info": o.MOVE,
  8278. "big-image": "images/nav_help_gesture_position.png"
  8279. },
  8280. middle: {
  8281. "top-info": o.ROTATE,
  8282. "big-image": "images/nav_help_gesture_drag_two_finger.png"
  8283. }
  8284. }
  8285. };
  8286. var e = {
  8287. "top-info": o.INSIDE,
  8288. "big-image": "images/nav_help_click_inside.png",
  8289. keyboard: "images/nav_help_inside_key.png"
  8290. };
  8291. this.assets[a.LANDING[s.OUTDOOR]].desktop.middle = e,
  8292. this.assets[a.LANDING[s.DOLLHOUSE]].desktop.right = e,
  8293. this.assets[a.LANDING[s.FLOORPLAN]].desktop.right = e;
  8294. var t = {
  8295. "top-info": o.INSIDE,
  8296. "big-image": "images/nav_help_tap_inside.png"
  8297. };
  8298. this.assets[a.LANDING[s.OUTDOOR]].mobile.middle = t,
  8299. this.assets[a.LANDING[s.DOLLHOUSE]].mobile.right = t,
  8300. this.assets[a.LANDING[s.FLOORPLAN]].mobile.right = t,
  8301. this.assets[a.NAVIGATION] = {},
  8302. this.assets[a.NAVIGATION][s.PANORAMA] = {
  8303. desktop: {
  8304. left: {
  8305. "top-info": o.HELP_DESKTOP_PANORAMA_1A,
  8306. "bottom-info": o.HELP_DESKTOP_PANORAMA_1B,
  8307. "big-image": "images/nav_help_mouse_drag_left.png",
  8308. keyboard: "images/nav_help_keyboard_left_right.png"
  8309. },
  8310. middle: {
  8311. "top-info": o.HELP_DESKTOP_PANORAMA_2A,
  8312. "bottom-info": o.HELP_DESKTOP_PANORAMA_2B,
  8313. "big-image": "images/nav_help_mouse_click.png",
  8314. keyboard: "images/nav_help_keyboard_up_down.png"
  8315. },
  8316. right: {
  8317. "top-info": o.HELP_DESKTOP_PANORAMA_3A,
  8318. "bottom-info": o.HELP_DESKTOP_PANORAMA_3B,
  8319. "big-image": "images/nav_help_mouse_zoom.png",
  8320. keyboard: "images/nav_help_zoom_keys.png"
  8321. }
  8322. },
  8323. mobile: {
  8324. left: {
  8325. "top-info": o.HELP_MOBILE_PANORAMA_1,
  8326. "big-image": "images/nav_help_gesture_drag.png"
  8327. },
  8328. middle: {
  8329. "top-info": o.HELP_MOBILE_PANORAMA_2,
  8330. "big-image": "images/nav_help_gesture_tap.png"
  8331. },
  8332. right: {
  8333. "top-info": o.HELP_MOBILE_3,
  8334. "big-image": "images/nav_help_gesture_pinch.png"
  8335. }
  8336. }
  8337. },
  8338. this.assets[a.NAVIGATION][s.DOLLHOUSE] = {
  8339. desktop: {
  8340. left: {
  8341. "top-info": o.HELP_DESKTOP_DOLLHOUSE_1A,
  8342. "bottom-info": o.HELP_DESKTOP_DOLLHOUSE_1B,
  8343. "big-image": "images/nav_help_mouse_drag_left.png",
  8344. keyboard: "images/nav_help_keyboard_all.png"
  8345. },
  8346. middle: {
  8347. "top-info": o.HELP_DESKTOP_DOLLHOUSE_2A,
  8348. "big-image": "images/nav_help_mouse_position_right.png"
  8349. },
  8350. right: {
  8351. "top-info": o.HELP_DESKTOP_DOLLHOUSE_3A,
  8352. "big-image": "images/nav_help_mouse_zoom.png"
  8353. }
  8354. },
  8355. mobile: {
  8356. left: {
  8357. "top-info": o.HELP_MOBILE_DOLLHOUSE_1,
  8358. "big-image": "images/nav_help_gesture_drag.png"
  8359. },
  8360. middle: {
  8361. "top-info": o.HELP_MOBILE_DOLLHOUSE_2,
  8362. "big-image": "images/nav_help_gesture_position_two_finger.png"
  8363. },
  8364. right: {
  8365. "top-info": o.HELP_MOBILE_3,
  8366. "big-image": "images/nav_help_gesture_pinch.png"
  8367. }
  8368. }
  8369. },
  8370. this.assets[a.NAVIGATION][s.FLOORPLAN] = {
  8371. desktop: {
  8372. left: {
  8373. "top-info": o.HELP_DESKTOP_FLOORPLAN_1A,
  8374. "big-image": "images/nav_help_mouse_position_left.png"
  8375. },
  8376. middle: {
  8377. "top-info": o.HELP_DESKTOP_FLOORPLAN_2A,
  8378. "bottom-info": o.HELP_DESKTOP_FLOORPLAN_2B,
  8379. "big-image": "images/nav_help_mouse_drag_right.png",
  8380. keyboard: "images/nav_help_keyboard_left_right.png"
  8381. },
  8382. right: {
  8383. "top-info": o.HELP_DESKTOP_FLOORPLAN_3A,
  8384. "bottom-info": o.HELP_DESKTOP_FLOORPLAN_3B,
  8385. "big-image": "images/nav_help_mouse_zoom.png",
  8386. keyboard: "images/nav_help_keyboard_up_down.png"
  8387. }
  8388. },
  8389. mobile: {
  8390. left: {
  8391. "top-info": o.HELP_MOBILE_FLOORPLAN_1,
  8392. "big-image": "images/nav_help_gesture_position.png"
  8393. },
  8394. middle: {
  8395. "top-info": o.HELP_MOBILE_FLOORPLAN_2,
  8396. "big-image": "images/nav_help_gesture_drag_two_finger.png"
  8397. },
  8398. right: {
  8399. "top-info": o.HELP_MOBILE_3,
  8400. "big-image": "images/nav_help_gesture_pinch.png"
  8401. }
  8402. }
  8403. },
  8404. this.assets[a.NAVIGATION][s.OUTDOOR] = JSON.parse(JSON.stringify(this.assets[a.NAVIGATION][s.PANORAMA])),
  8405. this.assets[a.NAVIGATION][s.OUTDOOR].desktop.middle = {
  8406. "top-info": o.HELP_DESKTOP_360_2A,
  8407. "bottom-info": o.HELP_DESKTOP_360_2B,
  8408. "big-image": "images/nav_help_click_inside.png",
  8409. keyboard: "images/nav_help_inside_key.png"
  8410. },
  8411. this.assets[a.NAVIGATION][s.OUTDOOR].mobile.middle = {
  8412. "top-info": o.HELP_MOBILE_360_2,
  8413. "big-image": "images/nav_help_tap_inside.png"
  8414. },
  8415. this.assets[a.MORE_HELP] = {
  8416. desktop: {
  8417. "more-help-hlr": {
  8418. "top-info": o.HELP_MORE_HLR_A,
  8419. "big-image": "images/nav_help_expand.svg",
  8420. "bottom-info": o.HELP_DESKTOP_MORE_HLR_B
  8421. },
  8422. "more-help-dollhouse": {
  8423. "top-info": o.HELP_MORE_DOLLHOUSE_A,
  8424. "big-image": "images/nav_help_dollhouse.svg",
  8425. "bottom-info": o.HELP_DESKTOP_MORE_DOLLHOUSE_B
  8426. },
  8427. "more-help-floors": {
  8428. "top-info": o.HELP_MORE_FLOORS_A,
  8429. "big-image": "images/nav_help_floor picker.svg",
  8430. "bottom-info": o.HELP_DESKTOP_MORE_FLOORS_B
  8431. },
  8432. "more-help-tag": {
  8433. "top-info": o.HELP_MORE_TAG_A,
  8434. "big-image": "images/nav_help_tag.svg",
  8435. "bottom-info": o.HELP_DESKTOP_MORE_TAG_B
  8436. },
  8437. "more-help-zoom": {
  8438. "top-info": o.HELP_MORE_ZOOM_A,
  8439. "big-image": "images/nav_help_zoom.svg",
  8440. "bottom-info": o.HELP_DESKTOP_MORE_ZOOM_B
  8441. },
  8442. "more-help-tour": {
  8443. "top-info": o.HELP_MORE_TOUR_A,
  8444. "big-image": "images/nav_help_play.png",
  8445. "bottom-info": o.HELP_DESKTOP_MORE_TOUR_B
  8446. },
  8447. "more-help-inside": {
  8448. "top-info": o.HELP_MORE_INSIDE_A,
  8449. "big-image": "images/nav_help_inside.svg",
  8450. "bottom-info": o.HELP_DESKTOP_MORE_INSIDE_B
  8451. },
  8452. "more-help-vr": {
  8453. "top-info": o.HELP_MORE_VR_A,
  8454. "big-image": "images/nav_help_vr.svg",
  8455. "bottom-info": o.HELP_DESKTOP_MORE_VR_B
  8456. },
  8457. "more-help-360": {
  8458. "top-info": o.HELP_MORE_360_A,
  8459. "big-image": "images/nav_help_360.svg",
  8460. "bottom-info": o.HELP_DESKTOP_MORE_360_B
  8461. },
  8462. "more-help-fullscreen": {
  8463. "top-info": o.HELP_MORE_FULLSCREEN_A,
  8464. "big-image": "images/nav_help_fullscreen.svg",
  8465. "bottom-info": o.HELP_DESKTOP_MORE_FULLSCREEN_B
  8466. }
  8467. },
  8468. mobile: {
  8469. "more-help-hlr": {
  8470. "top-info": o.HELP_MORE_HLR_A,
  8471. "big-image": "images/nav_help_expand.svg",
  8472. "bottom-info": o.HELP_DESKTOP_MORE_HLR_B
  8473. },
  8474. "more-help-dollhouse": {
  8475. "top-info": o.HELP_MORE_DOLLHOUSE_A,
  8476. "big-image": "images/nav_help_dollhouse.svg",
  8477. "bottom-info": o.HELP_MOBILE_MORE_DOLLHOUSE_B
  8478. },
  8479. "more-help-floors": {
  8480. "top-info": o.HELP_MORE_FLOORS_A,
  8481. "big-image": "images/nav_help_floor picker.svg",
  8482. "bottom-info": o.HELP_DESKTOP_MORE_FLOORS_B
  8483. },
  8484. "more-help-tag": {
  8485. "top-info": o.HELP_MORE_TAG_A,
  8486. "big-image": "images/nav_help_tag.svg",
  8487. "bottom-info": o.HELP_MOBILE_MORE_TAG_B
  8488. },
  8489. "more-help-tour": {
  8490. "top-info": o.HELP_MORE_TOUR_A,
  8491. "big-image": "images/nav_help_play.png",
  8492. "bottom-info": o.HELP_DESKTOP_MORE_TOUR_B
  8493. },
  8494. "more-help-inside": {
  8495. "top-info": o.HELP_MORE_INSIDE_A,
  8496. "big-image": "images/nav_help_inside.svg",
  8497. "bottom-info": o.HELP_MOBILE_MORE_INSIDE_B
  8498. },
  8499. "more-help-vr": {
  8500. "top-info": o.HELP_MORE_VR_A,
  8501. "big-image": "images/webvr.svg",
  8502. "bottom-info": o.HELP_MOBILE_MORE_VR_B
  8503. },
  8504. "more-help-360": {
  8505. "top-info": o.HELP_MORE_360_A,
  8506. "big-image": "images/nav_help_360.svg",
  8507. "bottom-info": o.HELP_MOBILE_MORE_360_B
  8508. }
  8509. }
  8510. },
  8511. this.assets[a.TOUR_INTERACTION[s.PANORAMA]] = {
  8512. desktop: {
  8513. left: {
  8514. "top-info": o.ROTATE,
  8515. "big-image": "images/nav_help_mouse_drag_left.png",
  8516. keyboard: "images/nav_help_keyboard_left_right.png"
  8517. },
  8518. middle: {
  8519. "top-info": o.MOVE,
  8520. "big-image": "images/nav_help_mouse_click.png",
  8521. keyboard: "images/nav_help_keyboard_up_down.png"
  8522. },
  8523. right: {
  8524. "top-info": o.PLAY,
  8525. "big-image": "images/Desktop-help-play-button.svg",
  8526. keyboard: "images/Desktop-help-spacebar-2.svg"
  8527. }
  8528. },
  8529. mobile: {
  8530. left: {
  8531. "top-info": o.ROTATE,
  8532. "big-image": "images/nav_help_gesture_drag.png"
  8533. },
  8534. middle: {
  8535. "top-info": o.MOVE,
  8536. "big-image": "images/nav_help_gesture_tap.png"
  8537. },
  8538. right: {
  8539. "top-info": o.PLAY,
  8540. "big-image": "images/mobile-help-play-button.svg"
  8541. }
  8542. }
  8543. },
  8544. this.assets[a.TOUR_INTERACTION[s.OUTDOOR]] = JSON.parse(JSON.stringify(this.assets[a.TOUR_INTERACTION[s.PANORAMA]])),
  8545. this.assets[a.TOUR_INTERACTION[s.OUTDOOR]].desktop.middle = this.assets[a.LANDING[s.OUTDOOR]].desktop.middle,
  8546. this.assets[a.TOUR_INTERACTION[s.OUTDOOR]].mobile.middle = this.assets[a.LANDING[s.OUTDOOR]].mobile.middle,
  8547. this.assets[a.TOUR_INTERACTION[s.FLOORPLAN]] = JSON.parse(JSON.stringify(this.assets[a.TOUR_INTERACTION[s.OUTDOOR]])),
  8548. this.assets[a.TOUR_INTERACTION[s.FLOORPLAN]].desktop.left = this.assets[a.LANDING[s.FLOORPLAN]].desktop.left,
  8549. this.assets[a.TOUR_INTERACTION[s.FLOORPLAN]].mobile.left = this.assets[a.LANDING[s.FLOORPLAN]].mobile.left
  8550. }
  8551. },
  8552. fill: function(e, t, i) {
  8553. n.call(this, e, t, i, !0)
  8554. },
  8555. clear: function(e, t, i) {
  8556. n.call(this, e, t, i, !1)
  8557. }
  8558. }
  8559. }
  8560. , {
  8561. "../enum/HelpModalSize": 27,
  8562. "../enum/HelpModalType": 28,
  8563. "../enum/Viewmode": 51,
  8564. "../localization/localize": 108,
  8565. "../util/browser": 182
  8566. }],
  8567. 76: [function(e, t, i) {
  8568. "use strict";
  8569. t.exports = Object.freeze({
  8570. OPENED: "share.open",
  8571. CLOSED: "share.closed",
  8572. LINK_CLICKED: "share.linked"
  8573. })
  8574. }
  8575. , {}],
  8576. 77: [function(e, t, i) {
  8577. "use strict";
  8578. function n(e) {
  8579. function t(t, i) {
  8580. var n = window.screenY + ($("#player").height() - i) / 2
  8581. , r = window.screenX + ($("#player").width() - t) / 2
  8582. , o = "top=" + n + ",left=" + r + ",width=" + t + ",height=" + i;
  8583. I.emit(l.LINK_CLICKED, {
  8584. channel: e
  8585. }),
  8586. window.open(C[e], "shareWindow", o)
  8587. }
  8588. switch (e) {
  8589. case y.FACEBOOK:
  8590. t(580, 420);
  8591. break;
  8592. case y.TWITTER:
  8593. t(550, 440);
  8594. break;
  8595. case y.MAIL:
  8596. I.emit(l.LINK_CLICKED, {
  8597. channel: "email"
  8598. }),
  8599. window.open(C[e], "_blank");
  8600. break;
  8601. case y.LINKEDIN:
  8602. }
  8603. }
  8604. function r(e) {
  8605. I.emit(l.LINK_CLICKED, {
  8606. channel: "copylink"
  8607. });
  8608. var t = document.createRange();
  8609. t.selectNodeContents(v);
  8610. var i = window.getSelection();
  8611. i.removeAllRanges(),
  8612. i.addRange(t),
  8613. document.execCommand("copy"),
  8614. A.classList.remove("hidden"),
  8615. v.classList.add("highlighted")
  8616. }
  8617. function o(e) {
  8618. e && (e.stopPropagation(),
  8619. e.target === v) || (window.getSelection().removeAllRanges(),
  8620. v.classList.remove("highlighted"),
  8621. A.classList.add("hidden"))
  8622. }
  8623. var a = e("../../util/browser")
  8624. , s = e("../../localization/localize")
  8625. , l = e("./ShareEvents")
  8626. , c = e("../../util/common")
  8627. , h = e("events").EventEmitter
  8628. , u = document.getElementById("sharing")
  8629. , d = document.getElementById("share-modal")
  8630. , p = document.getElementById("share-close")
  8631. , f = document.getElementById("facebook-share")
  8632. , g = document.getElementById("twitter-share")
  8633. , m = document.getElementById("mail-share")
  8634. , v = document.getElementById("share-url-text")
  8635. , A = document.getElementById("copy-success")
  8636. , y = Object.freeze({
  8637. FACEBOOK: "facebook",
  8638. TWITTER: "twitter",
  8639. MAIL: "mail",
  8640. LINKEDIN: "linkedin"
  8641. })
  8642. , C = {};
  8643. C[y.FACEBOOK] = "http://www.facebook.com/sharer.php?u=" + encodeURIComponent(window.location.href + "&utm_source=1") + "&t=",
  8644. C[y.TWITTER] = "http://twitter.com/intent/tweet?text=",
  8645. C[y.MAIL] = "mailto:?subject=";
  8646. var I = {
  8647. init: function(e) {
  8648. var t = encodeURIComponent(s.SHARE_EXPLORE + e + " " + s.SHARE_AT + " ");
  8649. C[y.FACEBOOK] += t + encodeURIComponent(window.location.href + "&utm_source=1"),
  8650. C[y.TWITTER] += t + encodeURIComponent(window.location.href + "&utm_source=2 " + s.SHARE_WITH + " #port"),
  8651. C[y.MAIL] += encodeURIComponent(s.SHARE_EXPLORE + e + s.SHARE_3D) + "&body=" + t + encodeURIComponent(window.location.href + "&utm_source=3"),
  8652. u.addEventListener("click", this.toggle.bind(this)),
  8653. p.addEventListener("click", this.hide.bind(this)),
  8654. v.addEventListener("click", r),
  8655. d.addEventListener("click", o),
  8656. f.addEventListener("click", n.bind(this, y.FACEBOOK)),
  8657. g.addEventListener("click", n.bind(this, y.TWITTER)),
  8658. m.addEventListener("click", n.bind(this, y.MAIL)),
  8659. v.textContent = window.location.href + "&utm_source=4",
  8660. d.classList.add(a.isMobile() ? "mobile" : "desktop"),
  8661. u.classList.remove("hidden")
  8662. },
  8663. show: function() {
  8664. this.emit(l.OPENED),
  8665. d.classList.add("fadeIn")
  8666. },
  8667. hide: function() {
  8668. d.classList.contains("fadeIn") && (this.emit(l.CLOSED),
  8669. document.selection && document.selection.empty(),
  8670. window.getSelection().removeAllRanges(),
  8671. o(),
  8672. d.classList.remove("fadeIn"))
  8673. },
  8674. toggle: function() {
  8675. d.classList.contains("fadeIn") ? this.hide() : this.show()
  8676. }
  8677. };
  8678. c.extendObject(I, h.prototype),
  8679. t.exports = I
  8680. }
  8681. , {
  8682. "../../localization/localize": 108,
  8683. "../../util/browser": 182,
  8684. "../../util/common": 185,
  8685. "./ShareEvents": 76,
  8686. events: 202
  8687. }],
  8688. 78: [function(e, t, i) {
  8689. "use strict";
  8690. t.exports = Object.freeze({
  8691. OPENED: "terms.opened",
  8692. CLOSED: "terms.closed"
  8693. })
  8694. }
  8695. , {}],
  8696. 79: [function(e, t, i) {
  8697. "use strict";
  8698. var n = e("./TermsEvent")
  8699. , r = e("../../localization/localize")
  8700. , o = e("../../analytics")
  8701. , a = e("../../util/ajax")
  8702. , s = e("../../util/common")
  8703. , l = e("events").EventEmitter
  8704. , c = document.getElementById("terms-modal")
  8705. , h = {
  8706. init: function() {
  8707. $(".footer-terms").on("click", function(e) {
  8708. e.preventDefault(),
  8709. this.show()
  8710. }
  8711. .bind(this)),
  8712. $("#terms-modal .close").on("click", this.hide.bind(this))
  8713. },
  8714. show: function() {
  8715. this.emit(n.OPENED),
  8716. a.get("static/" + r.TERMS_TEXT_FILE).done(function(e) {
  8717. var t = $("#terms-text").html(e);
  8718. o.track("showcase_gui", {
  8719. gui_action: "click_terms_button",
  8720. interaction_source: "gui"
  8721. }),
  8722. t.find("a").attr("target", "_blank")
  8723. }).fail(function() {
  8724. $("#terms-text").html("<h1>" + r.TERMS_OF_USE + "</h1><p>" + r.TERMS_FAIL)
  8725. }),
  8726. c.classList.add("fadeIn")
  8727. },
  8728. hide: function(e) {
  8729. e && e.preventDefault(),
  8730. c.classList.contains("fadeIn") && this.emit(n.CLOSED),
  8731. c.classList.remove("fadeIn")
  8732. }
  8733. };
  8734. s.extendObject(h, l.prototype),
  8735. t.exports = h
  8736. }
  8737. , {
  8738. "../../analytics": 4,
  8739. "../../localization/localize": 108,
  8740. "../../util/ajax": 181,
  8741. "../../util/common": 185,
  8742. "./TermsEvent": 78,
  8743. events: 202
  8744. }],
  8745. 80: [function(e, t, i) {
  8746. "use strict";
  8747. t.exports = Object.freeze({
  8748. OPEN_INFO: "title.open.info",
  8749. CLOSE_INFO: "title.close.info",
  8750. SHOW_INFO: "title.show.info",
  8751. HIDE_INFO: "title.hide.info",
  8752. LINK_CLICKED: "title.link.click",
  8753. CONTACT_LINK_CLICKED: "title.contact.click",
  8754. ORIGIN_LINK_CLICKED: "title.origin.click"
  8755. })
  8756. }
  8757. , {}],
  8758. 81: [function(e, t, i) {
  8759. "use strict";
  8760. function n(e, t) {
  8761. o.tags.enabled && 0 !== Object.keys(e.tags).length && r(e, t)
  8762. }
  8763. function r(e, t) {
  8764. function i(i) {
  8765. e.shouldShowtags = "show" === this.value,
  8766. e.shouldShowtags ? t.showAlltags(o.tags.startup.fadeInDuration) : t.hideAlltags(o.tags.startup.fadeInDuration)
  8767. }
  8768. document.getElementById("tag-toggles").classList.remove("hidden"),
  8769. document.getElementById("radio-tag-show").checked = !0;
  8770. for (var n = document.getElementById("tag-inputs").querySelectorAll("input"), r = 0; r < n.length; r++)
  8771. n[r].addEventListener("change", i)
  8772. }
  8773. var o = e("../../settings");
  8774. t.exports.init = n
  8775. }
  8776. , {
  8777. "../../settings": 166
  8778. }],
  8779. 82: [function(e, t, i) {
  8780. (function(i) {
  8781. "use strict";
  8782. function n(e, t) {
  8783. return e && u.valueFromHash("title", 1) && 2 !== u.valueFromHash("mls", 0) ? (document.getElementsByClassName("titleText")[0].innerText = e, g_weixinObj.title = e,
  8784. e.length > g.minTooltipCharacters && I.parentElement.setAttribute("data-original-title", e),
  8785. t && 1 !== m.specialEdition && m.brand && !m.mls ? document.getElementById("cobrandTitle").innerText = t : (document.getElementsByClassName("co-brand")[0].classList.add("hidden"),
  8786. document.getElementById("gui-name").classList.add("noCoBrand"),
  8787. document.getElementById("cobrandTitle").classList.add("hidden")),
  8788. !0) : (document.getElementById("model-title").classList.add("hidden"),
  8789. !1)
  8790. }
  8791. function r(e) {
  8792. return e ? (L = !0,
  8793. void (_.innerHTML = e)) : void _.classList.add("hidden")
  8794. }
  8795. function o(e, t, i, n) {
  8796. if (!e && !t && !i || !m.brand || u.valueFromHash("mls", !1))
  8797. return void T.classList.add("hidden");
  8798. L = !0;
  8799. var r = []
  8800. , o = c(r, "<br>");
  8801. if (e && o('<span id="contactName">' + e + "</span>"),
  8802. t) {
  8803. var a = n || t
  8804. , s = u.isMobile() ? '<a id="phone" href="callto:' + t + '">' + a + "</a>" : "<span>" + a + "</span>";
  8805. o(s)
  8806. }
  8807. i && o('<a id="email" href="mailTo:' + i + '">' + i + "</a>"),
  8808. r[0] = "",
  8809. x.innerHTML = r.join("")
  8810. }
  8811. function a(e) {
  8812. if ("string" == typeof e)
  8813. try {
  8814. e = JSON.parse(e)
  8815. } catch (e) {
  8816. return y.warn("Unable to parse address data"),
  8817. void S.parentElement.classList.add("hidden")
  8818. }
  8819. if (!(e && (e.address_1 || e.address_2 || e.city || e.state || e.zip)))
  8820. return void S.parentElement.classList.add("hidden");
  8821. L = !0;
  8822. var t = []
  8823. , i = c(t, " ");
  8824. e.address_1 && i(e.address_1),
  8825. e.address_2 && i(e.address_2),
  8826. e.city && i(e.city, ", "),
  8827. e.state && i(e.state, ", "),
  8828. e.zip && i(e.zip, e.state ? " " : ", "),
  8829. t[0] = "",
  8830. S.innerText = t.join("")
  8831. }
  8832. function s(e) {
  8833. var t = document.createElement("a");
  8834. return t.id = "url",
  8835. t.target = "_blank",
  8836. t.href = e,
  8837. t.innerText = e,
  8838. t.addEventListener("click", N.emit.bind(N, v.ORIGIN_LINK_CLICKED)),
  8839. t
  8840. }
  8841. function l(e) {
  8842. return !(!e || u.inIframe() && document.referrer === e) && (R.classList.remove("hidden"),
  8843. P.innerHTML = f.WEBVR_LEARN_MORE + ": ",
  8844. P.appendChild(s(e)),
  8845. O.forEach(function(e) {
  8846. e.classList.add("share-link")
  8847. }),
  8848. !0)
  8849. }
  8850. function c(e, t) {
  8851. var i = e
  8852. , n = t;
  8853. return function(e, t) {
  8854. i.push(t || n, e)
  8855. }
  8856. }
  8857. function h() {
  8858. document.getElementById("title-toggle").addEventListener("click", N.toggleTitle.bind(N)),
  8859. L && I.addEventListener("click", N.toggleMeta.bind(N, !1));
  8860. var e = [].slice.call(_.querySelectorAll("a"));
  8861. e.forEach(function(e) {
  8862. e.addEventListener("click", N.emit.bind(N, v.LINK_CLICKED))
  8863. });
  8864. var t = [].slice.call(T.querySelectorAll("a"));
  8865. t.forEach(function(e) {
  8866. e.addEventListener("click", N.emit.bind(N, v.CONTACT_LINK_CLICKED, {
  8867. contact_type: e.getAttribute("id")
  8868. }))
  8869. })
  8870. }
  8871. var u = e("../../util/browser")
  8872. , d = e("../../util/common")
  8873. , p = e("../../util/logger")
  8874. , f = e("../../localization/localize")
  8875. , g = e("./titleBarSettings")
  8876. , m = e("../../settings")
  8877. , v = e("./TitleEvents")
  8878. , A = e("events").EventEmitter
  8879. , y = new p(i)
  8880. , C = document.querySelector(".pinTop.left")
  8881. , I = document.getElementsByClassName("title-container")[0]
  8882. , E = document.getElementById("title-toggle").querySelector("i")
  8883. , b = document.getElementById("meta-info-wrapper")
  8884. , w = document.getElementById("meta-info")
  8885. , _ = document.getElementById("meta-description")
  8886. , T = document.getElementsByClassName("contact-info")[0]
  8887. , x = document.getElementById("contact-data")
  8888. , S = document.getElementById("addressTxt")
  8889. , M = document.getElementById("tag-toggles")
  8890. , R = document.getElementById("share-origin")
  8891. , P = document.getElementById("share-link-wrapper")
  8892. , O = [w, b, I]
  8893. , L = !1
  8894. , D = !1
  8895. , N = {
  8896. populate: function(e) {
  8897. if (n(window.DATA.name, e.coBrand)) {
  8898. if (r(e.description),
  8899. o(e.contactName, e.phone, e.email, e.formatted_contact_phone),
  8900. a(e.address),
  8901. L) {
  8902. var t = document.createElement("br");
  8903. M.insertBefore(t, M.firstElementChild)
  8904. }
  8905. e.socialSharing && m.share.enabled && (D = l(e.url))
  8906. }
  8907. },
  8908. finishSetup: function(e) {
  8909. L = L || !!e,
  8910. h(),
  8911. L || (D ? I.classList.add("share-only") : I.classList.add("no-meta"))
  8912. },
  8913. toggleMeta: function(e, t) {
  8914. var title = document.getElementById("model-title");
  8915. t && t.preventDefault();
  8916. var i = w.classList.contains("expand");
  8917. e && !i || (i ? (O.forEach(function(e) {
  8918. e.classList.remove("expand")
  8919. }),
  8920. this.emit(v.CLOSE_INFO),title.classList.remove("expand")) : (O.forEach(function(e) {
  8921. e.classList.add("expand");
  8922. }),
  8923. title.classList.add("expand"),
  8924. this.emit(v.OPEN_INFO)))
  8925. },
  8926. setupToggling: function() {
  8927. b.style.height = w.offsetHeight + "px",
  8928. w.addEventListener("transitionend", function() {
  8929. b.style.height = w.offsetHeight + "px"
  8930. })
  8931. },
  8932. toggleTitle: function(e) {
  8933. e && e.preventDefault(),
  8934. C.classList.contains("closed") ? (C.classList.add("open"),
  8935. E.classList.remove("icon-dpad-right"),
  8936. E.classList.add("icon-dpad-left"),
  8937. this.emit(v.SHOW_INFO),
  8938. setTimeout(function() {
  8939. C.classList.remove("closed"),
  8940. C.classList.remove("open")
  8941. }, g.removeAnimationClasses)) : (C.classList.add("closed"),
  8942. E.classList.remove("icon-dpad-left"),
  8943. E.classList.add("icon-dpad-right"),
  8944. this.emit(v.HIDE_INFO))
  8945. }
  8946. };
  8947. d.extendObject(N, A.prototype),
  8948. t.exports = N
  8949. }
  8950. ).call(this, "/js/gui/title/titleBar.js")
  8951. }
  8952. , {
  8953. "../../localization/localize": 108,
  8954. "../../settings": 166,
  8955. "../../util/browser": 182,
  8956. "../../util/common": 185,
  8957. "../../util/logger": 189,
  8958. "./TitleEvents": 80,
  8959. "./titleBarSettings": 83,
  8960. events: 202
  8961. }],
  8962. 83: [function(e, t, i) {
  8963. "use strict";
  8964. t.exports = Object.freeze({
  8965. minTooltipCharacters: 19,
  8966. removeAnimationClasses: 500
  8967. })
  8968. }
  8969. , {}],
  8970. 84: [function(e, t, i) {
  8971. "use strict";
  8972. function n(e) {
  8973. C = e,
  8974. P.forEach(function(e) {
  8975. b.addEventListener(e, u.bind(this, !1), !0),
  8976. w.addEventListener(e, u.bind(this, !0), !0),
  8977. E.addEventListener(e, stopTour2, !0)
  8978. /* S.forEach(function(t) {//会触发导览停止
  8979. t.addEventListener(e, stopTour, !0)
  8980. }) */
  8981. $("#drawer img").on(e, stopTour)
  8982. })
  8983. document.addEventListener("keydown", u.bind(this, !1), !0)
  8984. C.on(v.TourStart, function() {
  8985. E.classList.add("playing")
  8986. })
  8987. }
  8988. function play() {//r
  8989. settings.playTourNearBy ? C.playTourNearBy() : C.playTour()
  8990. I && clearTimeout(I),
  8991. d(),
  8992. _.removeClass("fadeIn")
  8993. }
  8994. function stopTour2() {//o
  8995. E.classList.contains("playing") && (C.stopTour(),
  8996. _.addClass("fadeIn"),
  8997. setTimeout(function() {
  8998. _.removeClass("fadeIn")
  8999. }, p.tourInteraction.showPauseButton),
  9000. O || (clearTimeout(I),
  9001. I = setTimeout(h, p.tourInteraction.showModal)),
  9002. setTimeout(function() {
  9003. E.classList.remove("playing")
  9004. }, p.tourInteraction.allowNextClick))
  9005. }
  9006. function stopTour() { //a
  9007. if(dontStopTourWhenClickItem) return
  9008. C.tourInProgress && (C.stopTour(), //interrupt函数也会停止
  9009. C.endTourProgress(),
  9010. E.classList.remove("playing"))
  9011. }
  9012. function togglePlay() {//s
  9013. T.is(":visible") ? play() : stopTour2()
  9014. }
  9015. function l() {
  9016. x.hasClass("playing") && (clearTimeout(I),
  9017. C.atEndOfTour() ? c() : _.removeClass("fadeIn"))
  9018. }
  9019. function c() {
  9020. E.classList.remove("playing"),
  9021. h()
  9022. }
  9023. function h() {//去掉导览结束时的提示
  9024. /* if (!p.tourInteraction.disabled) {
  9025. M.removeClass("small landing " + g.FLOORPLAN + " " + g.OUTDOOR + " " + g.PANORAMA),
  9026. M.addClass("fadeIn tour " + m.deviceType);
  9027. var e = p.tourInteraction.smallModal ? y.SMALL : y.LARGE;
  9028. if (!p.tourInteraction.smallModal) {
  9029. var t;
  9030. 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,
  9031. m.fill(R, A.TOUR_INTERACTION[t]),
  9032. M.addClass(t)
  9033. }
  9034. M.addClass(e)
  9035. } */
  9036. }
  9037. function u(e, t) {
  9038. if (t) {
  9039. var i = "keydown" === t.type
  9040. , n = t.which === f.SPACE || C.tourIsPlaying;
  9041. i && n || e || (O = !0),
  9042. C.atEndOfTour() && d(),
  9043. !C.tourIsPlaying && C.tourInProgress && (_.removeClass("fadeIn"), d(), t.which !== f.SPACE && stopTour()),
  9044. i && n && togglePlay() //空格键播放或暂停
  9045. }
  9046. }
  9047. function d() {
  9048. M.removeClass("fadeIn")
  9049. }
  9050. var p = (e("../util/browser"),
  9051. e("../settings"))
  9052. , f = e("../enum/Keys")
  9053. , g = e("../enum/Viewmode")
  9054. , m = (e("./helpManager"),
  9055. e("./populateModal"))
  9056. , v = e("../enum/DirectorEvents")
  9057. , A = e("../enum/HelpModalType")
  9058. , y = e("../enum/HelpModalSize")
  9059. , C = null
  9060. , I = null
  9061. , E = document.getElementById("pause-overlay")
  9062. , b = document.getElementById("player")
  9063. , w = document.getElementById("gui")
  9064. , _ = $("#pause-icon").eq(0)
  9065. , T = $("#play").eq(0)
  9066. , x = $("#playHead").eq(0)
  9067. , S = $(".rightViewContainer, #previous, #next, #gui-modes-inside, #gui-modes-outside, #gui-modes-dollhouse, #gui-modes-floorplan").toArray()
  9068. , M = $("#interaction-modal").eq(0)
  9069. , R = $("#interaction-modal .interaction").toArray()
  9070. , P = ["touchstart", "mousedown", "pointerdown"]
  9071. , O = !1;
  9072. t.exports.init = n,
  9073. t.exports.play = play,
  9074. t.exports.pause = stopTour2,
  9075. t.exports.pauseWithoutCTA = stopTour,
  9076. t.exports.togglePlay = togglePlay,
  9077. t.exports.stopTour = l,
  9078. t.exports.dismissModal = d
  9079. }
  9080. , {
  9081. "../enum/DirectorEvents": 23,
  9082. "../enum/HelpModalSize": 27,
  9083. "../enum/HelpModalType": 28,
  9084. "../enum/Keys": 30,
  9085. "../enum/Viewmode": 51,
  9086. "../settings": 166,
  9087. "../util/browser": 182,
  9088. "./helpManager": 68,
  9089. "./populateModal": 75
  9090. }],
  9091. 85: [function(e, t, i) {
  9092. "use strict";
  9093. t.exports = Object.freeze({
  9094. OPENED: "vr.modal.opened",
  9095. LAUNCH: "vr.modal.launch",
  9096. CLOSED: "vr.modal.closed",
  9097. NEXT: "vr.modal.next",
  9098. PREV: "vr.modal.prev",
  9099. STORE: "vr.modal.store",
  9100. falseICECHOSEN: "vr.modal.device"
  9101. })
  9102. }
  9103. , {}],
  9104. 86: [function(e, t, i) {
  9105. "use strict";
  9106. function n(e, t, i) {
  9107. function n(e, t, n, r) {
  9108. function o() {
  9109. return p + "&m=" + t + "&display=" + e
  9110. }
  9111. function s() {
  9112. var e = "&utm_medium=" + (a.inIframe() ? "embed" : "direct")
  9113. , t = "&utm_source=" + u
  9114. , n = "&utm_showcase_session_id=" + i;
  9115. return e + t + n
  9116. }
  9117. function l() {
  9118. return d + "&sids=" + t + "&lsid=" + t + "&ln=" + encodeURIComponent(n) + "&ld=" + encodeURIComponent(r) + "&display=" + e
  9119. }
  9120. return a.valueFromHash("vrcoll", !1) ? l() + s() : o() + s()
  9121. }
  9122. function r(e, t, i, r) {
  9123. var o = "https://api.branch.io/v1/url"
  9124. , a = n(e, t, i, r)
  9125. , s = {
  9126. responseType: "json",
  9127. data: {
  9128. branch_key: h.appConfig.branch_key,
  9129. data: {
  9130. m: t,
  9131. full_url: a,
  9132. $desktop_url: m,
  9133. $og_app_id: "331853976762864119",
  9134. $og_title: i,
  9135. $og_description: r,
  9136. $og_image_url: location.origin + "/api/v1/player/models/" + t + "/thumb",
  9137. $canonical_url: window.location.href
  9138. }
  9139. }
  9140. };
  9141. c.post(o, s).done(function(t) {
  9142. f[e] = t.url
  9143. }).fail(function(t) {
  9144. f[e] = t
  9145. }
  9146. .bind(this, a))
  9147. }
  9148. function o(e, t, i) {
  9149. for (var r in s) {
  9150. var o = s[r]
  9151. , a = n(o, e, t, i);
  9152. f[o] = a
  9153. }
  9154. }
  9155. var u = a.inIframe() ? encodeURIComponent(document.referrer) : encodeURIComponent(window.location.href)
  9156. , d = g + "/vr/dlist/?ret=" + u
  9157. , p = g + "/vr/show/?ret=" + u
  9158. , m = "";
  9159. switch (e) {
  9160. case l.IOS:
  9161. r(s.CardboardIOS, t.sid, t.name, t.summary);
  9162. break;
  9163. default:
  9164. o(t.sid, t.name, t.summary)
  9165. }
  9166. }
  9167. function r(e) {
  9168. var t = f[e];
  9169. window.open(t, "_blank")
  9170. }
  9171. function o(e) {
  9172. var t = u[e];
  9173. window.open(t, "_blank")
  9174. }
  9175. var a = e("../../util/browser")
  9176. , s = e("../../enum/VRApps")
  9177. , l = e("../../enum/VRPlatforms")
  9178. , c = e("../../util/ajax")
  9179. , h = e("../../settings")
  9180. , u = {};
  9181. u[s.CardboardAndroid] = "https://play.google.com/store/apps/details?id=com.port.mpvrcardboard&redirect_uri=",
  9182. u[s.CardboardIOS] = "https://itunes.apple.com/us/app/port-vr/id1168808473&redirect_uri=",
  9183. u[s.GearVR] = "https://www.oculus.com/experiences/gear-vr/811670972252145/?redirect_uri=";
  9184. for (var d in s) {
  9185. var p = s[d];
  9186. u[p] += encodeURIComponent(document.referrer + "&display=" + p)
  9187. }
  9188. var f = {}
  9189. , g = function() {
  9190. var e = window.location.host;
  9191. return e.indexOf(".port.com") === -1 && e.indexOf("localhost") === -1 && (e = "my.port.com"),
  9192. "https://" + e
  9193. }();
  9194. t.exports.init = n,
  9195. t.exports.launch = r,
  9196. t.exports.launchStore = o
  9197. }
  9198. , {
  9199. "../../enum/VRApps": 46,
  9200. "../../enum/VRPlatforms": 49,
  9201. "../../settings": 166,
  9202. "../../util/ajax": 181,
  9203. "../../util/browser": 182
  9204. }],
  9205. 87: [function(e, t, i) {
  9206. "use strict";
  9207. function n(e) {
  9208. var t;
  9209. switch (e) {
  9210. case m.IOS:
  9211. return t = p.iosVersion(),
  9212. t.major > 9 || 9 === t.major && t.minor >= 1;
  9213. case m.Android:
  9214. return t = p.androidVersion(),
  9215. t.major > 4 || 4 === t.major && t.minor > 4 || 4 === t.major && 4 === t.minor && t.patch >= 4
  9216. }
  9217. return !1
  9218. }
  9219. function r(e, t) {
  9220. function i(e) {
  9221. K.emit(A.STORE, {
  9222. type: e
  9223. }),
  9224. f.launchStore(e)
  9225. }
  9226. function r(e) {
  9227. switch (e !== _.pageCount && (a(e),
  9228. N.text(e + 1 + " / " + _.pageCount)),
  9229. e) {
  9230. case _.Title:
  9231. O.css("display", "none"),
  9232. L.text(u[e]),
  9233. o(s);
  9234. break;
  9235. case _.Cardboard:
  9236. O.css("display", "block"),
  9237. L.text(u[e]),
  9238. M.filter(".cardboard").off(),
  9239. M.filter(".gearvr").off(),
  9240. c(e, s),
  9241. h(H, X, Z);
  9242. break;
  9243. case _.Gear:
  9244. L.text(u[e]),
  9245. c(e, s),
  9246. T.addClass("lastPage"),
  9247. h(G, X, Z);
  9248. break;
  9249. case _.pageCount:
  9250. T.removeClass("fadeIn"),
  9251. K.emit(A.CLOSED)
  9252. }
  9253. B.filter("[src='']").hide()
  9254. }
  9255. var s = function() {
  9256. return p.detectAndroid() ? p.detectAndroidMobile() && n(m.Android) ? (T.addClass("supported"),
  9257. w = ".show-supported",
  9258. m.Android) : (T.addClass("unsupported"),
  9259. w = ".show-unsupported",
  9260. m.UnsupportedAndroid) : p.detectIPhone() || p.detectIPod() ? (T.addClass("ios"),
  9261. w = ".show-ios",
  9262. _ = v.ios,
  9263. m.IOS) : (T.addClass("desktop"),
  9264. w = ".show-desktop",
  9265. m.Desktop)
  9266. }();
  9267. f.init(s, e, t),
  9268. s !== m.Desktop && T.addClass("mobile");
  9269. var l = function(e) {
  9270. K.emit(A.LAUNCH, {
  9271. vr_platform: s,
  9272. vr_app: e
  9273. }),
  9274. f.launch(e)
  9275. };
  9276. q.cardboardAndroid = l.bind(this, g.CardboardAndroid),
  9277. q.gear = l.bind(this, g.GearVR),
  9278. q.cardboardIOS = l.bind(this, g.CardboardIOS),
  9279. d(),
  9280. $(".show-supported, .show-unsupported, .show-ios, .show-desktop").hide(),
  9281. $(w).show();
  9282. var u = [C.VR_LEARN_MORE_CAPS, C.VR_NEXT_CAPS, C.VR_GOT_IT_CAPS]
  9283. , y = ["vr_modal_learn_more", "vr_modal_next", "vr_modal_done"];
  9284. s === m.IOS && (u.splice(1, 1),
  9285. y.splice(1, 1)),
  9286. $("#vr").on("click", function(e) {
  9287. e.preventDefault();
  9288. player.FlyToMode("panorama", ()=>{
  9289. if(!window.vrEnabled) { // 开启VR
  9290. window.vrEnabled = true;
  9291. this.classList.add('active');
  9292. $('#gui div').not('#vrOff').addClass('vrHide');
  9293. $('#vrOffImg').css({'display':'inline-block'});
  9294. }else{
  9295. }
  9296. })
  9297. });
  9298. let exitVR = function(){
  9299. $('#gui div').not('#vrOff').removeClass('vrHide');
  9300. $('#vrOffImg').css({'display':'none'});
  9301. $('#player canvas').css({width:'', 'height': ''}); // 清楚vr下给canvas设置的宽高, 避免横竖屏切换的时候出现宽高错误的现象
  9302. $('#vr').removeClass('active'); // 清除vr按钮的激活样式
  9303. }
  9304. $('#vrOff').on('click', function(){
  9305. window.vrEnabled = false;
  9306. exitVR()
  9307. })
  9308. window.bus.addEventListener('exitWebXR',(e)=>{
  9309. exitVR()
  9310. })
  9311. var I = "https://my.port.com/vr/show/?m=" + e.sid;
  9312. s === m.IOS ? $(".cardboardLink").on("click", i.bind(this, g.CardboardIOS)) : $(".cardboardLink").on("click", i.bind(this, g.CardboardAndroid)),
  9313. $(".gearLink").on("click", i.bind(this, g.GearVR)),
  9314. $("span.modelLink").text(I),
  9315. O.on("click", function(e) {
  9316. K.emit(A.PREV),
  9317. b--,
  9318. r(b)
  9319. }),
  9320. L.on("click", function(e) {
  9321. L.text();
  9322. K.emit(A.NEXT, {
  9323. nextAction: y[b]
  9324. }),
  9325. b++,
  9326. r(b)
  9327. }),
  9328. T.find(".close").on("click", K.dismiss)
  9329. }
  9330. function o(e) {
  9331. switch (e) {
  9332. case m.Android:
  9333. M.filter(".cardboard").off().on("click", q.cardboardAndroid),
  9334. M.filter(".gearvr").off().on("click", q.gear),
  9335. s(H, G, "logo-button", "same-line");
  9336. break;
  9337. case m.UnsupportedAndroid:
  9338. s("", z, "", "");
  9339. break;
  9340. case m.IOS:
  9341. M.filter(".cardboard").off().on("click", q.cardboardIOS),
  9342. s(H, "", "logo-button", "");
  9343. break;
  9344. case m.Desktop:
  9345. M.filter(".cardboard").off().on("click", l.bind(this, null, F, U)),
  9346. M.filter(".gearvr").off().on("click", l.bind(this, G, V, null)),
  9347. s(H, G, "logo-button", "same-line"),
  9348. Q.cardboard()
  9349. }
  9350. }
  9351. function a(e) {
  9352. $(".p1, .p2, .p3").hide(),
  9353. x.insertAfter(S),
  9354. T.removeClass("front-page"),
  9355. T.removeClass("details-page"),
  9356. T.removeClass("lastPage"),
  9357. M.removeClass("logo-button"),
  9358. M.removeClass("same-line"),
  9359. S.removeClass("headsetOptions"),
  9360. R.attr("src", ""),
  9361. R.filter(".second").removeClass("gear"),
  9362. R.css("display", "inline-block"),
  9363. R.off(),
  9364. P.filter(".second").css("display", ""),
  9365. D.css("display", "none"),
  9366. $(".p" + (e + 1) + w).show(),
  9367. R.filter(".third").insertBefore(P.filter(".third"))
  9368. }
  9369. function s(e, t, i, n) {
  9370. T.addClass("front-page"),
  9371. R.filter(".first").attr("src", e),
  9372. R.filter(".second").attr("src", t),
  9373. M.filter(".first").addClass(i),
  9374. M.filter(".second").addClass(i),
  9375. M.addClass(n),
  9376. ".show-desktop" === w && S.insertAfter(x)
  9377. }
  9378. function l(e, t, i) {
  9379. S.addClass("headsetOptions"),
  9380. M.off(),
  9381. R.filter(".second").attr("src", t),
  9382. D.css("display", "block"),
  9383. P.filter(".second").css("display", "none"),
  9384. D.on("click", function() {
  9385. a(_.Title),
  9386. o(m.Desktop)
  9387. }),
  9388. e && (K.emit(A.falseICECHOSEN, {
  9389. name: g.GearVR
  9390. }),
  9391. R.filter(".first").attr("src", e),
  9392. R.filter(".second").addClass("gear"),
  9393. R.filter(".second").on("click", f.launchStore.bind(this, g.GearVR)),
  9394. Q.gearvr()),
  9395. i && (K.emit(A.falseICECHOSEN, {
  9396. name: g.Cardboard
  9397. }),
  9398. R.filter(".third").attr("src", i),
  9399. R.filter(".third").show(),
  9400. R.filter(".third").insertAfter(R.filter(".second")),
  9401. R.filter(".third").addClass("link"),
  9402. R.filter(".second").addClass("link"),
  9403. R.filter(".second").on("click", f.launchStore.bind(this, g.CardboardIOS)),
  9404. R.filter(".third").on("click", f.launchStore.bind(this, g.CardboardAndroid)),
  9405. Q.cardboard())
  9406. }
  9407. function c(e, t) {
  9408. switch (t) {
  9409. case m.IOS:
  9410. X = Y,
  9411. Z = j;
  9412. break;
  9413. case m.Desktop:
  9414. e === _.Cardboard ? (X = F,
  9415. Z = U,
  9416. R.filter(".second").on("click", f.launchStore.bind(this, g.CardboardIOS)),
  9417. R.filter(".third").on("click", f.launchStore.bind(this, g.CardboardAndroid))) : (X = V,
  9418. R.filter(".second").on("click", f.launchStore.bind(this, g.GearVR)),
  9419. Z = "");
  9420. break;
  9421. default:
  9422. e === _.Cardboard ? (X = z,
  9423. Z = j) : (X = k,
  9424. Z = W)
  9425. }
  9426. }
  9427. function h(e, t, i) {
  9428. T.find(".inner").addClass("details-page"),
  9429. T.addClass("details-page"),
  9430. R.filter(".first").attr("src", e),
  9431. R.filter(".second").attr("src", t),
  9432. R.filter(".third").attr("src", i)
  9433. }
  9434. function u() {
  9435. T.hasClass("fadeIn") && (T.removeClass("fadeIn"),
  9436. K.emit(A.CLOSED))
  9437. }
  9438. function d() {
  9439. var e = p.aspectRatio() > 1 && p.isMobile();
  9440. T.toggleClass("landscape", e).toggleClass("portrait", !e),
  9441. T.toggleClass("tiny", $("#player").height() <= y.narrowLandscapeHeight),
  9442. T.toggleClass("tinier", $("#player").height() <= y.reallyNarrowLandscapeHeight)
  9443. }
  9444. var p = e("../../util/browser")
  9445. , f = e("./vrLink")
  9446. , g = e("../../enum/VRApps")
  9447. , m = e("../../enum/VRPlatforms")
  9448. , v = e("../../enum/VRPages")
  9449. , A = e("./vrEvent")
  9450. , y = (e("../../settings"),
  9451. e("../../constants"))
  9452. , C = e("../../localization/localize")
  9453. , I = e("../../util/common")
  9454. , E = e("events").EventEmitter
  9455. , b = 0
  9456. , w = null
  9457. , _ = v.standard
  9458. , T = $(".vr-popup")
  9459. , x = T.find(".vr-popup-body")
  9460. , S = T.find(".vr-images")
  9461. , M = T.find(".img-container")
  9462. , R = T.find(".vr-sm-image")
  9463. , P = M.find(".vr-img-caption")
  9464. , O = $(".vr-buttons").find(".prev-button")
  9465. , L = $(".vr-buttons").find(".next-button")
  9466. , D = S.find(".front-close")
  9467. , N = $(".vr-page")
  9468. , B = T.find("img")
  9469. , F = "images/apple-store.png"
  9470. , V = "images/badge-oculus.png"
  9471. , U = "images/badge-cardboard.png"
  9472. , k = "images/logo-samsung.png"
  9473. , H = "images/headset-cardboard.png"
  9474. , G = "images/headset-gearvr.png"
  9475. , z = "images/ico-android-robot.png"
  9476. , W = "images/ico-gearvr.png"
  9477. , j = "images/ico-vr.png"
  9478. , Y = "images/apple-logo-white.svg"
  9479. , X = null
  9480. , Z = null
  9481. , q = {}
  9482. , K = {
  9483. init: r,
  9484. dismiss: u,
  9485. isDeviceSupported: n
  9486. };
  9487. I.extendObject(K, E.prototype),
  9488. $(window).resize(d);
  9489. var Q = function() {
  9490. var e = P.filter(".first").find(".cardboard")
  9491. , t = P.filter(".first").find(".gearvr");
  9492. return {
  9493. cardboard: function() {
  9494. t.addClass("hidden"),
  9495. e.removeClass("hidden")
  9496. },
  9497. gearvr: function() {
  9498. e.addClass("hidden"),
  9499. t.removeClass("hidden")
  9500. }
  9501. }
  9502. }();
  9503. t.exports = K
  9504. }
  9505. , {
  9506. "../../constants": 8,
  9507. "../../enum/VRApps": 46,
  9508. "../../enum/VRPages": 48,
  9509. "../../enum/VRPlatforms": 49,
  9510. "../../localization/localize": 108,
  9511. "../../settings": 166,
  9512. "../../util/browser": 182,
  9513. "../../util/common": 185,
  9514. "./vrEvent": 85,
  9515. "./vrLink": 86,
  9516. events: 202
  9517. }],
  9518. 88: [function(e, t, i) {
  9519. "use strict";
  9520. t.exports = Object.freeze({
  9521. OPENED: "webvr.modal.opened",
  9522. SHOW_TERMS: "webvr.footer.show.terms"
  9523. })
  9524. }
  9525. , {}],
  9526. 89: [function(e, t, i) {
  9527. (function(i) {
  9528. "use strict";
  9529. function n(e, t, i, n) {
  9530. function r(e) {
  9531. e.preventDefault(),
  9532. a(e.currentTarget.id)
  9533. }
  9534. function a(e) {
  9535. ne[e](),
  9536. Object.keys(ne).map(function(t, i) {
  9537. $("#" + t).toggleClass("tabs-underlined", t === e)
  9538. })
  9539. }
  9540. y = i,
  9541. v = t,
  9542. w.init(E.Android, e, n),
  9543. m();
  9544. var l = new RegExp("daydream","i")
  9545. , c = l.test(y.displayName);
  9546. c ? (a("tabdaydream"),
  9547. B.filter(".device-headset-side").attr("src", H),
  9548. D.find(".title").text(x.localizeText("WEBVR_FOR_DAYDREAM"))) : (a("tabcardboard"),
  9549. B.filter(".device-headset-side").attr("src", Y),
  9550. D.find(".title").text(x.localizeText("WEBVR_FOR_CARDBOARD"))),
  9551. $("#vr").on("click", function(e) {
  9552. e.preventDefault(),
  9553. g("click_webvr_button"),
  9554. L.is(":hidden") && (ie.emit(_.OPENED),
  9555. o())
  9556. }),
  9557. $(".webvr-popup .close").on("click", function(e) {
  9558. e.preventDefault(),
  9559. D.hasClass("hidden") ? (g("webvr_help_close"),
  9560. p()) : s()
  9561. }),
  9562. $("#tabcardboard").on("click", r),
  9563. $("#tabdaydream").on("click", r),
  9564. $("#tabnative").on("click", r),
  9565. $(".webvr-popup .open-with-app").on("click", function(e) {
  9566. e.preventDefault(),
  9567. g("webvr_learn_more"),
  9568. a("tabnative"),
  9569. p()
  9570. }),
  9571. $(".webvr-popup .help").on("click", function(e) {
  9572. e.preventDefault(),
  9573. g(D.hasClass("hidden") ? "webvr_help_close" : "webvr_help_show"),
  9574. p()
  9575. }),
  9576. $(".webvr-popup .terms").on("click", function(e) {
  9577. e.preventDefault(),
  9578. g("webvr_click_terms"),
  9579. s(),
  9580. ie.emit(_.SHOW_TERMS)
  9581. }),
  9582. F.on("click", function(e) {
  9583. e.preventDefault(),
  9584. g(ee),
  9585. window.open(J, "_blank")
  9586. }),
  9587. V.on("click", function(e) {
  9588. e.preventDefault(),
  9589. g("webvr_phone_link"),
  9590. window.open(te, "_blank")
  9591. }),
  9592. $(".webvr-popup .badge-cardboard").on("click", function(e) {
  9593. e.preventDefault(),
  9594. g("webvr_cardboard_link"),
  9595. w.launch(b.CardboardAndroid)
  9596. }),
  9597. $(".webvr-popup .badge-oculus").on("click", function(e) {
  9598. e.preventDefault(),
  9599. g("webvr_oculus_link"),
  9600. w.launch(b.GearVR)
  9601. })
  9602. }
  9603. function r() {
  9604. function e() {
  9605. y.isPresenting || (f(),
  9606. window.removeEventListener("vrdisplaypresentchange", e))
  9607. }
  9608. R.info("Headset mounted"),
  9609. v.suspend();
  9610. var t = document.createElement("canvas");
  9611. for (t.getContext("webgl"),
  9612. t.className = "webvr-canvas",
  9613. document.bgColor = "#000",
  9614. document.body.style.backgroundColor = "#000"; document.body.firstChild; )
  9615. document.body.removeChild(document.body.firstChild);
  9616. document.body.appendChild(t),
  9617. g("webvr_enter_app"),
  9618. y.requestPresent([{
  9619. source: t,
  9620. predistorted: !0
  9621. }]).catch(function(t) {
  9622. R.error("Failed to present: " + t),
  9623. g("webvr_exit_calibrate"),
  9624. e()
  9625. }),
  9626. A.then(function() {
  9627. window.dispatchEvent(new Event("vrapp-start"))
  9628. }),
  9629. window.addEventListener("vrdisplaypresentchange", e)
  9630. }
  9631. function o() {
  9632. O.fadeOut(I.guiAnimationSpeed),
  9633. L.fadeIn(I.guiAnimationSpeed),
  9634. a()
  9635. }
  9636. function a() {
  9637. if (!A) {
  9638. var e = C.valueFromHash("webvr") || I.appConfig.webvr_version
  9639. , t = "https://static.port.com/webvr/" + e + "/js/main.js";
  9640. A = new Promise(function(e, i) {
  9641. var n = document.createElement("script");
  9642. n.type = "text/javascript",
  9643. n.src = t,
  9644. n.onload = e,
  9645. document.head.appendChild(n)
  9646. }
  9647. )
  9648. }
  9649. D.find(".enter-button").on("click", r)
  9650. }
  9651. function s() {
  9652. g("webvr_modal_close"),
  9653. D.find(".enter-button").off("click", r),
  9654. L.fadeOut(I.guiAnimationSpeed, function() {
  9655. D.toggleClass("hidden", !1),
  9656. N.toggleClass("hidden", !0),
  9657. C.exitFullscreen()
  9658. }),
  9659. O.fadeIn(I.guiAnimationSpeed)
  9660. }
  9661. function l() {
  9662. k.toggleClass("hidden", !1),
  9663. U.toggleClass("hidden", !0)
  9664. }
  9665. function c() {
  9666. k.toggleClass("hidden", !0),
  9667. U.toggleClass("hidden", !1)
  9668. }
  9669. function h() {
  9670. B.filter(".device-headset").attr("src", G),
  9671. B.filter(".device-phone").attr("src", z),
  9672. J = Z,
  9673. ee = K,
  9674. F.text(x.localizeText("WEBVR_DAYDREAM_VIEW")),
  9675. V.text(x.localizeText("VR_NEED_DAYDREAM_PHONE")),
  9676. $(".webvr-popup .detail.daydream-label").toggleClass("hidden", !1),
  9677. c()
  9678. }
  9679. function u() {
  9680. B.filter(".badge-cardboard").attr("src", j),
  9681. B.filter(".badge-oculus").attr("src", X),
  9682. l()
  9683. }
  9684. function d() {
  9685. B.filter(".device-headset").attr("src", Y),
  9686. B.filter(".device-phone").attr("src", W),
  9687. J = q,
  9688. ee = Q,
  9689. F.text(x.localizeText("VR_GOOGLE_CARDBOARD")),
  9690. V.text(x.localizeText("VR_COMPATIBLE_ANDROID_LONG")),
  9691. $(".webvr-popup .detail.daydream-label").toggleClass("hidden", !0),
  9692. c()
  9693. }
  9694. function p() {
  9695. D.toggleClass("hidden"),
  9696. N.toggleClass("hidden")
  9697. }
  9698. function f() {
  9699. R.info("exiting webVR"),
  9700. g("webvr_exit_app"),
  9701. window.location.search.indexOf("&qs=1") === -1 ? window.location = window.location + "&qs=1" : window.location = window.location
  9702. }
  9703. function g(e) {
  9704. var t = C.isLandscape() ? "landscape" : "portrait";
  9705. T.trackAlways("showcase_gui", {
  9706. gui_action: e,
  9707. orientation: t
  9708. })
  9709. }
  9710. function m() {
  9711. var e = C.isLandscape();
  9712. L.toggleClass("landscape", e).toggleClass("portrait", !e)
  9713. }
  9714. var v, A, y, C = e("../../util/browser"), I = e("../../settings"), E = (e("./../gui"),
  9715. e("../../enum/VRPlatforms")), b = e("../../enum/VRApps"), w = e("./../vr/vrLink"), _ = e("./WebVrEvent"), T = e("../../analytics"), x = (e("../../constants"),
  9716. 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 = "images/device-daydream-side.png", G = "images/device-daydream.png", z = "images/device-pixel.png", W = "images/ico-android-robot.png", j = "images/badge-cardboard.png", Y = "images/headset-cardboard.png", X = "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 = {
  9717. init: n
  9718. }, ne = {
  9719. tabcardboard: d,
  9720. tabdaydream: h,
  9721. tabnative: u
  9722. };
  9723. S.extendObject(ie, P.prototype),
  9724. $(window).resize(m),
  9725. t.exports = ie
  9726. }
  9727. ).call(this, "/js/gui/webvr/webVRgui.js")
  9728. }
  9729. , {
  9730. "../../analytics": 4,
  9731. "../../constants": 8,
  9732. "../../enum/VRApps": 46,
  9733. "../../enum/VRPlatforms": 49,
  9734. "../../localization/localize": 108,
  9735. "../../settings": 166,
  9736. "../../util/browser": 182,
  9737. "../../util/common": 185,
  9738. "../../util/logger": 189,
  9739. "./../gui": 65,
  9740. "./../vr/vrLink": 86,
  9741. "./WebVrEvent": 88,
  9742. events: 202
  9743. }],
  9744. 90: [function(e, t, i) {
  9745. "use strict";
  9746. function n(e, t, i, n, o) {
  9747. n || 0 === n ? this.floorId = n : this.floorId = -1,
  9748. this.roomId = o || "",
  9749. this.labelId = e,
  9750. this.position = (new r.Vector3).copy(t),
  9751. this.text = i
  9752. }
  9753. var r = e("three")
  9754. , o = e("../util/browser");
  9755. n.prototype.build = function() {
  9756. var e = window.document.createElement("div");
  9757. o.isMobile() ? e.setAttribute("class", "gui-floorplan-label gui-floorplan-label-mobile") : e.setAttribute("class", "gui-floorplan-label");
  9758. var t = window.document.createElement("div");
  9759. t.setAttribute("class", "gui-floorplan-label-text");
  9760. var i = window.document.createTextNode(this.text);
  9761. t.appendChild(i),
  9762. e.appendChild(t),
  9763. window.document.body.appendChild(e),
  9764. this.labelGui = e,
  9765. this.textBlock = t,
  9766. $(this.labelGui).hide();
  9767. var n = window.getComputedStyle(this.labelGui);
  9768. this.initialTransform = n.transform || n.webkitTransform
  9769. }
  9770. ,
  9771. t.exports = n
  9772. }
  9773. , {
  9774. "../util/browser": 182,
  9775. three: 217
  9776. }],
  9777. 91: [function(e, t, i) {
  9778. "use strict";
  9779. function n() {
  9780. this.player = null,
  9781. this.modelManager = null,
  9782. this.container = null
  9783. }
  9784. var r = e("three")
  9785. , o = (e("../util/common"),
  9786. e("../enum/PlayerEvents"))
  9787. , a = (e("../enum/DirectorEvents"),
  9788. e("../enum/ModelManagerEvents"))
  9789. , s = e("../settings")
  9790. , l = e("../enum/Viewmode")
  9791. , c = (e("../enum/WarpStyle"),
  9792. e("../util/transitions"),
  9793. e("../util/lerp"),
  9794. e("../util/browser"));
  9795. //场景初始化
  9796. n.prototype.init = function(e, t, i) {
  9797. this.player = e,
  9798. this.modelManager = t,
  9799. this.container = i,
  9800. this.updateModel(),
  9801. this.bindEvents()
  9802. }
  9803. ,
  9804. n.prototype.bindEvents = function() {
  9805. this.modelManager.on(a.ActiveModelChanged, this.updateModel.bind(this)),
  9806. this.player.on(o.ViewChanged, this.handlePlayerViewChanged.bind(this)),
  9807. this.player.on(o.ModeChanged, this.handlePlayerViewChanged.bind(this)),
  9808. this.player.on(o.StartInside, this.handleStartInside.bind(this)),
  9809. this.player.on(o.StartOutside, this.handleStartOutside.bind(this))
  9810. }
  9811. ,
  9812. n.prototype.updateModel = function() {
  9813. this.model = this.modelManager.getActiveModel()
  9814. }
  9815. ,
  9816. n.prototype.handlePlayerViewChanged = function() {
  9817. this.updateLabelVisibility(),
  9818. this.updateLabelDisplay()
  9819. }
  9820. ,
  9821. n.prototype.getLabelsForFloor = function(e, t) {
  9822. return t = t || [],
  9823. t.length = 0,
  9824. this.model.labels.forEach(function(i) {
  9825. this.labelVisibleForFloor(i, e) && t.push(i)
  9826. }
  9827. .bind(this)),
  9828. t
  9829. }
  9830. ,
  9831. n.prototype.getLabelsForCurrentFloor = function(e) {
  9832. return this.getLabelsForFloor(this.model.currentFloor.floorIndex, e)
  9833. }
  9834. ,
  9835. n.prototype.labelVisibleForFloor = function(e, t) {
  9836. var i = c.isMobile() && this.player.getLabelScaleFactor() < s.labels.zoomHideThreshhold.mobile || !c.isMobile() && this.player.getLabelScaleFactor() < s.labels.zoomHideThreshhold.desktop;
  9837. if (!this.model.showingLabels || !e.labelGui || !i)
  9838. return !1;
  9839. var n = e.floorId === this.model.floors.size() - 1;
  9840. return this.model.allFloorsVisible ? n : e.floorId === t
  9841. }
  9842. ,
  9843. n.prototype.updateLabelVisibility = function(e) {
  9844. this.model.labels.forEach(function(e) {
  9845. 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)
  9846. }
  9847. .bind(this))
  9848. }
  9849. ,
  9850. n.prototype.showAllLabels = function(e, t) {
  9851. this.model.labels.forEach(function(i) {
  9852. this.showLabel(i, e, t)
  9853. }
  9854. .bind(this))
  9855. }
  9856. ,
  9857. n.prototype.hideAllLabels = function(e, t) {
  9858. this.model.labels.forEach(function(i) {
  9859. this.hideLabel(i, e, t)
  9860. }
  9861. .bind(this))
  9862. }
  9863. ,
  9864. n.prototype.showLabel = function(e, t, i) {
  9865. this.model.showingLabels && (e.visible || (e.visible = !0,
  9866. e.labelGui.style.display = "block",
  9867. e.labelGui.style.opacity = 0,
  9868. $(e.labelGui).delay(t).fadeTo(i, 1)))
  9869. }
  9870. ,
  9871. n.prototype.hideLabel = function(e, t, i) {
  9872. e.visible && (e.visible = !1,
  9873. c.isMobile() ? $(e.labelGui).hide() : $(e.labelGui).delay(t).fadeOut(i))
  9874. }
  9875. ,
  9876. n.prototype.supportedMode = function() {
  9877. return this.player.mode === l.FLOORPLAN
  9878. }
  9879. ,
  9880. n.prototype.updateLabelDisplay = function() {
  9881. var e = (new r.Vector3,
  9882. new r.Vector3,
  9883. []);
  9884. return function() {
  9885. var t = this.player.getLabelScaleFactor()
  9886. , i = .6
  9887. , n = 1.2
  9888. , r = (1 - t) * n + i
  9889. , o = c.isMobile() ? s.labels.zoomTruncateThreshhold.mobile : s.labels.zoomTruncateThreshhold.desktop;
  9890. this.getLabelsForCurrentFloor(e);
  9891. for (var a = 0; a < e.length; a++) {
  9892. var l = e[a];
  9893. this.supportedMode() && l.labelGui && (this.updateProjectedGuiElement(l.labelGui, l.textBlock, l.position, r, r),
  9894. 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)
  9895. }
  9896. }
  9897. }(),
  9898. n.prototype.updateProjectedGuiElement = function() {
  9899. var e = new r.Vector3;
  9900. new r.Vector3;
  9901. return function(t, i, n, r, o) {
  9902. i.style.fontSize = 100 * o + "%";
  9903. var a = $("#player").width()
  9904. , s = $("#player").height()
  9905. , l = .5 * a
  9906. , c = .5 * s;
  9907. e.copy(n),
  9908. e.project(this.player.camera);
  9909. var h = e.x * l + l
  9910. , u = -(e.y * c) + c;
  9911. h -= t.offsetWidth / 2,
  9912. u -= t.offsetHeight / 2,
  9913. t.style.left = h + "px",
  9914. t.style.top = u + "px"
  9915. }
  9916. }(),
  9917. n.prototype.handleStartInside = function(e) {
  9918. this.updateLabelVisibility()
  9919. }
  9920. ,
  9921. n.prototype.handleStartOutside = function() {
  9922. this.updateLabelVisibility()
  9923. }
  9924. ,
  9925. t.exports = n
  9926. }
  9927. , {
  9928. "../enum/DirectorEvents": 23,
  9929. "../enum/ModelManagerEvents": 33,
  9930. "../enum/PlayerEvents": 40,
  9931. "../enum/Viewmode": 51,
  9932. "../enum/WarpStyle": 52,
  9933. "../settings": 166,
  9934. "../util/browser": 182,
  9935. "../util/common": 185,
  9936. "../util/lerp": 188,
  9937. "../util/transitions": 195,
  9938. three: 217
  9939. }],
  9940. 92: [function(e, t, i) {
  9941. "use strict";
  9942. Array.prototype.findIndex || (Array.prototype.findIndex = function(e) {
  9943. if (null == this)
  9944. throw new TypeError("Array.prototype.findIndex called on null or undefined");
  9945. if ("function" != typeof e)
  9946. throw new TypeError("predicate must be a function");
  9947. for (var t, i = Object(this), n = i.length >>> 0, r = arguments[1], o = 0; o < n; o++)
  9948. if (t = i[o],
  9949. e.call(r, t, o, i))
  9950. return o;
  9951. return -1
  9952. }
  9953. ),
  9954. Array.prototype.find || Object.defineProperty(Array.prototype, "find", {
  9955. value: function(e) {
  9956. if (null == this)
  9957. throw new TypeError('"this" is null or not defined');
  9958. var t = Object(this)
  9959. , i = t.length >>> 0;
  9960. if ("function" != typeof e)
  9961. throw new TypeError("predicate must be a function");
  9962. for (var n = arguments[1], r = 0; r < i; ) {
  9963. var o = t[r];
  9964. if (e.call(n, o, r, t))
  9965. return o;
  9966. r++
  9967. }
  9968. }
  9969. })
  9970. }
  9971. , {}],
  9972. 93: [function(e, t, i) {
  9973. "use strict";
  9974. var n = n || {};
  9975. t.exports = n,
  9976. n.gui = n.gui || {},
  9977. n.utils = n.utils || {},
  9978. n.controllers = n.controllers || {},
  9979. n.dom = n.dom || {},
  9980. n.color = n.color || {},
  9981. n.utils.css = function() {
  9982. return {
  9983. load: function(e, t) {
  9984. t = t || document;
  9985. var i = t.createElement("link");
  9986. i.type = "text/css",
  9987. i.rel = "stylesheet",
  9988. i.href = e,
  9989. t.getElementsByTagName("head")[0].appendChild(i)
  9990. },
  9991. inject: function(e, t) {
  9992. t = t || document;
  9993. var i = document.createElement("style");
  9994. i.type = "text/css",
  9995. i.innerHTML = e,
  9996. t.getElementsByTagName("head")[0].appendChild(i)
  9997. }
  9998. }
  9999. }(),
  10000. n.utils.common = function() {
  10001. var e = Array.prototype.forEach
  10002. , t = Array.prototype.slice;
  10003. return {
  10004. BREAK: {},
  10005. extend: function(e) {
  10006. return this.each(t.call(arguments, 1), function(t) {
  10007. for (var i in t)
  10008. this.isUndefined(t[i]) || (e[i] = t[i])
  10009. }, this),
  10010. e
  10011. },
  10012. defaults: function(e) {
  10013. return this.each(t.call(arguments, 1), function(t) {
  10014. for (var i in t)
  10015. this.isUndefined(e[i]) && (e[i] = t[i])
  10016. }, this),
  10017. e
  10018. },
  10019. compose: function() {
  10020. var e = t.call(arguments);
  10021. return function() {
  10022. for (var i = t.call(arguments), n = e.length - 1; n >= 0; n--)
  10023. i = [e[n].apply(this, i)];
  10024. return i[0]
  10025. }
  10026. },
  10027. each: function(t, i, n) {
  10028. if (t)
  10029. if (e && t.forEach && t.forEach === e)
  10030. t.forEach(i, n);
  10031. else if (t.length === t.length + 0) {
  10032. for (var r = 0, o = t.length; r < o; r++)
  10033. if (r in t && i.call(n, t[r], r) === this.BREAK)
  10034. return
  10035. } else
  10036. for (var r in t)
  10037. if (i.call(n, t[r], r) === this.BREAK)
  10038. return
  10039. },
  10040. defer: function(e) {
  10041. setTimeout(e, 0)
  10042. },
  10043. toArray: function(e) {
  10044. return e.toArray ? e.toArray() : t.call(e)
  10045. },
  10046. isUndefined: function(e) {
  10047. return void 0 === e
  10048. },
  10049. isNull: function(e) {
  10050. return null === e
  10051. },
  10052. isNaN: function(e) {
  10053. return e !== e
  10054. },
  10055. isArray: Array.isArray || function(e) {
  10056. return e.constructor === Array
  10057. }
  10058. ,
  10059. isObject: function(e) {
  10060. return e === Object(e)
  10061. },
  10062. isNumber: function(e) {
  10063. return e === e + 0
  10064. },
  10065. isString: function(e) {
  10066. return e === e + ""
  10067. },
  10068. isBoolean: function(e) {
  10069. return e === !1 || e === !0
  10070. },
  10071. isFunction: function(e) {
  10072. return "[object Function]" === Object.prototype.toString.call(e)
  10073. }
  10074. }
  10075. }(),
  10076. n.controllers.Controller = function(e) {
  10077. var t = function(e, t) {
  10078. this.initialValue = e[t],
  10079. this.domElement = document.createElement("div"),
  10080. this.object = e,
  10081. this.property = t,
  10082. this.__onChange = void 0,
  10083. this.__onFinishChange = void 0
  10084. };
  10085. return e.extend(t.prototype, {
  10086. onChange: function(e) {
  10087. return this.__onChange = e,
  10088. this
  10089. },
  10090. onFinishChange: function(e) {
  10091. return this.__onFinishChange = e,
  10092. this
  10093. },
  10094. setValue: function(e) {
  10095. return this.object[this.property] = e,
  10096. this.__onChange && this.__onChange.call(this, e),
  10097. this.updateDisplay(),
  10098. this
  10099. },
  10100. getValue: function() {
  10101. return this.object[this.property]
  10102. },
  10103. updateDisplay: function() {
  10104. return this
  10105. },
  10106. isModified: function() {
  10107. return this.initialValue !== this.getValue()
  10108. }
  10109. }),
  10110. t
  10111. }(n.utils.common),
  10112. n.dom.dom = function(e) {
  10113. function t(t) {
  10114. if ("0" === t || e.isUndefined(t))
  10115. return 0;
  10116. var i = t.match(r);
  10117. return e.isNull(i) ? 0 : parseFloat(i[1])
  10118. }
  10119. var i = {
  10120. HTMLEvents: ["change"],
  10121. MouseEvents: ["click", "mousemove", "mousedown", "mouseup", "mouseover"],
  10122. KeyboardEvents: ["keydown"]
  10123. }
  10124. , n = {};
  10125. e.each(i, function(t, i) {
  10126. e.each(t, function(e) {
  10127. n[e] = i
  10128. })
  10129. });
  10130. var r = /(\d+(\.\d+)?)px/
  10131. , o = {
  10132. makeSelectable: function(e, t) {
  10133. void 0 !== e && void 0 !== e.style && (e.onselectstart = t ? function() {
  10134. return !1
  10135. }
  10136. : function() {}
  10137. ,
  10138. e.style.MozUserSelect = t ? "auto" : "none",
  10139. e.style.KhtmlUserSelect = t ? "auto" : "none",
  10140. e.unselectable = t ? "on" : "off")
  10141. },
  10142. makeFullscreen: function(t, i, n) {
  10143. e.isUndefined(i) && (i = !0),
  10144. e.isUndefined(n) && (n = !0),
  10145. t.style.position = "absolute",
  10146. i && (t.style.left = 0,
  10147. t.style.right = 0),
  10148. n && (t.style.top = 0,
  10149. t.style.bottom = 0)
  10150. },
  10151. fakeEvent: function(t, i, r, o) {
  10152. r = r || {};
  10153. var a = n[i];
  10154. if (!a)
  10155. throw new Error("Event type " + i + " not supported.");
  10156. var s = document.createEvent(a);
  10157. switch (a) {
  10158. case "MouseEvents":
  10159. var l = r.x || r.clientX || 0
  10160. , c = r.y || r.clientY || 0;
  10161. s.initMouseEvent(i, r.bubbles || !1, r.cancelable || !0, window, r.clickCount || 1, 0, 0, l, c, !1, !1, !1, !1, 0, null);
  10162. break;
  10163. case "KeyboardEvents":
  10164. var h = s.initKeyboardEvent || s.initKeyEvent;
  10165. e.defaults(r, {
  10166. cancelable: !0,
  10167. ctrlKey: !1,
  10168. altKey: !1,
  10169. shiftKey: !1,
  10170. metaKey: !1,
  10171. keyCode: void 0,
  10172. charCode: void 0
  10173. }),
  10174. h(i, r.bubbles || !1, r.cancelable, window, r.ctrlKey, r.altKey, r.shiftKey, r.metaKey, r.keyCode, r.charCode);
  10175. break;
  10176. default:
  10177. s.initEvent(i, r.bubbles || !1, r.cancelable || !0)
  10178. }
  10179. e.defaults(s, o),
  10180. t.dispatchEvent(s)
  10181. },
  10182. bind: function(e, t, i, n) {
  10183. return n = n || !1,
  10184. e.addEventListener ? e.addEventListener(t, i, n) : e.attachEvent && e.attachEvent("on" + t, i),
  10185. o
  10186. },
  10187. unbind: function(e, t, i, n) {
  10188. return n = n || !1,
  10189. e.removeEventListener ? e.removeEventListener(t, i, n) : e.detachEvent && e.detachEvent("on" + t, i),
  10190. o
  10191. },
  10192. addClass: function(e, t) {
  10193. if (void 0 === e.className)
  10194. e.className = t;
  10195. else if (e.className !== t) {
  10196. var i = e.className.split(/ +/);
  10197. i.indexOf(t) == -1 && (i.push(t),
  10198. e.className = i.join(" ").replace(/^\s+/, "").replace(/\s+$/, ""))
  10199. }
  10200. return o
  10201. },
  10202. removeClass: function(e, t) {
  10203. if (t)
  10204. if (void 0 === e.className)
  10205. ;
  10206. else if (e.className === t)
  10207. e.removeAttribute("class");
  10208. else {
  10209. var i = e.className.split(/ +/)
  10210. , n = i.indexOf(t);
  10211. n != -1 && (i.splice(n, 1),
  10212. e.className = i.join(" "))
  10213. }
  10214. else
  10215. e.className = void 0;
  10216. return o
  10217. },
  10218. hasClass: function(e, t) {
  10219. return new RegExp("(?:^|\\s+)" + t + "(?:\\s+|$)").test(e.className) || !1
  10220. },
  10221. getWidth: function(e) {
  10222. var i = getComputedStyle(e);
  10223. return t(i["border-left-width"]) + t(i["border-right-width"]) + t(i["padding-left"]) + t(i["padding-right"]) + t(i.width)
  10224. },
  10225. getHeight: function(e) {
  10226. var i = getComputedStyle(e);
  10227. return t(i["border-top-width"]) + t(i["border-bottom-width"]) + t(i["padding-top"]) + t(i["padding-bottom"]) + t(i.height)
  10228. },
  10229. getOffset: function(e) {
  10230. var t = {
  10231. left: 0,
  10232. top: 0
  10233. };
  10234. if (e.offsetParent)
  10235. do
  10236. t.left += e.offsetLeft,
  10237. t.top += e.offsetTop;
  10238. while (e = e.offsetParent);return t
  10239. },
  10240. isActive: function(e) {
  10241. return e === document.activeElement && (e.type || e.href)
  10242. }
  10243. };
  10244. return o
  10245. }(n.utils.common),
  10246. n.controllers.OptionController = function(e, t, i) {
  10247. var n = function(e, r, o) {
  10248. n.superclass.call(this, e, r);
  10249. var a = this;
  10250. if (this.__select = document.createElement("select"),
  10251. i.isArray(o)) {
  10252. var s = {};
  10253. i.each(o, function(e) {
  10254. s[e] = e
  10255. }),
  10256. o = s
  10257. }
  10258. i.each(o, function(e, t) {
  10259. var i = document.createElement("option");
  10260. i.innerHTML = t,
  10261. i.setAttribute("value", e),
  10262. a.__select.appendChild(i)
  10263. }),
  10264. this.updateDisplay(),
  10265. t.bind(this.__select, "change", function() {
  10266. var e = this.options[this.selectedIndex].value;
  10267. a.setValue(e)
  10268. }),
  10269. this.domElement.appendChild(this.__select)
  10270. };
  10271. return n.superclass = e,
  10272. i.extend(n.prototype, e.prototype, {
  10273. setValue: function(e) {
  10274. var t = n.superclass.prototype.setValue.call(this, e);
  10275. return this.__onFinishChange && this.__onFinishChange.call(this, this.getValue()),
  10276. t
  10277. },
  10278. updateDisplay: function() {
  10279. return this.__select.value = this.getValue(),
  10280. n.superclass.prototype.updateDisplay.call(this)
  10281. }
  10282. }),
  10283. n
  10284. }(n.controllers.Controller, n.dom.dom, n.utils.common),
  10285. n.controllers.NumberController = function(e, t) {
  10286. function i(e) {
  10287. return e = e.toString(),
  10288. e.indexOf(".") > -1 ? e.length - e.indexOf(".") - 1 : 0
  10289. }
  10290. var n = function(e, r, o) {
  10291. n.superclass.call(this, e, r),
  10292. o = o || {},
  10293. this.__min = o.min,
  10294. this.__max = o.max,
  10295. this.__step = o.step,
  10296. 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,
  10297. this.__precision = i(this.__impliedStep)
  10298. };
  10299. return n.superclass = e,
  10300. t.extend(n.prototype, e.prototype, {
  10301. setValue: function(e) {
  10302. return void 0 !== this.__min && e < this.__min ? e = this.__min : void 0 !== this.__max && e > this.__max && (e = this.__max),
  10303. void 0 !== this.__step && e % this.__step != 0 && (e = Math.round(e / this.__step) * this.__step),
  10304. n.superclass.prototype.setValue.call(this, e)
  10305. },
  10306. min: function(e) {
  10307. return this.__min = e,
  10308. this
  10309. },
  10310. max: function(e) {
  10311. return this.__max = e,
  10312. this
  10313. },
  10314. step: function(e) {
  10315. return this.__step = e,
  10316. this.__impliedStep = e,
  10317. this.__precision = i(e),
  10318. this
  10319. }
  10320. }),
  10321. n
  10322. }(n.controllers.Controller, n.utils.common),
  10323. n.controllers.NumberControllerBox = function(e, t, i) {
  10324. function n(e, t) {
  10325. var i = Math.pow(10, t);
  10326. return Math.round(e * i) / i
  10327. }
  10328. var r = function(e, n, o) {
  10329. function a() {
  10330. var e = parseFloat(d.__input.value);
  10331. i.isNaN(e) || d.setValue(e)
  10332. }
  10333. function s() {
  10334. a(),
  10335. d.__onFinishChange && d.__onFinishChange.call(d, d.getValue())
  10336. }
  10337. function l(e) {
  10338. t.bind(window, "mousemove", c),
  10339. t.bind(window, "mouseup", h),
  10340. u = e.clientY
  10341. }
  10342. function c(e) {
  10343. var t = u - e.clientY;
  10344. d.setValue(d.getValue() + t * d.__impliedStep),
  10345. u = e.clientY
  10346. }
  10347. function h() {
  10348. t.unbind(window, "mousemove", c),
  10349. t.unbind(window, "mouseup", h)
  10350. }
  10351. this.__truncationSuspended = !1,
  10352. r.superclass.call(this, e, n, o);
  10353. var u, d = this;
  10354. this.__input = document.createElement("input"),
  10355. this.__input.setAttribute("type", "text"),
  10356. t.bind(this.__input, "change", a),
  10357. t.bind(this.__input, "blur", s),
  10358. t.bind(this.__input, "mousedown", l),
  10359. t.bind(this.__input, "keydown", function(e) {
  10360. 13 === e.keyCode && (d.__truncationSuspended = !0,
  10361. this.blur(),
  10362. d.__truncationSuspended = !1)
  10363. }),
  10364. this.updateDisplay(),
  10365. this.domElement.appendChild(this.__input)
  10366. };
  10367. return r.superclass = e,
  10368. i.extend(r.prototype, e.prototype, {
  10369. updateDisplay: function() {
  10370. return this.__input.value = this.__truncationSuspended ? this.getValue() : n(this.getValue(), this.__precision),
  10371. r.superclass.prototype.updateDisplay.call(this)
  10372. }
  10373. }),
  10374. r
  10375. }(n.controllers.NumberController, n.dom.dom, n.utils.common),
  10376. n.controllers.NumberControllerSlider = function(e, t, i, n, r) {
  10377. function o(e, t, i, n, r) {
  10378. return n + (r - n) * ((e - t) / (i - t))
  10379. }
  10380. var a = function(e, i, n, r, s) {
  10381. function l(e) {
  10382. t.bind(window, "mousemove", c),
  10383. t.bind(window, "mouseup", h),
  10384. c(e)
  10385. }
  10386. function c(e) {
  10387. e.preventDefault();
  10388. var i = t.getOffset(u.__background)
  10389. , n = t.getWidth(u.__background);
  10390. return u.setValue(o(e.clientX, i.left, i.left + n, u.__min, u.__max)),
  10391. !1
  10392. }
  10393. function h() {
  10394. t.unbind(window, "mousemove", c),
  10395. t.unbind(window, "mouseup", h),
  10396. u.__onFinishChange && u.__onFinishChange.call(u, u.getValue())
  10397. }
  10398. a.superclass.call(this, e, i, {
  10399. min: n,
  10400. max: r,
  10401. step: s
  10402. });
  10403. var u = this;
  10404. this.__background = document.createElement("div"),
  10405. this.__foreground = document.createElement("div"),
  10406. t.bind(this.__background, "mousedown", l),
  10407. t.addClass(this.__background, "slider"),
  10408. t.addClass(this.__foreground, "slider-fg"),
  10409. this.updateDisplay(),
  10410. this.__background.appendChild(this.__foreground),
  10411. this.domElement.appendChild(this.__background)
  10412. };
  10413. return a.superclass = e,
  10414. a.useDefaultStyles = function() {
  10415. i.inject(r)
  10416. }
  10417. ,
  10418. n.extend(a.prototype, e.prototype, {
  10419. updateDisplay: function() {
  10420. var e = (this.getValue() - this.__min) / (this.__max - this.__min);
  10421. return this.__foreground.style.width = 100 * e + "%",
  10422. a.superclass.prototype.updateDisplay.call(this)
  10423. }
  10424. }),
  10425. a
  10426. }(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}"),
  10427. n.controllers.FunctionController = function(e, t, i) {
  10428. var n = function(e, i, r) {
  10429. n.superclass.call(this, e, i);
  10430. var o = this;
  10431. this.__button = document.createElement("div"),
  10432. this.__button.innerHTML = void 0 === r ? "Fire" : r,
  10433. t.bind(this.__button, "click", function(e) {
  10434. return e.preventDefault(),
  10435. o.fire(),
  10436. !1
  10437. }),
  10438. t.addClass(this.__button, "button"),
  10439. this.domElement.appendChild(this.__button)
  10440. };
  10441. return n.superclass = e,
  10442. i.extend(n.prototype, e.prototype, {
  10443. fire: function() {
  10444. this.__onChange && this.__onChange.call(this),
  10445. this.__onFinishChange && this.__onFinishChange.call(this, this.getValue()),
  10446. this.getValue().call(this.object)
  10447. }
  10448. }),
  10449. n
  10450. }(n.controllers.Controller, n.dom.dom, n.utils.common),
  10451. n.controllers.BooleanController = function(e, t, i) {
  10452. var n = function(e, i) {
  10453. function r() {
  10454. o.setValue(!o.__prev)
  10455. }
  10456. n.superclass.call(this, e, i);
  10457. var o = this;
  10458. this.__prev = this.getValue(),
  10459. this.__checkbox = document.createElement("input"),
  10460. this.__checkbox.setAttribute("type", "checkbox"),
  10461. t.bind(this.__checkbox, "change", r, !1),
  10462. this.domElement.appendChild(this.__checkbox),
  10463. this.updateDisplay()
  10464. };
  10465. return n.superclass = e,
  10466. i.extend(n.prototype, e.prototype, {
  10467. setValue: function(e) {
  10468. var t = n.superclass.prototype.setValue.call(this, e);
  10469. return this.__onFinishChange && this.__onFinishChange.call(this, this.getValue()),
  10470. this.__prev = this.getValue(),
  10471. t
  10472. },
  10473. updateDisplay: function() {
  10474. return this.getValue() === !0 ? (this.__checkbox.setAttribute("checked", "checked"),
  10475. this.__checkbox.checked = !0) : this.__checkbox.checked = !1,
  10476. n.superclass.prototype.updateDisplay.call(this)
  10477. }
  10478. }),
  10479. n
  10480. }(n.controllers.Controller, n.dom.dom, n.utils.common),
  10481. n.color.toString = function(e) {
  10482. return function(t) {
  10483. if (1 == t.a || e.isUndefined(t.a)) {
  10484. for (var i = t.hex.toString(16); i.length < 6; )
  10485. i = "0" + i;
  10486. return "#" + i
  10487. }
  10488. return "rgba(" + Math.round(t.r) + "," + Math.round(t.g) + "," + Math.round(t.b) + "," + t.a + ")"
  10489. }
  10490. }(n.utils.common),
  10491. n.color.interpret = function(e, t) {
  10492. var i, n, r = function() {
  10493. n = !1;
  10494. var e = arguments.length > 1 ? t.toArray(arguments) : arguments[0];
  10495. return t.each(o, function(r) {
  10496. if (r.litmus(e))
  10497. return t.each(r.conversions, function(r, o) {
  10498. if (i = r.read(e),
  10499. n === !1 && i !== !1)
  10500. return n = i,
  10501. i.conversionName = o,
  10502. i.conversion = r,
  10503. t.BREAK
  10504. }),
  10505. t.BREAK
  10506. }),
  10507. n
  10508. }, o = [{
  10509. litmus: t.isString,
  10510. conversions: {
  10511. THREE_CHAR_HEX: {
  10512. read: function(e) {
  10513. var t = e.match(/^#([A-F0-9])([A-F0-9])([A-F0-9])$/i);
  10514. return null !== t && {
  10515. space: "HEX",
  10516. hex: parseInt("0x" + t[1].toString() + t[1].toString() + t[2].toString() + t[2].toString() + t[3].toString() + t[3].toString())
  10517. }
  10518. },
  10519. write: e
  10520. },
  10521. SIX_CHAR_HEX: {
  10522. read: function(e) {
  10523. var t = e.match(/^#([A-F0-9]{6})$/i);
  10524. return null !== t && {
  10525. space: "HEX",
  10526. hex: parseInt("0x" + t[1].toString())
  10527. }
  10528. },
  10529. write: e
  10530. },
  10531. CSS_RGB: {
  10532. read: function(e) {
  10533. var t = e.match(/^rgb\(\s*(.+)\s*,\s*(.+)\s*,\s*(.+)\s*\)/);
  10534. return null !== t && {
  10535. space: "RGB",
  10536. r: parseFloat(t[1]),
  10537. g: parseFloat(t[2]),
  10538. b: parseFloat(t[3])
  10539. }
  10540. },
  10541. write: e
  10542. },
  10543. CSS_RGBA: {
  10544. read: function(e) {
  10545. var t = e.match(/^rgba\(\s*(.+)\s*,\s*(.+)\s*,\s*(.+)\s*\,\s*(.+)\s*\)/);
  10546. return null !== t && {
  10547. space: "RGB",
  10548. r: parseFloat(t[1]),
  10549. g: parseFloat(t[2]),
  10550. b: parseFloat(t[3]),
  10551. a: parseFloat(t[4])
  10552. }
  10553. },
  10554. write: e
  10555. }
  10556. }
  10557. }, {
  10558. litmus: t.isNumber,
  10559. conversions: {
  10560. HEX: {
  10561. read: function(e) {
  10562. return {
  10563. space: "HEX",
  10564. hex: e,
  10565. conversionName: "HEX"
  10566. }
  10567. },
  10568. write: function(e) {
  10569. return e.hex
  10570. }
  10571. }
  10572. }
  10573. }, {
  10574. litmus: t.isArray,
  10575. conversions: {
  10576. RGB_ARRAY: {
  10577. read: function(e) {
  10578. return 3 == e.length && {
  10579. space: "RGB",
  10580. r: e[0],
  10581. g: e[1],
  10582. b: e[2]
  10583. }
  10584. },
  10585. write: function(e) {
  10586. return [e.r, e.g, e.b]
  10587. }
  10588. },
  10589. RGBA_ARRAY: {
  10590. read: function(e) {
  10591. return 4 == e.length && {
  10592. space: "RGB",
  10593. r: e[0],
  10594. g: e[1],
  10595. b: e[2],
  10596. a: e[3]
  10597. }
  10598. },
  10599. write: function(e) {
  10600. return [e.r, e.g, e.b, e.a]
  10601. }
  10602. }
  10603. }
  10604. }, {
  10605. litmus: t.isObject,
  10606. conversions: {
  10607. RGBA_OBJ: {
  10608. read: function(e) {
  10609. return !!(t.isNumber(e.r) && t.isNumber(e.g) && t.isNumber(e.b) && t.isNumber(e.a)) && {
  10610. space: "RGB",
  10611. r: e.r,
  10612. g: e.g,
  10613. b: e.b,
  10614. a: e.a
  10615. }
  10616. },
  10617. write: function(e) {
  10618. return {
  10619. r: e.r,
  10620. g: e.g,
  10621. b: e.b,
  10622. a: e.a
  10623. }
  10624. }
  10625. },
  10626. RGB_OBJ: {
  10627. read: function(e) {
  10628. return !!(t.isNumber(e.r) && t.isNumber(e.g) && t.isNumber(e.b)) && {
  10629. space: "RGB",
  10630. r: e.r,
  10631. g: e.g,
  10632. b: e.b
  10633. }
  10634. },
  10635. write: function(e) {
  10636. return {
  10637. r: e.r,
  10638. g: e.g,
  10639. b: e.b
  10640. }
  10641. }
  10642. },
  10643. HSVA_OBJ: {
  10644. read: function(e) {
  10645. return !!(t.isNumber(e.h) && t.isNumber(e.s) && t.isNumber(e.v) && t.isNumber(e.a)) && {
  10646. space: "HSV",
  10647. h: e.h,
  10648. s: e.s,
  10649. v: e.v,
  10650. a: e.a
  10651. }
  10652. },
  10653. write: function(e) {
  10654. return {
  10655. h: e.h,
  10656. s: e.s,
  10657. v: e.v,
  10658. a: e.a
  10659. }
  10660. }
  10661. },
  10662. HSV_OBJ: {
  10663. read: function(e) {
  10664. return !!(t.isNumber(e.h) && t.isNumber(e.s) && t.isNumber(e.v)) && {
  10665. space: "HSV",
  10666. h: e.h,
  10667. s: e.s,
  10668. v: e.v
  10669. }
  10670. },
  10671. write: function(e) {
  10672. return {
  10673. h: e.h,
  10674. s: e.s,
  10675. v: e.v
  10676. }
  10677. }
  10678. }
  10679. }
  10680. }];
  10681. return r
  10682. }(n.color.toString, n.utils.common),
  10683. n.GUI = n.gui.GUI = function(e, t, i, n, r, o, a, s, l, c, h, u, d, p, f) {
  10684. function g(e, t, i, o) {
  10685. if (void 0 === t[i])
  10686. throw new Error("Object " + t + ' has no property "' + i + '"');
  10687. var a;
  10688. if (o.color)
  10689. a = new h(t,i);
  10690. else {
  10691. var s = [t, i].concat(o.factoryArgs);
  10692. a = n.apply(e, s)
  10693. }
  10694. o.before instanceof r && (o.before = o.before.__li),
  10695. A(e, a),
  10696. p.addClass(a.domElement, "c");
  10697. var l = document.createElement("span");
  10698. p.addClass(l, "property-name"),
  10699. l.innerHTML = a.property;
  10700. var c = document.createElement("div");
  10701. c.appendChild(l),
  10702. c.appendChild(a.domElement);
  10703. var u = m(e, c, o.before);
  10704. return p.addClass(u, V.CLASS_CONTROLLER_ROW),
  10705. p.addClass(u, typeof a.getValue()),
  10706. v(e, u, a),
  10707. e.__controllers.push(a),
  10708. a
  10709. }
  10710. function m(e, t, i) {
  10711. var n = document.createElement("li");
  10712. return t && n.appendChild(t),
  10713. i ? e.__ul.insertBefore(n, params.before) : e.__ul.appendChild(n),
  10714. e.onResize(),
  10715. n
  10716. }
  10717. function v(e, t, i) {
  10718. if (i.__li = t,
  10719. i.__gui = e,
  10720. f.extend(i, {
  10721. options: function(t) {
  10722. return arguments.length > 1 ? (i.remove(),
  10723. g(e, i.object, i.property, {
  10724. before: i.__li.nextElementSibling,
  10725. factoryArgs: [f.toArray(arguments)]
  10726. })) : f.isArray(t) || f.isObject(t) ? (i.remove(),
  10727. g(e, i.object, i.property, {
  10728. before: i.__li.nextElementSibling,
  10729. factoryArgs: [t]
  10730. })) : void 0
  10731. },
  10732. name: function(e) {
  10733. return i.__li.firstElementChild.firstElementChild.innerHTML = e,
  10734. i
  10735. },
  10736. listen: function() {
  10737. return i.__gui.listen(i),
  10738. i
  10739. },
  10740. remove: function() {
  10741. return i.__gui.remove(i),
  10742. i
  10743. }
  10744. }),
  10745. i instanceof l) {
  10746. var n = new s(i.object,i.property,{
  10747. min: i.__min,
  10748. max: i.__max,
  10749. step: i.__step
  10750. });
  10751. f.each(["updateDisplay", "onChange", "onFinishChange"], function(e) {
  10752. var t = i[e]
  10753. , r = n[e];
  10754. i[e] = n[e] = function() {
  10755. var e = Array.prototype.slice.call(arguments);
  10756. return t.apply(i, e),
  10757. r.apply(n, e)
  10758. }
  10759. }),
  10760. p.addClass(t, "has-slider"),
  10761. i.domElement.insertBefore(n.domElement, i.domElement.firstElementChild)
  10762. } else if (i instanceof s) {
  10763. var r = function(t) {
  10764. return f.isNumber(i.__min) && f.isNumber(i.__max) ? (i.remove(),
  10765. g(e, i.object, i.property, {
  10766. before: i.__li.nextElementSibling,
  10767. factoryArgs: [i.__min, i.__max, i.__step]
  10768. })) : t
  10769. };
  10770. i.min = f.compose(r, i.min),
  10771. i.max = f.compose(r, i.max)
  10772. } else
  10773. i instanceof o ? (p.bind(t, "click", function() {
  10774. p.fakeEvent(i.__checkbox, "click")
  10775. }),
  10776. p.bind(i.__checkbox, "click", function(e) {
  10777. e.stopPropagation()
  10778. })) : i instanceof a ? (p.bind(t, "click", function() {
  10779. p.fakeEvent(i.__button, "click")
  10780. }),
  10781. p.bind(t, "mouseover", function() {
  10782. p.addClass(i.__button, "hover")
  10783. }),
  10784. p.bind(t, "mouseout", function() {
  10785. p.removeClass(i.__button, "hover")
  10786. })) : i instanceof h && (p.addClass(t, "color"),
  10787. i.updateDisplay = f.compose(function(e) {
  10788. return t.style.borderLeftColor = i.__color.toString(),
  10789. e
  10790. }, i.updateDisplay),
  10791. i.updateDisplay());
  10792. i.setValue = f.compose(function(t) {
  10793. return e.getRoot().__preset_select && i.isModified() && T(e.getRoot(), !0),
  10794. t
  10795. }, i.setValue)
  10796. }
  10797. function A(e, t) {
  10798. var i = e.getRoot()
  10799. , n = i.__rememberedObjects.indexOf(t.object);
  10800. if (n != -1) {
  10801. var r = i.__rememberedObjectIndecesToControllers[n];
  10802. if (void 0 === r && (r = {},
  10803. i.__rememberedObjectIndecesToControllers[n] = r),
  10804. r[t.property] = t,
  10805. i.load && i.load.remembered) {
  10806. var o, a = i.load.remembered;
  10807. if (a[e.preset])
  10808. o = a[e.preset];
  10809. else {
  10810. if (!a[L])
  10811. return;
  10812. o = a[L]
  10813. }
  10814. if (o[n] && void 0 !== o[n][t.property]) {
  10815. var s = o[n][t.property];
  10816. t.initialValue = s,
  10817. t.setValue(s)
  10818. }
  10819. }
  10820. }
  10821. }
  10822. function y(e, t) {
  10823. return document.location.href + "." + t
  10824. }
  10825. function C(e) {
  10826. var t = e.__save_row = document.createElement("li");
  10827. p.addClass(e.domElement, "has-save"),
  10828. e.__ul.insertBefore(t, e.__ul.firstChild),
  10829. p.addClass(t, "save-row");
  10830. var i = document.createElement("span");
  10831. i.innerHTML = "&nbsp;",
  10832. p.addClass(i, "button gears");
  10833. var n = document.createElement("span");
  10834. n.innerHTML = "Save",
  10835. p.addClass(n, "button"),
  10836. p.addClass(n, "save");
  10837. var r = document.createElement("span");
  10838. r.innerHTML = "New",
  10839. p.addClass(r, "button"),
  10840. p.addClass(r, "save-as");
  10841. var o = document.createElement("span");
  10842. o.innerHTML = "Revert",
  10843. p.addClass(o, "button"),
  10844. p.addClass(o, "revert");
  10845. var a = e.__preset_select = document.createElement("select");
  10846. if (e.load && e.load.remembered ? f.each(e.load.remembered, function(t, i) {
  10847. w(e, i, i == e.preset)
  10848. }) : w(e, L, !1),
  10849. p.bind(a, "change", function() {
  10850. for (var t = 0; t < e.__preset_select.length; t++)
  10851. e.__preset_select[t].innerHTML = e.__preset_select[t].value;
  10852. e.preset = this.value
  10853. }),
  10854. t.appendChild(a),
  10855. t.appendChild(i),
  10856. t.appendChild(n),
  10857. t.appendChild(r),
  10858. t.appendChild(o),
  10859. D) {
  10860. var s = document.getElementById("dg-save-locally")
  10861. , l = document.getElementById("dg-local-explain");
  10862. s.style.display = "block";
  10863. var c = document.getElementById("dg-local-storage");
  10864. "true" === localStorage.getItem(y(e, "isLocal")) && c.setAttribute("checked", "checked");
  10865. var h = function() {
  10866. l.style.display = e.useLocalStorage ? "block" : "none"
  10867. };
  10868. h(),
  10869. p.bind(c, "change", function() {
  10870. e.useLocalStorage = !e.useLocalStorage,
  10871. h()
  10872. })
  10873. }
  10874. var u = document.getElementById("dg-new-constructor");
  10875. p.bind(u, "keydown", function(e) {
  10876. !e.metaKey || 67 !== e.which && 67 != e.keyCode || S.hide()
  10877. }),
  10878. p.bind(i, "click", function() {
  10879. u.innerHTML = JSON.stringify(e.getSaveObject(), void 0, 2),
  10880. S.show(),
  10881. u.focus(),
  10882. u.select()
  10883. }),
  10884. p.bind(n, "click", function() {
  10885. e.save()
  10886. }),
  10887. p.bind(r, "click", function() {
  10888. var t = prompt("Enter a new preset name.");
  10889. t && e.saveAs(t)
  10890. }),
  10891. p.bind(o, "click", function() {
  10892. e.revert()
  10893. })
  10894. }
  10895. function I(e) {
  10896. function t(t) {
  10897. return t.preventDefault(),
  10898. r = t.clientX,
  10899. p.addClass(e.__closeButton, V.CLASS_DRAG),
  10900. p.bind(window, "mousemove", i),
  10901. p.bind(window, "mouseup", n),
  10902. !1
  10903. }
  10904. function i(t) {
  10905. return t.preventDefault(),
  10906. e.width += r - t.clientX,
  10907. e.onResize(),
  10908. r = t.clientX,
  10909. !1
  10910. }
  10911. function n() {
  10912. p.removeClass(e.__closeButton, V.CLASS_DRAG),
  10913. p.unbind(window, "mousemove", i),
  10914. p.unbind(window, "mouseup", n)
  10915. }
  10916. e.__resize_handle = document.createElement("div"),
  10917. f.extend(e.__resize_handle.style, {
  10918. width: "6px",
  10919. marginLeft: "-3px",
  10920. height: "200px",
  10921. cursor: "ew-resize",
  10922. position: "absolute"
  10923. });
  10924. var r;
  10925. p.bind(e.__resize_handle, "mousedown", t),
  10926. p.bind(e.__closeButton, "mousedown", t),
  10927. e.domElement.insertBefore(e.__resize_handle, e.domElement.firstElementChild)
  10928. }
  10929. function E(e, t) {
  10930. e.domElement.style.width = t + "px",
  10931. e.__save_row && e.autoPlace && (e.__save_row.style.width = t + "px"),
  10932. e.__closeButton && (e.__closeButton.style.width = t + "px")
  10933. }
  10934. function b(e, t) {
  10935. var i = {};
  10936. return f.each(e.__rememberedObjects, function(n, r) {
  10937. var o = {}
  10938. , a = e.__rememberedObjectIndecesToControllers[r];
  10939. f.each(a, function(e, i) {
  10940. o[i] = t ? e.initialValue : e.getValue()
  10941. }),
  10942. i[r] = o
  10943. }),
  10944. i
  10945. }
  10946. function w(e, t, i) {
  10947. var n = document.createElement("option");
  10948. n.innerHTML = t,
  10949. n.value = t,
  10950. e.__preset_select.appendChild(n),
  10951. i && (e.__preset_select.selectedIndex = e.__preset_select.length - 1)
  10952. }
  10953. function _(e) {
  10954. for (var t = 0; t < e.__preset_select.length; t++)
  10955. e.__preset_select[t].value == e.preset && (e.__preset_select.selectedIndex = t)
  10956. }
  10957. function T(e, t) {
  10958. var i = e.__preset_select[e.__preset_select.selectedIndex];
  10959. t ? i.innerHTML = i.value + "*" : i.innerHTML = i.value
  10960. }
  10961. function x(e) {
  10962. 0 != e.length && u(function() {
  10963. x(e)
  10964. }),
  10965. f.each(e, function(e) {
  10966. e.updateDisplay()
  10967. })
  10968. }
  10969. e.inject(i);
  10970. var S, M, R = "dg", P = 72, O = 20, L = "Default", D = function() {
  10971. try {
  10972. return "localStorage"in window && null !== window.localStorage
  10973. } catch (e) {
  10974. return !1
  10975. }
  10976. }(), N = !0, B = !1, F = [], V = function(e) {
  10977. function t() {
  10978. var e = i.getRoot();
  10979. e.width += 1,
  10980. f.defer(function() {
  10981. e.width -= 1
  10982. })
  10983. }
  10984. var i = this;
  10985. this.domElement = document.createElement("div"),
  10986. this.__ul = document.createElement("ul"),
  10987. this.domElement.appendChild(this.__ul),
  10988. p.addClass(this.domElement, R),
  10989. this.__folders = {},
  10990. this.__controllers = [],
  10991. this.__rememberedObjects = [],
  10992. this.__rememberedObjectIndecesToControllers = [],
  10993. this.__listening = [],
  10994. e = e || {},
  10995. e = f.defaults(e, {
  10996. autoPlace: !0,
  10997. width: V.DEFAULT_WIDTH
  10998. }),
  10999. e = f.defaults(e, {
  11000. resizable: e.autoPlace,
  11001. hideable: e.autoPlace
  11002. }),
  11003. f.isUndefined(e.load) ? e.load = {
  11004. preset: L
  11005. } : e.preset && (e.load.preset = e.preset),
  11006. f.isUndefined(e.parent) && e.hideable && F.push(this),
  11007. e.resizable = f.isUndefined(e.parent) && e.resizable,
  11008. e.autoPlace && f.isUndefined(e.scrollable) && (e.scrollable = !0);
  11009. var n, r = D && "true" === localStorage.getItem(y(this, "isLocal"));
  11010. if (Object.defineProperties(this, {
  11011. parent: {
  11012. get: function() {
  11013. return e.parent
  11014. }
  11015. },
  11016. scrollable: {
  11017. get: function() {
  11018. return e.scrollable
  11019. }
  11020. },
  11021. autoPlace: {
  11022. get: function() {
  11023. return e.autoPlace
  11024. }
  11025. },
  11026. preset: {
  11027. get: function() {
  11028. return i.parent ? i.getRoot().preset : e.load.preset
  11029. },
  11030. set: function(t) {
  11031. i.parent ? i.getRoot().preset = t : e.load.preset = t,
  11032. _(this),
  11033. i.revert()
  11034. }
  11035. },
  11036. width: {
  11037. get: function() {
  11038. return e.width
  11039. },
  11040. set: function(t) {
  11041. e.width = t,
  11042. E(i, t)
  11043. }
  11044. },
  11045. name: {
  11046. get: function() {
  11047. return e.name
  11048. },
  11049. set: function(t) {
  11050. e.name = t,
  11051. a && (a.innerHTML = e.name)
  11052. }
  11053. },
  11054. closed: {
  11055. get: function() {
  11056. return e.closed
  11057. },
  11058. set: function(t) {
  11059. e.closed = t,
  11060. e.closed ? p.addClass(i.__ul, V.CLASS_CLOSED) : p.removeClass(i.__ul, V.CLASS_CLOSED),
  11061. this.onResize(),
  11062. i.__closeButton && (i.__closeButton.innerHTML = t ? V.TEXT_OPEN : V.TEXT_CLOSED)
  11063. }
  11064. },
  11065. load: {
  11066. get: function() {
  11067. return e.load
  11068. }
  11069. },
  11070. useLocalStorage: {
  11071. get: function() {
  11072. return r
  11073. },
  11074. set: function(e) {
  11075. D && (r = e,
  11076. e ? p.bind(window, "unload", n) : p.unbind(window, "unload", n),
  11077. localStorage.setItem(y(i, "isLocal"), e))
  11078. }
  11079. }
  11080. }),
  11081. f.isUndefined(e.parent)) {
  11082. if (e.closed = !1,
  11083. p.addClass(this.domElement, V.CLASS_MAIN),
  11084. p.makeSelectable(this.domElement, !1),
  11085. D && r) {
  11086. i.useLocalStorage = !0;
  11087. var o = localStorage.getItem(y(this, "gui"));
  11088. o && (e.load = JSON.parse(o))
  11089. }
  11090. this.__closeButton = document.createElement("div"),
  11091. this.__closeButton.innerHTML = V.TEXT_CLOSED,
  11092. p.addClass(this.__closeButton, V.CLASS_CLOSE_BUTTON),
  11093. this.domElement.appendChild(this.__closeButton),
  11094. p.bind(this.__closeButton, "click", function() {
  11095. i.closed = !i.closed
  11096. })
  11097. } else {
  11098. void 0 === e.closed && (e.closed = !0);
  11099. var a = document.createTextNode(e.name);
  11100. p.addClass(a, "controller-name");
  11101. var s = m(i, a)
  11102. , l = function(e) {
  11103. return e.preventDefault(),
  11104. i.closed = !i.closed,
  11105. !1
  11106. };
  11107. p.addClass(this.__ul, V.CLASS_CLOSED),
  11108. p.addClass(s, "title"),
  11109. p.bind(s, "click", l),
  11110. e.closed || (this.closed = !1)
  11111. }
  11112. e.autoPlace && (f.isUndefined(e.parent) && (N && (M = document.createElement("div"),
  11113. p.addClass(M, R),
  11114. p.addClass(M, V.CLASS_AUTO_PLACE_CONTAINER),
  11115. document.body.appendChild(M),
  11116. N = !1),
  11117. M.appendChild(this.domElement),
  11118. p.addClass(this.domElement, V.CLASS_AUTO_PLACE)),
  11119. this.parent || E(i, e.width)),
  11120. p.bind(window, "resize", function() {
  11121. i.onResize()
  11122. }),
  11123. p.bind(this.__ul, "webkitTransitionEnd", function() {
  11124. i.onResize()
  11125. }),
  11126. p.bind(this.__ul, "transitionend", function() {
  11127. i.onResize()
  11128. }),
  11129. p.bind(this.__ul, "oTransitionEnd", function() {
  11130. i.onResize()
  11131. }),
  11132. this.onResize(),
  11133. e.resizable && I(this),
  11134. n = function() {
  11135. D && "true" === localStorage.getItem(y(i, "isLocal")) && localStorage.setItem(y(i, "gui"), JSON.stringify(i.getSaveObject()))
  11136. }
  11137. ,
  11138. this.saveToLocalStorageIfPossible = n;
  11139. i.getRoot();
  11140. e.parent || t()
  11141. };
  11142. return V.toggleHide = function() {
  11143. B = !B,
  11144. f.each(F, function(e) {
  11145. e.domElement.style.zIndex = B ? -999 : 999,
  11146. e.domElement.style.opacity = B ? 0 : 1
  11147. })
  11148. }
  11149. ,
  11150. V.CLASS_AUTO_PLACE = "a",
  11151. V.CLASS_AUTO_PLACE_CONTAINER = "ac",
  11152. V.CLASS_MAIN = "main",
  11153. V.CLASS_CONTROLLER_ROW = "cr",
  11154. V.CLASS_TOO_TALL = "taller-than-window",
  11155. V.CLASS_CLOSED = "closed",
  11156. V.CLASS_CLOSE_BUTTON = "close-button",
  11157. V.CLASS_DRAG = "drag",
  11158. V.DEFAULT_WIDTH = 245,
  11159. V.TEXT_CLOSED = "Close Controls",
  11160. V.TEXT_OPEN = "Open Controls",
  11161. p.bind(window, "keydown", function(e) {
  11162. "text" === document.activeElement.type || e.which !== P && e.keyCode != P || V.toggleHide()
  11163. }, !1),
  11164. f.extend(V.prototype, {
  11165. add: function(e, t) {
  11166. return g(this, e, t, {
  11167. factoryArgs: Array.prototype.slice.call(arguments, 2)
  11168. })
  11169. },
  11170. addColor: function(e, t) {
  11171. return g(this, e, t, {
  11172. color: !0
  11173. })
  11174. },
  11175. remove: function(e) {
  11176. this.__ul.removeChild(e.__li),
  11177. this.__controllers.slice(this.__controllers.indexOf(e), 1);
  11178. var t = this;
  11179. f.defer(function() {
  11180. t.onResize()
  11181. })
  11182. },
  11183. destroy: function() {
  11184. this.autoPlace && M.removeChild(this.domElement)
  11185. },
  11186. addFolder: function(e) {
  11187. if (void 0 !== this.__folders[e])
  11188. throw new Error('You already have a folder in this GUI by the name "' + e + '"');
  11189. var t = {
  11190. name: e,
  11191. parent: this
  11192. };
  11193. t.autoPlace = this.autoPlace,
  11194. this.load && this.load.folders && this.load.folders[e] && (t.closed = this.load.folders[e].closed,
  11195. t.load = this.load.folders[e]);
  11196. var i = new V(t);
  11197. this.__folders[e] = i;
  11198. var n = m(this, i.domElement);
  11199. return p.addClass(n, "folder"),
  11200. i
  11201. },
  11202. open: function() {
  11203. this.closed = !1
  11204. },
  11205. close: function() {
  11206. this.closed = !0
  11207. },
  11208. onResize: function() {
  11209. var e = this.getRoot();
  11210. if (e.scrollable) {
  11211. var t = p.getOffset(e.__ul).top
  11212. , i = 0;
  11213. f.each(e.__ul.childNodes, function(t) {
  11214. e.autoPlace && t === e.__save_row || (i += p.getHeight(t))
  11215. }),
  11216. $("#player").height() - t - O < i ? (p.addClass(e.domElement, V.CLASS_TOO_TALL),
  11217. e.__ul.style.height = $("#player").height() - t - O + "px") : (p.removeClass(e.domElement, V.CLASS_TOO_TALL),
  11218. e.__ul.style.height = "auto")
  11219. }
  11220. e.__resize_handle && f.defer(function() {
  11221. e.__resize_handle.style.height = e.__ul.offsetHeight + "px"
  11222. }),
  11223. e.__closeButton && (e.__closeButton.style.width = e.width + "px")
  11224. },
  11225. remember: function() {
  11226. if (f.isUndefined(S) && (S = new d,
  11227. S.domElement.innerHTML = t),
  11228. this.parent)
  11229. throw new Error("You can only call remember on a top level GUI.");
  11230. var e = this;
  11231. f.each(Array.prototype.slice.call(arguments), function(t) {
  11232. 0 == e.__rememberedObjects.length && C(e),
  11233. e.__rememberedObjects.indexOf(t) == -1 && e.__rememberedObjects.push(t)
  11234. }),
  11235. this.autoPlace && E(this, this.width)
  11236. },
  11237. getRoot: function() {
  11238. for (var e = this; e.parent; )
  11239. e = e.parent;
  11240. return e
  11241. },
  11242. getSaveObject: function() {
  11243. var e = this.load;
  11244. return e.closed = this.closed,
  11245. this.__rememberedObjects.length > 0 && (e.preset = this.preset,
  11246. e.remembered || (e.remembered = {}),
  11247. e.remembered[this.preset] = b(this)),
  11248. e.folders = {},
  11249. f.each(this.__folders, function(t, i) {
  11250. e.folders[i] = t.getSaveObject()
  11251. }),
  11252. e
  11253. },
  11254. save: function() {
  11255. this.load.remembered || (this.load.remembered = {}),
  11256. this.load.remembered[this.preset] = b(this),
  11257. T(this, !1),
  11258. this.saveToLocalStorageIfPossible()
  11259. },
  11260. saveAs: function(e) {
  11261. this.load.remembered || (this.load.remembered = {},
  11262. this.load.remembered[L] = b(this, !0)),
  11263. this.load.remembered[e] = b(this),
  11264. this.preset = e,
  11265. w(this, e, !0),
  11266. this.saveToLocalStorageIfPossible()
  11267. },
  11268. revert: function(e) {
  11269. f.each(this.__controllers, function(t) {
  11270. this.getRoot().load.remembered ? A(e || this.getRoot(), t) : t.setValue(t.initialValue)
  11271. }, this),
  11272. f.each(this.__folders, function(e) {
  11273. e.revert(e)
  11274. }),
  11275. e || T(this.getRoot(), !1)
  11276. },
  11277. listen: function(e) {
  11278. var t = 0 == this.__listening.length;
  11279. this.__listening.push(e),
  11280. t && x(this.__listening)
  11281. }
  11282. }),
  11283. V
  11284. }(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) {
  11285. return function(s, l) {
  11286. var c = s[l];
  11287. 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,{
  11288. min: arguments[2],
  11289. max: arguments[3]
  11290. }) : a.isString(c) ? new n(s,l) : a.isFunction(c) ? new r(s,l,"") : a.isBoolean(c) ? new o(s,l) : void 0
  11291. }
  11292. }(n.controllers.OptionController, n.controllers.NumberControllerBox, n.controllers.NumberControllerSlider, n.controllers.StringController = function(e, t, i) {
  11293. var n = function(e, i) {
  11294. function r() {
  11295. a.setValue(a.__input.value)
  11296. }
  11297. function o() {
  11298. a.__onFinishChange && a.__onFinishChange.call(a, a.getValue())
  11299. }
  11300. n.superclass.call(this, e, i);
  11301. var a = this;
  11302. this.__input = document.createElement("input"),
  11303. this.__input.setAttribute("type", "text"),
  11304. t.bind(this.__input, "keyup", r),
  11305. t.bind(this.__input, "change", r),
  11306. t.bind(this.__input, "blur", o),
  11307. t.bind(this.__input, "keydown", function(e) {
  11308. 13 === e.keyCode && this.blur()
  11309. }),
  11310. this.updateDisplay(),
  11311. this.domElement.appendChild(this.__input)
  11312. };
  11313. return n.superclass = e,
  11314. i.extend(n.prototype, e.prototype, {
  11315. updateDisplay: function() {
  11316. return t.isActive(this.__input) || (this.__input.value = this.getValue()),
  11317. n.superclass.prototype.updateDisplay.call(this)
  11318. }
  11319. }),
  11320. n
  11321. }(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) {
  11322. function o(e, t, i, n) {
  11323. e.style.background = "",
  11324. r.each(l, function(r) {
  11325. e.style.cssText += "background: " + r + "linear-gradient(" + t + ", " + i + " 0%, " + n + " 100%); "
  11326. })
  11327. }
  11328. function a(e) {
  11329. e.style.background = "",
  11330. e.style.cssText += "background: -moz-linear-gradient(top, #ff0000 0%, #ff00ff 17%, #0000ff 34%, #00ffff 50%, #00ff00 67%, #ffff00 84%, #ff0000 100%);",
  11331. e.style.cssText += "background: -webkit-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);",
  11332. e.style.cssText += "background: -o-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);",
  11333. e.style.cssText += "background: -ms-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);",
  11334. e.style.cssText += "background: linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);"
  11335. }
  11336. var s = function(e, l) {
  11337. function c(e) {
  11338. p(e),
  11339. t.bind(window, "mousemove", p),
  11340. t.bind(window, "mouseup", h)
  11341. }
  11342. function h() {
  11343. t.unbind(window, "mousemove", p),
  11344. t.unbind(window, "mouseup", h)
  11345. }
  11346. function u() {
  11347. var e = n(this.value);
  11348. e !== !1 ? (g.__color.__state = e,
  11349. g.setValue(g.__color.toOriginal())) : this.value = g.__color.toString()
  11350. }
  11351. function d() {
  11352. t.unbind(window, "mousemove", f),
  11353. t.unbind(window, "mouseup", d)
  11354. }
  11355. function p(e) {
  11356. e.preventDefault();
  11357. var i = t.getWidth(g.__saturation_field)
  11358. , n = t.getOffset(g.__saturation_field)
  11359. , r = (e.clientX - n.left + document.body.scrollLeft) / i
  11360. , o = 1 - (e.clientY - n.top + document.body.scrollTop) / i;
  11361. return o > 1 ? o = 1 : o < 0 && (o = 0),
  11362. r > 1 ? r = 1 : r < 0 && (r = 0),
  11363. g.__color.v = o,
  11364. g.__color.s = r,
  11365. g.setValue(g.__color.toOriginal()),
  11366. !1
  11367. }
  11368. function f(e) {
  11369. e.preventDefault();
  11370. var i = t.getHeight(g.__hue_field)
  11371. , n = t.getOffset(g.__hue_field)
  11372. , r = 1 - (e.clientY - n.top + document.body.scrollTop) / i;
  11373. return r > 1 ? r = 1 : r < 0 && (r = 0),
  11374. g.__color.h = 360 * r,
  11375. g.setValue(g.__color.toOriginal()),
  11376. !1
  11377. }
  11378. s.superclass.call(this, e, l),
  11379. this.__color = new i(this.getValue()),
  11380. this.__temp = new i(0);
  11381. var g = this;
  11382. this.domElement = document.createElement("div"),
  11383. t.makeSelectable(this.domElement, !1),
  11384. this.__selector = document.createElement("div"),
  11385. this.__selector.className = "selector",
  11386. this.__saturation_field = document.createElement("div"),
  11387. this.__saturation_field.className = "saturation-field",
  11388. this.__field_knob = document.createElement("div"),
  11389. this.__field_knob.className = "field-knob",
  11390. this.__field_knob_border = "2px solid ",
  11391. this.__hue_knob = document.createElement("div"),
  11392. this.__hue_knob.className = "hue-knob",
  11393. this.__hue_field = document.createElement("div"),
  11394. this.__hue_field.className = "hue-field",
  11395. this.__input = document.createElement("input"),
  11396. this.__input.type = "text",
  11397. this.__input_textShadow = "0 1px 1px ",
  11398. t.bind(this.__input, "keydown", function(e) {
  11399. 13 === e.keyCode && u.call(this)
  11400. }),
  11401. t.bind(this.__input, "blur", u),
  11402. t.bind(this.__selector, "mousedown", function(e) {
  11403. t.addClass(this, "drag").bind(window, "mouseup", function(e) {
  11404. t.removeClass(g.__selector, "drag")
  11405. })
  11406. });
  11407. var m = document.createElement("div");
  11408. r.extend(this.__selector.style, {
  11409. width: "122px",
  11410. height: "102px",
  11411. padding: "3px",
  11412. backgroundColor: "#222",
  11413. boxShadow: "0px 1px 3px rgba(0,0,0,0.3)"
  11414. }),
  11415. r.extend(this.__field_knob.style, {
  11416. position: "absolute",
  11417. width: "12px",
  11418. height: "12px",
  11419. border: this.__field_knob_border + (this.__color.v < .5 ? "#fff" : "#000"),
  11420. boxShadow: "0px 1px 3px rgba(0,0,0,0.5)",
  11421. borderRadius: "12px",
  11422. zIndex: 1
  11423. }),
  11424. r.extend(this.__hue_knob.style, {
  11425. position: "absolute",
  11426. width: "15px",
  11427. height: "2px",
  11428. borderRight: "4px solid #fff",
  11429. zIndex: 1
  11430. }),
  11431. r.extend(this.__saturation_field.style, {
  11432. width: "100px",
  11433. height: "100px",
  11434. border: "1px solid #555",
  11435. marginRight: "3px",
  11436. display: "inline-block",
  11437. cursor: "pointer"
  11438. }),
  11439. r.extend(m.style, {
  11440. width: "100%",
  11441. height: "100%",
  11442. background: "none"
  11443. }),
  11444. o(m, "top", "rgba(0,0,0,0)", "#000"),
  11445. r.extend(this.__hue_field.style, {
  11446. width: "15px",
  11447. height: "100px",
  11448. display: "inline-block",
  11449. border: "1px solid #555",
  11450. cursor: "ns-resize"
  11451. }),
  11452. a(this.__hue_field),
  11453. r.extend(this.__input.style, {
  11454. outline: "none",
  11455. textAlign: "center",
  11456. color: "#fff",
  11457. border: 0,
  11458. fontWeight: "bold",
  11459. textShadow: this.__input_textShadow + "rgba(0,0,0,0.7)"
  11460. }),
  11461. t.bind(this.__saturation_field, "mousedown", c),
  11462. t.bind(this.__field_knob, "mousedown", c),
  11463. t.bind(this.__hue_field, "mousedown", function(e) {
  11464. f(e),
  11465. t.bind(window, "mousemove", f),
  11466. t.bind(window, "mouseup", d)
  11467. }),
  11468. this.__saturation_field.appendChild(m),
  11469. this.__selector.appendChild(this.__field_knob),
  11470. this.__selector.appendChild(this.__saturation_field),
  11471. this.__selector.appendChild(this.__hue_field),
  11472. this.__hue_field.appendChild(this.__hue_knob),
  11473. this.domElement.appendChild(this.__input),
  11474. this.domElement.appendChild(this.__selector),
  11475. this.updateDisplay()
  11476. };
  11477. s.superclass = e,
  11478. r.extend(s.prototype, e.prototype, {
  11479. updateDisplay: function() {
  11480. var e = n(this.getValue());
  11481. if (e !== !1) {
  11482. var t = !1;
  11483. r.each(i.COMPONENTS, function(i) {
  11484. if (!r.isUndefined(e[i]) && !r.isUndefined(this.__color.__state[i]) && e[i] !== this.__color.__state[i])
  11485. return t = !0,
  11486. {}
  11487. }, this),
  11488. t && r.extend(this.__color.__state, e)
  11489. }
  11490. r.extend(this.__temp.__state, this.__color.__state),
  11491. this.__temp.a = 1;
  11492. var a = this.__color.v < .5 || this.__color.s > .5 ? 255 : 0
  11493. , s = 255 - a;
  11494. r.extend(this.__field_knob.style, {
  11495. marginLeft: 100 * this.__color.s - 7 + "px",
  11496. marginTop: 100 * (1 - this.__color.v) - 7 + "px",
  11497. backgroundColor: this.__temp.toString(),
  11498. border: this.__field_knob_border + "rgb(" + a + "," + a + "," + a + ")"
  11499. }),
  11500. this.__hue_knob.style.marginTop = 100 * (1 - this.__color.h / 360) + "px",
  11501. this.__temp.s = 1,
  11502. this.__temp.v = 1,
  11503. o(this.__saturation_field, "left", "#fff", this.__temp.toString()),
  11504. r.extend(this.__input.style, {
  11505. backgroundColor: this.__input.value = this.__color.toString(),
  11506. color: "rgb(" + a + "," + a + "," + a + ")",
  11507. textShadow: this.__input_textShadow + "rgba(" + s + "," + s + "," + s + ",.7)"
  11508. })
  11509. }
  11510. });
  11511. var l = ["-moz-", "-o-", "-webkit-", "-ms-", ""];
  11512. return s
  11513. }(n.controllers.Controller, n.dom.dom, n.color.Color = function(e, t, i, n) {
  11514. function r(e, t, i) {
  11515. Object.defineProperty(e, t, {
  11516. get: function() {
  11517. return "RGB" === this.__state.space ? this.__state[t] : (a(this, t, i),
  11518. this.__state[t])
  11519. },
  11520. set: function(e) {
  11521. "RGB" !== this.__state.space && (a(this, t, i),
  11522. this.__state.space = "RGB"),
  11523. this.__state[t] = e
  11524. }
  11525. })
  11526. }
  11527. function o(e, t) {
  11528. Object.defineProperty(e, t, {
  11529. get: function() {
  11530. return "HSV" === this.__state.space ? this.__state[t] : (s(this),
  11531. this.__state[t])
  11532. },
  11533. set: function(e) {
  11534. "HSV" !== this.__state.space && (s(this),
  11535. this.__state.space = "HSV"),
  11536. this.__state[t] = e
  11537. }
  11538. })
  11539. }
  11540. function a(e, i, r) {
  11541. if ("HEX" === e.__state.space)
  11542. e.__state[i] = t.component_from_hex(e.__state.hex, r);
  11543. else {
  11544. if ("HSV" !== e.__state.space)
  11545. throw "Corrupted color state";
  11546. n.extend(e.__state, t.hsv_to_rgb(e.__state.h, e.__state.s, e.__state.v))
  11547. }
  11548. }
  11549. function s(e) {
  11550. var i = t.rgb_to_hsv(e.r, e.g, e.b);
  11551. n.extend(e.__state, {
  11552. s: i.s,
  11553. v: i.v
  11554. }),
  11555. n.isNaN(i.h) ? n.isUndefined(e.__state.h) && (e.__state.h = 0) : e.__state.h = i.h
  11556. }
  11557. var l = function() {
  11558. if (this.__state = e.apply(this, arguments),
  11559. this.__state === !1)
  11560. throw "Failed to interpret color arguments";
  11561. this.__state.a = this.__state.a || 1
  11562. };
  11563. return l.COMPONENTS = ["r", "g", "b", "h", "s", "v", "hex", "a"],
  11564. n.extend(l.prototype, {
  11565. toString: function() {
  11566. return i(this)
  11567. },
  11568. toOriginal: function() {
  11569. return this.__state.conversion.write(this)
  11570. }
  11571. }),
  11572. r(l.prototype, "r", 2),
  11573. r(l.prototype, "g", 1),
  11574. r(l.prototype, "b", 0),
  11575. o(l.prototype, "h"),
  11576. o(l.prototype, "s"),
  11577. o(l.prototype, "v"),
  11578. Object.defineProperty(l.prototype, "a", {
  11579. get: function() {
  11580. return this.__state.a
  11581. },
  11582. set: function(e) {
  11583. this.__state.a = e
  11584. }
  11585. }),
  11586. Object.defineProperty(l.prototype, "hex", {
  11587. get: function() {
  11588. return "HEX" !== !this.__state.space && (this.__state.hex = t.rgb_to_hex(this.r, this.g, this.b)),
  11589. this.__state.hex
  11590. },
  11591. set: function(e) {
  11592. this.__state.space = "HEX",
  11593. this.__state.hex = e
  11594. }
  11595. }),
  11596. l
  11597. }(n.color.interpret, n.color.math = function() {
  11598. var e;
  11599. return {
  11600. hsv_to_rgb: function(e, t, i) {
  11601. var n = Math.floor(e / 60) % 6
  11602. , r = e / 60 - Math.floor(e / 60)
  11603. , o = i * (1 - t)
  11604. , a = i * (1 - r * t)
  11605. , s = i * (1 - (1 - r) * t)
  11606. , l = [[i, s, o], [a, i, o], [o, i, s], [o, a, i], [s, o, i], [i, o, a]][n];
  11607. return {
  11608. r: 255 * l[0],
  11609. g: 255 * l[1],
  11610. b: 255 * l[2]
  11611. }
  11612. },
  11613. rgb_to_hsv: function(e, t, i) {
  11614. var n, r, o = Math.min(e, t, i), a = Math.max(e, t, i), s = a - o;
  11615. return 0 == a ? {
  11616. h: NaN,
  11617. s: 0,
  11618. v: 0
  11619. } : (r = s / a,
  11620. n = e == a ? (t - i) / s : t == a ? 2 + (i - e) / s : 4 + (e - t) / s,
  11621. n /= 6,
  11622. n < 0 && (n += 1),
  11623. {
  11624. h: 360 * n,
  11625. s: r,
  11626. v: a / 255
  11627. })
  11628. },
  11629. rgb_to_hex: function(e, t, i) {
  11630. var n = this.hex_with_component(0, 2, e);
  11631. return n = this.hex_with_component(n, 1, t),
  11632. n = this.hex_with_component(n, 0, i)
  11633. },
  11634. component_from_hex: function(e, t) {
  11635. return e >> 8 * t & 255
  11636. },
  11637. hex_with_component: function(t, i, n) {
  11638. return n << (e = 8 * i) | t & ~(255 << e)
  11639. }
  11640. }
  11641. }(), n.color.toString, n.utils.common), n.color.interpret, n.utils.common), n.utils.requestAnimationFrame = function() {
  11642. return window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame || window.oRequestAnimationFrame || window.msRequestAnimationFrame || function(e, t) {
  11643. window.setTimeout(e, 1e3 / 60)
  11644. }
  11645. }(), n.dom.CenteredDiv = function(e, t) {
  11646. var i = function() {
  11647. this.backgroundElement = document.createElement("div"),
  11648. t.extend(this.backgroundElement.style, {
  11649. backgroundColor: "rgba(0,0,0,0.8)",
  11650. top: 0,
  11651. left: 0,
  11652. display: "none",
  11653. zIndex: "1000",
  11654. opacity: 0,
  11655. WebkitTransition: "opacity 0.2s linear"
  11656. }),
  11657. e.makeFullscreen(this.backgroundElement),
  11658. this.backgroundElement.style.position = "fixed",
  11659. this.domElement = document.createElement("div"),
  11660. t.extend(this.domElement.style, {
  11661. position: "fixed",
  11662. display: "none",
  11663. zIndex: "1001",
  11664. opacity: 0,
  11665. WebkitTransition: "-webkit-transform 0.2s ease-out, opacity 0.2s linear"
  11666. }),
  11667. document.body.appendChild(this.backgroundElement),
  11668. document.body.appendChild(this.domElement);
  11669. var i = this;
  11670. e.bind(this.backgroundElement, "click", function() {
  11671. i.hide()
  11672. })
  11673. };
  11674. return i.prototype.show = function() {
  11675. var e = this;
  11676. this.backgroundElement.style.display = "block",
  11677. this.domElement.style.display = "block",
  11678. this.domElement.style.opacity = 0,
  11679. this.domElement.style.webkitTransform = "scale(1.1)",
  11680. this.layout(),
  11681. t.defer(function() {
  11682. e.backgroundElement.style.opacity = 1,
  11683. e.domElement.style.opacity = 1,
  11684. e.domElement.style.webkitTransform = "scale(1)"
  11685. })
  11686. }
  11687. ,
  11688. i.prototype.hide = function() {
  11689. var t = this
  11690. , i = function() {
  11691. t.domElement.style.display = "none",
  11692. t.backgroundElement.style.display = "none",
  11693. e.unbind(t.domElement, "webkitTransitionEnd", i),
  11694. e.unbind(t.domElement, "transitionend", i),
  11695. e.unbind(t.domElement, "oTransitionEnd", i)
  11696. };
  11697. e.bind(this.domElement, "webkitTransitionEnd", i),
  11698. e.bind(this.domElement, "transitionend", i),
  11699. e.bind(this.domElement, "oTransitionEnd", i),
  11700. this.backgroundElement.style.opacity = 0,
  11701. this.domElement.style.opacity = 0,
  11702. this.domElement.style.webkitTransform = "scale(1.1)"
  11703. }
  11704. ,
  11705. i.prototype.layout = function() {
  11706. this.domElement.style.left = $("#player").width() / 2 - e.getWidth(this.domElement) / 2 + "px",
  11707. this.domElement.style.top = $("#player").height() / 2 - e.getHeight(this.domElement) / 2 + "px"
  11708. }
  11709. ,
  11710. i
  11711. }(n.dom.dom, n.utils.common), n.dom.dom, n.utils.common)
  11712. }
  11713. , {}],
  11714. 94: [function(e, t, i) {
  11715. (function(e) {
  11716. "use strict";
  11717. function i(t) {
  11718. function i(e) {
  11719. 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++) {
  11720. var n = _((t[i] * e + 50) / 100);
  11721. n < 1 ? n = 1 : n > 255 && (n = 255),
  11722. T[G[i]] = n
  11723. }
  11724. 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++) {
  11725. var a = _((r[o] * e + 50) / 100);
  11726. a < 1 ? a = 1 : a > 255 && (a = 255),
  11727. x[G[o]] = a
  11728. }
  11729. for (var s = [1, 1.387039845, 1.306562965, 1.175875602, 1, .785694958, .5411961, .275899379], l = 0, c = 0; c < 8; c++)
  11730. for (var h = 0; h < 8; h++)
  11731. S[l] = 1 / (T[G[l]] * s[c] * s[h] * 8),
  11732. M[l] = 1 / (x[G[l]] * s[c] * s[h] * 8),
  11733. l++
  11734. }
  11735. function n(e, t) {
  11736. for (var i = 0, n = 0, r = new Array, o = 1; o <= 16; o++) {
  11737. for (var a = 1; a <= e[o]; a++)
  11738. r[t[n]] = [],
  11739. r[t[n]][0] = i,
  11740. r[t[n]][1] = o,
  11741. n++,
  11742. i++;
  11743. i *= 2
  11744. }
  11745. return r
  11746. }
  11747. function r() {
  11748. C = n(z, W),
  11749. I = n(X, Z),
  11750. E = n(j, Y),
  11751. b = n(q, K)
  11752. }
  11753. function o() {
  11754. for (var e = 1, t = 2, i = 1; i <= 15; i++) {
  11755. for (var n = e; n < t; n++)
  11756. P[32767 + n] = i,
  11757. R[32767 + n] = [],
  11758. R[32767 + n][1] = i,
  11759. R[32767 + n][0] = n;
  11760. for (var r = -(t - 1); r <= -e; r++)
  11761. P[32767 + r] = i,
  11762. R[32767 + r] = [],
  11763. R[32767 + r][1] = i,
  11764. R[32767 + r][0] = t - 1 + r;
  11765. e <<= 1,
  11766. t <<= 1
  11767. }
  11768. }
  11769. function a() {
  11770. for (var e = 0; e < 256; e++)
  11771. H[e] = 19595 * e,
  11772. H[e + 256 >> 0] = 38470 * e,
  11773. H[e + 512 >> 0] = 7471 * e + 32768,
  11774. H[e + 768 >> 0] = -11059 * e,
  11775. H[e + 1024 >> 0] = -21709 * e,
  11776. H[e + 1280 >> 0] = 32768 * e + 8421375,
  11777. H[e + 1536 >> 0] = -27439 * e,
  11778. H[e + 1792 >> 0] = -5329 * e
  11779. }
  11780. function s(e) {
  11781. for (var t = e[0], i = e[1] - 1; i >= 0; )
  11782. t & 1 << i && (N |= 1 << B),
  11783. i--,
  11784. B--,
  11785. B < 0 && (255 == N ? (l(255),
  11786. l(0)) : l(N),
  11787. B = 7,
  11788. N = 0)
  11789. }
  11790. function l(e) {
  11791. D.push(e)
  11792. }
  11793. function c(e) {
  11794. l(e >> 8 & 255),
  11795. l(255 & e)
  11796. }
  11797. function h(e, t) {
  11798. var i, n, r, o, a, s, l, c, h, u = 0, d = 8, p = 64;
  11799. for (h = 0; h < d; ++h) {
  11800. i = e[u],
  11801. n = e[u + 1],
  11802. r = e[u + 2],
  11803. o = e[u + 3],
  11804. a = e[u + 4],
  11805. s = e[u + 5],
  11806. l = e[u + 6],
  11807. c = e[u + 7];
  11808. var f = i + c
  11809. , g = i - c
  11810. , m = n + l
  11811. , v = n - l
  11812. , A = r + s
  11813. , y = r - s
  11814. , C = o + a
  11815. , I = o - a
  11816. , E = f + C
  11817. , b = f - C
  11818. , w = m + A
  11819. , _ = m - A;
  11820. e[u] = E + w,
  11821. e[u + 4] = E - w;
  11822. var T = .707106781 * (_ + b);
  11823. e[u + 2] = b + T,
  11824. e[u + 6] = b - T,
  11825. E = I + y,
  11826. w = y + v,
  11827. _ = v + g;
  11828. var x = .382683433 * (E - _)
  11829. , S = .5411961 * E + x
  11830. , M = 1.306562965 * _ + x
  11831. , R = .707106781 * w
  11832. , P = g + R
  11833. , L = g - R;
  11834. e[u + 5] = L + S,
  11835. e[u + 3] = L - S,
  11836. e[u + 1] = P + M,
  11837. e[u + 7] = P - M,
  11838. u += 8
  11839. }
  11840. for (u = 0,
  11841. h = 0; h < d; ++h) {
  11842. i = e[u],
  11843. n = e[u + 8],
  11844. r = e[u + 16],
  11845. o = e[u + 24],
  11846. a = e[u + 32],
  11847. s = e[u + 40],
  11848. l = e[u + 48],
  11849. c = e[u + 56];
  11850. var D = i + c
  11851. , N = i - c
  11852. , B = n + l
  11853. , F = n - l
  11854. , V = r + s
  11855. , U = r - s
  11856. , k = o + a
  11857. , H = o - a
  11858. , G = D + k
  11859. , z = D - k
  11860. , W = B + V
  11861. , j = B - V;
  11862. e[u] = G + W,
  11863. e[u + 32] = G - W;
  11864. var Y = .707106781 * (j + z);
  11865. e[u + 16] = z + Y,
  11866. e[u + 48] = z - Y,
  11867. G = H + U,
  11868. W = U + F,
  11869. j = F + N;
  11870. var X = .382683433 * (G - j)
  11871. , Z = .5411961 * G + X
  11872. , q = 1.306562965 * j + X
  11873. , K = .707106781 * W
  11874. , Q = N + K
  11875. , J = N - K;
  11876. e[u + 40] = J + Z,
  11877. e[u + 24] = J - Z,
  11878. e[u + 8] = Q + q,
  11879. e[u + 56] = Q - q,
  11880. u++
  11881. }
  11882. var $;
  11883. for (h = 0; h < p; ++h)
  11884. $ = e[h] * t[h],
  11885. O[h] = $ > 0 ? $ + .5 | 0 : $ - .5 | 0;
  11886. return O
  11887. }
  11888. function u() {
  11889. c(65504),
  11890. c(16),
  11891. l(74),
  11892. l(70),
  11893. l(73),
  11894. l(70),
  11895. l(0),
  11896. l(1),
  11897. l(1),
  11898. l(0),
  11899. c(1),
  11900. c(1),
  11901. l(0),
  11902. l(0)
  11903. }
  11904. function d(e, t) {
  11905. c(65472),
  11906. c(17),
  11907. l(8),
  11908. c(t),
  11909. c(e),
  11910. l(3),
  11911. l(1),
  11912. l(17),
  11913. l(0),
  11914. l(2),
  11915. l(17),
  11916. l(1),
  11917. l(3),
  11918. l(17),
  11919. l(1)
  11920. }
  11921. function p() {
  11922. c(65499),
  11923. c(132),
  11924. l(0);
  11925. for (var e = 0; e < 64; e++)
  11926. l(T[e]);
  11927. l(1);
  11928. for (var t = 0; t < 64; t++)
  11929. l(x[t])
  11930. }
  11931. function f() {
  11932. c(65476),
  11933. c(418),
  11934. l(0);
  11935. for (var e = 0; e < 16; e++)
  11936. l(z[e + 1]);
  11937. for (var t = 0; t <= 11; t++)
  11938. l(W[t]);
  11939. l(16);
  11940. for (var i = 0; i < 16; i++)
  11941. l(j[i + 1]);
  11942. for (var n = 0; n <= 161; n++)
  11943. l(Y[n]);
  11944. l(1);
  11945. for (var r = 0; r < 16; r++)
  11946. l(X[r + 1]);
  11947. for (var o = 0; o <= 11; o++)
  11948. l(Z[o]);
  11949. l(17);
  11950. for (var a = 0; a < 16; a++)
  11951. l(q[a + 1]);
  11952. for (var s = 0; s <= 161; s++)
  11953. l(K[s])
  11954. }
  11955. function g() {
  11956. c(65498),
  11957. c(12),
  11958. l(3),
  11959. l(1),
  11960. l(0),
  11961. l(2),
  11962. l(17),
  11963. l(3),
  11964. l(17),
  11965. l(0),
  11966. l(63),
  11967. l(0)
  11968. }
  11969. function m(e, t, i, n, r) {
  11970. for (var o, a = r[0], l = r[240], c = 16, u = 63, d = 64, p = h(e, t), f = 0; f < d; ++f)
  11971. L[G[f]] = p[f];
  11972. var g = L[0] - i;
  11973. i = L[0],
  11974. 0 == g ? s(n[0]) : (o = 32767 + g,
  11975. s(n[P[o]]),
  11976. s(R[o]));
  11977. for (var m = 63; m > 0 && 0 == L[m]; m--)
  11978. ;
  11979. if (0 == m)
  11980. return s(a),
  11981. i;
  11982. for (var v, A = 1; A <= m; ) {
  11983. for (var y = A; 0 == L[A] && A <= m; ++A)
  11984. ;
  11985. var C = A - y;
  11986. if (C >= c) {
  11987. v = C >> 4;
  11988. for (var I = 1; I <= v; ++I)
  11989. s(l);
  11990. C &= 15
  11991. }
  11992. o = 32767 + L[A],
  11993. s(r[(C << 4) + P[o]]),
  11994. s(R[o]),
  11995. A++
  11996. }
  11997. return m != u && s(a),
  11998. i
  11999. }
  12000. function v() {
  12001. for (var e = String.fromCharCode, t = 0; t < 256; t++)
  12002. k[t] = e(t)
  12003. }
  12004. function A(e) {
  12005. if (e <= 0 && (e = 1),
  12006. e > 100 && (e = 100),
  12007. w != e) {
  12008. var t = 0;
  12009. t = e < 50 ? Math.floor(5e3 / e) : Math.floor(200 - 2 * e),
  12010. i(t),
  12011. w = e
  12012. }
  12013. }
  12014. function y() {
  12015. var e = (new Date).getTime();
  12016. t || (t = 50),
  12017. v(),
  12018. r(),
  12019. o(),
  12020. a(),
  12021. A(t);
  12022. (new Date).getTime() - e
  12023. }
  12024. var C, I, E, b, w, _ = (Math.round,
  12025. 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];
  12026. this.encode = function(t, i) {
  12027. var n = ((new Date).getTime(),
  12028. i.quality);
  12029. n && A(n),
  12030. D = new Array,
  12031. N = 0,
  12032. B = 7,
  12033. c(65496),
  12034. u(),
  12035. p(),
  12036. d(t.width, t.height),
  12037. f(),
  12038. g();
  12039. var r = 0
  12040. , o = 0
  12041. , a = 0;
  12042. N = 0,
  12043. B = 7,
  12044. this.encode.displayName = "_encode_";
  12045. 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; ) {
  12046. for (l = 0; l < G; ) {
  12047. for (w = G * z + l,
  12048. _ = w,
  12049. T = -1,
  12050. x = 0,
  12051. R = 0; R < 64; R++)
  12052. x = (k ? 63 - R : R) >> 3,
  12053. T = 4 * (7 & R),
  12054. _ = w + x * G + T,
  12055. z + x >= L && (_ -= G * (z + 1 + x - L)),
  12056. l + T >= G && (_ -= l + T - G + 4),
  12057. h = P[_++],
  12058. v = P[_++],
  12059. y = P[_++],
  12060. F[R] = (H[h] + H[v + 256 >> 0] + H[y + 512 >> 0] >> 16) - 128,
  12061. V[R] = (H[h + 768 >> 0] + H[v + 1024 >> 0] + H[y + 1280 >> 0] >> 16) - 128,
  12062. U[R] = (H[h + 1280 >> 0] + H[v + 1536 >> 0] + H[y + 1792 >> 0] >> 16) - 128;
  12063. r = m(F, S, r, C, E),
  12064. o = m(V, M, o, I, b),
  12065. a = m(U, M, a, I, b),
  12066. l += 32
  12067. }
  12068. z += W
  12069. }
  12070. if (B >= 0) {
  12071. var j = [];
  12072. j[1] = B + 1,
  12073. j[0] = (1 << B + 1) - 1,
  12074. s(j)
  12075. }
  12076. return c(65497),
  12077. new e(D)
  12078. }
  12079. ,
  12080. y()
  12081. }
  12082. function n(e, t) {
  12083. t = t || {},
  12084. t.quality = t.quality || 50;
  12085. var n = t.quality
  12086. , r = new i(n)
  12087. , o = r.encode(e, t);
  12088. return {
  12089. data: o,
  12090. width: e.width,
  12091. height: e.height
  12092. }
  12093. }
  12094. t.exports.encode = n
  12095. }
  12096. ).call(this, e("buffer").Buffer)
  12097. }
  12098. , {
  12099. buffer: 198
  12100. }],
  12101. 95: [function(e, t, i) {
  12102. "use strict";
  12103. !function() {
  12104. if ("performance"in window == !1 && (window.performance = {}),
  12105. Date.now = Date.now || function() {
  12106. return (new Date).getTime()
  12107. }
  12108. ,
  12109. "now"in window.performance == !1) {
  12110. var e = Date.now();
  12111. performance.timing && performance.timing.navigationStart && (e = performance.timing.navigationStart),
  12112. window.performance.now = function() {
  12113. return Date.now() - e
  12114. }
  12115. }
  12116. }()
  12117. }
  12118. , {}],
  12119. 96: [function(e, t, i) {
  12120. "use strict";
  12121. var n = e("three");
  12122. n.EffectComposer = function(e, t) {
  12123. if (this.renderer = e,
  12124. void 0 === t) {
  12125. var i = {
  12126. minFilter: n.LinearFilter,
  12127. magFilter: n.LinearFilter,
  12128. format: n.RGBAFormat,
  12129. stencilBuffer: !1
  12130. }
  12131. , r = e.getSize();
  12132. t = new n.WebGLRenderTarget(r.width,r.height,i)
  12133. }
  12134. this.renderTarget1 = t,
  12135. this.renderTarget2 = t.clone(),
  12136. this.writeBuffer = this.renderTarget1,
  12137. this.readBuffer = this.renderTarget2,
  12138. this.passes = [],
  12139. void 0 === n.CopyShader && console.error("THREE.EffectComposer relies on THREE.CopyShader"),
  12140. this.copyPass = new n.ShaderPass(n.CopyShader)
  12141. }
  12142. ,
  12143. n.EffectComposer.prototype = {
  12144. swapBuffers: function() {
  12145. var e = this.readBuffer;
  12146. this.readBuffer = this.writeBuffer,
  12147. this.writeBuffer = e
  12148. },
  12149. addPass: function(e) {
  12150. this.passes.push(e)
  12151. },
  12152. insertPass: function(e, t) {
  12153. this.passes.splice(t, 0, e)
  12154. },
  12155. render: function(e) {
  12156. this.writeBuffer = this.renderTarget1,
  12157. this.readBuffer = this.renderTarget2;
  12158. var t, i, r = !1, o = this.passes.length;
  12159. for (i = 0; i < o; i++)
  12160. if (t = this.passes[i],
  12161. t.enabled) {
  12162. if (t.render(this.renderer, this.writeBuffer, this.readBuffer, e, r),
  12163. t.needsSwap) {
  12164. if (r) {
  12165. var a = this.renderer.context;
  12166. a.stencilFunc(a.NOTEQUAL, 1, 4294967295),
  12167. this.copyPass.render(this.renderer, this.writeBuffer, this.readBuffer, e),
  12168. a.stencilFunc(a.EQUAL, 1, 4294967295)
  12169. }
  12170. this.swapBuffers()
  12171. }
  12172. t instanceof n.MaskPass ? r = !0 : t instanceof n.ClearMaskPass && (r = !1)
  12173. }
  12174. },
  12175. reset: function(e) {
  12176. if (void 0 === e) {
  12177. var t = this.renderer.getSize();
  12178. e = this.renderTarget1.clone(),
  12179. e.setSize(t.width, t.height)
  12180. }
  12181. this.renderTarget1.dispose(),
  12182. this.renderTarget2.dispose(),
  12183. this.renderTarget1 = e,
  12184. this.renderTarget2 = e.clone(),
  12185. this.writeBuffer = this.renderTarget1,
  12186. this.readBuffer = this.renderTarget2
  12187. },
  12188. setSize: function(e, t) {
  12189. this.renderTarget1.setSize(e, t),
  12190. this.renderTarget2.setSize(e, t)
  12191. this.passes.forEach(a=>{//add for TransitionPass
  12192. a.setSize && a.setSize(e, t)
  12193. })
  12194. }
  12195. }
  12196. }
  12197. , {
  12198. three: 217
  12199. }],
  12200. 97: [function(e, t, i) {
  12201. "use strict";
  12202. var n = e("three");
  12203. n.MaskPass = function(e, t) {
  12204. this.scene = e,
  12205. this.camera = t,
  12206. this.enabled = !0,
  12207. this.clear = !0,
  12208. this.needsSwap = !1,
  12209. this.inverse = !1
  12210. }
  12211. ,
  12212. n.MaskPass.prototype = {
  12213. render: function(e, t, i, n) {
  12214. var r = e.context;
  12215. r.colorMask(!1, !1, !1, !1),
  12216. r.depthMask(!1);
  12217. var o, a;
  12218. this.inverse ? (o = 0,
  12219. a = 1) : (o = 1,
  12220. a = 0),
  12221. r.enable(r.STENCIL_TEST),
  12222. r.stencilOp(r.REPLACE, r.REPLACE, r.REPLACE),
  12223. r.stencilFunc(r.ALWAYS, o, 4294967295),
  12224. r.clearStencil(a),
  12225. e.render(this.scene, this.camera, i, this.clear),
  12226. e.render(this.scene, this.camera, t, this.clear),
  12227. r.colorMask(!0, !0, !0, !0),
  12228. r.depthMask(!0),
  12229. r.stencilFunc(r.EQUAL, 1, 4294967295),
  12230. r.stencilOp(r.KEEP, r.KEEP, r.KEEP)
  12231. }
  12232. },
  12233. n.ClearMaskPass = function() {
  12234. this.enabled = !0
  12235. }
  12236. ,
  12237. n.ClearMaskPass.prototype = {
  12238. render: function(e, t, i, n) {
  12239. var r = e.context;
  12240. r.disable(r.STENCIL_TEST)
  12241. }
  12242. }
  12243. }
  12244. , {
  12245. three: 217
  12246. }],
  12247. 98: [function(e, t, i) {
  12248. "use strict";
  12249. var n = e("three");
  12250. n.RenderPass = function(e, t, i, r, o) {
  12251. this.scene = e,
  12252. this.camera = t,
  12253. this.overrideMaterial = i,
  12254. this.clearColor = r,
  12255. this.clearAlpha = void 0 !== o ? o : 1,
  12256. this.oldClearColor = new n.Color,
  12257. this.oldClearAlpha = 1,
  12258. this.enabled = !0,
  12259. this.clear = !0,
  12260. this.needsSwap = !1
  12261. }
  12262. ,
  12263. n.RenderPass.prototype = {
  12264. render: function(e, t, i, n) {
  12265. this.scene.overrideMaterial = this.overrideMaterial,
  12266. this.clearColor && (this.oldClearColor.copy(e.getClearColor()),
  12267. this.oldClearAlpha = e.getClearAlpha(),
  12268. e.setClearColor(this.clearColor, this.clearAlpha)),
  12269. e.render(this.scene, this.camera, i, this.clear),
  12270. this.clearColor && e.setClearColor(this.oldClearColor, this.oldClearAlpha),
  12271. this.scene.overrideMaterial = null
  12272. }
  12273. }
  12274. }
  12275. , {
  12276. three: 217
  12277. }],
  12278. 99: [function(e, t, i) {
  12279. "use strict";
  12280. var n = e("three");
  12281. n.ShaderPass = function(e, t) {
  12282. this.textureID = void 0 !== t ? t : "tDiffuse",
  12283. e instanceof n.ShaderMaterial ? (this.uniforms = e.uniforms,
  12284. this.material = e) : e && (this.uniforms = n.UniformsUtils.clone(e.uniforms),
  12285. this.material = new n.ShaderMaterial({
  12286. defines: e.defines || {},
  12287. uniforms: this.uniforms,
  12288. vertexShader: e.vertexShader,
  12289. fragmentShader: e.fragmentShader
  12290. })),
  12291. this.renderToScreen = !1,
  12292. this.enabled = !0,
  12293. this.needsSwap = !0,
  12294. this.clear = !1,
  12295. this.camera = new n.OrthographicCamera(-1,1,1,-1,0,1),
  12296. this.scene = new n.Scene,
  12297. this.quad = new n.Mesh(new n.PlaneBufferGeometry(2,2),null),
  12298. this.scene.add(this.quad)
  12299. }
  12300. ,
  12301. n.ShaderPass.prototype = {
  12302. render: function(e, t, i, n) {
  12303. this.uniforms[this.textureID] && (this.uniforms[this.textureID].value = i),
  12304. this.quad.material = this.material,
  12305. this.renderToScreen ? e.render(this.scene, this.camera) : e.render(this.scene, this.camera, t, this.clear)
  12306. }
  12307. }
  12308. }
  12309. , {
  12310. three: 217
  12311. }],
  12312. 100: [function(e, t, i) {
  12313. "use strict";
  12314. var n = e("three");
  12315. n.CopyShader = {
  12316. uniforms: {
  12317. tDiffuse: {
  12318. type: "t",
  12319. value: null
  12320. },
  12321. opacity: {
  12322. type: "f",
  12323. value: 1
  12324. }
  12325. },
  12326. vertexShader: ["varying vec2 vUv;", "void main() {", "vUv = uv;", "gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );", "}"].join("\n"),
  12327. fragmentShader: ["uniform float opacity;", "uniform sampler2D tDiffuse;", "varying vec2 vUv;", "void main() {", "vec4 texel = texture2D( tDiffuse, vUv );", "gl_FragColor = opacity * texel;", "}"].join("\n")
  12328. }
  12329. }
  12330. , {
  12331. three: 217
  12332. }],
  12333. 101: [function(e, t, i) {
  12334. "use strict";
  12335. var n = e("three");
  12336. n.HorizontalBlurShader = {
  12337. uniforms: {
  12338. tDiffuse: {
  12339. type: "t",
  12340. value: null
  12341. },
  12342. h: {
  12343. type: "f",
  12344. value: 1 / 512
  12345. }
  12346. },
  12347. vertexShader: ["varying vec2 vUv;", "void main() {", "vUv = uv;", "gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );", "}"].join("\n"),
  12348. 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")
  12349. }
  12350. }
  12351. , {
  12352. three: 217
  12353. }],
  12354. 102: [function(e, t, i) {
  12355. "use strict";
  12356. var n = e("three");
  12357. n.VerticalBlurShader = {
  12358. uniforms: {
  12359. tDiffuse: {
  12360. type: "t",
  12361. value: null
  12362. },
  12363. v: {
  12364. type: "f",
  12365. value: 1 / 512
  12366. }
  12367. },
  12368. vertexShader: ["varying vec2 vUv;", "void main() {", "vUv = uv;", "gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );", "}"].join("\n"),
  12369. 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")
  12370. }
  12371. }
  12372. , {
  12373. three: 217
  12374. }],
  12375. 103: [function(e, t, i) {
  12376. "use strict";
  12377. var n = e("three");
  12378. !function() {
  12379. if ("performance"in window == 0 && (window.performance = {}),
  12380. "now"in window.performance == 0) {
  12381. var e = Date.now();
  12382. performance.timing && performance.timing.navigationStart && (e = performance.timing.navigationStart),
  12383. window.performance.now = function() {
  12384. return Date.now() - e
  12385. }
  12386. }
  12387. }(),
  12388. n.WebGLRenderer.prototype.paramThreeToGL = function(e) {
  12389. var t, i = this.extensions, r = this.context;
  12390. if (e === n.RepeatWrapping)
  12391. return r.REPEAT;
  12392. if (e === n.ClampToEdgeWrapping)
  12393. return r.CLAMP_TO_EDGE;
  12394. if (e === n.MirroredRepeatWrapping)
  12395. return r.MIRRORED_REPEAT;
  12396. if (e === n.NearestFilter)
  12397. return r.NEAREST;
  12398. if (e === n.NearestMipMapNearestFilter)
  12399. return r.NEAREST_MIPMAP_NEAREST;
  12400. if (e === n.NearestMipMapLinearFilter)
  12401. return r.NEAREST_MIPMAP_LINEAR;
  12402. if (e === n.LinearFilter)
  12403. return r.LINEAR;
  12404. if (e === n.LinearMipMapNearestFilter)
  12405. return r.LINEAR_MIPMAP_NEAREST;
  12406. if (e === n.LinearMipMapLinearFilter)
  12407. return r.LINEAR_MIPMAP_LINEAR;
  12408. if (e === n.UnsignedByteType)
  12409. return r.UNSIGNED_BYTE;
  12410. if (e === n.UnsignedShort4444Type)
  12411. return r.UNSIGNED_SHORT_4_4_4_4;
  12412. if (e === n.UnsignedShort5551Type)
  12413. return r.UNSIGNED_SHORT_5_5_5_1;
  12414. if (e === n.UnsignedShort565Type)
  12415. return r.UNSIGNED_SHORT_5_6_5;
  12416. if (e === n.ByteType)
  12417. return r.BYTE;
  12418. if (e === n.ShortType)
  12419. return r.SHORT;
  12420. if (e === n.UnsignedShortType)
  12421. return r.UNSIGNED_SHORT;
  12422. if (e === n.IntType)
  12423. return r.INT;
  12424. if (e === n.UnsignedIntType)
  12425. return r.UNSIGNED_INT;
  12426. if (e === n.FloatType)
  12427. return r.FLOAT;
  12428. if (t = i.get("OES_texture_half_float"),
  12429. null !== t && e === n.HalfFloatType)
  12430. return t.HALF_FLOAT_OES;
  12431. if (e === n.AlphaFormat)
  12432. return r.ALPHA;
  12433. if (e === n.RGBFormat)
  12434. return r.RGB;
  12435. if (e === n.RGBAFormat)
  12436. return r.RGBA;
  12437. if (e === n.LuminanceFormat)
  12438. return r.LUMINANCE;
  12439. if (e === n.LuminanceAlphaFormat)
  12440. return r.LUMINANCE_ALPHA;
  12441. if (e === n.AddEquation)
  12442. return r.FUNC_ADD;
  12443. if (e === n.SubtractEquation)
  12444. return r.FUNC_SUBTRACT;
  12445. if (e === n.ReverseSubtractEquation)
  12446. return r.FUNC_REVERSE_SUBTRACT;
  12447. if (e === n.ZeroFactor)
  12448. return r.ZERO;
  12449. if (e === n.OneFactor)
  12450. return r.ONE;
  12451. if (e === n.SrcColorFactor)
  12452. return r.SRC_COLOR;
  12453. if (e === n.OneMinusSrcColorFactor)
  12454. return r.ONE_MINUS_SRC_COLOR;
  12455. if (e === n.SrcAlphaFactor)
  12456. return r.SRC_ALPHA;
  12457. if (e === n.OneMinusSrcAlphaFactor)
  12458. return r.ONE_MINUS_SRC_ALPHA;
  12459. if (e === n.DstAlphaFactor)
  12460. return r.DST_ALPHA;
  12461. if (e === n.OneMinusDstAlphaFactor)
  12462. return r.ONE_MINUS_DST_ALPHA;
  12463. if (e === n.DstColorFactor)
  12464. return r.DST_COLOR;
  12465. if (e === n.OneMinusDstColorFactor)
  12466. return r.ONE_MINUS_DST_COLOR;
  12467. if (e === n.SrcAlphaSaturateFactor)
  12468. return r.SRC_ALPHA_SATURATE;
  12469. if (t = i.get("WEBGL_compressed_texture_s3tc"),
  12470. null !== t) {
  12471. if (e === n.RGB_S3TC_DXT1_Format)
  12472. return t.COMPRESSED_RGB_S3TC_DXT1_EXT;
  12473. if (e === n.RGBA_S3TC_DXT1_Format)
  12474. return t.COMPRESSED_RGBA_S3TC_DXT1_EXT;
  12475. if (e === n.RGBA_S3TC_DXT3_Format)
  12476. return t.COMPRESSED_RGBA_S3TC_DXT3_EXT;
  12477. if (e === n.RGBA_S3TC_DXT5_Format)
  12478. return t.COMPRESSED_RGBA_S3TC_DXT5_EXT
  12479. }
  12480. if (t = i.get("WEBGL_compressed_texture_pvrtc"),
  12481. null !== t) {
  12482. if (e === n.RGB_PVRTC_4BPPV1_Format)
  12483. return t.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;
  12484. if (e === n.RGB_PVRTC_2BPPV1_Format)
  12485. return t.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;
  12486. if (e === n.RGBA_PVRTC_4BPPV1_Format)
  12487. return t.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;
  12488. if (e === n.RGBA_PVRTC_2BPPV1_Format)
  12489. return t.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG
  12490. }
  12491. if (t = i.get("WEBGL_compressed_texture_etc1"),
  12492. null !== t && e === n.RGB_ETC1_Format)
  12493. return t.COMPRESSED_RGB_ETC1_WEBGL;
  12494. if (t = i.get("EXT_blend_minmax"),
  12495. null !== t) {
  12496. if (e === n.MinEquation)
  12497. return t.MIN_EXT;
  12498. if (e === n.MaxEquation)
  12499. return t.MAX_EXT
  12500. }
  12501. return 0
  12502. }
  12503. ,
  12504. n.WebGLState = function(e, t, i) {
  12505. var r = this
  12506. , o = new n.Vector4
  12507. , a = e.getParameter(e.MAX_VERTEX_ATTRIBS)
  12508. , s = new Uint8Array(a)
  12509. , l = new Uint8Array(a)
  12510. , c = new Uint8Array(a)
  12511. , h = {}
  12512. , u = null
  12513. , d = null
  12514. , p = null
  12515. , f = null
  12516. , g = null
  12517. , m = null
  12518. , v = null
  12519. , A = null
  12520. , y = !1
  12521. , C = null
  12522. , I = null
  12523. , E = null
  12524. , b = null
  12525. , w = null
  12526. , _ = null
  12527. , T = null
  12528. , x = null
  12529. , S = null
  12530. , M = null
  12531. , R = null
  12532. , P = null
  12533. , O = null
  12534. , L = null
  12535. , D = null
  12536. , N = e.getParameter(e.MAX_TEXTURE_IMAGE_UNITS)
  12537. , B = void 0
  12538. , F = {}
  12539. , V = new n.Vector4
  12540. , U = null
  12541. , k = null
  12542. , H = new n.Vector4
  12543. , G = new n.Vector4;
  12544. this.init = function() {
  12545. this.clearColor(0, 0, 0, 1),
  12546. this.clearDepth(1),
  12547. this.clearStencil(0),
  12548. this.enable(e.DEPTH_TEST),
  12549. e.depthFunc(e.LEQUAL),
  12550. e.frontFace(e.CCW),
  12551. e.cullFace(e.BACK),
  12552. this.enable(e.CULL_FACE),
  12553. this.enable(e.BLEND),
  12554. e.blendEquation(e.FUNC_ADD),
  12555. e.blendFunc(e.SRC_ALPHA, e.ONE_MINUS_SRC_ALPHA)
  12556. }
  12557. ,
  12558. this.initAttributes = function() {
  12559. for (var e = 0, t = s.length; e < t; e++)
  12560. s[e] = 0
  12561. }
  12562. ,
  12563. this.enableAttribute = function(i) {
  12564. if (s[i] = 1,
  12565. 0 === l[i] && (e.enableVertexAttribArray(i),
  12566. l[i] = 1),
  12567. 0 !== c[i]) {
  12568. var n = t.get("ANGLE_instanced_arrays");
  12569. n.vertexAttribDivisorANGLE(i, 0),
  12570. c[i] = 0
  12571. }
  12572. }
  12573. ,
  12574. this.enableAttributeAndDivisor = function(t, i, n) {
  12575. s[t] = 1,
  12576. 0 === l[t] && (e.enableVertexAttribArray(t),
  12577. l[t] = 1),
  12578. c[t] !== i && (n.vertexAttribDivisorANGLE(t, i),
  12579. c[t] = i)
  12580. }
  12581. ,
  12582. this.disableUnusedAttributes = function() {
  12583. for (var t = 0, i = l.length; t < i; t++)
  12584. l[t] !== s[t] && (e.disableVertexAttribArray(t),
  12585. l[t] = 0)
  12586. }
  12587. ,
  12588. this.enable = function(t) {
  12589. h[t] !== !0 && (e.enable(t),
  12590. h[t] = !0)
  12591. }
  12592. ,
  12593. this.disable = function(t) {
  12594. h[t] !== !1 && (e.disable(t),
  12595. h[t] = !1)
  12596. }
  12597. ,
  12598. this.getCompressedTextureFormats = function() {
  12599. if (null === u && (u = [],
  12600. t.get("WEBGL_compressed_texture_pvrtc") || t.get("WEBGL_compressed_texture_s3tc") || t.get("WEBGL_compressed_texture_etc1")))
  12601. for (var i = e.getParameter(e.COMPRESSED_TEXTURE_FORMATS), n = 0; n < i.length; n++)
  12602. u.push(i[n]);
  12603. return u
  12604. }
  12605. ,
  12606. this.setBlending = function(t, r, o, a, s, l, c, h) {
  12607. t === n.NoBlending ? this.disable(e.BLEND) : this.enable(e.BLEND),
  12608. t === d && h === y || (t === n.AdditiveBlending ? h ? (e.blendEquationSeparate(e.FUNC_ADD, e.FUNC_ADD),
  12609. e.blendFuncSeparate(e.ONE, e.ONE, e.ONE, e.ONE)) : (e.blendEquation(e.FUNC_ADD),
  12610. e.blendFunc(e.SRC_ALPHA, e.ONE)) : t === n.SubtractiveBlending ? h ? (e.blendEquationSeparate(e.FUNC_ADD, e.FUNC_ADD),
  12611. e.blendFuncSeparate(e.ZERO, e.ZERO, e.ONE_MINUS_SRC_COLOR, e.ONE_MINUS_SRC_ALPHA)) : (e.blendEquation(e.FUNC_ADD),
  12612. e.blendFunc(e.ZERO, e.ONE_MINUS_SRC_COLOR)) : t === n.MultiplyBlending ? h ? (e.blendEquationSeparate(e.FUNC_ADD, e.FUNC_ADD),
  12613. e.blendFuncSeparate(e.ZERO, e.ZERO, e.SRC_COLOR, e.SRC_ALPHA)) : (e.blendEquation(e.FUNC_ADD),
  12614. e.blendFunc(e.ZERO, e.SRC_COLOR)) : h ? (e.blendEquationSeparate(e.FUNC_ADD, e.FUNC_ADD),
  12615. e.blendFuncSeparate(e.ONE, e.ONE_MINUS_SRC_ALPHA, e.ONE, e.ONE_MINUS_SRC_ALPHA)) : (e.blendEquationSeparate(e.FUNC_ADD, e.FUNC_ADD),
  12616. e.blendFuncSeparate(e.SRC_ALPHA, e.ONE_MINUS_SRC_ALPHA, e.ONE, e.ONE_MINUS_SRC_ALPHA)),
  12617. d = t,
  12618. y = h),
  12619. t === n.CustomBlending ? (s = s || r,
  12620. l = l || o,
  12621. c = c || a,
  12622. r === p && s === m || (e.blendEquationSeparate(i(r), i(s)),
  12623. p = r,
  12624. m = s),
  12625. o === f && a === g && l === v && c === A || (e.blendFuncSeparate(i(o), i(a), i(l), i(c)),
  12626. f = o,
  12627. g = a,
  12628. v = l,
  12629. A = c)) : (p = null,
  12630. f = null,
  12631. g = null,
  12632. m = null,
  12633. v = null,
  12634. A = null)
  12635. }
  12636. ,
  12637. this.setDepthFunc = function(t) {
  12638. if (C !== t) {
  12639. if (t)
  12640. switch (t) {
  12641. case n.NeverDepth:
  12642. e.depthFunc(e.NEVER);
  12643. break;
  12644. case n.AlwaysDepth:
  12645. e.depthFunc(e.ALWAYS);
  12646. break;
  12647. case n.LessDepth:
  12648. e.depthFunc(e.LESS);
  12649. break;
  12650. case n.LessEqualDepth:
  12651. e.depthFunc(e.LEQUAL);
  12652. break;
  12653. case n.EqualDepth:
  12654. e.depthFunc(e.EQUAL);
  12655. break;
  12656. case n.GreaterEqualDepth:
  12657. e.depthFunc(e.GEQUAL);
  12658. break;
  12659. case n.GreaterDepth:
  12660. e.depthFunc(e.GREATER);
  12661. break;
  12662. case n.NotEqualDepth:
  12663. e.depthFunc(e.NOTEQUAL);
  12664. break;
  12665. default:
  12666. e.depthFunc(e.LEQUAL)
  12667. }
  12668. else
  12669. e.depthFunc(e.LEQUAL);
  12670. C = t
  12671. }
  12672. }
  12673. ,
  12674. this.setDepthTest = function(t) {
  12675. t ? this.enable(e.DEPTH_TEST) : this.disable(e.DEPTH_TEST)
  12676. }
  12677. ,
  12678. this.setDepthWrite = function(t) {
  12679. I !== t && (e.depthMask(t),
  12680. I = t)
  12681. }
  12682. ,
  12683. this.setColorWrite = function(t) {
  12684. E !== t && (e.colorMask(t, t, t, t),
  12685. E = t)
  12686. }
  12687. ,
  12688. this.setStencilFunc = function(t, i, n) {
  12689. w === t && _ === i && T === n || (e.stencilFunc(t, i, n),
  12690. w = t,
  12691. _ = i,
  12692. T = n)
  12693. }
  12694. ,
  12695. this.setStencilOp = function(t, i, n) {
  12696. x === t && S === i && M === n || (e.stencilOp(t, i, n),
  12697. x = t,
  12698. S = i,
  12699. M = n)
  12700. }
  12701. ,
  12702. this.setStencilTest = function(t) {
  12703. t ? this.enable(e.STENCIL_TEST) : this.disable(e.STENCIL_TEST)
  12704. }
  12705. ,
  12706. this.setStencilWrite = function(t) {
  12707. b !== t && (e.stencilMask(t),
  12708. b = t)
  12709. }
  12710. ,
  12711. this.setFlipSided = function(t) {
  12712. R !== t && (t ? e.frontFace(e.CW) : e.frontFace(e.CCW),
  12713. R = t)
  12714. }
  12715. ,
  12716. this.setLineWidth = function(t) {
  12717. t !== P && (e.lineWidth(t),
  12718. P = t)
  12719. }
  12720. ,
  12721. this.setPolygonOffset = function(t, i, n) {
  12722. t ? this.enable(e.POLYGON_OFFSET_FILL) : this.disable(e.POLYGON_OFFSET_FILL),
  12723. !t || O === i && L === n || (e.polygonOffset(i, n),
  12724. O = i,
  12725. L = n)
  12726. }
  12727. ,
  12728. this.getScissorTest = function() {
  12729. return D
  12730. }
  12731. ,
  12732. this.setScissorTest = function(t) {
  12733. D = t,
  12734. t ? this.enable(e.SCISSOR_TEST) : this.disable(e.SCISSOR_TEST)
  12735. }
  12736. ,
  12737. this.activeTexture = function(t) {
  12738. void 0 === t && (t = e.TEXTURE0 + N - 1),
  12739. B !== t && (e.activeTexture(t),
  12740. B = t)
  12741. }
  12742. ,
  12743. this.bindTexture = function(t, i) {
  12744. void 0 === B && r.activeTexture();
  12745. var n = F[B];
  12746. void 0 === n && (n = {
  12747. type: void 0,
  12748. texture: void 0
  12749. },
  12750. F[B] = n),
  12751. n.type === t && n.texture === i || (e.bindTexture(t, i),
  12752. n.type = t,
  12753. n.texture = i)
  12754. }
  12755. ,
  12756. this.compressedTexImage2D = function() {
  12757. try {
  12758. e.compressedTexImage2D.apply(e, arguments)
  12759. } catch (e) {
  12760. console.error(e)
  12761. }
  12762. }
  12763. ,
  12764. this.texImage2D = function() {
  12765. try {
  12766. e.texImage2D.apply(e, arguments)
  12767. } catch (e) {
  12768. console.error(e)
  12769. }
  12770. }
  12771. ,
  12772. this.clearColor = function(t, i, n, r) {
  12773. o.set(t, i, n, r),
  12774. V.equals(o) === !1 && (e.clearColor(t, i, n, r),
  12775. V.copy(o))
  12776. }
  12777. ,
  12778. this.clearDepth = function(t) {
  12779. U !== t && (e.clearDepth(t),
  12780. U = t)
  12781. }
  12782. ,
  12783. this.clearStencil = function(t) {
  12784. k !== t && (e.clearStencil(t),
  12785. k = t)
  12786. }
  12787. ,
  12788. this.scissor = function(t) {
  12789. H.equals(t) === !1 && (e.scissor(t.x, t.y, t.z, t.w),
  12790. H.copy(t))
  12791. }
  12792. ,
  12793. this.viewport = function(t) {
  12794. G.equals(t) === !1 && (e.viewport(t.x, t.y, t.z, t.w),
  12795. G.copy(t))
  12796. }
  12797. ,
  12798. this.reset = function() {
  12799. for (var t = 0; t < l.length; t++)
  12800. 1 === l[t] && (e.disableVertexAttribArray(t),
  12801. l[t] = 0);
  12802. h = {},
  12803. u = null,
  12804. B = void 0,
  12805. F = {},
  12806. d = null,
  12807. E = null,
  12808. I = null,
  12809. b = null,
  12810. R = null
  12811. }
  12812. }
  12813. }
  12814. , {
  12815. three: 217
  12816. }],
  12817. 104: [function(e, t, i) {
  12818. (function(i, n) {
  12819. "use strict";
  12820. function r(e) {
  12821. this.urls = e;
  12822. var t = i("bWVzc2FnZSBiaW5hcnlfbWVzaCB7CglyZXBlYXRlZCBjaHVua19zaW1wbGUgY2h1bmsgPSAxOwoJcmVwZWF0ZWQgY2h1bmtfcXVhbnRpemVkIHF1YW50aXplZF9jaHVuayA9IDI7Cn0KCi8vIERlZmluaXRpb24gb2YgdmVydGljZXM6IDNEIGNvb3JkaW5hdGVzLCBhbmQgMkQgdGV4dHVyZSBjb29yZGluYXRlcy4KbWVzc2FnZSB2ZXJ0aWNlc19zaW1wbGUgewoJcmVwZWF0ZWQgZmxvYXQgeHl6ID0gMSBbcGFja2VkPXRydWVdOyAgLy8geF8wLHlfMCx6XzAsIHhfMSx5XzEsel8xLCAuLi4KCXJlcGVhdGVkIGZsb2F0IHV2ID0gMiBbcGFja2VkPXRydWVdOyAgLy8gdV8wLHZfMCwgdV8xLHZfMSwgLi4uCn0KCi8vIEluZGV4ZXMgb2YgdmVydGljZXMgb2YgZmFjZXMKbWVzc2FnZSBmYWNlc19zaW1wbGUgewoJcmVwZWF0ZWQgdWludDMyIGZhY2VzID0gMSBbcGFja2VkPXRydWVdOyAvLyBpMDAsaTAxLGkwMiwgaTEwLGkxMSxpMTIsIC4uLgp9CgovLyBBIHNpbXBseSBlbmNvZGVkIGNodW5rLgovLyBUT0RPOiBhZGQgY2h1bmsgcHJvcGVyaXRlcyAoc3VjaCBhcyAicmVmbGVjdGl2ZSIpCm1lc3NhZ2UgY2h1bmtfc2ltcGxlIHsKCW9wdGlvbmFsIHZlcnRpY2VzX3NpbXBsZSB2ZXJ0aWNlcyA9IDE7CglvcHRpb25hbCBmYWNlc19zaW1wbGUgZmFjZXMgPSAyOwoJb3B0aW9uYWwgc3RyaW5nIGNodW5rX25hbWUgPSAzOwoJb3B0aW9uYWwgc3RyaW5nIG1hdGVyaWFsX25hbWUgPSA0Owp9CgovLyBRdWFudGl6ZWQgdmVyc2lvbnMgZm9sbG93OgptZXNzYWdlIHZlcnRpY2VzX3F1YW50aXplZCB7CglvcHRpb25hbCBmbG9hdCBxdWFudGl6YXRpb24gPSAxOwoJcmVwZWF0ZWQgZmxvYXQgdHJhbnNsYXRpb24gPSAyOwoJcmVwZWF0ZWQgc2ludDMyIHggPSAzIFtwYWNrZWQ9dHJ1ZV07CglyZXBlYXRlZCBzaW50MzIgeSA9IDQgW3BhY2tlZD10cnVlXTsKCXJlcGVhdGVkIHNpbnQzMiB6ID0gNSBbcGFja2VkPXRydWVdOwp9CgptZXNzYWdlIHV2X3F1YW50aXplZCB7CglvcHRpb25hbCBzdHJpbmcgbmFtZSA9IDE7CglvcHRpb25hbCBmbG9hdCBxdWFudGl6YXRpb24gPSAyOwoJcmVwZWF0ZWQgc2ludDMyIHUgPSAzIFtwYWNrZWQ9dHJ1ZV07CglyZXBlYXRlZCBzaW50MzIgdiA9IDQgW3BhY2tlZD10cnVlXTsKfQoKLy8gSW5kZXhlcyBvZiB2ZXJ0aWNlcyBvZiBmYWNlcwptZXNzYWdlIGZhY2VzX2NvbXByZXNzZWQgewoJcmVwZWF0ZWQgc2ludDMyIGZhY2VzID0gMSBbcGFja2VkPXRydWVdOyAvLyBpMDAsaTAxLGkwMiwgaTEwLGkxMSxpMTIsIC4uLgp9CgptZXNzYWdlIGNodW5rX3F1YW50aXplZCB7CglvcHRpb25hbCBzdHJpbmcgY2h1bmtfbmFtZSA9IDE7CglvcHRpb25hbCBzdHJpbmcgbWF0ZXJpYWxfbmFtZSA9IDI7CglvcHRpb25hbCB2ZXJ0aWNlc19xdWFudGl6ZWQgdmVydGljZXMgPSAzOwoJcmVwZWF0ZWQgdXZfcXVhbnRpemVkIHV2cyA9IDQ7CglvcHRpb25hbCBmYWNlc19zaW1wbGUgZmFjZXMgPSA1Owp9Cg==", "base64");
  12823. this.builder = a.loadProto(t),
  12824. this.decoder = this.builder.build("binary_mesh")
  12825. }
  12826. var o = e("three")
  12827. , a = e("protobufjs")
  12828. , s = e("../util/logger")
  12829. , l = (e("../util/common"),
  12830. e("../util/ajax"))
  12831. , c = e("../objects/Chunk")
  12832. , h = new s(n);
  12833. r.prototype = {
  12834. constructor: r,
  12835. load: function(e, t, i, n) {
  12836. return h.time("download"),
  12837. l.get(e, {
  12838. responseType: "arraybuffer"
  12839. }).done(function(r) {
  12840. h.timeEnd("download"),
  12841. this.parse(r, e, t, i, n)
  12842. }
  12843. .bind(this)).fail(n)
  12844. },
  12845. parse: function(e, t, i, n, r) {
  12846. var o = this.readProtobuf(e);
  12847. if (!o)
  12848. return r();
  12849. try {
  12850. h.time("convert to webgl"),
  12851. this.convertProtobufToSceneObject(o, t, i, n, r),
  12852. h.timeEnd("convert to webgl")
  12853. } catch (e) {
  12854. return h.error("failed parsing .dam"),
  12855. h.error(e.message),
  12856. r()
  12857. }
  12858. },
  12859. readProtobuf: function(e) {
  12860. var t;
  12861. try {
  12862. h.time("parse proto"),
  12863. t = this.decoder.decode(e),
  12864. h.timeEnd("parse proto")
  12865. } catch (e) {
  12866. return h.error("failed parsing proto for .dam"),
  12867. h.error(e.message),
  12868. null
  12869. }
  12870. return t
  12871. },
  12872. convertProtobufToSceneObject: function(e, t, i, n, r) {
  12873. function a(e) {
  12874. var i = new o.BufferGeometry;
  12875. return i.addAttribute("position", new o.BufferAttribute(new Float32Array(e.vertices.xyz,0,3),3)),
  12876. e.vertices.uv.length > 0 && i.addAttribute("uv", new o.BufferAttribute(new Float32Array(e.vertices.uv,0,2),2)),
  12877. i.setIndex(new o.BufferAttribute(new Uint32Array(e.faces.faces,0,1),1)),
  12878. i.applyMatrix(s),
  12879. i.computeBoundingBox(),
  12880. new c({
  12881. geometry: i,
  12882. textureName: e.material_name,
  12883. name: e.chunk_name,
  12884. meshUrl: t
  12885. })
  12886. }
  12887. if (0 === e.chunk.length)
  12888. return h.warn("No chunks in damfile..."),
  12889. i([]);
  12890. var s = new o.Matrix4;
  12891. s.set(1, 0, 0, 0, 0, 0, 1, 0, 0, -1, 0, 0, 0, 0, 0, 1);
  12892. var l = e.chunk.map(a);
  12893. return l ? i(l) : (h.error(".dam protobuf came out with no chunks..."),
  12894. r())
  12895. }
  12896. },
  12897. t.exports = r
  12898. }
  12899. ).call(this, e("buffer").Buffer, "/js/loaders/DamLoader.js")
  12900. }
  12901. , {
  12902. "../objects/Chunk": 144,
  12903. "../util/ajax": 181,
  12904. "../util/common": 185,
  12905. "../util/logger": 189,
  12906. buffer: 198,
  12907. protobufjs: 214,
  12908. three: 217
  12909. }],
  12910. 105: [function(e, t, i) {
  12911. (function(i) {
  12912. "use strict";
  12913. var n = (e("three"),
  12914. e("../settings"),
  12915. e("../util/browser"),
  12916. e("./DamLoader"))
  12917. , r = e("../util/logger")
  12918. , o = (e("../ab"),
  12919. new r(i));
  12920. t.exports = {
  12921. getLoaders: function() {
  12922. return [["_50k", ".dam", n], ["", ".dam", n]]
  12923. },
  12924. load: function(e, t, i, n, r, a) {
  12925. var s = this.getLoaders();
  12926. a = a || 0;
  12927. var l = s[a];
  12928. if (!l)
  12929. return void (r && r("No suitable model file found..."));
  12930. var c = l[0]
  12931. , h = l[1]
  12932. , u = new l[2](t)
  12933. , d = t.get(e + c + h);
  12934. d ? (o.debug("Trying " + c + h),
  12935. u.load(d, i, n, function() {
  12936. this.load(e, t, i, n, r, ++a)
  12937. }
  12938. .bind(this))) : (o.debug("Skipping " + h + ", not available"),
  12939. this.load(e, t, i, n, r, ++a))
  12940. }
  12941. }
  12942. }
  12943. ).call(this, "/js/loaders/ModelLoader.js")
  12944. }
  12945. , {
  12946. "../ab": 3,
  12947. "../settings": 166,
  12948. "../util/browser": 182,
  12949. "../util/logger": 189,
  12950. "./DamLoader": 104,
  12951. three: 217
  12952. }],
  12953. 106: [function(e, t, i) {
  12954. (function(i) {
  12955. "use strict";
  12956. var n = e("../util/common")
  12957. , r = e("../util/texture")
  12958. , o = e("../util/browser")
  12959. , a = e("../util/logger")
  12960. , s = e("../settings")
  12961. , l = new a(i);
  12962. t.exports = {
  12963. load: function(e, t) {
  12964. function i(e, i) {
  12965. e || (t.push(i),
  12966. p++,
  12967. d.notify(p, a),
  12968. p === a && d.resolve())
  12969. }
  12970. if (!e.chunks[0] || !e.chunks[0].meshUrl)
  12971. return $.when();
  12972. var a = n.countUnique(e.chunks.map(function(e) {
  12973. return e.textureName
  12974. }))
  12975. , c = e.chunks[0].meshUrl.indexOf("_50k") !== -1 ? "_50k" : ""
  12976. , h = "_50k" === c ? "high" : "low";
  12977. s.minimalMemoryMode && "high" === h && (o.detectSamsungS6() ? (l.warn("Galaxy S6 cannot handle large textures, turning down quality."),
  12978. h = "low") : a > s.maxMobileTextures && (l.warn("Model probably too large for mobile, turning down quality."),
  12979. h = "low"));
  12980. //经常没有low的贴图,这里要不要去掉转low的?? xzw
  12981. var u = e.data.job.uuid + c + "_texture_jpg_" + h + "/"
  12982. , d = $.Deferred()
  12983. , p = 0;
  12984. return e.chunks.forEach(function(t) {
  12985. if (!t.material.map && t.textureName) {
  12986. var n = e.urls.get(u + t.textureName);
  12987. t.setTextureMap(r.load(n, i.bind(this, r.isLoaded(n))))
  12988. }
  12989. }),
  12990. d.promise()
  12991. }
  12992. }
  12993. }
  12994. ).call(this, "/js/loaders/ModelTextureLoader.js")
  12995. }
  12996. , {
  12997. "../settings": 166,
  12998. "../util/browser": 182,
  12999. "../util/common": 185,
  13000. "../util/logger": 189,
  13001. "../util/texture": 194
  13002. }],
  13003. 107: [function(e, t, i) {
  13004. (function(i, n) {
  13005. "use strict";
  13006. function r(e) {
  13007. this.model = e,
  13008. this.modelDataPath = this.model.urls.get("vision.modeldata")+"?m="+new Date().getTime(),
  13009. this.sweepLocationsPath = this.model.urls.get("sweep_locations.csv");
  13010. var t = i("Ly8gUHJvdG9jb2wgQnVmZmVyIGZvciBwdWNrIHZpc2liaWxpdHkgYW5kIHJlbGF0ZWQgZGF0YQovLwovLyBUbyBkdW1wIG91dCBhIGJpbnJheSBtYW5pZmVzdCBpbiB0ZXh0IGZvcm1hdCwgeW91IGNhbiB1c2UgcHJvdG9jIGRpcmVjdGx5OgovLyAgIHByb3RvYyAtLXByb3RvX3BhdGggfi9kZXYvbXBfdmlzaW9uLyAgLS1kZWNvZGU9ZW9zLnN0b3JhZ2UuVmlzaW9uTW9kZWxkYXRhIH4vZGV2L21wX3Zpc2lvbi9lb3Mvc3RvcmFnZS92aXNpb25fbW9kZWxkYXRhLnByb3RvIDwgdmlzaW9uLm1vZGVsZGF0YQoKLy8gcGFja2FnZSBlb3Muc3RvcmFnZTsKCi8vIGltcG9ydCAiZW9zL2luZnJhL2NvbW1vbi5wcm90byI7Ci8vIFRoZSBmb2xsb3dpbmcgd2VyZSBtYW51YWxseSBleHRyYWN0ZWQgaGVyZSwgSlMgZG9lcyBub3QgbGlrZSBwcm90b2J1ZiBpbXBvcnRzCgptZXNzYWdlIEFmZmluZTNmIHsKCW9wdGlvbmFsIFF1YXRlcm5pb25mIHJvdGF0aW9uID0gMTsKCW9wdGlvbmFsIFZlY3RvcjNmIHRyYW5zbGF0aW9uID0gMjsKfQoKbWVzc2FnZSBRdWF0ZXJuaW9uZiB7CglvcHRpb25hbCBmbG9hdCB3ID0gMTsKCW9wdGlvbmFsIGZsb2F0IHggPSAyOwoJb3B0aW9uYWwgZmxvYXQgeSA9IDM7CglvcHRpb25hbCBmbG9hdCB6ID0gNDsKfQoKbWVzc2FnZSBWZWN0b3IzZiB7CglvcHRpb25hbCBmbG9hdCB4ID0gMTsKCW9wdGlvbmFsIGZsb2F0IHkgPSAyOwoJb3B0aW9uYWwgZmxvYXQgeiA9IDM7Cn0KCi8vCi8vIE9uZSBzd2VlcCAvIHBhbm8KLy8KbWVzc2FnZSBTd2VlcExvY2F0aW9uIHsKCW9wdGlvbmFsIGJ5dGVzIHV1aWQgPSAxOyAgLyogdXVpZCAqLwoJb3B0aW9uYWwgQWZmaW5lM2YgcG9zZSA9IDI7ICAvKiBjYW1lcmEgcG9zZSAoeCwgeSx6KSBpbiBtZXRlciBhbmQgYSBxdWF0ZXJuaW9uKi8KCW9wdGlvbmFsIFZlY3RvcjNmIHB1Y2sgPSAzOyAgLyogcHVjayBsb2NhdGlvbiAtIHggYW55IGlzIGdlbmVyYWxseSB0aGUgc2FtZSBhcyBwb3NlLCB6IGlzIHRoZSBoZWlnaHQgb2YgdGhlIGNsb3Nlc3QgZmxvb3IgdW5kZXIgdGhlIGNhbWVyYSAqLwoJb3B0aW9uYWwgaW50MzIgZ3JvdXAgPSA0OyAgLyogZmxvb3IgaW5kZXggKi8KCW9wdGlvbmFsIGludDMyIHN1Ymdyb3VwID0gNTsgIC8qIHJvb20gaW5kZXggKi8KCXJlcGVhdGVkIGludDMyIHZpc2libGVzID0gNjsgIC8qIGxpc3Qgb2YgaW5kaWNlcyB0byBhbGwgcHVja3MgdmlzaWJsZSBmcm9tIHRoaXMgcHVjayAqLwoJcmVwZWF0ZWQgZmxvYXQgc2NvcmVzID0gNzsgLyogdXNlZCBhcyBwYXJ0IG9mIHNjb3JpbmcgZnVuY3Rpb24gZm9yIGRldGVybWluaW5nIHdoaWNoIHB1Y2sgdG8gZ28gdG8gbmV4dCAqLwogIG9wdGlvbmFsIHN0cmluZyBzd2VlcF9uYW1lID0gODsKCiAgLy8gV2l0aCBvdXRkb29yIHBhbm9zLCB3ZSBoYXZlIGEgY291cGxlIG9mIGRpZmZlcmVudCBzaXR1YXRpb25zIGZvciBhbGlnbm1lbnQuIFRoZSBjb21tb24KICAvLyBjYXNlIGlzIHRoYXQgdGhlIHBhbm8gYWxpZ25lZCBub3JtYWxseS4gSXQgY291bGQgYWxzbyBoYXZlIGJlZW4gcGxhY2VkIG1hbnVhbGx5IGluCiAgLy8gQ2FwdHVyZUFwcCBvciBXb3Jrc2hvcCwgb3IgbGVmdCB1bmFsaWduZWQgZm9yIGhpZ2hsaWdodC1yZWVsIHZpZXdpbmcuCiAgZW51bSBBbGlnbm1lbnRUeXBlCiAgewogICAgICBVTktOT1dOID0gMDsKICAgICAgQUxJR05FRCA9IDE7CiAgICAgIFVOQUxJR05FRCA9IDI7CiAgICAgIE1BTlVBTExZX1BMQUNFRCA9IDM7CiAgfQogIG9wdGlvbmFsIEFsaWdubWVudFR5cGUgYWxpZ25tZW50X3R5cGUgPSA5IFtkZWZhdWx0ID0gQUxJR05FRF07Cn0KCm1lc3NhZ2UgU3ViZ3JvdXBJbmZvIHsKCW9wdGlvbmFsIGludDMyIHN1Ymdyb3VwID0gMTsKCW9wdGlvbmFsIGZsb2F0IGFyZWEgPSAyOyAvKiBmbG9vciBhcmVhIGluIG1eMiAoc3F1YXJlIG1ldGVyYWdlKSAqLwp9CgovKiBBbGwgcHVja3MgaW4gYSBtb2RlbC4gUHVja3MgYXJlIHN0b3JlZCBpbiBzY2FubmluZyBvcmRlci4gKi8KbWVzc2FnZSBWaXNpb25Nb2RlbGRhdGEgewoJcmVwZWF0ZWQgU3dlZXBMb2NhdGlvbiBzd2VlcExvY2F0aW9ucyA9IDE7CglyZXBlYXRlZCBTdWJncm91cEluZm8gc3ViZ3JvdXBJbmZvcyA9IDI7Cn0K", "base64")
  13011. , n = o.loadProto(t);
  13012. this.decoder = n.build("VisionModeldata")
  13013. }
  13014. var o = e("protobufjs")
  13015. , a = e("../util/ajax")
  13016. , s = (e("../util/common"),
  13017. e("../util/math"))
  13018. , l = e("../util/logger")
  13019. , c = new l(n);
  13020. r.prototype.load = function() {
  13021. return this.modelDataPath ? (c.info("Using vision.modeldata"),
  13022. this.loadVisionModelData()) : this.sweepLocationsPath ? (c.warn("Using sweep_locations.csv"),
  13023. this.loadSweepLocationsCSV()) : (c.warn("No sweep file found"),
  13024. $.when([]))
  13025. }
  13026. ,
  13027. r.prototype.loadVisionModelData = function() {
  13028. return a.get(this.modelDataPath, {
  13029. responseType: "arraybuffer"
  13030. }).then(function(e) {
  13031. var t;
  13032. try {
  13033. t = this.decoder.decode(e)
  13034. } catch (e) {
  13035. return c.warn("Could not decode vision.modeldata, trying sweep_locations.csv"),
  13036. this.loadSweepLocationsCSV()
  13037. }
  13038. var i = t.sweepLocations.map(function(e) {
  13039. return {
  13040. uuid: e.uuid.toUTF8().replace(/-/g, ""),
  13041. position: {
  13042. x: e.pose.translation.x,
  13043. y: e.pose.translation.y,
  13044. z: e.pose.translation.z
  13045. },
  13046. quaternion: {
  13047. x: e.pose.rotation.x,
  13048. y: e.pose.rotation.y,
  13049. z: e.pose.rotation.z,
  13050. w: e.pose.rotation.w
  13051. },
  13052. puck: {
  13053. x: e.puck.x,
  13054. y: e.puck.y,
  13055. z: e.puck.z
  13056. },
  13057. floor: window.sceneFrom == 'kankan' ? e.subgroup : e.group,
  13058. neighbours: e.visibles,
  13059. alignmentType: e.alignment_type
  13060. }
  13061. }).map(function(e) {
  13062. return e.position = s.convertVisionVector(e.position),
  13063. e.quaternion = s.convertVisionQuaternion(e.quaternion),
  13064. e.puck = s.convertVisionVector(e.puck),
  13065. e
  13066. });
  13067. return i.forEach(function(e) {
  13068. e.neighbours = e.neighbours.map(function(e) {
  13069. return i[e].uuid
  13070. })
  13071. }),
  13072. i
  13073. }
  13074. .bind(this), function() {
  13075. return c.warn("Could not load vision.modeldata, trying sweep_locations.csv"),
  13076. this.loadSweepLocationsCSV()
  13077. }
  13078. .bind(this))
  13079. }
  13080. ,
  13081. r.prototype.loadSweepLocationsCSV = function() {
  13082. return a.get(this.sweepLocationsPath).then(function(e) {
  13083. var t = e.split("\n").map(function(e) {
  13084. return e.split(", ")
  13085. }).filter(function(e) {
  13086. return e.length > 1
  13087. }).map(function(e) {
  13088. return {
  13089. uuid: e[0],
  13090. position: {
  13091. x: parseFloat(e[1]),
  13092. y: parseFloat(e[2]),
  13093. z: parseFloat(e[3])
  13094. },
  13095. quaternion: {
  13096. x: parseFloat(e[4]),
  13097. y: parseFloat(e[5]),
  13098. z: parseFloat(e[6]),
  13099. w: parseFloat(e[7])
  13100. }
  13101. }
  13102. }).map(function(e) {
  13103. return e.position = s.convertVisionVector(e.position),
  13104. e.quaternion = s.convertVisionQuaternion(e.quaternion),
  13105. e
  13106. });
  13107. return t
  13108. }).fail(function() {
  13109. c.warn("Could not load sweep_locations.csv, no sweeps loaded.")
  13110. })
  13111. }
  13112. ,
  13113. t.exports = r
  13114. }
  13115. ).call(this, e("buffer").Buffer, "/js/loaders/SweepDataLoader.js")
  13116. }
  13117. , {
  13118. "../util/ajax": 181,
  13119. "../util/common": 185,
  13120. "../util/logger": 189,
  13121. "../util/math": 190,
  13122. buffer: 198,
  13123. protobufjs: 214
  13124. }],
  13125. 108: [function(e, t, i) {
  13126. (function(i) {
  13127. "use strict";
  13128. function n() {
  13129. this.locale = null
  13130. }
  13131. var r = e("../settings")
  13132. , o = e("../util/common")
  13133. , a = e("../util/logger")
  13134. , s = e("../enum/Locale")
  13135. , l = new a(i);
  13136. n.prototype.init = function() {
  13137. var t;
  13138. switch (r.languageTag) {
  13139. case null:
  13140. case "en":
  13141. case s.EN_US:
  13142. this.locale = s.EN_US,
  13143. t = e("./strings-en-US");
  13144. break;
  13145. case "es":
  13146. case s.ES_MX:
  13147. this.locale = s.ES_MX,
  13148. t = e("./strings-es-MX");
  13149. break;
  13150. case "fr":
  13151. case s.FR_FR:
  13152. this.locale = s.FR_FR,
  13153. t = e("./strings-fr-FR");
  13154. break;
  13155. case "de":
  13156. case s.DE_DE:
  13157. this.locale = s.DE_DE,
  13158. t = e("./strings-de-DE");
  13159. break;
  13160. case "ru":
  13161. case s.RU_RU:
  13162. this.locale = s.RU_RU,
  13163. t = e("./strings-ru-RU");
  13164. break;
  13165. case "cn":
  13166. case s.CN_CN:
  13167. this.locale = s.CN_CN,
  13168. t = e("./strings-cn-CN");
  13169. break;
  13170. case "jp":
  13171. case s.JP_JP:
  13172. this.locale = s.JP_JP,
  13173. t = e("./strings-jp-JP");
  13174. break;
  13175. default:
  13176. l.info("Unsupported language tag, defaulting to 'en-US'"),
  13177. this.locale = s.EN_US,
  13178. t = e("./strings-en-US")
  13179. }
  13180. l.info("Using locale '" + this.locale + "'"),
  13181. o.extendObject(this, t)
  13182. }
  13183. ,
  13184. n.prototype.localizeGUI = function() {
  13185. var e = document.querySelector("#gui-parent");
  13186. this.localizeTree(e),
  13187. this.localizeLoadingText()
  13188. }
  13189. ,
  13190. n.prototype.localizeLoadingText = function() {
  13191. // var e = document.querySelector("#loader-cont")
  13192. // , t = e.getAttribute("title");
  13193. // e.removeAttribute("title"),
  13194. // e.setAttribute("data-status", t),
  13195. // e.classList.add(this.locale),
  13196. document.querySelector("#help-dialog").classList.add(this.locale),
  13197. document.querySelector("#interaction-modal").classList.add(this.locale),
  13198. document.querySelector("#gui").classList.add(this.locale);
  13199. }
  13200. ,
  13201. n.prototype.localizeTree = function(e) {
  13202. var t, i, n = /{\[{ ?(\w+) ?}\]}/;
  13203. if (e.nodeType === Node.TEXT_NODE)
  13204. t = e.data.match(n),
  13205. t && (i = t[1],
  13206. e.data = this.localizeText(i) || i);
  13207. else if (e.nodeType === Node.ELEMENT_NODE) {
  13208. var r = e.getAttribute("title");
  13209. r && (t = r.match(n),
  13210. t && (i = t[1],
  13211. e.setAttribute("title", this.localizeText(i) || i)))
  13212. }
  13213. for (e = e.firstChild; e; )
  13214. this.localizeTree(e),
  13215. e = e.nextSibling
  13216. }
  13217. ,
  13218. n.prototype.localizeText = function(t) {
  13219. var i = this[t];
  13220. return i || this.locale === s.EN_US || (l.warn("Localization key '" + t + "' not available for locale '" + this.locale + "', defaulting to English."),
  13221. i = e("./strings-en-US")[t]),
  13222. i || l.warn("Localization key '" + t + "' not available for locale 'en-US'"),
  13223. i
  13224. }
  13225. ,
  13226. t.exports = new n
  13227. }
  13228. ).call(this, "/js/localization/localize.js")
  13229. }
  13230. , {
  13231. "../enum/Locale": 31,
  13232. "../settings": 166,
  13233. "../util/common": 185,
  13234. "../util/logger": 189,
  13235. "./strings-cn-CN": 109,
  13236. "./strings-de-DE": 110,
  13237. "./strings-en-US": 111,
  13238. "./strings-es-MX": 112,
  13239. "./strings-fr-FR": 113,
  13240. "./strings-jp-JP": 114,
  13241. "./strings-ru-RU": 115
  13242. }],
  13243. 109: [function(e, t, i) {
  13244. "use strict";
  13245. t.exports = {
  13246. PAGE_TITLE: "",
  13247. LOADING: "正在加载",
  13248. PRESENTED_BY_CAPS: "呈现者:",
  13249. POWERED_BY: "技术支持:",
  13250. POWERED_BY_CAPS: "技术支持:",
  13251. DESKTOP_SHORT_CTA: "点击一次以探索这个 3D 空间。",
  13252. MOBILE_SHORT_CTA: "点击一次以探索这个 3D 空间。",
  13253. PRESENTED_BY: "呈现者:",
  13254. MORE: "更多 ",
  13255. LESS: "更少 ",
  13256. TAG_CONTENT: "tag™ 内容",
  13257. SHOW: "显示",
  13258. HIDE: "隐藏",
  13259. DOLLHOUSE: "场景屋",
  13260. FLOOR_PLAN: "楼层平面图",
  13261. OPEN_HIGHLIGHTS: "打开精彩片段",
  13262. CLOSE_HIGHLIGHTS: "关闭",
  13263. PREVIOUS: "上一个",
  13264. PLAY: "播放",
  13265. PAUSE: "暂停",
  13266. NEXT: "下一个",
  13267. EXPLORE_3D_SPACE: "探索 3D 空间",
  13268. VIEW_DOLLHOUSE: "观看场景屋",
  13269. SOCIAL_SHARING: "分享这个空间",
  13270. VIEW_IN_VR: "以 VR 观看",
  13271. VIEW_FULLSCREEN: "全屏观看",
  13272. EXIT_FULLSCREEN: " 退出全屏",
  13273. ZOOM_IN: "放大",
  13274. ZOOM_OUT: "缩小",
  13275. FLOOR_NAME: "楼层",
  13276. FLOOR_ALL: "ALL",
  13277. FLOOR_Lang: ["Floor",""],
  13278. TERMS: "条款",
  13279. PORT_TERMS: "port 条款",
  13280. TERMS_OF_USE: "使用条款",
  13281. CLOSE_TERMS: "关闭",
  13282. TERMS_TEXT_FILE: "terms-cn-CN.html",
  13283. TERMS_FAIL: "无法获取条款。请确保您有互联网连接以查看使用条款。",
  13284. WEBVR_FOR_DAYDREAM: "用于 Daydream 视图",
  13285. WEBVR_ENTER_WEBVR: "进入 VR",
  13286. WEBVR_DIFFERENT_HEADSET: "有其他耳机吗?",
  13287. WEBVR_LEARN_MORE: "了解更多",
  13288. WEBVR_VIEW_SPACE: "在 VR 中观看空间",
  13289. WEBVR_DAYDREAM_VIEW: "Daydream 视图",
  13290. WEBVR_DAYDREAM_PHONE: "支持 Daydream 的手机",
  13291. WEBVR_FOR_CARDBOARD: "用于 Google Cardboard",
  13292. WEBVR_VIEW_CARDBOARD: "或在 Google Cardboard 上观看",
  13293. VR_VIEW_SPACE: "在虚拟现实中观看空间",
  13294. VR_LEARN_MORE_CAPS: "了解更多",
  13295. VR_PREVIOUS_CAPS: "上一个’,",
  13296. VR_NEXT_CAPS: "下一个",
  13297. VR_GOT_IT_CAPS: "明白了",
  13298. VR_SHOW_SUPPORTED: "点击以使用 VR 观看空间",
  13299. VR_SHOW_UNSUPPORTED: "很遗憾,您的设备不符合在 VR 中观看空间的最低要求。",
  13300. VR_SHOW_IOS_1: "点击以使用 VR 观看空间",
  13301. VR_SHOW_IOS_2: "需要有 port VR 应用程序和兼容的 iPhone 才能观看",
  13302. VR_WHAT_YOU_NEED: "关于...您需要什么",
  13303. VR_NEED_CARDBOARD: "您使用 Google Cardboard 时需要什么",
  13304. VR_NEED_SAMSUNG: "您使用 Samsung Gear VR 时需要什么",
  13305. VR_NEED_DAYDREAM: "需要事先与 DAYDREAM VIEW 配对",
  13306. VR_NEED_DAYDREAM_PHONE: "支持 Daydream 的手机",
  13307. VR_GOOGLE_CARDBOARD: "Google Cardboard",
  13308. VR_GOOGLE_DAYDREAM: "Google Daydream",
  13309. VR_APP: "port VR 应用程序",
  13310. VR_SAMSUNG_GEAR_VR: "Samsung Gear VR",
  13311. VR_COMPATIBLE_IPHONES_1: "iPhones",
  13312. VR_COMPATIBLE_IPHONES_2: "iPhone 5s 和更高版本,运行 iOS 9.1 和更高版本",
  13313. VR_COMPATIBLE_IPHONES_3: "兼容的 iPhone",
  13314. VR_COMPATIBLE_ANDROID: "兼容的 Android 设备",
  13315. VR_COMPATIBLE_ANDROID_LONG: "4.5-5.5 英寸、运行 Android OS 4.4.4 和更高版本的兼容型 Android 设备显示屏",
  13316. VR_ANDROID_DETAIL: "4.5 至 5.5 英寸、运行 Android OS 4.4.4 和更高版本的显示屏",
  13317. VR_ANDROID_DVICES: "Android 设备",
  13318. VR_COMPATIBLE_SAMSUNG: "兼容的 Samsung 设备",
  13319. VR_SAMSUNG_DETAIL: "Galaxy S6 和更高版本",
  13320. VR_APP_FOR_CARDBOARD: "用于 Google Cardboard 的 port VR 应用程序",
  13321. VR_APP_FOR_SAMSUNG: "用于 Gear VR 的 port VR 应用程序",
  13322. VR_APP_FOR_ANDROID: "用于 Android 手机的 port VR 应用程序",
  13323. VR_APP_OPEN: "请使用 port VR 应用程序打开",
  13324. VR_DOWNLOAD_HERE: "在此下载",
  13325. VR_REQUIRE_HEADSET: "需要一副 VR 耳机并安装用于 Android 的 port VR 应用程序",
  13326. VR_REDIRECT_TO_STORE: "如果未安装应用程序,您将跳转到应用程序商店。",
  13327. VR_IMPROPER_EMBED: "port 空间未正确嵌入,无法在您的 Web 浏览器支持 VR。",
  13328. VR_OPEN_ANDROID_LINK: "在您的手机上打开链接",
  13329. VR_ANDROID_OPTIONS: "可用的 VR 耳机选项",
  13330. SHARE_TO: "分享到",
  13331. SHARE_LINK: "直接链接",
  13332. SHARE_EXPLORE: "探索",
  13333. SHARE_AT: "在",
  13334. SHARE_WITH: "使用",
  13335. SHARE_3D: "以 3D",
  13336. SHARE_COPIED: "已复制!",
  13337. ERROR_BROWSER_SOLUTION: "安装更新的浏览器以探索 3D。",
  13338. ERROR_BROWSER_EXPLANATION: "WebGL 需要现代的浏览器。",
  13339. ERROR_GENERIC_PROBLEM: "糟糕,出现问题。",
  13340. ERROR_GENERIC_SOLUTION: "重新启动您的浏览器。",
  13341. ERROR_GENERIC_ACTIONS_1: "如果问题仍然存在,",
  13342. ERROR_GENERIC_ACTIONS_2: "请安装支持的浏览器",
  13343. ERROR_GENERIC_ACTIONS_3: " 或",
  13344. ERROR_GENERIC_ACTIONS_4: "查看我们的故障排除指南",
  13345. ERROR_WEBGL_UNSUPPORTED_PROBLEM: "浏览器不受支持。",
  13346. ERROR_WEBGL_IOS_PROBLEM: "iOS 版本不受支持。",
  13347. ERROR_WEBGL_IOS_SOLUTION: "升级到 iOS 8 或更高版本以在 3D 中探索。",
  13348. ERROR_WEBGL_IOS_ACTIONS_1: "点击 ",
  13349. ERROR_WEBGL_IOS_ACTIONS_2: "设置 > 通用 > 软件更新",
  13350. ERROR_WEBGL_SAFARI_PROBLEM: "启用 WebGL 以在 3D 中探索。",
  13351. ERROR_WEBGL_SAFARI_ACTIONS_1: "单击",
  13352. ERROR_WEBGL_SAFARI_ACTIONS_2: "菜单栏中的首选项 > 高级 > 显示开发菜单",
  13353. ERROR_WEBGL_SAFARI_ACTIONS_3: "然后单击",
  13354. ERROR_WEBGL_SAFARI_ACTIONS_4: "开发 > 启用 WebGL",
  13355. ERROR_MISSING_URLS_PROBLEM: "糟糕,没有此模型的全景。",
  13356. ERROR_MISSING_URLS_EXPLANATION: "这是较早的模型。网站所有者可能正在开发一种新模型。",
  13357. ERROR_LOADING_FAILED_PROBLEM: "糟糕,模式不可用。",
  13358. ERROR_LOADING_FAILED_ACTIONS_1: "如果问题仍然存在,",
  13359. ERROR_LOADING_FAILED_ACTIONS_2: "查看我们的故障排除指南",
  13360. ERROR_MAINTENANCE_PROBLEM: "正在进行维护",
  13361. ERROR_MAINTENANCE_SOLUTION: "请过几分钟再来。",
  13362. LINK_TO_LOCATION: "地点链接",
  13363. MENU_COPY: "复制",
  13364. LINK_ALERT_COPY: "请使用 CTRL/CMD + C 复制。",
  13365. ROTATE: "旋转",
  13366. MOVE: "移动",
  13367. INSIDE: "内部",
  13368. ZOOM: "缩放",
  13369. HELP: "小帮手",
  13370. HELP_NAVIGATION_TAB: "导航",
  13371. HELP_MORE_HELP_TAB: "更多帮助",
  13372. HELP_DESKTOP_PANORAMA_1A: "单击并拖动以环顾空间。",
  13373. HELP_DESKTOP_PANORAMA_2A: "单击整个空间内的圆环以四处移动。",
  13374. HELP_DESKTOP_PANORAMA_3A: "使用鼠标滚轮来放大和缩小。",
  13375. HELP_DESKTOP_PANORAMA_1B: "或者,使用箭头键向左向右转。",
  13376. HELP_DESKTOP_PANORAMA_2B: "或者,使用箭头键向前移动和向后移动。",
  13377. HELP_DESKTOP_PANORAMA_3B: "或者,使用加号和减号键来放大和缩小。",
  13378. HELP_DESKTOP_360_2A: "单击内部视图图标以进入空间。",
  13379. HELP_DESKTOP_360_2B: "或者,按 1 号键进入内部视图。 ",
  13380. HELP_DESKTOP_DOLLHOUSE_1A: "左键单击并向左、向右、向上和向下拖动以旋转场景屋。",
  13381. HELP_DESKTOP_DOLLHOUSE_2A: "右键单击并向左、向右、向上和向下拖动以改变场景屋在屏幕上的位置。",
  13382. HELP_DESKTOP_DOLLHOUSE_3A: "使用鼠标滚轮来放大和缩小。",
  13383. HELP_DESKTOP_DOLLHOUSE_1B: "或者,使用箭头键来旋转场景屋。",
  13384. HELP_DESKTOP_FLOORPLAN_1A: "左键单击并向左、向右、向上和向下拖动以改变楼层平面图在屏幕上的位置。",
  13385. HELP_DESKTOP_FLOORPLAN_2A: "右键单击并向左或向右拖动以旋转楼层平面图。",
  13386. HELP_DESKTOP_FLOORPLAN_3A: "使用鼠标滚轮来放大和缩小。",
  13387. HELP_DESKTOP_FLOORPLAN_2B: "或者,使用箭头键以向左或向右旋转。",
  13388. HELP_DESKTOP_FLOORPLAN_3B: "或者,使用箭头键来放大和缩小。",
  13389. HELP_MOBILE_PANORAMA_1: "触摸并拖动以环顾空间。",
  13390. HELP_MOBILE_PANORAMA_2: "点击整个空间内的圆环以四处移动。",
  13391. HELP_MOBILE_3: "使用捏合手势来放大和缩小。",
  13392. HELP_MOBILE_360_2: "点击内部视图图标以进入空间。",
  13393. HELP_MOBILE_DOLLHOUSE_1: "触摸并向上、向下、向左和向右拖动以旋转场景屋。",
  13394. HELP_MOBILE_DOLLHOUSE_2: "用两指触摸并拖动以定位场景屋。",
  13395. HELP_MOBILE_FLOORPLAN_1: "触摸并拖动以定位楼层平面图。",
  13396. HELP_MOBILE_FLOORPLAN_2: "用两指触摸并拖动以旋转楼层平面图。",
  13397. HELP_MORE_HLR_A: "精彩片段集锦",
  13398. HELP_DESKTOP_MORE_HLR_B: "打开以使用缩略图图像在空间中流览。",
  13399. HELP_MORE_DOLLHOUSE_A: "场景屋",
  13400. HELP_DESKTOP_MORE_DOLLHOUSE_B: "单击以查看和旋转 3D 内整个空间的俯视图。",
  13401. HELP_MOBILE_MORE_DOLLHOUSE_B: "点击以查看和旋转 3D 内整个空间的俯视图。",
  13402. HELP_MORE_FLOORS_A: "楼层选择器",
  13403. HELP_DESKTOP_MORE_FLOORS_B: "在空间中的楼层之间切换。",
  13404. HELP_MORE_TAG_A: "tag™ 贴文",
  13405. HELP_DESKTOP_MORE_TAG_B: "单击或悬停鼠标以查看空间中的功能信息。",
  13406. HELP_MOBILE_MORE_TAG_B: "点击以查看空间中的功能信息。",
  13407. HELP_MORE_ZOOM_A: "缩放控件",
  13408. HELP_DESKTOP_MORE_ZOOM_B: "使用这些控件来放大和缩小或使用滚轮。",
  13409. HELP_MORE_TOUR_A: "导览控件",
  13410. HELP_DESKTOP_MORE_TOUR_B: "通过导览播放、暂停以及向前和向后流览。",
  13411. HELP_MORE_INSIDE_A: "内部视图",
  13412. HELP_DESKTOP_MORE_INSIDE_B: "单击以探索空间内部。",
  13413. HELP_MOBILE_MORE_INSIDE_B: "点击以探索空间内部。",
  13414. HELP_MORE_VR_A: "VR 模式",
  13415. HELP_DESKTOP_MORE_VR_B: "单击以在虚拟现实中启动空间。",
  13416. HELP_MOBILE_MORE_VR_B: "点击以在虚拟现实中启动空间。",
  13417. HELP_MORE_360_A: "360° 视图",
  13418. HELP_DESKTOP_MORE_360_B: "单击精彩片段集锦中的 360 视图中以观看室外场景。",
  13419. HELP_MOBILE_MORE_360_B: "点击精彩片段集锦中的 360 视图中以观看室外场景。",
  13420. HELP_MORE_FULLSCREEN_A: "全屏",
  13421. HELP_DESKTOP_MORE_FULLSCREEN_B: "将 3D Showcase 扩展到全屏。",
  13422. CLOSE: "关闭"
  13423. }
  13424. }
  13425. , {}],
  13426. 110: [function(e, t, i) {
  13427. "use strict";
  13428. t.exports = {
  13429. PAGE_TITLE: "",
  13430. LOADING: "Lädt",
  13431. PRESENTED_BY_CAPS: "PRÄSENTIERT VON",
  13432. POWERED_BY: "Angetrieben von",
  13433. POWERED_BY_CAPS: "ANGETRIEBEN VON",
  13434. DESKTOP_SHORT_CTA: "Sehen sie sich in diesem 3D Raum um.",
  13435. MOBILE_SHORT_CTA: "Sehen sie sich in diesem 3D Raum um.",
  13436. PRESENTED_BY: "Präsentiert von ",
  13437. MORE: "Mehr ",
  13438. LESS: "Weniger ",
  13439. TAG_CONTENT: "tag™ Inhalt",
  13440. SHOW: "Anzeigen",
  13441. HIDE: "Verbergen",
  13442. DOLLHOUSE: "Puppenhaus",
  13443. FLOOR_PLAN: "Grundriss",
  13444. OPEN_HIGHLIGHTS: "Highlights anzeigen",
  13445. CLOSE_HIGHLIGHTS: "Schließen",
  13446. PREVIOUS: "Vorheriges",
  13447. PLAY: "Abspielen",
  13448. PAUSE: "Pausieren",
  13449. NEXT: "Nächstes",
  13450. EXPLORE_3D_SPACE: "Innenraum betreten",
  13451. VIEW_DOLLHOUSE: "Puppenhaus ansehen",
  13452. SOCIAL_SHARING: "Teilen Sie diesen Raum",
  13453. VIEW_IN_VR: "In VR ansehen",
  13454. VIEW_FULLSCREEN: "Ansicht im Vollbildmodus",
  13455. EXIT_FULLSCREEN: "Beenden des Vollbildmodus",
  13456. ZOOM_IN: "Vergrößern",
  13457. ZOOM_OUT: "Verkleinern",
  13458. FLOOR_NAME: "Etage ",
  13459. FLOOR_ALL: "Alle",
  13460. TERMS: "Bedingungen",
  13461. PORT_TERMS: "port Bedingungen",
  13462. TERMS_OF_USE: "Nutzungsbedingungen",
  13463. TERMS_TEXT_FILE: "terms-de-DE.html",
  13464. CLOSE_TERMS: "Schließen",
  13465. TERMS_FAIL: "Konnte die Nutzungsbedingungen nicht abrufen. Bitte stellen Sie sicher, dass Sie zum Internet verbunden sind.",
  13466. HELP: "Hilfe",
  13467. HELP_NAVIGATION_TAB: "Navigation",
  13468. HELP_MORE_HELP_TAB: "Hilfe-Details",
  13469. CLOSE: "Schließen",
  13470. HELP_DESKTOP_PANORAMA_1A: "Klicken und ziehen Sie um sich im Raum umzusehen.",
  13471. HELP_DESKTOP_PANORAMA_2A: "Klicken Sie auf die Ringe im Raum um sich zu bewegen.",
  13472. HELP_DESKTOP_PANORAMA_3A: "Verwenden Sie das Scrollrad zum Vergrößern und Verkleinern.",
  13473. HELP_DESKTOP_PANORAMA_1B: "Oder verwenden Sie die Pfeiltasten um sich nach links und rechts zu bewegen.",
  13474. HELP_DESKTOP_PANORAMA_2B: "Oder verwenden Sie die Pfeiltasten um sich vorwärts und rückwärts zubewegen.",
  13475. HELP_DESKTOP_PANORAMA_3B: "Oder verwenden Sie die Plus- und Minus-Tasten zum Vergrößern und Verkleinern.",
  13476. HELP_DESKTOP_360_2A: "Klicken Sie die Innenansicht ikone, um diesen Raum zu starten .",
  13477. HELP_DESKTOP_360_2B: "Oder, drücken Sie die 1-Taste um die Innenraumansicht zu starten.",
  13478. HELP_DESKTOP_DOLLHOUSE_1A: "Klicken Sie mit der linken Maustaste und ziehen Sie nach links, rechts, oben und unten um das Puppenhaus zu drehen.",
  13479. 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.",
  13480. HELP_DESKTOP_DOLLHOUSE_3A: "Verwenden Sie das Scrollrad zum Vergrößern und Verkleinern.",
  13481. HELP_DESKTOP_DOLLHOUSE_1B: "Oder verwenden Sie die Pfeiltasten um das Puppenhaus zu drehen.",
  13482. 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.",
  13483. HELP_DESKTOP_FLOORPLAN_2A: "Klicken Sie mit der rechten Maustaste und ziehen Sie nach links oder rechts um den Grundriss zu drehen.",
  13484. HELP_DESKTOP_FLOORPLAN_3A: "Verwenden Sie das Scrollrad zum Vergrößern und Verkleinern.",
  13485. HELP_DESKTOP_FLOORPLAN_2B: "Oder verwenden Sie die Pfeiltasten um das Modell nach links oder rechts zu drehen.",
  13486. HELP_DESKTOP_FLOORPLAN_3B: "Oder verwenden Sie die Pfeiltasten zum Vergrößern und Verkleinern.",
  13487. HELP_MOBILE_PANORAMA_1: "Berühren und ziehen an dem Raum um sich umzusehen.",
  13488. HELP_MOBILE_PANORAMA_2: "Klicken Sie auf die Ringe im Raum, um sich zu bewegen.",
  13489. HELP_MOBILE_3: "Benutzen Sie die Zoom-Gäste zum Vergrößern und Verkleinern.",
  13490. HELP_MOBILE_360_2: "Tippen Sie die Innenansicht ikone, um diesen Raum zu starten.",
  13491. HELP_MOBILE_DOLLHOUSE_1: "Berühren und nach oben, unten, links und rechts ziehen um das Puppenhaus zu drehen.",
  13492. HELP_MOBILE_DOLLHOUSE_2: "Berühren und mit zwei Fingern ziehen um das Puppenhaus zu positionieren.",
  13493. HELP_MOBILE_FLOORPLAN_1: "Berühren und ziehen, um den Grundriss zu positionieren.",
  13494. HELP_MOBILE_FLOORPLAN_2: "Berühren und ziehen mit zwei Fingern, um den Grundriss zu drehen.",
  13495. HELP_MORE_HLR_A: "Liste das Highlight",
  13496. HELP_DESKTOP_MORE_HLR_B: "Öffnen um durch den Raum mit Vorschau-Bildern zu navigieren.",
  13497. HELP_MORE_DOLLHOUSE_A: "Puppenhaus Ansicht",
  13498. HELP_DESKTOP_MORE_DOLLHOUSE_B: "Klicken Sie um die von oben nach unten Sicht des gesamten Raumes in 3D anzuzeigen und zu drehen.",
  13499. HELP_MOBILE_MORE_DOLLHOUSE_B: "Tippen Sie um die von oben nach unten Sicht des gesamten Raumes in 3D anzuzeigen und zu drehen.",
  13500. HELP_MORE_FLOORS_A: "Etage auswählen",
  13501. HELP_DESKTOP_MORE_FLOORS_B: "Zwischen den Etagen im Raum wechseln.",
  13502. HELP_MORE_TAG_A: "tag™ Posts",
  13503. HELP_DESKTOP_MORE_TAG_B: "Klicken Sie auf oder bewegen Sie Ihren Mauszeiger über die Informationen über die Funktionen im Raum.",
  13504. HELP_MOBILE_MORE_TAG_B: "Tippen Sie für Informationen über die Funktionen im Raum.",
  13505. HELP_MORE_ZOOM_A: "Zoom Steuerung",
  13506. HELP_DESKTOP_MORE_ZOOM_B: "Verwenden Sie diese Steuerung oder das Scrollrad zum Vergrößern und Verkleinern.",
  13507. HELP_MORE_TOUR_A: "Tour Steuerung",
  13508. HELP_DESKTOP_MORE_TOUR_B: "Abspielen, pausieren und vorwärts und rückwärts durch eine geführte Tour navigieren.",
  13509. HELP_MORE_INSIDE_A: "Innenansicht",
  13510. HELP_DESKTOP_MORE_INSIDE_B: "Klicken Sie hier um sich im Raum umzusehen.",
  13511. HELP_MOBILE_MORE_INSIDE_B: "Sehen Sie sich in diesen 3D Raum um.",
  13512. HELP_MORE_VR_A: "VR Modus",
  13513. HELP_DESKTOP_MORE_VR_B: "Klicken Sie hier, um den Raum in der virtuellen Realität zu starten.",
  13514. HELP_MOBILE_MORE_VR_B: "Tippen Sie um den Raum in der virtuellen Realität zu starten.",
  13515. HELP_MORE_360_A: "360° Views Ansicht ",
  13516. HELP_DESKTOP_MORE_360_B: "Klicken Sie die 360° Views Ansicht in das Highlight um Aussen-Szenen zu sehen.",
  13517. HELP_MOBILE_MORE_360_B: "Tippen Sie die 360° Views Ansicht in das Highlight um Aussen-Szenen zu sehen.",
  13518. HELP_MORE_FULLSCREEN_A: "Vollbild",
  13519. HELP_DESKTOP_MORE_FULLSCREEN_B: "Erweitern Sie 3D Showcase im Vollbildmodus.",
  13520. WEBVR_FOR_CARDBOARD: "Für Google Cardboard",
  13521. WEBVR_FOR_DAYDREAM: "Für Daydream View",
  13522. WEBVR_ENTER_WEBVR: "Starten Sie VR",
  13523. WEBVR_DIFFERENT_HEADSET: "Haben Sie anderes Headset?",
  13524. WEBVR_LEARN_MORE: "Mehr Infos",
  13525. WEBVR_VIEW_SPACE: "Ansicht des Raumes in VR",
  13526. WEBVR_DAYDREAM_VIEW: "Daydream View",
  13527. WEBVR_DAYDREAM_PHONE: "Daydream-fähiges Handy",
  13528. WEBVR_VIEW_CARDBOARD: "Oder mit Google Cardboard ansehen",
  13529. VR_WHAT_YOU_NEED: "Was Sie dafür brauchen...",
  13530. VR_NEED_DAYDREAM_PHONE: "Daydream-fähiges Handy",
  13531. VR_GOOGLE_DAYDREAM: "Google Daydream",
  13532. VR_APP: "port VR App",
  13533. VR_APP_OPEN: "Oder öffnen Sie die port VR App",
  13534. 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",
  13535. VR_SAMSUNG_DETAIL: "Galaxy S6 und neuer",
  13536. VR_APP_FOR_ANDROID: "port VR app für Android",
  13537. VR_NEED_DAYDREAM: "ERFORDERT VOR DER 'PAIRING' MIT DAYDREAM VIEW",
  13538. VR_VIEW_SPACE: "Ansicht des Raumes in VR",
  13539. VR_LEARN_MORE_CAPS: "MEHR INFOS",
  13540. VR_PREVIOUS_CAPS: "ZURÜCK",
  13541. VR_NEXT_CAPS: "WEITER",
  13542. VR_GOT_IT_CAPS: "VERSTANDEN",
  13543. VR_SHOW_SUPPORTED: "Tippen Sie um den Raum in VR zu sehen",
  13544. VR_SHOW_UNSUPPORTED: "Schade, aber Ihr Gerät erfüllt nicht die Mindestanforderungen um den Raum in VR zu sehen.",
  13545. VR_SHOW_IOS_1: "Tippen Sie um den Raum in VR zu sehen",
  13546. VR_SHOW_IOS_2: "port VR App sowie kompatibles iPhone sind von nöten um diesen Raum zu sehen",
  13547. VR_NEED_CARDBOARD: "Was Sie dafür brauchen ist Google Cardboard",
  13548. VR_NEED_SAMSUNG: "Was Sie dafür brauchen ist Samsung Gear VR",
  13549. VR_GOOGLE_CARDBOARD: "Google Cardboard",
  13550. VR_SAMSUNG_GEAR_VR: "Samsung Gear VR",
  13551. VR_COMPATIBLE_IPHONES_1: "iPhones",
  13552. VR_COMPATIBLE_IPHONES_2: "iPhone 5s oder neuer, mit iOS 9.1 und später",
  13553. VR_COMPATIBLE_IPHONES_3: "Kompatibles iPhones",
  13554. VR_COMPATIBLE_ANDROID: "Kompatibles Android Gerät",
  13555. VR_ANDROID_DETAIL: "Bildschirmdiagonale von 11,5 bis 14 cm (4,5 - 5,5 Zoll) und Android 4.4.4 und neuer",
  13556. VR_ANDROID_DVICES: "Android Geräte",
  13557. VR_COMPATIBLE_SAMSUNG: "Kompatible Samsung Geräte",
  13558. VR_APP_FOR_CARDBOARD: "port VR App für Google Cardboard",
  13559. VR_APP_FOR_SAMSUNG: "port VR App für Gear VR",
  13560. VR_DOWNLOAD_HERE: "Hier runterladen",
  13561. VR_REQUIRE_HEADSET: "Benötigt das ein VR-Headset und port VR App für Android installiert wird",
  13562. VR_REDIRECT_TO_STORE: "Wenn App nicht installiert ist, werden Sie zum App Store umgeleitet.",
  13563. VR_IMPROPER_EMBED: "Der port Raum ist nicht richtig eingebettet um VR in Ihrem Webbrowser zu unterstützen.",
  13564. VR_OPEN_ANDROID_LINK: "Öffnen Sie den Link auf Ihrem Handy",
  13565. VR_ANDROID_OPTIONS: "VR Headset Optionen",
  13566. SHARE_TO: "Teilen auf",
  13567. SHARE_LINK: "Direkter Link",
  13568. SHARE_EXPLORE: "Umsehen",
  13569. SHARE_AT: "auf",
  13570. SHARE_WITH: "mit",
  13571. SHARE_3D: "in 3D",
  13572. SHARE_COPIED: "Kopiert!",
  13573. ERROR_BROWSER_SOLUTION: "Installieren Sie einen neueren Browser um sich in 3D umzusehen.",
  13574. ERROR_BROWSER_EXPLANATION: "WebGL benötigt einen modernen Browser.",
  13575. ERROR_GENERIC_PROBLEM: "Huch, etwas ist schief gelaufen.",
  13576. ERROR_GENERIC_SOLUTION: "Starten Sie Ihren Browser neu.",
  13577. ERROR_GENERIC_ACTIONS_1: "Wenn das Problem weiterhin besteht, ",
  13578. ERROR_GENERIC_ACTIONS_2: "Installieren Sie einen unterstützten Browser",
  13579. ERROR_GENERIC_ACTIONS_3: " oder ",
  13580. ERROR_GENERIC_ACTIONS_4: "Sehen Sie unseren Leitfaden zur Fehlerbehebung",
  13581. ERROR_WEBGL_UNSUPPORTED_PROBLEM: "Browser wird nicht unterstützt.",
  13582. ERROR_WEBGL_IOS_PROBLEM: "iOS-Version wird nicht unterstützt.",
  13583. ERROR_WEBGL_IOS_SOLUTION: "Aktualisieren Sie auf iOS 8 oder neuer um sich in 3D umzusehen.",
  13584. ERROR_WEBGL_IOS_ACTIONS_1: "Tippen ",
  13585. ERROR_WEBGL_IOS_ACTIONS_2: "Einstellungen > Allgemein > Softwareaktualisierung",
  13586. ERROR_WEBGL_SAFARI_PROBLEM: "Aktivieren Sie WebVR um sich in 3D umzusehen.",
  13587. ERROR_WEBGL_SAFARI_ACTIONS_1: "Klicken ",
  13588. ERROR_WEBGL_SAFARI_ACTIONS_2: "Präferenzen > Fortgeschrittene > Entwickler-Menü anzeigen",
  13589. ERROR_WEBGL_SAFARI_ACTIONS_3: "Klicken Sie dann ",
  13590. ERROR_WEBGL_SAFARI_ACTIONS_4: "Entwickler > WebGL Aktivieren",
  13591. ERROR_MISSING_URLS_PROBLEM: "Huch, es gibt keine Panoramen für dieses Modell .",
  13592. ERROR_MISSING_URLS_EXPLANATION: "Dies ist ein älteres Modell. Der Website-Besitzer hat eventuell ein neues Modell in Arbeit.",
  13593. ERROR_LOADING_FAILED_PROBLEM: "Huch, das Modell ist nicht verfügbar.",
  13594. ERROR_LOADING_FAILED_ACTIONS_1: "Wenn das Problem weiterhin besteht, ",
  13595. ERROR_LOADING_FAILED_ACTIONS_2: "sehen Sie unseren Leitfaden zur Fehlerbehebung",
  13596. ERROR_MAINTENANCE_PROBLEM: "Wartung im Gange.",
  13597. ERROR_MAINTENANCE_SOLUTION: "Bitte versuchen Sie es in ein paar Minuten nochmal.",
  13598. LINK_TO_LOCATION: "Link zu",
  13599. MENU_COPY: "Kopieren",
  13600. LINK_ALERT_COPY: "Bitte benutzen Sie CTRL/CMD + C zum kopieren.",
  13601. ROTATE: "Drehen",
  13602. INSIDE: "Drinnen",
  13603. MOVE: "Bewegen",
  13604. ZOOM: "Vergrößern"
  13605. }
  13606. }
  13607. , {}],
  13608. 111: [function(e, t, i) {
  13609. "use strict";
  13610. t.exports = {
  13611. PAGE_TITLE: "",
  13612. LOADING: "Loading",
  13613. PRESENTED_BY_CAPS: "PRESENTED BY",
  13614. POWERED_BY: "powered by ",
  13615. POWERED_BY_CAPS: "POWERED BY",
  13616. DESKTOP_SHORT_CTA: "Click to explore this 3D space.",
  13617. MOBILE_SHORT_CTA: "Tap to explore this 3D space.",
  13618. PRESENTED_BY: "Presented by ",
  13619. MORE: "More ",
  13620. LESS: "Less ",
  13621. TAG_CONTENT: "tag™ Content",
  13622. SHOW: "Show",
  13623. HIDE: "Hide",
  13624. DOLLHOUSE: "Dollhouse",
  13625. FLOOR_PLAN: "Floor plan",
  13626. OPEN_HIGHLIGHTS: "Open Highlights",
  13627. CLOSE_HIGHLIGHTS: "Close",
  13628. PREVIOUS: "Previous",
  13629. PLAY: "Play",
  13630. PAUSE: "Pause",
  13631. NEXT: "Next",
  13632. EXPLORE_3D_SPACE: "Explore 3D Space",
  13633. VIEW_DOLLHOUSE: "View dollhouse",
  13634. SOCIAL_SHARING: "Share this Space",
  13635. VIEW_IN_VR: "View in VR",
  13636. VIEW_FULLSCREEN: "全屏",
  13637. EXIT_FULLSCREEN: "退出全屏",
  13638. ZOOM_IN: "Zoom in",
  13639. ZOOM_OUT: "Zoom out",
  13640. FLOOR_NAME: "Floor ",
  13641. FLOOR_ALL: "全部",
  13642. TERMS: "Terms",
  13643. PORT_TERMS: "port terms",
  13644. TERMS_OF_USE: "Terms of Use",
  13645. TERMS_TEXT_FILE: "terms-en-US.html",
  13646. CLOSE_TERMS: "Close",
  13647. TERMS_FAIL: "Could not fetch terms. Please make sure you have an internet connection to view the terms of use.",
  13648. HELP: "Help",
  13649. HELP_NAVIGATION_TAB: "Navigation",
  13650. HELP_MORE_HELP_TAB: "More Help",
  13651. CLOSE: "Close",
  13652. HELP_DESKTOP_PANORAMA_1A: "Click and Drag to look around the Space.",
  13653. HELP_DESKTOP_PANORAMA_2A: "Click on the rings throughout the space to move around.",
  13654. HELP_DESKTOP_PANORAMA_3A: "Use the scroll wheel to zoom in and out.",
  13655. HELP_DESKTOP_PANORAMA_1B: "Or, use the arrow keys to turn left and right.",
  13656. HELP_DESKTOP_PANORAMA_2B: "Or, use the arrow keys to move forward and back.",
  13657. HELP_DESKTOP_PANORAMA_3B: "Or, use the plus and minus keys to zoom in and out.",
  13658. HELP_DESKTOP_360_2A: "Click the Inside View icon to enter the Space.",
  13659. HELP_DESKTOP_360_2B: "Or, press the number 1 key to enter Inside View.",
  13660. HELP_DESKTOP_DOLLHOUSE_1A: "Left click and drag left, right, up, and down to rotate the Dollhouse.",
  13661. HELP_DESKTOP_DOLLHOUSE_2A: "Right click and drag left, right, up, and down to change the Dollhouse position on screen.",
  13662. HELP_DESKTOP_DOLLHOUSE_3A: "Use the scroll wheel to zoom in and out.",
  13663. HELP_DESKTOP_DOLLHOUSE_1B: "Or, use the arrow keys to rotate the Dollhouse.",
  13664. HELP_DESKTOP_FLOORPLAN_1A: "Left click and drag left, right, up, and down to change the Floorplan position on screen.",
  13665. HELP_DESKTOP_FLOORPLAN_2A: "Right click and drag left or right to rotate the Floorplan.",
  13666. HELP_DESKTOP_FLOORPLAN_3A: "Use the scroll wheel to zoom in and out.",
  13667. HELP_DESKTOP_FLOORPLAN_2B: "Or, use the arrow keys to rotate left or right.",
  13668. HELP_DESKTOP_FLOORPLAN_3B: "Or, use the arrow keys to zoom in and out.",
  13669. HELP_MOBILE_PANORAMA_1: "Touch and Drag to look around the Space.",
  13670. HELP_MOBILE_PANORAMA_2: "Tap on the rings throughout the Space to move around.",
  13671. HELP_MOBILE_3: "Use a pinch gesture to zoom in and out.",
  13672. HELP_MOBILE_360_2: "Tap the Inside View icon to enter the Space.",
  13673. HELP_MOBILE_DOLLHOUSE_1: "Touch and drag up, down, left, and right to rotate the Dollhouse.",
  13674. HELP_MOBILE_DOLLHOUSE_2: "Touch and drag with two fingers to position the Dollhouse.",
  13675. HELP_MOBILE_FLOORPLAN_1: "Touch and drag to position the Floorplan.",
  13676. HELP_MOBILE_FLOORPLAN_2: "Touch and drag with two fingers to rotate the Floorplan.",
  13677. HELP_MORE_HLR_A: "Highlight Reel",
  13678. HELP_DESKTOP_MORE_HLR_B: "Open to navigate through the Space using thumbnail images.",
  13679. HELP_MORE_DOLLHOUSE_A: "Dollhouse View",
  13680. HELP_DESKTOP_MORE_DOLLHOUSE_B: "Click to view and rotate a top-down view of the entire Space in 3D.",
  13681. HELP_MOBILE_MORE_DOLLHOUSE_B: "Tap to view and rotate a top-down view of the entire Space in 3D.",
  13682. HELP_MORE_FLOORS_A: "Floor Selector",
  13683. HELP_DESKTOP_MORE_FLOORS_B: "Switch between floors in the Space.",
  13684. HELP_MORE_TAG_A: "tag™ Posts",
  13685. HELP_DESKTOP_MORE_TAG_B: "Click or hover over for information about features in the Space.",
  13686. HELP_MOBILE_MORE_TAG_B: "Tap for information about features in the Space.",
  13687. HELP_MORE_ZOOM_A: "Zoom Controls",
  13688. HELP_DESKTOP_MORE_ZOOM_B: "Use these controls to zoom in and out or use the scroll wheel.",
  13689. HELP_MORE_TOUR_A: "Tour Controls",
  13690. HELP_DESKTOP_MORE_TOUR_B: "Play, pause, and navigate forward and backward through a Guided Tour.",
  13691. HELP_MORE_INSIDE_A: "Inside View",
  13692. HELP_DESKTOP_MORE_INSIDE_B: "Click to explore inside the Space.",
  13693. HELP_MOBILE_MORE_INSIDE_B: "Tap to explore inside the Space.",
  13694. HELP_MORE_VR_A: "VR Mode",
  13695. HELP_DESKTOP_MORE_VR_B: "Click to launch the Space in virtual reality.",
  13696. HELP_MOBILE_MORE_VR_B: "Tap to launch the Space in virtual reality.",
  13697. HELP_MORE_360_A: "360° Views",
  13698. HELP_DESKTOP_MORE_360_B: "Click 360 Views in the Highlight Reel to view outdoor scenes.",
  13699. HELP_MOBILE_MORE_360_B: "Tap 360 Views in the Highlight Reel to view outdoor scenes.",
  13700. HELP_MORE_FULLSCREEN_A: "Full screen",
  13701. HELP_DESKTOP_MORE_FULLSCREEN_B: "Expand 3D Showcase to full screen.",
  13702. WEBVR_FOR_CARDBOARD: "For Google Cardboard",
  13703. WEBVR_VIEW_CARDBOARD: "Or View on Google Cardboard",
  13704. WEBVR_FOR_DAYDREAM: "For Daydream View",
  13705. WEBVR_ENTER_WEBVR: "ENTER VR",
  13706. WEBVR_DIFFERENT_HEADSET: "Have a different headset?",
  13707. WEBVR_LEARN_MORE: "Learn more",
  13708. WEBVR_VIEW_SPACE: "View Space in VR",
  13709. WEBVR_DAYDREAM_VIEW: "Daydream View",
  13710. WEBVR_DAYDREAM_PHONE: "Daydream-ready phone",
  13711. VR_VIEW_SPACE: "View Space in Virtual Reality",
  13712. VR_LEARN_MORE_CAPS: "LEARN MORE",
  13713. VR_PREVIOUS_CAPS: "PREVIOUS",
  13714. VR_NEXT_CAPS: "NEXT",
  13715. VR_GOT_IT_CAPS: "GOT IT",
  13716. VR_SHOW_SUPPORTED: "Tap to view the Space in VR with",
  13717. VR_SHOW_UNSUPPORTED: "Sorry, but your device doesn't meet the minimum requirements to view a space in VR.",
  13718. VR_SHOW_IOS_1: "Tap to view the space in VR",
  13719. VR_SHOW_IOS_2: "Requires port VR app and compatible iPhone to view",
  13720. VR_WHAT_YOU_NEED: "What You'll Need For...",
  13721. VR_NEED_CARDBOARD: "What you'll need with Google Cardboard",
  13722. VR_NEED_SAMSUNG: "What you'll need with Samsung Gear VR",
  13723. VR_NEED_DAYDREAM: "NEEDS PRIOR PAIRING WITH DAYDREAM VIEW",
  13724. VR_NEED_DAYDREAM_PHONE: "Daydream-ready phone",
  13725. VR_GOOGLE_CARDBOARD: "Google Cardboard",
  13726. VR_GOOGLE_DAYDREAM: "Google Daydream",
  13727. VR_APP: "port VR App",
  13728. VR_SAMSUNG_GEAR_VR: "Samsung Gear VR",
  13729. VR_COMPATIBLE_IPHONES_1: "iPhones",
  13730. VR_COMPATIBLE_IPHONES_2: "iPhone 5s and newer, running iOS 9.1 and higher",
  13731. VR_COMPATIBLE_IPHONES_3: "Compatible iPhones",
  13732. VR_COMPATIBLE_ANDROID: "Compatible Android Devices",
  13733. VR_COMPATIBLE_ANDROID_LONG: 'Compatible Android Devices Displays from 4.5"-5.5" running Android OS 4.4.4 and higher',
  13734. VR_ANDROID_DETAIL: 'Displays from 4.5"-5.5" running Android OS 4.4.4 and higher',
  13735. VR_ANDROID_DVICES: "Android Devices",
  13736. VR_COMPATIBLE_SAMSUNG: "Compatible Samsung Devices",
  13737. VR_SAMSUNG_DETAIL: "Galaxy S6 and Above",
  13738. VR_APP_FOR_CARDBOARD: "port VR app for Google Cardboard",
  13739. VR_APP_FOR_SAMSUNG: "port VR app for Gear VR",
  13740. VR_APP_FOR_ANDROID: "port VR app for Android Phones",
  13741. VR_APP_OPEN: "Open with the port VR app instead",
  13742. VR_DOWNLOAD_HERE: "Download here",
  13743. VR_REQUIRE_HEADSET: "Requires a VR headset and port VR app for Android to be installed",
  13744. VR_REDIRECT_TO_STORE: "If app is not installed, you will be redirected to the app store.",
  13745. VR_IMPROPER_EMBED: "The port Space is not embedded properly to support VR in your web browser.",
  13746. VR_OPEN_ANDROID_LINK: "Open the Link on Your Mobile Phone",
  13747. VR_ANDROID_OPTIONS: "Available VR Headset Options",
  13748. SHARE_TO: "Share to",
  13749. SHARE_LINK: "Direct Link",
  13750. SHARE_EXPLORE: "Explore ",
  13751. SHARE_AT: "at",
  13752. SHARE_WITH: "with",
  13753. SHARE_3D: " in 3D",
  13754. SHARE_COPIED: "Copied!",
  13755. ERROR_BROWSER_SOLUTION: "Install a new browser to explore in 3D.",
  13756. ERROR_BROWSER_EXPLANATION: "WebGL requires a modern browser.",
  13757. ERROR_GENERIC_PROBLEM: "Oops, something went wrong.",
  13758. ERROR_GENERIC_SOLUTION: "Restart your browser.",
  13759. ERROR_GENERIC_ACTIONS_1: "If the problem persists, ",
  13760. ERROR_GENERIC_ACTIONS_2: "install a supported browser",
  13761. ERROR_GENERIC_ACTIONS_3: " or ",
  13762. ERROR_GENERIC_ACTIONS_4: "see our troubleshooting guide",
  13763. ERROR_WEBGL_UNSUPPORTED_PROBLEM: "Browser not supported.",
  13764. ERROR_WEBGL_IOS_PROBLEM: "iOS version not supported.",
  13765. ERROR_WEBGL_IOS_SOLUTION: "Upgrade to iOS 8 or higher to explore in 3D.",
  13766. ERROR_WEBGL_IOS_ACTIONS_1: "Tap ",
  13767. ERROR_WEBGL_IOS_ACTIONS_2: "Settings > General > Software Update",
  13768. ERROR_WEBGL_SAFARI_PROBLEM: "Enable WebGL to explore in 3D.",
  13769. ERROR_WEBGL_SAFARI_ACTIONS_1: "Click ",
  13770. ERROR_WEBGL_SAFARI_ACTIONS_2: "Preferences > Advanced > Show Develop menu",
  13771. ERROR_WEBGL_SAFARI_ACTIONS_3: "Then click ",
  13772. ERROR_WEBGL_SAFARI_ACTIONS_4: "Develop > Enable WebGL",
  13773. ERROR_MISSING_URLS_PROBLEM: "Oops, there are no panoramas for this model.",
  13774. ERROR_MISSING_URLS_EXPLANATION: "This is an older model. The website owner may have a new model on the way.",
  13775. ERROR_LOADING_FAILED_PROBLEM: "模型不可用.",
  13776. ERROR_LOADING_FAILED_ACTIONS_1: "If the problem persists, ",
  13777. ERROR_LOADING_FAILED_ACTIONS_2: "see our troubleshooting guide",
  13778. ERROR_MAINTENANCE_PROBLEM: "Maintenance in progress.",
  13779. ERROR_MAINTENANCE_SOLUTION: "Please come back in a few minutes.",
  13780. LINK_TO_LOCATION: "Link to location",
  13781. MENU_COPY: "Copy",
  13782. LINK_ALERT_COPY: "Please use CTRL/CMD + C to copy.",
  13783. ROTATE: "Rotate",
  13784. INSIDE: "Inside",
  13785. MOVE: "Move",
  13786. ZOOM: "Zoom"
  13787. }
  13788. }
  13789. , {}],
  13790. 112: [function(e, t, i) {
  13791. "use strict";
  13792. t.exports = {
  13793. PAGE_TITLE: "",
  13794. LOADING: "Cargando",
  13795. PRESENTED_BY_CAPS: "PRESENTADO POR",
  13796. POWERED_BY: "potenciando por ",
  13797. POWERED_BY_CAPS: "POTENCIADO POR ",
  13798. DESKTOP_SHORT_CTA: "Haga clic para explorar este Espacio 3D.",
  13799. MOBILE_SHORT_CTA: "Pulse para explorar este Espacio 3D.",
  13800. PRESENTED_BY: "Presentado por ",
  13801. MORE: "Más ",
  13802. LESS: "Menos ",
  13803. TAG_CONTENT: "Contenido de tag™",
  13804. SHOW: "Mostrar",
  13805. HIDE: "Ocultar",
  13806. DOLLHOUSE: "Dollhouse",
  13807. FLOOR_PLAN: "Planos",
  13808. OPEN_HIGHLIGHTS: "Aspectos Destacados",
  13809. CLOSE_HIGHLIGHTS: "Cerrar",
  13810. PREVIOUS: "Anterior",
  13811. PLAY: "Play",
  13812. PAUSE: "Pausa",
  13813. NEXT: "Siguiente",
  13814. EXPLORE_3D_SPACE: "Explorar el Espacio 3D",
  13815. VIEW_DOLLHOUSE: "Ver dollhouse",
  13816. SOCIAL_SHARING: "Compartir este espacio",
  13817. VIEW_IN_VR: "Ver en realidad virtual",
  13818. VIEW_FULLSCREEN: "Ver en pantalla completa",
  13819. EXIT_FULLSCREEN: "Salir de pantalla completa",
  13820. ZOOM_IN: "Acercar",
  13821. ZOOM_OUT: "Alejar",
  13822. FLOOR_NAME: "Piso ",
  13823. FLOOR_ALL: "Todas",
  13824. TERMS: "Condiciones",
  13825. PORT_TERMS: "port términos de uso",
  13826. TERMS_OF_USE: "Términos de uso",
  13827. TERMS_TEXT_FILE: "terms-es-MX.html",
  13828. CLOSE_TERMS: "Cerrar",
  13829. 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.",
  13830. HELP: "Ayuda",
  13831. HELP_NAVIGATION_TAB: "Navegación",
  13832. HELP_MORE_HELP_TAB: "Más Ayuda",
  13833. CLOSE: "Cerrar",
  13834. HELP_DESKTOP_PANORAMA_1A: "Haga clic y arrastre para mirar alrededor del espacio.",
  13835. HELP_DESKTOP_PANORAMA_2A: "Haga clic en los aros a lo largo del espacio para moverse.",
  13836. HELP_DESKTOP_PANORAMA_3A: "Use la rueda de desplazamiento para acercar o alejar.",
  13837. HELP_DESKTOP_PANORAMA_1B: "O use las teclas de flecha para girar a la izquierda y a la derecha.",
  13838. HELP_DESKTOP_PANORAMA_2B: "O use las teclas de dirección para adelantar o retroceder.",
  13839. HELP_DESKTOP_PANORAMA_3B: "O use la tecla más para acercar y la tecla menos para alejar.",
  13840. HELP_DESKTOP_360_2A: "Haga clic en el icono Vista Interior para ingresar al Espacio.",
  13841. HELP_DESKTOP_360_2B: "O bien, presione la tecla numero 1 para entrar en la Vista Interior.",
  13842. HELP_DESKTOP_DOLLHOUSE_1A: "Haga clic izquierdo y arrastre hacia la izquierda, derecha, arriba o abajo para girar la Dollhouse.",
  13843. HELP_DESKTOP_DOLLHOUSE_2A: "Haga clic derecho y arrastre hacia la izquierda, derecha, arriba o abajo para cambiar la posición della dollhouse.",
  13844. HELP_DESKTOP_DOLLHOUSE_3A: "Use la rueda de desplazamiento para acercar o alejar.",
  13845. HELP_DESKTOP_DOLLHOUSE_1B: "O use las teclas de dirección para girar la Dollhouse.",
  13846. 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.",
  13847. HELP_DESKTOP_FLOORPLAN_2A: "Haga clic derecho y arrastre hacia la izquierda o derecha para girar la planta.",
  13848. HELP_DESKTOP_FLOORPLAN_3A: "Use la rueda de desplazamiento para acercar o alejar.",
  13849. HELP_DESKTOP_FLOORPLAN_2B: "O use las teclas para girar hacia la izquierda o derecha.",
  13850. HELP_DESKTOP_FLOORPLAN_3B: "O use las teclas de dirección para acercar o alejar.",
  13851. HELP_MOBILE_PANORAMA_1: "Toque y arrastre para mirar alrededor del espacio.",
  13852. HELP_MOBILE_PANORAMA_2: "Toque en los aros a lo largo del espacio para moverse.",
  13853. HELP_MOBILE_3: "Use el gesto de pellizcar para acercar o alejar.",
  13854. HELP_MOBILE_360_2: "Toque el ícono Vista Interior para entrar en el Espacio.",
  13855. HELP_MOBILE_DOLLHOUSE_1: "Toque y arrastre con dos dedos para cambiar la posición della dollhouse.",
  13856. HELP_MOBILE_DOLLHOUSE_2: "Toque y arrastre con dos dedos para cambiar la posición de la vista aérea.",
  13857. HELP_MOBILE_FLOORPLAN_1: "Toque y arrastre para cambiar la posición de la planta.",
  13858. HELP_MOBILE_FLOORPLAN_2: "Toque y arrastre con dos dedos para girar la planta.",
  13859. HELP_MORE_HLR_A: "Galería destacada",
  13860. HELP_DESKTOP_MORE_HLR_B: "Abra para navegar a través del espacio utilizando imágenes en miniatura.",
  13861. HELP_MORE_DOLLHOUSE_A: "Vista aérea por pisos",
  13862. HELP_DESKTOP_MORE_DOLLHOUSE_B: "Haga clic para ver y girar la Dollhouse del espacio completo en 3D.",
  13863. HELP_MOBILE_MORE_DOLLHOUSE_B: "Toque para ver y girar la vista Dollhouse del espacio completo en 3D.",
  13864. HELP_MORE_FLOORS_A: "Seleccionador de plantas",
  13865. HELP_DESKTOP_MORE_FLOORS_B: "Cambie de una planta a otra en el espacio.",
  13866. HELP_MORE_TAG_A: "tag™ Posts",
  13867. HELP_DESKTOP_MORE_TAG_B: "Haga clic o coloque el cursor para obtener más información acerca de las características del espacio.",
  13868. HELP_MOBILE_MORE_TAG_B: "Toque para obtener más información acerca de las características del espacio.",
  13869. HELP_MORE_ZOOM_A: "Controles de zoom",
  13870. HELP_DESKTOP_MORE_ZOOM_B: "Use estos controles o la rueda de desplazamiento para acercar o alejar.",
  13871. HELP_MORE_TOUR_A: "Controles de recorrido",
  13872. HELP_DESKTOP_MORE_TOUR_B: "Reproduzca, pause, adelante o retroceda a través de un recorrido guiado.",
  13873. HELP_MORE_INSIDE_A: "Vista interior",
  13874. HELP_DESKTOP_MORE_INSIDE_B: "Haga clic para explorar el interior del espacio.",
  13875. HELP_MOBILE_MORE_INSIDE_B: "Toque para explorar el interior del espacio.",
  13876. HELP_MORE_VR_A: "Modo de realidad virtual",
  13877. HELP_DESKTOP_MORE_VR_B: "Toque para ver el espacio en realidad virtual.",
  13878. HELP_MOBILE_MORE_VR_B: "Toque para ver el espacio en realidad virtual.",
  13879. HELP_MORE_360_A: "360° Views",
  13880. HELP_DESKTOP_MORE_360_B: "Una vez que se encuentre en galería destacada, haga clic en vistas de 360º para ver el exterior.",
  13881. HELP_MOBILE_MORE_360_B: "Una vez que se encuentre en galería destacada, toque en vistas de 360º para ver el exterior.",
  13882. HELP_MORE_FULLSCREEN_A: "Pantalla completa",
  13883. HELP_DESKTOP_MORE_FULLSCREEN_B: "Expanda el escenario 3D para verlo en pantalla completa.",
  13884. WEBVR_FOR_CARDBOARD: "Para Google Cardboard",
  13885. WEBVR_FOR_DAYDREAM: "Para Daydream View",
  13886. WEBVR_ENTER_WEBVR: "ENTRAR VR",
  13887. WEBVR_DIFFERENT_HEADSET: "¿Tiene un auricular diferente?",
  13888. WEBVR_LEARN_MORE: "Más información",
  13889. WEBVR_VIEW_SPACE: "Ver Espacio en VR",
  13890. WEBVR_DAYDREAM_VIEW: "Daydream View",
  13891. WEBVR_DAYDREAM_PHONE: "Daydream Teléfono listos",
  13892. WEBVR_VIEW_CARDBOARD: "O Ver en Google Cardboard",
  13893. VR_NEED_DAYDREAM: "Necesidades antes de acoplarse con Daydream View",
  13894. VR_NEED_DAYDREAM_PHONE: "Teléfono listo para Daydream",
  13895. VR_GOOGLE_DAYDREAM: "Daydream de Google",
  13896. VR_APP: "port VR App",
  13897. VR_COMPATIBLE_ANDROID_LONG: 'Compatible con los Dispositivos Android con Pantallas de 4.5"-5.5" operando Android OS 4.4.4 y posteriores',
  13898. VR_APP_FOR_ANDROID: "Aplicación port VR para Teléfonos Android",
  13899. VR_APP_OPEN: "Abrir con la aplicación port VR en su lugar",
  13900. VR_VIEW_SPACE: "Ver Espacio en realidad virtual",
  13901. VR_LEARN_MORE_CAPS: "SABER MÁS",
  13902. VR_PREVIOUS_CAPS: "ANTERIOR",
  13903. VR_NEXT_CAPS: "SIGUIENTE",
  13904. VR_GOT_IT_CAPS: "COMPRENDIDO",
  13905. VR_SHOW_SUPPORTED: "Pulse para ver el Espacio en realidad virtual con",
  13906. VR_SHOW_UNSUPPORTED: "Lo sentimos, pero su dispositivo no cumple los requisitos mínimos para ver un Espacio en realidad virtual.",
  13907. VR_SHOW_IOS_1: "Pulse para ver el Espacio en realidad virtual",
  13908. VR_SHOW_IOS_2: "Necesita la aplicación port VR y un iPhone compatible para ver",
  13909. VR_WHAT_YOU_NEED: "Lo que necesitaras...",
  13910. VR_NEED_CARDBOARD: "Lo que necesitaras con Google Cardboard",
  13911. VR_NEED_SAMSUNG: "Lo que necesitaras con el Samsung Gear VR",
  13912. VR_GOOGLE_CARDBOARD: "Google Cardboard",
  13913. VR_SAMSUNG_GEAR_VR: "Samsung Gear VR",
  13914. VR_COMPATIBLE_IPHONES_1: "iPhones",
  13915. VR_COMPATIBLE_IPHONES_2: "Compatible con iPhone 6S o superior y con iOS 9.1 en adelante",
  13916. VR_COMPATIBLE_IPHONES_3: "iPhones compatibles",
  13917. VR_COMPATIBLE_ANDROID: "Dispositivos Android compatibles",
  13918. VR_ANDROID_DETAIL: "Pantallas de 11.43 cm a 13.97 cm con OS de Android 4.4.4 en adelante",
  13919. VR_ANDROID_DVICES: "Dispositivos Android",
  13920. VR_COMPATIBLE_SAMSUNG: "Dispositivos compatibles del Samsung",
  13921. VR_SAMSUNG_DETAIL: "Galaxy S5 en adelante",
  13922. VR_APP_FOR_CARDBOARD: "Aplicación port VR para Google Cardboard",
  13923. VR_APP_FOR_SAMSUNG: "Aplicación port VR para Gear VR",
  13924. VR_DOWNLOAD_HERE: "Descargar aquí",
  13925. VR_REQUIRE_HEADSET: "Necesita un casco de realidad virtual y que se instale la aplicación port VR para Android",
  13926. VR_REDIRECT_TO_STORE: "Si la aplicación no está instalada, se le redirigirá a la tienda de aplicaciones.",
  13927. VR_IMPROPER_EMBED: "El espacio de port no está incorporado correctamente para apoyar VR en su navegador web.",
  13928. VR_OPEN_ANDROID_LINK: "Abre el enlace en tu teléfono móvil",
  13929. VR_ANDROID_OPTIONS: "Opciones de auriculares en RV disponibles",
  13930. SHARE_TO: "Compartir en",
  13931. SHARE_LINK: "Enlace directo",
  13932. SHARE_EXPLORE: "Explorar ",
  13933. SHARE_AT: "en",
  13934. SHARE_WITH: "con",
  13935. SHARE_3D: " en 3D",
  13936. SHARE_COPIED: "¡Copiado!",
  13937. ERROR_BROWSER_SOLUTION: "Instale un nuevo navegador para explorar en 3D.",
  13938. ERROR_BROWSER_EXPLANATION: "WebGL requiere un navegador moderno.",
  13939. ERROR_GENERIC_PROBLEM: "Vaya, algo ha ido mal.",
  13940. ERROR_GENERIC_SOLUTION: "Reinicie su navegador.",
  13941. ERROR_GENERIC_ACTIONS_1: "Si el problema persiste, ",
  13942. ERROR_GENERIC_ACTIONS_2: "instale un navegador compatible",
  13943. ERROR_GENERIC_ACTIONS_3: " o ",
  13944. ERROR_GENERIC_ACTIONS_4: "consulte nuestra guía de solución de problemas",
  13945. ERROR_WEBGL_UNSUPPORTED_PROBLEM: "Navegador no compatible.",
  13946. ERROR_WEBGL_IOS_PROBLEM: "Versión de iOS no compatible.",
  13947. ERROR_WEBGL_IOS_SOLUTION: "Actualice a iOS 8 o superior para explorar en 3D.",
  13948. ERROR_WEBGL_IOS_ACTIONS_1: "Pulse ",
  13949. ERROR_WEBGL_IOS_ACTIONS_2: "Ajustes > General > Actualización de software",
  13950. ERROR_WEBGL_SAFARI_PROBLEM: "Habilite WebGL para explorar en 3D.",
  13951. ERROR_WEBGL_SAFARI_ACTIONS_1: "Haga clic en ",
  13952. ERROR_WEBGL_SAFARI_ACTIONS_2: "Preferencias > Avanzado > Mostrar el menú Desarrollar",
  13953. ERROR_WEBGL_SAFARI_ACTIONS_3: "Después, haga clic en ",
  13954. ERROR_WEBGL_SAFARI_ACTIONS_4: "Desarrollar > Habilitar WebGL",
  13955. ERROR_MISSING_URLS_PROBLEM: "Vaya, no hay panoramas para este modelo.",
  13956. ERROR_MISSING_URLS_EXPLANATION: "Este es un modelo antiguo. El propietario del sitio web puede tener un nuevo modelo en mente.",
  13957. ERROR_LOADING_FAILED_PROBLEM: "Vaya, modelo no disponible.",
  13958. ERROR_LOADING_FAILED_ACTIONS_1: "Si el problema persiste, ",
  13959. ERROR_LOADING_FAILED_ACTIONS_2: "consulte nuestra guía de solución de problemas",
  13960. ERROR_MAINTENANCE_PROBLEM: "Mantenimiento en progreso.",
  13961. ERROR_MAINTENANCE_SOLUTION: "Regrese en unos minutos.",
  13962. LINK_TO_LOCATION: "Enlace a la ubicación",
  13963. MENU_COPY: "Copiar",
  13964. LINK_ALERT_COPY: "Utilice CTRL/CMD + C para copiar.",
  13965. ROTATE: "Girar",
  13966. INSIDE: "Interior",
  13967. MOVE: "Moverse",
  13968. ZOOM: "Acercar o alejar"
  13969. }
  13970. }
  13971. , {}],
  13972. 113: [function(e, t, i) {
  13973. "use strict";
  13974. t.exports = {
  13975. PAGE_TITLE: "",
  13976. LOADING: "Chargement",
  13977. PRESENTED_BY_CAPS: "PRÉSENTÉ PAR",
  13978. POWERED_BY: "alimenté par ",
  13979. POWERED_BY_CAPS: "ALIMENTÉ PAR",
  13980. DESKTOP_SHORT_CTA: "Cliquez pour explorer l'Espace 3D.",
  13981. MOBILE_SHORT_CTA: "Cliquez pour explorer l'Espace 3D.",
  13982. PRESENTED_BY: "Présenté par ",
  13983. MORE: "Plus ",
  13984. LESS: "Moins ",
  13985. TAG_CONTENT: "Contenu tag™",
  13986. SHOW: "Montrer",
  13987. HIDE: "Cacher",
  13988. DOLLHOUSE: "Dollhouse",
  13989. FLOOR_PLAN: "Plan de sol",
  13990. OPEN_HIGHLIGHTS: "Ouvrir les faits saillants",
  13991. CLOSE_HIGHLIGHTS: "Fermer",
  13992. PREVIOUS: "Précédent",
  13993. PLAY: "Lecture",
  13994. PAUSE: "Pause",
  13995. NEXT: "Suivant",
  13996. EXPLORE_3D_SPACE: "Explorer l'Espace en 3D",
  13997. VIEW_DOLLHOUSE: "Voir dollhouse",
  13998. SOCIAL_SHARING: "Partager cet espace",
  13999. VIEW_IN_VR: "Voir en VR",
  14000. VIEW_FULLSCREEN: "Plein écran",
  14001. EXIT_FULLSCREEN: "Fermer plein écran",
  14002. ZOOM_IN: "Zoom avant",
  14003. ZOOM_OUT: "Zoom arrière",
  14004. FLOOR_NAME: "Étage ",
  14005. FLOOR_ALL: "Tous",
  14006. TERMS: "Mentions légales",
  14007. PORT_TERMS: "port mentions légales",
  14008. TERMS_OF_USE: "Conditions d'utilisation",
  14009. TERMS_TEXT_FILE: "terms-fr-FR.html",
  14010. CLOSE_TERMS: "Fermer",
  14011. TERMS_FAIL: "Impossible d'accéder aux mentions légales. Vérifiez que vous avez une connexion Internet pour afficher les conditions d'utilisation.",
  14012. HELP: "Aide",
  14013. HELP_NAVIGATION_TAB: "Navigation",
  14014. HELP_MORE_HELP_TAB: "Aide",
  14015. CLOSE: "Fermer",
  14016. HELP_DESKTOP_PANORAMA_1A: "Cliquez et faites glisser pour regarder autour de l’espace.",
  14017. HELP_DESKTOP_PANORAMA_2A: "Cliquez sur les anneaux pour vous déplacer.",
  14018. HELP_DESKTOP_PANORAMA_3A: "Utilisez la molette de votre souris pour zoomer.",
  14019. HELP_DESKTOP_PANORAMA_1B: "Ou utilisez les touches pour tourner.",
  14020. HELP_DESKTOP_PANORAMA_2B: "Ou utilisez les touches pour avancer et reculer.",
  14021. HELP_DESKTOP_PANORAMA_3B: "Ou utilisez les touches plus et moins pour zoomer.",
  14022. HELP_DESKTOP_360_2A: "Cliquez sur l’icône Vue Intérieure pour entrer dans l’Espace.",
  14023. HELP_DESKTOP_360_2B: "Ou, appuyez sur la touche numéro 1 pour entrer dans la Vue Intérieure.",
  14024. HELP_DESKTOP_DOLLHOUSE_1A: "Faites un clic gauche et bougez votre souris pour faire pivoter la vue Dollhouse.",
  14025. HELP_DESKTOP_DOLLHOUSE_2A: "Faites un clic droit et bougez votre souris pour changer la position de la vue Dollhouse.",
  14026. HELP_DESKTOP_DOLLHOUSE_3A: "Utilisez la molette de votre souris pour zoomer.",
  14027. HELP_DESKTOP_DOLLHOUSE_1B: "Ou utilisez les touches pour faire pivoter la vue Dollhouse.",
  14028. HELP_DESKTOP_FLOORPLAN_1A: "Faites un clic droit pour changer la position du plan sur l’écran.",
  14029. HELP_DESKTOP_FLOORPLAN_2A: "Faites un clic droit et faites glisser à gauche ou à droite pour faire pivoter le plan.",
  14030. HELP_DESKTOP_FLOORPLAN_3A: "Utilisez la molette de votre souris pour zoomer.",
  14031. HELP_DESKTOP_FLOORPLAN_2B: "Ou utilisez les touches pour faire pivoter à gauche ou à droite.",
  14032. HELP_DESKTOP_FLOORPLAN_3B: "Ou utilisez les touches pour effectuer un zoom avant ou arrière.",
  14033. HELP_MOBILE_PANORAMA_1: "Touchez et faites glisser pour regarder autour de l’espace.",
  14034. HELP_MOBILE_PANORAMA_2: "Tapez sur les anneaux dans tout l’espace pour vous déplacer.",
  14035. HELP_MOBILE_3: "Utilisez un geste de pincement pour zoomer avant/arrière.",
  14036. HELP_MOBILE_360_2: "Tapez sur l’icône Vue Intérieure pour entrer dans l’Espace.",
  14037. HELP_MOBILE_DOLLHOUSE_1: "Touchez et faites glisser vers le haut/bas/gauche/droite pour faire pivoter la vue Dollhouse.",
  14038. HELP_MOBILE_DOLLHOUSE_2: "Touchez et faites glisser avec deux doigts pour positionner vue en coupe.",
  14039. HELP_MOBILE_FLOORPLAN_1: "Touchez et faites glisser pour positionner le plan.",
  14040. HELP_MOBILE_FLOORPLAN_2: "Touchez et faites glisser avec deux doigts pour faire pivoter le plan.",
  14041. HELP_MORE_HLR_A: "Carrousel",
  14042. HELP_DESKTOP_MORE_HLR_B: "Ouvrez pour naviguer dans l’espace en utilisant les vignettes.",
  14043. HELP_MORE_DOLLHOUSE_A: "Vue en coupe",
  14044. HELP_DESKTOP_MORE_DOLLHOUSE_B: "Cliquez pour afficher et faire pivoter l’espace entier en 3D.",
  14045. HELP_MOBILE_MORE_DOLLHOUSE_B: "Tapez pour afficher et faire pivoter l’espace entier en 3D.",
  14046. HELP_MORE_FLOORS_A: "Sélecteur d’étage",
  14047. HELP_DESKTOP_MORE_FLOORS_B: "Basculer entre les étages dans l’espace.",
  14048. HELP_MORE_TAG_A: "tag™ Posts",
  14049. HELP_DESKTOP_MORE_TAG_B: "Cliquez ou survolez pour obtenir des informations sur l’espace.",
  14050. HELP_MOBILE_MORE_TAG_B: "Tapez pour obtenir des informations sur l’espace.",
  14051. HELP_MORE_ZOOM_A: "Commandes de zoom",
  14052. HELP_DESKTOP_MORE_ZOOM_B: "Utilisez votre clavier ou la molette de votre souris pour zoomer.",
  14053. HELP_MORE_TOUR_A: "Commandes de la visite",
  14054. HELP_DESKTOP_MORE_TOUR_B: "Mettez en marche ou en pause, avancez et reculez lors d'une visite guidée.",
  14055. HELP_MORE_INSIDE_A: "Vue intérieure",
  14056. HELP_DESKTOP_MORE_INSIDE_B: "Cliquez pour explorer l’intérieur de l’espace.",
  14057. HELP_MOBILE_MORE_INSIDE_B: "Tapez pour explorer l’intérieur de l’espace.",
  14058. HELP_MORE_VR_A: "Mode RV",
  14059. HELP_DESKTOP_MORE_VR_B: "Cliquez pour lancer l’espace en réalité virtuelle.",
  14060. HELP_MOBILE_MORE_VR_B: "Tapez pour lancer l’espace en réalité virtuelle.",
  14061. HELP_MORE_360_A: "Vues 360°",
  14062. HELP_DESKTOP_MORE_360_B: "Cliquez sur vues 360°, dans le carrousel pour voir les scènes extérieures.",
  14063. HELP_MOBILE_MORE_360_B: "Tapez sur vues 360°, dans le carrousel pour voir les scènes extérieures.",
  14064. HELP_MORE_FULLSCREEN_A: "Plein écran",
  14065. HELP_DESKTOP_MORE_FULLSCREEN_B: "Voir 3D Showcase en plein écran.",
  14066. WEBVR_FOR_CARDBOARD: "Pour Google Cardboard",
  14067. WEBVR_FOR_DAYDREAM: "Pour Daydream View",
  14068. WEBVR_ENTER_WEBVR: "ENTRER VR",
  14069. WEBVR_DIFFERENT_HEADSET: "Avez-vous un casque différent?",
  14070. WEBVR_LEARN_MORE: "En savoir plus",
  14071. WEBVR_VIEW_SPACE: "Voir Espace en VR",
  14072. WEBVR_DAYDREAM_VIEW: "Daydream View",
  14073. WEBVR_DAYDREAM_PHONE: "Téléphone compatibles Daydream",
  14074. WEBVR_VIEW_CARDBOARD: "Ou Afficher sur Google Cardboard",
  14075. VR_VIEW_SPACE: "Voir l'Espace en Réalité Virtuelle",
  14076. VR_LEARN_MORE_CAPS: "EN SAVOIR PLUS",
  14077. VR_PREVIOUS_CAPS: "PRÉCÉDENT",
  14078. VR_NEXT_CAPS: "SUIVANT",
  14079. VR_GOT_IT_CAPS: "BIEN COMPRIS",
  14080. VR_SHOW_SUPPORTED: "Taper pour voir l'Espace en VR avec",
  14081. VR_SHOW_UNSUPPORTED: "Désolé mais votre appareil ne répond pas aux critères minimaux pour voir cet Espace en mode VR.",
  14082. VR_SHOW_IOS_1: "Taper pour voir l’Espace en Realité Virtuelle",
  14083. VR_SHOW_IOS_2: "Nécessite l’application port VR et un iPhone compatible pour voir",
  14084. VR_WHAT_YOU_NEED: "Ce dont vous aurez besoin pour...",
  14085. VR_NEED_CARDBOARD: "Ce dont vous aurez besoin avec Google Cardboard",
  14086. VR_NEED_SAMSUNG: "Ce dont vous aurez besoin avec Samsung Gear VR",
  14087. VR_NEED_DAYDREAM: "BESOINS AVANT APPARIEMENT AVEC DAYDREAM VIEW",
  14088. VR_NEED_DAYDREAM_PHONE: "Téléphone compatible avec Daydream",
  14089. VR_GOOGLE_CARDBOARD: "Google Cardboard",
  14090. VR_GOOGLE_DAYDREAM: "Google Daydream",
  14091. VR_APP: "port VR App",
  14092. VR_SAMSUNG_GEAR_VR: "Samsung Gear VR",
  14093. VR_COMPATIBLE_IPHONES_1: "iPhones",
  14094. VR_COMPATIBLE_IPHONES_2: "iPhone 5s et plus récent, avec iOS 9.1 et plus récent",
  14095. VR_COMPATIBLE_IPHONES_3: "iPhones compatibles",
  14096. VR_COMPATIBLE_ANDROID: "Appareils Android compatibles",
  14097. 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",
  14098. VR_ANDROID_DETAIL: 'Écrans 4.5" à 5.5" avec Android 4.4.4 ou plus récent',
  14099. VR_ANDROID_DVICES: "Appareils Android",
  14100. VR_COMPATIBLE_SAMSUNG: "Appareils Samsung Compatibles",
  14101. VR_SAMSUNG_DETAIL: "Galaxy S6 et plus récents",
  14102. VR_APP_FOR_CARDBOARD: "Application port VR pour Google Cardboard",
  14103. VR_APP_FOR_SAMSUNG: "Application port VR pour Gear VR",
  14104. VR_APP_FOR_ANDROID: "Application port VR pour téléphones Android",
  14105. VR_APP_OPEN: "Ouvrir plutôt avec l’application port VR",
  14106. VR_DOWNLOAD_HERE: "Télécharger ici",
  14107. VR_REQUIRE_HEADSET: "Nécessite un casque VR et l'application port VR pour Android afin d'être installé",
  14108. VR_REDIRECT_TO_STORE: "Si l'application n'est pas installée, vous serez rediriger vers l'App store.",
  14109. VR_IMPROPER_EMBED: "L'Espace port n'est pas correctement intégré pour supporter VR dans votre navigateur Web.",
  14110. VR_OPEN_ANDROID_LINK: "Ouvrez ce lien avec votre appareil mobile",
  14111. VR_ANDROID_OPTIONS: "Options disponibles pour casque VR sous",
  14112. SHARE_TO: "Partager sur",
  14113. SHARE_LINK: "Lien direct",
  14114. SHARE_EXPLORE: "Explorer ",
  14115. SHARE_AT: "à",
  14116. SHARE_WITH: "avec",
  14117. SHARE_3D: " en 3D",
  14118. SHARE_COPIED: "Copié!",
  14119. ERROR_BROWSER_SOLUTION: "Installer un nouveau navigateur pour explorer en 3D.",
  14120. ERROR_BROWSER_EXPLANATION: "WebGL a besoin d'un navigateur récent.",
  14121. ERROR_GENERIC_PROBLEM: "Il y eu un problème.",
  14122. ERROR_GENERIC_SOLUTION: "Redémarrer votre navigateur.",
  14123. ERROR_GENERIC_ACTIONS_1: "Si le problème persiste, ",
  14124. ERROR_GENERIC_ACTIONS_2: "installez un navigateur plus récent",
  14125. ERROR_GENERIC_ACTIONS_3: " ou ",
  14126. ERROR_GENERIC_ACTIONS_4: "voir notre guide de dépannage",
  14127. ERROR_WEBGL_UNSUPPORTED_PROBLEM: "Navigateur non-supporté.",
  14128. ERROR_WEBGL_IOS_PROBLEM: "Version iOS non-supportée.",
  14129. ERROR_WEBGL_IOS_SOLUTION: "Mettre à jour avec iOS8 au minimum pour voir l'Espace en 3D.",
  14130. ERROR_WEBGL_IOS_ACTIONS_1: "Tapez ",
  14131. ERROR_WEBGL_IOS_ACTIONS_2: "Paramètres > Général > Mise à jour Software",
  14132. ERROR_WEBGL_SAFARI_PROBLEM: "Activez WegGL pour explorer en 3D.",
  14133. ERROR_WEBGL_SAFARI_ACTIONS_1: "Cliquez ",
  14134. ERROR_WEBGL_SAFARI_ACTIONS_2: "Préferences > Avancés > Voir menu développeur",
  14135. ERROR_WEBGL_SAFARI_ACTIONS_3: "Puis cliquez ",
  14136. ERROR_WEBGL_SAFARI_ACTIONS_4: "Développe > Activé WebGL",
  14137. ERROR_MISSING_URLS_PROBLEM: "Il n'y a pas de panoromas pour ce modèle.",
  14138. ERROR_MISSING_URLS_EXPLANATION: "Ceci est un ancien modèle. Le propriétaire du site a peut-être un nouveau modèle en cours.",
  14139. ERROR_LOADING_FAILED_PROBLEM: "Ce modèle n'est pas disponible.",
  14140. ERROR_LOADING_FAILED_ACTIONS_1: "Si le problème persiste, ",
  14141. ERROR_LOADING_FAILED_ACTIONS_2: "voir notre guide de dépannage",
  14142. ERROR_MAINTENANCE_PROBLEM: "Maintenance en cours.",
  14143. ERROR_MAINTENANCE_SOLUTION: "Revenez dans quelques instants.",
  14144. LINK_TO_LOCATION: "Lien vers l'emplacement",
  14145. MENU_COPY: "Copie",
  14146. LINK_ALERT_COPY: "Utiliser CTRL+CMD C pour copier.",
  14147. ROTATE: "Faire pivoter",
  14148. INSIDE: "Intérieure",
  14149. MOVE: "Se déplacer",
  14150. ZOOM: "Zoom"
  14151. }
  14152. }
  14153. , {}],
  14154. 114: [function(e, t, i) {
  14155. "use strict";
  14156. t.exports = {
  14157. PAGE_TITLE: "",
  14158. LOADING: "読み込み中",
  14159. PRESENTED_BY_CAPS: "PRESENTED BY",
  14160. POWERED_BY: "powered by",
  14161. POWERED_BY_CAPS: "POWERED BY",
  14162. DESKTOP_SHORT_CTA: "クリックしてこの3D Spaceを探索",
  14163. MOBILE_SHORT_CTA: "タップしてこの3D Spaceを探索",
  14164. PRESENTED_BY: "Presented by ",
  14165. MORE: "全て表示 ",
  14166. LESS: "閉じる ",
  14167. TAG_CONTENT: "tag™コンテンツ ",
  14168. SHOW: "表示",
  14169. HIDE: "非表示",
  14170. DOLLHOUSE: "ドールハウス",
  14171. FLOOR_PLAN: "フロアプラン",
  14172. OPEN_HIGHLIGHTS: "ハイライトを開く",
  14173. CLOSE_HIGHLIGHTS: "閉じる",
  14174. PREVIOUS: "前へ",
  14175. PLAY: "再生",
  14176. PAUSE: "一時停止",
  14177. NEXT: "次へ",
  14178. EXPLORE_3D_SPACE: "3DSpaceの探索",
  14179. VIEW_DOLLHOUSE: "ドールハウスの表示",
  14180. SOCIAL_SHARING: "このSpaceを共有する",
  14181. VIEW_IN_VR: "VRで表示",
  14182. VIEW_FULLSCREEN: "フルスクリーン表示",
  14183. EXIT_FULLSCREEN: "フルスクリーン表示を終了",
  14184. ZOOM_IN: "ズームイン",
  14185. ZOOM_OUT: "ズームアウト",
  14186. FLOOR_NAME: "フロア ",
  14187. FLOOR_ALL: "すべて",
  14188. TERMS: "規約",
  14189. PORT_TERMS: "port規約",
  14190. TERMS_OF_USE: "利用規約",
  14191. CLOSE_TERMS: "閉じる",
  14192. TERMS_TEXT_FILE: "terms-jp-JP.html",
  14193. TERMS_FAIL: "規約を取得できませんでした。利用規約を表示するためにインターネットに接続されていることを確認してください。",
  14194. WEBVR_FOR_DAYDREAM: "Daydream View用",
  14195. WEBVR_ENTER_WEBVR: "VRに入る",
  14196. WEBVR_DIFFERENT_HEADSET: "別のヘッドセットをお持ちですか?",
  14197. WEBVR_LEARN_MORE: "もっと詳しく",
  14198. WEBVR_VIEW_SPACE: "VRでSpaceを表示",
  14199. WEBVR_DAYDREAM_VIEW: "Daydream View",
  14200. WEBVR_DAYDREAM_PHONE: "Daydream対応スマホ",
  14201. WEBVR_FOR_CARDBOARD: "Google Cardboard用",
  14202. WEBVR_VIEW_CARDBOARD: "またはGoogle Cardboardで表示",
  14203. VR_VIEW_SPACE: "バーチャルリアリティでSpaceを表示",
  14204. VR_LEARN_MORE_CAPS: "もっと詳しく",
  14205. VR_PREVIOUS_CAPS: "前へ",
  14206. VR_NEXT_CAPS: "次へ",
  14207. VR_GOT_IT_CAPS: "了解",
  14208. VR_SHOW_SUPPORTED: "タップして次を使用してVRでSpaceを表示: ",
  14209. VR_SHOW_UNSUPPORTED: "お使いのデバイスはVRでSpaceを表示する最低要件を満たしていません",
  14210. VR_SHOW_IOS_1: "タップしてVRでSpaceを表示",
  14211. VR_SHOW_IOS_2: "表示するにはport VRアプリと互換性のあるiPhoneが必要です",
  14212. VR_WHAT_YOU_NEED: "必要なもの",
  14213. VR_NEED_CARDBOARD: "Google Cardboardに必要なもの",
  14214. VR_NEED_SAMSUNG: "Samsung Gear VRに必要なもの",
  14215. VR_NEED_DAYDREAM: "事前にDaydream Viewとのペアリングが必要です",
  14216. VR_NEED_DAYDREAM_PHONE: "Daydream対応スマホ",
  14217. VR_GOOGLE_CARDBOARD: "Google Cardboard",
  14218. VR_GOOGLE_DAYDREAM: "Google Daydream",
  14219. VR_APP: "port VRアプリ",
  14220. VR_SAMSUNG_GEAR_VR: "Samsung Gear VR",
  14221. VR_COMPATIBLE_IPHONES_1: "iPhone",
  14222. VR_COMPATIBLE_IPHONES_2: "iOS 9.1以降で動作するiPhone 5s以降のモデル",
  14223. VR_COMPATIBLE_IPHONES_3: "互換性のあるiPhone",
  14224. VR_COMPATIBLE_ANDROID: "互換性のあるAndroidデバイス",
  14225. VR_COMPATIBLE_ANDROID_LONG: "Android OS 4.4.4以降で動作する互換性のあるAndroidデバイスの4.5~5.5インチディスプレイ",
  14226. VR_ANDROID_DETAIL: "Android OS 4.4.4以降で動作する4.5~5.5インチディスプレイ",
  14227. VR_ANDROID_DVICES: "Androidデバイス",
  14228. VR_COMPATIBLE_SAMSUNG: "互換性のあるSamsungデバイス",
  14229. VR_SAMSUNG_DETAIL: "Galaxy S5以降のモデル",
  14230. VR_APP_FOR_CARDBOARD: "Google Cardboard用のport VRアプリ",
  14231. VR_APP_FOR_SAMSUNG: "Gear VR 用のport VRアプリ",
  14232. VR_APP_FOR_ANDROID: "Androidフォン用のport VRアプリ",
  14233. VR_APP_OPEN: "port VRアプリで開く",
  14234. VR_DOWNLOAD_HERE: "ここからダウンロード",
  14235. VR_REQUIRE_HEADSET: "Android 用のVRヘッドセットとport VRアプリ をインストールする必要があります",
  14236. VR_REDIRECT_TO_STORE: "アプリがインストールされていない場合、App Storeにリダイレクトされます",
  14237. VR_IMPROPER_EMBED: "お使いのウェブブラウザでVRがサポートされるようport Spaceが適切に埋め込まれていません。",
  14238. VR_OPEN_ANDROID_LINK: "お使いの携帯電話でリンクを開いてください",
  14239. VR_ANDROID_OPTIONS: "利用可能なVRヘッドセットオプション",
  14240. SHARE_TO: "共有先",
  14241. SHARE_LINK: "ダイレクトリンク",
  14242. SHARE_EXPLORE: "探索",
  14243. SHARE_AT: "場所",
  14244. SHARE_WITH: "使用アプリ",
  14245. SHARE_3D: "3Dで",
  14246. SHARE_COPIED: "コピーされました!",
  14247. ERROR_BROWSER_SOLUTION: "3D探索するには、新しいバージョンのブラウザをインストールしてください",
  14248. ERROR_BROWSER_EXPLANATION: "WebGLにはモダンブラウザが必要です。",
  14249. ERROR_GENERIC_PROBLEM: "問題が発生しました。",
  14250. ERROR_GENERIC_SOLUTION: "ブラウザを再起動してください。",
  14251. ERROR_GENERIC_ACTIONS_1: "問題が解決しない場合は、",
  14252. ERROR_GENERIC_ACTIONS_2: "サポートされているブラウザをインストールしてください",
  14253. ERROR_GENERIC_ACTIONS_3: "または",
  14254. ERROR_GENERIC_ACTIONS_4: "トラブルシューティングガイドを参照してください",
  14255. ERROR_WEBGL_UNSUPPORTED_PROBLEM: "ブラウザがサポートされていません。",
  14256. ERROR_WEBGL_IOS_PROBLEM: "サポートされていないiOSバージョンです。",
  14257. ERROR_WEBGL_IOS_SOLUTION: "3D探索するには、iOS 8以降にアップグレードしてください。",
  14258. ERROR_WEBGL_IOS_ACTIONS_1: "以下の順にタップします:",
  14259. ERROR_WEBGL_IOS_ACTIONS_2: "設定 > 全般 > ソフトウェアの更新",
  14260. ERROR_WEBGL_SAFARI_PROBLEM: "WebGLを有効にして3Dで探索します。",
  14261. ERROR_WEBGL_SAFARI_ACTIONS_1: "以下の順にクリックします:",
  14262. ERROR_WEBGL_SAFARI_ACTIONS_2: "環境設定 > 詳細 > メニューバーに開発メニューを表示",
  14263. ERROR_WEBGL_SAFARI_ACTIONS_3: "その後、以下の順にクリックします:",
  14264. ERROR_WEBGL_SAFARI_ACTIONS_4: "開発 > WebGLを有効にする",
  14265. ERROR_MISSING_URLS_PROBLEM: "このモデルではパノラマを使用できません。",
  14266. ERROR_MISSING_URLS_EXPLANATION: "これは古いモデルです。ウェブサイト所有者が新しいモデルを開発中かもしれません。",
  14267. ERROR_LOADING_FAILED_PROBLEM: "モデルは利用できません。",
  14268. ERROR_LOADING_FAILED_ACTIONS_1: "問題が解決しない場合は、",
  14269. ERROR_LOADING_FAILED_ACTIONS_2: "トラブルシューティングガイドを参照してください",
  14270. ERROR_MAINTENANCE_PROBLEM: "メンテナンスは進行中です。",
  14271. ERROR_MAINTENANCE_SOLUTION: "しばらくしてからやり直し てください。",
  14272. LINK_TO_LOCATION: "ロケーションへのリンク",
  14273. MENU_COPY: "コピー",
  14274. LINK_ALERT_COPY: "コピーするにはCTRL/CMD + Cを使用してください。",
  14275. ROTATE: "回転",
  14276. MOVE: "移動",
  14277. INSIDE: "内側",
  14278. ZOOM: "ズーム",
  14279. HELP: "ヘルプ",
  14280. HELP_NAVIGATION_TAB: "ナビゲーション",
  14281. HELP_MORE_HELP_TAB: "その他のヘルプ",
  14282. HELP_DESKTOP_PANORAMA_1A: "Spaceを見回すには、クリックしてドラッグします。",
  14283. HELP_DESKTOP_PANORAMA_2A: "移動するには、Space全体にあるリングをクリックします。",
  14284. HELP_DESKTOP_PANORAMA_3A: "スクロールホイールを使用してズームイン、ズームアウトします。",
  14285. HELP_DESKTOP_PANORAMA_1B: "または、矢印キーを使用して左右に向きを変えます。",
  14286. HELP_DESKTOP_PANORAMA_2B: "または、矢印キーを使用して前後に向きを変えます。",
  14287. HELP_DESKTOP_PANORAMA_3B: "あるいは、プラス(+)キーまたはマイナス(-)キーを使用して、ズームイン、ズームアウトします。",
  14288. HELP_DESKTOP_360_2A: "内側ビューアイコンをクリックしてSpaceに入ります。",
  14289. HELP_DESKTOP_360_2B: "または、数字キー1を押して内側ビューに入ります。",
  14290. HELP_DESKTOP_DOLLHOUSE_1A: "左クリックと左右、上下のドラッグでドールハウスを回転します。",
  14291. HELP_DESKTOP_DOLLHOUSE_2A: "右クリックと左右、上下のドラッグでドールハウスの画面上の位置を変更します。",
  14292. HELP_DESKTOP_DOLLHOUSE_3A: "スクロールホイールを使用してズームイン、ズームアウトします。",
  14293. HELP_DESKTOP_DOLLHOUSE_1B: "または、矢印キーを使用してドールハウスを回転します。",
  14294. HELP_DESKTOP_FLOORPLAN_1A: "左ボタンを押しながら、上下左右にドラッグしてフロアプランの画面上の位置を変更します。",
  14295. HELP_DESKTOP_FLOORPLAN_2A: "右ボタンを押しながら左右にドラッグして、フロアプランを回転します。",
  14296. HELP_DESKTOP_FLOORPLAN_3A: "スクロールホイールを使用してズームイン、ズームアウトします。",
  14297. HELP_DESKTOP_FLOORPLAN_2B: "または、矢印キーを使用して左右に回転します。",
  14298. HELP_DESKTOP_FLOORPLAN_3B: "または、矢印キーを使用して、ズームイン、ズームアウトします。",
  14299. HELP_MOBILE_PANORAMA_1: "Spaceを見回すには、タッチしてドラッグします。",
  14300. HELP_MOBILE_PANORAMA_2: "移動するには、Space全体にあるリングをタップします。",
  14301. HELP_MOBILE_3: "ピンチジェスチャーを使用してズームイン、ズームアウトします。",
  14302. HELP_MOBILE_360_2: "内側ビューアイコンをタップしてSpaceに入ります。",
  14303. HELP_MOBILE_DOLLHOUSE_1: "タッチして上下左右にドラッグしてドールハウスを回転します。",
  14304. HELP_MOBILE_DOLLHOUSE_2: "タッチして、2本指でドラッグしてドールハウスを配置します。",
  14305. HELP_MOBILE_FLOORPLAN_1: "タッチ&ドラッグしてフロアプランを配置します。",
  14306. HELP_MOBILE_FLOORPLAN_2: "タッチして、2本指でドラッグしてフロアプランを回転します。",
  14307. HELP_MORE_HLR_A: "ハイライト",
  14308. HELP_DESKTOP_MORE_HLR_B: "サムネイル画像を使用してSpaceを移動するために開きます。",
  14309. HELP_MORE_DOLLHOUSE_A: "ドールハウス",
  14310. HELP_DESKTOP_MORE_DOLLHOUSE_B: "クリックして3DでSpace全体のトップダウンビューを表示して回転します。",
  14311. HELP_MOBILE_MORE_DOLLHOUSE_B: "タップして3DでSpace全体のトップダウンビューを表示して回転します。",
  14312. HELP_MORE_FLOORS_A: "フロアセレクター",
  14313. HELP_DESKTOP_MORE_FLOORS_B: "Space内のフロアを切り替えます。",
  14314. HELP_MORE_TAG_A: "tag™ Posts",
  14315. HELP_DESKTOP_MORE_TAG_B: "クリックするか、カーソルを置くとSpace内の機能についての説明が表示されます。",
  14316. HELP_MOBILE_MORE_TAG_B: "タップするとSpace内の機能についての説明が表示されます。",
  14317. HELP_MORE_ZOOM_A: "ズームコントロール",
  14318. HELP_DESKTOP_MORE_ZOOM_B: "これらのコントロールまたはスクロールホイールを使用して、ズームイン、ズームアウトします。",
  14319. HELP_MORE_TOUR_A: "ツアーコントロール",
  14320. HELP_DESKTOP_MORE_TOUR_B: "ガイド付きツアー中に再生、一時停止、前方・後方に移動します。",
  14321. HELP_MORE_INSIDE_A: "内側ビュー",
  14322. HELP_DESKTOP_MORE_INSIDE_B: "クリックしてSpace内を探索します。",
  14323. HELP_MOBILE_MORE_INSIDE_B: "タップしてSpace内を探索します。",
  14324. HELP_MORE_VR_A: "VRモード",
  14325. HELP_DESKTOP_MORE_VR_B: "クリックしてバーチャルリアリティでSpaceを起動します。",
  14326. HELP_MOBILE_MORE_VR_B: "タップしてバーチャルリアリティでSpaceを起動します。",
  14327. HELP_MORE_360_A: "360° Views",
  14328. HELP_DESKTOP_MORE_360_B: "Highlight Reelの360° Viewsをクリックして屋外シーンを表示します。",
  14329. HELP_MOBILE_MORE_360_B: "Highlight Reelの360° Viewsをタップして屋外シーンを表示します。",
  14330. HELP_MORE_FULLSCREEN_A: "フルスクリーン",
  14331. HELP_DESKTOP_MORE_FULLSCREEN_B: "3D Showcaseをフルスクリーン表示にします。",
  14332. CLOSE: "閉じる"
  14333. }
  14334. }
  14335. , {}],
  14336. 115: [function(e, t, i) {
  14337. "use strict";
  14338. t.exports = {
  14339. PAGE_TITLE: "",
  14340. LOADING: "Загрузка",
  14341. PRESENTED_BY_CAPS: "ПРЕДСТАВЛЕНО",
  14342. POWERED_BY: "разработано на платформе ",
  14343. POWERED_BY_CAPS: "РАЗРАБОТАНО НА ПЛАТФОРМЕ",
  14344. DESKTOP_SHORT_CTA: "Нажмите для просмотра.",
  14345. MOBILE_SHORT_CTA: "Нажмите для просмотра.",
  14346. PRESENTED_BY: "Представлено ",
  14347. MORE: "Больше ",
  14348. LESS: "Меньше ",
  14349. TAG_CONTENT: "tag™ Контент",
  14350. SHOW: "Показать",
  14351. HIDE: "Скрыть",
  14352. DOLLHOUSE: "Dollhouse",
  14353. FLOOR_PLAN: "Планировка",
  14354. OPEN_HIGHLIGHTS: "Открыть Фотоколлаж",
  14355. CLOSE_HIGHLIGHTS: "Закрыть",
  14356. PREVIOUS: "Предыдущий",
  14357. PLAY: "Воспроизвести",
  14358. PAUSE: "Пауза",
  14359. NEXT: "Следующий",
  14360. EXPLORE_3D_SPACE: "Просмотреть 3D модель",
  14361. VIEW_DOLLHOUSE: "Посмотреть Dollhouse",
  14362. SOCIAL_SHARING: "Поделиться этой моделью",
  14363. VIEW_IN_VR: "Посмотреть в VR",
  14364. VIEW_FULLSCREEN: "Полный экран",
  14365. EXIT_FULLSCREEN: "Выйти из полноэкранного режима",
  14366. ZOOM_IN: "Увеличить",
  14367. ZOOM_OUT: "Уменьшить",
  14368. FLOOR_NAME: "Этаж ",
  14369. FLOOR_ALL: "Все",
  14370. TERMS: "Условия",
  14371. PORT_TERMS: "Правила пользования",
  14372. TERMS_OF_USE: "Условия использования",
  14373. TERMS_TEXT_FILE: "terms-ru-RU.html",
  14374. CLOSE_TERMS: "Закрыть",
  14375. TERMS_FAIL: "Не удалось загрузить условия использования. Для просмотра условий использования, пожалуйста, убедитесь, что у Вас есть подключение к Интернету.",
  14376. HELP: "Помощь",
  14377. HELP_NAVIGATION_TAB: "Навигация",
  14378. HELP_MORE_HELP_TAB: "Доп. Помощь",
  14379. CLOSE: "Закрыть",
  14380. HELP_DESKTOP_PANORAMA_1A: "Нажмите и перетащите, чтобы осмотреть пространство вокруг.",
  14381. HELP_DESKTOP_PANORAMA_2A: "Для передвижения по модели нажимайте на круги .",
  14382. HELP_DESKTOP_PANORAMA_3A: "Используйте колесо прокрутки для увеличения и уменьшения.",
  14383. HELP_DESKTOP_PANORAMA_1B: "Или используйте клавиши со стрелками для поворота влево и вправо.",
  14384. HELP_DESKTOP_PANORAMA_2B: "Или используйте стрелки для перемещения вперед и назад.",
  14385. HELP_DESKTOP_PANORAMA_3B: "Или используйте клавиши ‘плюс’ и ‘минус’ для увеличения и уменьшения изображения.",
  14386. HELP_DESKTOP_360_2A: "Нажмите на значок ‘Вид Изнутри’, чтобы увидеть внутреннюю панораму.",
  14387. HELP_DESKTOP_360_2B: "или нажмите 1 на клавиатуре, чтобы увидеть внутреннюю панораму.",
  14388. HELP_DESKTOP_DOLLHOUSE_1A: "Нажмите левую кнопку мыши и перетащите влево, вправо, вверх и вниз, чтобы повернуть Dollhouse.",
  14389. HELP_DESKTOP_DOLLHOUSE_2A: "Нажмите правую кнопку мыши и перетащите влево, вправо, вверх и вниз, чтобы изменить позицию Dollhouse на экране.",
  14390. HELP_DESKTOP_DOLLHOUSE_3A: "Используйте колесо прокрутки чтобы увеличить и уменьшить.",
  14391. HELP_DESKTOP_DOLLHOUSE_1B: "Или используйте клавиши со стрелками, чтобы повернуть Dollhouse.",
  14392. HELP_DESKTOP_FLOORPLAN_1A: "Нажмите левую кнопку мыши и перетащите влево, вправо, вверх и вниз, чтобы изменить положение Планировки на экране.",
  14393. HELP_DESKTOP_FLOORPLAN_2A: "Нажмите правую кнопку мыши и перетащите влево или вправо, чтобы повернуть Планировку.",
  14394. HELP_DESKTOP_FLOORPLAN_3A: "Используйте колесо прокрутки чтобы увеличить и уменьшить.",
  14395. HELP_DESKTOP_FLOORPLAN_2B: "Или используйте клавиши со стрелками для поворота влево или вправо.",
  14396. HELP_DESKTOP_FLOORPLAN_3B: "Или используйте стрелки для увеличения и уменьшения.",
  14397. HELP_MOBILE_PANORAMA_1: "Нажмите и перетащите, чтобы осмотреть модель.",
  14398. HELP_MOBILE_PANORAMA_2: "Для передвижения по модели нажимайте на круги.",
  14399. HELP_MOBILE_3: "Используйте движение двумя пальцами в разные стороны, чтобы увеличить и уменьшить.",
  14400. HELP_MOBILE_360_2: "Нажмите на значок ‘Вид Изнутри’, чтобы увидеть внутреннюю панораму.",
  14401. HELP_MOBILE_DOLLHOUSE_1: "Нажмите и перетащите вверх, вниз, влево и вправо, чтобы повернуть Dollhouse.",
  14402. HELP_MOBILE_DOLLHOUSE_2: "Нажмите и перетащите, чтобы расположить Dollhouse.",
  14403. HELP_MOBILE_FLOORPLAN_1: "Нажмите и перетащите, чтобы расположить план здания.",
  14404. HELP_MOBILE_FLOORPLAN_2: "Коснитесь и перетащите двумя пальцами, чтобы повернуть план здания.",
  14405. HELP_MORE_HLR_A: "Фотоколлаж",
  14406. HELP_DESKTOP_MORE_HLR_B: "Откройте для перемещения по модели, используя иконки изображений.",
  14407. HELP_MORE_DOLLHOUSE_A: "Dollhouse",
  14408. HELP_DESKTOP_MORE_DOLLHOUSE_B: "Нажмите и поверните сверху вниз чтобы просмотреть всю 3D модель.",
  14409. HELP_MOBILE_MORE_DOLLHOUSE_B: "Нажмите и поверните сверху вниз чтобы просмотреть всю 3D модель.",
  14410. HELP_MORE_FLOORS_A: "Выбор Этажа",
  14411. HELP_DESKTOP_MORE_FLOORS_B: "Переключение между этажами.",
  14412. HELP_MORE_TAG_A: "tag™ Posts",
  14413. HELP_DESKTOP_MORE_TAG_B: "Нажмите или наведите курсор мыши для получения информации о функциях в Пространстве.",
  14414. HELP_MOBILE_MORE_TAG_B: "Нажмите для получения информации о функциях.",
  14415. HELP_MORE_ZOOM_A: "Масштаб",
  14416. HELP_DESKTOP_MORE_ZOOM_B: "Используйте эти кнопки для увеличения и уменьшения изображения или используйте колесо прокрутки.",
  14417. HELP_MORE_TOUR_A: "Управление Туром",
  14418. HELP_DESKTOP_MORE_TOUR_B: "Используйте кнопки Воспроизвести, Пауза, Вперед и Назад для управления фотоколлажем.",
  14419. HELP_MORE_INSIDE_A: "Вид Изнутри",
  14420. HELP_DESKTOP_MORE_INSIDE_B: "Нажмите, чтобы просмотреть модель изнутри.",
  14421. HELP_MOBILE_MORE_INSIDE_B: "Нажмите, чтобы просмотреть модель изнутри.",
  14422. HELP_MORE_VR_A: "Режим VR",
  14423. HELP_DESKTOP_MORE_VR_B: "Нажмите, чтобы запустить модель в виртуальной реальности.",
  14424. HELP_MOBILE_MORE_VR_B: "Нажмите, чтобы запустить модель в виртуальной реальности.",
  14425. HELP_MORE_360_A: "360° Views",
  14426. HELP_DESKTOP_MORE_360_B: "Нажмите на “360 Views” в фотоколлаже, чтобы просмотреть внешний пейзаж.",
  14427. HELP_MOBILE_MORE_360_B: "Нажмите на “360 Views” в фотоколлаже, чтобы просмотреть внешний пейзаж.",
  14428. HELP_MORE_FULLSCREEN_A: "Полный экран",
  14429. HELP_DESKTOP_MORE_FULLSCREEN_B: "Развернуть 3D Showcase во весь экран.",
  14430. WEBVR_FOR_CARDBOARD: "Для Google Cardboard",
  14431. WEBVR_FOR_DAYDREAM: "Для просмотра в Daydream",
  14432. WEBVR_ENTER_WEBVR: "ВОЙТИ В VR ",
  14433. WEBVR_DIFFERENT_HEADSET: "Есть другой VR-шлем?",
  14434. WEBVR_LEARN_MORE: "Узнать больше",
  14435. WEBVR_VIEW_SPACE: "Запустить модель в VR",
  14436. WEBVR_DAYDREAM_VIEW: "Посмотреть в Daydream",
  14437. WEBVR_DAYDREAM_PHONE: "Daydream-готовый телефон",
  14438. WEBVR_VIEW_CARDBOARD: "Или просмотреть в Google Cardboard",
  14439. VR_WHAT_YOU_NEED: "Что Вам потребуется...",
  14440. VR_NEED_DAYDREAM_PHONE: "Daydream-готовый телефон",
  14441. VR_GOOGLE_DAYDREAM: "Google Daydream",
  14442. VR_APP: "port VR App",
  14443. VR_APP_OPEN: "Или открыть через приложение port VR",
  14444. VR_COMPATIBLE_ANDROID_LONG: 'Совместимые Android устройства с диагональю экрана 4.5"-5.5" дюймов и Android версией 4.4.4, и выше',
  14445. VR_SAMSUNG_DETAIL: "Galaxy S6 и выше",
  14446. VR_APP_FOR_ANDROID: "Приложение port VR для Android",
  14447. VR_NEED_DAYDREAM: "Необходимо для соединением с Daydream",
  14448. VR_VIEW_SPACE: "Запустить модель в VR",
  14449. VR_LEARN_MORE_CAPS: "УЗНАТЬ БОЛЬШЕ",
  14450. VR_PREVIOUS_CAPS: "ПРЕДЫДУЩИЙ",
  14451. VR_NEXT_CAPS: "СЛЕДУЮЩИЙ",
  14452. VR_GOT_IT_CAPS: "ЯСНО",
  14453. VR_SHOW_SUPPORTED: "Нажмите, чтобы просмотреть модель в VR с помощью",
  14454. VR_SHOW_UNSUPPORTED: "Извините, но Ваше устройство не соответствует минимальным требованиям для просмотра модели в VR.",
  14455. VR_SHOW_IOS_1: "Нажмите, чтобы просмотреть модель в VR",
  14456. VR_SHOW_IOS_2: "Для просмотра требуется приложение port VR и совместимый iPhone",
  14457. VR_NEED_CARDBOARD: "Что Вам потребуется для Google Cardboard",
  14458. VR_NEED_SAMSUNG: "Что Вам потребуется для Samsung Gear VR",
  14459. VR_GOOGLE_CARDBOARD: "Google Cardboard",
  14460. VR_SAMSUNG_GEAR_VR: "Samsung Gear VR",
  14461. VR_COMPATIBLE_IPHONES_1: "iPhones",
  14462. VR_COMPATIBLE_IPHONES_2: "iPhone 5s или новее с iOS 9.1 и выше",
  14463. VR_COMPATIBLE_IPHONES_3: "Совместимые модели iPhone",
  14464. VR_COMPATIBLE_ANDROID: "Совместимые Android устройства",
  14465. VR_ANDROID_DETAIL: 'Экран от 4.5" до 5.5" и Android 4.4.4, и выше',
  14466. VR_ANDROID_DVICES: "Android устройства",
  14467. VR_COMPATIBLE_SAMSUNG: "Совместимые Samsung устройства",
  14468. VR_APP_FOR_CARDBOARD: "Приложение port VR для Google Cardboard",
  14469. VR_APP_FOR_SAMSUNG: "Приложение port VR для Gear VR",
  14470. VR_DOWNLOAD_HERE: "Скачать здесь",
  14471. VR_REQUIRE_HEADSET: "Требуется VR-шлем и установленное приложение port VR для Android",
  14472. VR_REDIRECT_TO_STORE: "Если приложение не установлено, Вы будете перенаправлены на страницу магазина приложений.",
  14473. VR_IMPROPER_EMBED: "port модель не встроена должным образом для поддержки VR в вашем веб-браузере.",
  14474. VR_OPEN_ANDROID_LINK: "Откройте ссылку на Вашем мобильном телефоне",
  14475. VR_ANDROID_OPTIONS: "Доступные опции VR-шлемов",
  14476. SHARE_TO: "Поделиться",
  14477. SHARE_LINK: "Прямая ссылка",
  14478. SHARE_EXPLORE: "просмотреть",
  14479. SHARE_AT: "на",
  14480. SHARE_WITH: "с",
  14481. SHARE_3D: "в 3D",
  14482. SHARE_COPIED: "Скопировано!",
  14483. ERROR_BROWSER_SOLUTION: "установите новый браузер, чтобы просмотреть 3D пространство.",
  14484. ERROR_BROWSER_EXPLANATION: "WebGL требует современный браузер.",
  14485. ERROR_GENERIC_PROBLEM: "Ой, что-то пошло не так.",
  14486. ERROR_GENERIC_SOLUTION: "Перезапустите браузер.",
  14487. ERROR_GENERIC_ACTIONS_1: "Если проблема не устранена, ",
  14488. ERROR_GENERIC_ACTIONS_2: "установите поддерживаемый браузер",
  14489. ERROR_GENERIC_ACTIONS_3: " или ",
  14490. ERROR_GENERIC_ACTIONS_4: "смотрите наше руководство по устранению неполадок",
  14491. ERROR_WEBGL_UNSUPPORTED_PROBLEM: "Браузер не поддерживается.",
  14492. ERROR_WEBGL_IOS_PROBLEM: "iOS-версия не поддерживается.",
  14493. ERROR_WEBGL_IOS_SOLUTION: "Обновите до iOS 8 или выше, чтобы просмотреть пространство в 3D.",
  14494. ERROR_WEBGL_IOS_ACTIONS_1: "Нажмите ",
  14495. ERROR_WEBGL_IOS_ACTIONS_2: "Настройки > Общие > Обновление ПО",
  14496. ERROR_WEBGL_SAFARI_PROBLEM: "Включите WebGL для 3D-просмотра.",
  14497. ERROR_WEBGL_SAFARI_ACTIONS_1: "Нажмите ",
  14498. ERROR_WEBGL_SAFARI_ACTIONS_2: "Настойки > Дополнения > Показывать меню “Разработка” в строке меню",
  14499. ERROR_WEBGL_SAFARI_ACTIONS_3: "Затем нажмите ",
  14500. ERROR_WEBGL_SAFARI_ACTIONS_4: "Разработка > Разрешить WebGL",
  14501. ERROR_MISSING_URLS_PROBLEM: "Ой, для этой модели нет панорамы.",
  14502. ERROR_MISSING_URLS_EXPLANATION: "Эта модель устарела. У владельца веб-сайта может быть новая модель.",
  14503. ERROR_LOADING_FAILED_PROBLEM: "Ой, модель недоступна.",
  14504. ERROR_LOADING_FAILED_ACTIONS_1: "Если проблема не устранена, ",
  14505. ERROR_LOADING_FAILED_ACTIONS_2: "посмотрите наше руководство по устранению неполадок",
  14506. ERROR_MAINTENANCE_PROBLEM: "Выполняется техническое обслуживание.",
  14507. ERROR_MAINTENANCE_SOLUTION: "Пожалуйста, попробуйте снова через несколько минут.",
  14508. LINK_TO_LOCATION: "Ссылка на местоположение",
  14509. MENU_COPY: "Копировать",
  14510. LINK_ALERT_COPY: "Для того, чтобы скопировать, пожалуйста, используйте CTRL/CMD + C.",
  14511. ROTATE: "Вращать",
  14512. MOVE: "Передвигаться",
  14513. INSIDE: "Вид изнутри",
  14514. ZOOM: "Масштаб"
  14515. }
  14516. }
  14517. , {}],
  14518. 116: [function(e, t, i) {//main.js
  14519. (function(t) {
  14520. "use strict";
  14521. var modelProgressBase = 0.4;
  14522. var progressUpdate = function(e){ // 0 <= e <= 1
  14523. console.log('e1:'+e)
  14524. e = Math.round(modelProgressBase * e * 100);
  14525. console.log('e2:'+e)
  14526. var t = $('.progressbar');
  14527. t.find('.bar').css('width',e+'%');
  14528. t.find('.label').css('left', t.width() * e / 100 - 15 + 'px' ); //上面跟着的字的百分比
  14529. t.find('.perc').text(e +'%'); //具体数字的百分比
  14530. }
  14531. $('#gui-loading').fadeIn(200);
  14532. progressUpdate(0.1)
  14533. var fileName = g_version ? 'modeldata.js' : 'someData.json' ;
  14534. $.ajax(g_Prefix + "data/"+window.number+"/"+fileName+"?"+randomTime().getTime(),{dataType: "json"}).done( function(e){ //改
  14535. var data = matcher(e);
  14536. data.files.templates[0] = g_Prefix + e.files.templates[0].replace("{{number}}",window.number);
  14537. data.user = {
  14538. "is_authenticated": false,
  14539. "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"]
  14540. }
  14541. try{//处理一下导览数据
  14542. data.model.images = data.model.images.filter(e=>{
  14543. if(!e.locations && !e.thumbnail_signed_src)return; //旧的曾有导览数据是错误的,将它删除
  14544. if(e.locations)e.locations = e.locations.filter(e=>e)
  14545. if(e.locations && e.locations.length == 0)return;
  14546. return e
  14547. })
  14548. }catch(e){console.log(e) }
  14549. window.DATA = data;
  14550. data.model.summary = data.summary
  14551. data.model.name = data.name
  14552. for(let i in data){
  14553. data[i] == "false" && (data[i] = false)
  14554. }
  14555. progressUpdate(0.7);
  14556. StartLoad(); //xzw someData.js是我整合的 原本在html里 但这样每个场景的html都不一样了
  14557. if(data.weixinDesc){
  14558. g_weixinObj.desc = data.weixinDesc;
  14559. }
  14560. if(data.shareImgUrl){
  14561. g_weixinObj.imgUrl = data.shareImgUrl
  14562. }
  14563. window.wx && manage.weixinShare();
  14564. //初始画面
  14565. data.camera_start && data.camera_start.thumbImg && E(manage.dealURL(data.camera_start.thumbImg))
  14566. function E(e) {
  14567. $("<img/>").attr("src", e).on("load", function() {
  14568. $("#gui-thumb").css("backgroundImage", "url(" + e + ")").fadeIn(500),
  14569. $(this).remove()
  14570. })
  14571. }
  14572. //背景
  14573. settings.transparentBg = settings.transparentBg || data.transparentBg || false,
  14574. settings.bgImg = settings.bgImg || data.bgImg || null
  14575. if(settings.bgImg){
  14576. $("#player").css({'background-image': "url("+settings.bgImg+")",
  14577. "background-position": "center center"
  14578. })
  14579. }
  14580. {//初始化导览时间
  14581. if(DATA.tourBlackSpeed == void 0)DATA.tourBlackSpeed = 100
  14582. window._settings.warp.teleportTime = settings.teleportTime / DATA.tourBlackSpeed * 100;
  14583. if(DATA.tourWalkSpeed == void 0)DATA.tourWalkSpeed = 100
  14584. if(DATA.tourRotTime == '' || DATA.tourRotTime == void 0){
  14585. DATA.tourRotTime = settings.tourRotTime; //默认停留2秒
  14586. }
  14587. settings.playTourNearBy = !DATA.tourFromStart
  14588. }
  14589. {//其他
  14590. _settings.floorPlanAngle = DATA.floorPlanAngle || 0
  14591. _settings.angleShift2d = DATA.angleShift2d || 0
  14592. if(DATA.insideLookLimit){
  14593. _settings.insideLookLimitDown = DATA.insideLookLimit[0]
  14594. _settings.insideLookLimitUp = DATA.insideLookLimit[1]
  14595. }
  14596. /* _settings.upDownAngleLimitPanos = {
  14597. 25:{up:30},
  14598. 26:{up:30},
  14599. 27:{up:30},
  14600. 28:{up:30},
  14601. 29:{up:30},
  14602. 30:{up:30},
  14603. 31:{up:30},
  14604. 32:{up:30},
  14605. 33:{up:24},
  14606. 34:{up:30},
  14607. 35:{up:30},
  14608. 36:{up:30},
  14609. 37:{up:30},
  14610. 38:{up:30},
  14611. 39:{up:30}
  14612. } */
  14613. }
  14614. if (data.showCad){
  14615. $.ajax({
  14616. url: '//super.4dage.com/data/'+ window.number +'/floor.json',
  14617. method: 'GET',
  14618. success(res) {
  14619. grendCAD(res, document.documentElement, data.cadSignColor, data.cadBorderColor, data.cadBorderWidth)
  14620. }
  14621. })
  14622. }
  14623. }).fail(e=>{
  14624. alert("缺少someData文件,请检查场景码是否正确。")
  14625. })
  14626. function StartLoad(){//当加载完data后
  14627. function i() {
  14628. var e = window.number//Y.getModelIDFromQueryString();
  14629. if (!e)
  14630. return b(null, "loading-failed");
  14631. var t = Y.parseSidUrl(e)
  14632. , i = l()
  14633. , a = c()
  14634. , s = o()
  14635. , u = V.quickstart.enabled
  14636. , g = null
  14637. , m = null
  14638. , v = null
  14639. , w = null
  14640. , T = null
  14641. , x = null
  14642. , S = null
  14643. , M = null
  14644. , R = null
  14645. , P = null
  14646. , O = null
  14647. , L = null
  14648. , N = new ue;
  14649. r(s);
  14650. h({ //MP开头写法
  14651. urlBase: t.urlBase
  14652. }).then(function() {
  14653. return re.init(),
  14654. d(t, e) //getModel and load
  14655. }).then(function(e) {
  14656. progressUpdate(0.9)
  14657. return P = e,
  14658. p(P, V.appConfig.segment_key, V.appConfig.keen_write_key, V.appConfig.keen_project_id, {
  14659. startSource: i,
  14660. autoplay: V.autoplay,
  14661. quickstart: u
  14662. }),
  14663. P.urls.init()
  14664. }).then(function() {
  14665. return P.loadPanos()
  14666. }).then(function() {
  14667. m = X.getStartCameraOptions(P, P.panos),
  14668. S = A(P),
  14669. O = y(u, m.mode),
  14670. v = O.controls,
  14671. w = O.player,
  14672. T = O.director,
  14673. x = O.tagManager,
  14674. M = O.tileDownloader,
  14675. R = O.qualityManager,
  14676. L = O.panoRenderer,
  14677. C(P, S, O, s),
  14678. w.director = T,//xzw add
  14679. P.supportsTiles && M.start(),
  14680. !u || m.mode === D.PANORAMA && m.pano || (de.warn("Tried to quickstart, but failed as we are not starting in inside mode."),
  14681. u = !1);
  14682. var e = null;
  14683. if (u) {
  14684. de.warn("Quickstart engaged. Hold on to your knickers.");
  14685. var t = v.controls[D.PANORAMA];
  14686. g = new ie(R,S.scene,S.camera,t,s),
  14687. _(S, s, P),
  14688. e = g.load(m).then(function() {
  14689. S.addComponent(g),
  14690. S.once(le.AfterRender, function() {
  14691. de.warn("First render after quickstart load finished.")
  14692. })
  14693. })
  14694. }
  14695. window.flyToFirst = function(){//xzw add
  14696. var pano = w.model.panos.get("8d778e19657f433fb9cf8947d823bb70");
  14697. var q = new _x.Quaternion(0.7099827027821568,-0.07708150183830938,0.6958985789714591,0.07555241737970636);
  14698. var lookAtPoint = new _x.Vector3(0,0,-1).applyQuaternion(q).add(pano.position);
  14699. w.flyToPano({pano:pano, lookAtPoint:lookAtPoint})
  14700. };
  14701. return $.when(e, U.startLoading(P, w, T, V.autoplay, u, N))
  14702. }).then(function() {
  14703. return f(P, U.onProgress, i, !u, a)
  14704. }).then(function() {
  14705. if (m.quickstart = u,
  14706. I(P, S, O, s),
  14707. S.started || _(S, s, P),
  14708. H.modelLoaded(P, w, v, V.autoplay),
  14709. E(w, P, m, V.autoplay).done(function() {
  14710. T.autoTour()
  14711. }),
  14712. !P.supportsTiles) {
  14713. var e = new Z(P,w);
  14714. e.start()
  14715. }
  14716. u && (S.removeComponent(g),
  14717. g.destroy(),
  14718. m.pano.enter()),
  14719. U.init(P, T, w, v, S, m, H.getSessionId()),
  14720. U.endLoading(P, T, x),
  14721. S.once(le.AfterRender, function() {
  14722. N.setAppReadyTime();
  14723. var e = N.calcFullLoadingTime();
  14724. de.warn("Total load time: " + e / 1e3),
  14725. H.loadComplete(e),
  14726. de.warn("First render after model load finished.")
  14727. try {
  14728. window.evt && window.dispatchEvent(window.evt);
  14729. parent.postMessage({
  14730. cmd: "loaded",
  14731. }, "*")
  14732. } catch (err) {}
  14733. }),
  14734. S.on(le.MemoryUsageUpdated, n)
  14735. }).fail(b.bind(this, e))
  14736. }
  14737. function n(e) {
  14738. ce.update(e)
  14739. }
  14740. function r(e) {
  14741. de.info("Version", "2.25.6-0-gd87e5b1"),
  14742. q.defaultMaxListeners = 1e3,
  14743. a(e),
  14744. s()
  14745. }
  14746. function o() {
  14747. return document.getElementById("player")
  14748. }
  14749. function a(e) {
  14750. e.addEventListener("dragenter", T, !1),
  14751. e.addEventListener("dragover", T, !1)
  14752. }
  14753. function s() {
  14754. F.valueFromHash("title", !0) || $(document).ready(function() {
  14755. var e = $(".model-title");
  14756. e.hide()
  14757. })
  14758. }
  14759. function l() {
  14760. return F.valueFromHash("play", !1) ? "autoplay" : F.inIframe() ? "click" : "fullpage"
  14761. }
  14762. function c() {
  14763. return {
  14764. panoElementsToLoad: 6,
  14765. modelElementsToLoad: 0,
  14766. totalElementsLoaded: 0,
  14767. totalElementsToLoad: 0,
  14768. totalPercentageLoaded: 0,
  14769. progressCallback: null
  14770. }
  14771. }
  14772. function h(e) {
  14773. return K.loadFeatureFlags(e).done(function(e) {
  14774. K.updateDependentSettings(e, V)
  14775. })
  14776. }
  14777. // function u(e) {
  14778. // return Q.get(e.urlBase + "/api/v1/config/showcase", {
  14779. // responseType: "json",
  14780. // prefetchFrom: "config"
  14781. // }).then(function(e) {
  14782. // return e ? void j.extendObject(V.appConfig, e) : {}
  14783. // }, function(e) {
  14784. // return de.warn("Failed loading runtime config, using defaults."),
  14785. // $.when({})
  14786. // })
  14787. // }
  14788. function d(e, t) {
  14789. var i = B.getModel({
  14790. url: t,
  14791. floors: F.valueFromHash("f", !0),
  14792. autoload: !1
  14793. })
  14794. ;
  14795. return $.when(i, n).then(null, function(e) {
  14796. return this
  14797. })
  14798. }
  14799. function p(e, t, i, n, r) {
  14800. de.info("Model data loaded"),
  14801. de.debug("UUID: " + e.data.job.uuid),
  14802. J.init(K.getFlags()),
  14803. i && H.initKeen({
  14804. token: i,
  14805. appId: n
  14806. }),
  14807. H.initSegment({
  14808. model: e.sid,
  14809. version: "2.25.6-0-gd87e5b1",
  14810. startSource: r.startSource,
  14811. token: t,
  14812. autoplay: r.autoplay,
  14813. quickstart: r.quickstart
  14814. })
  14815. }
  14816. function f(e, t, i, n, r) {
  14817. return r.progressCallback = t,
  14818. H.sessionStart(),
  14819. e.load(n).progress(g.bind(this, r))
  14820. }
  14821. function g(e, t) {
  14822. e.modelElementsToLoad = t[1],
  14823. v(e),
  14824. m(e)
  14825. }
  14826. function m(e) {
  14827. e.totalElementsLoaded++,
  14828. e.totalPercentageLoaded = e.totalElementsLoaded / e.totalElementsToLoad,
  14829. //----许钟文-----------------模型进度条向后调整
  14830. isNaN(e.totalPercentageLoaded) && (e.totalPercentageLoaded = 0);
  14831. e.totalPercentageLoaded = modelProgressBase + (1-modelProgressBase)*e.totalPercentageLoaded;
  14832. //console.log('pro:'+e.totalPercentageLoaded)
  14833. //---------------------------
  14834. e.progressCallback && e.progressCallback(100 * e.totalPercentageLoaded)
  14835. }
  14836. function v(e) {
  14837. e.totalElementsToLoad = e.modelElementsToLoad + e.panoElementsToLoad
  14838. }
  14839. function A(e) {
  14840. var t = new x.PerspectiveCamera;
  14841. t.layers.enable(he.PANOMARKERS),
  14842. t.layers.enable(he.RETICULE),
  14843. t.layers.enable(he.TAG);
  14844. var i = new x.Scene
  14845. , n = new x.AmbientLight(16777215);
  14846. i.add(n),
  14847. i.plane = new x.Mesh(new x.PlaneBufferGeometry(1e5,1e5),new x.RawShaderMaterial({
  14848. side: x.DoubleSide
  14849. })),
  14850. i.plane.position.y = 0,
  14851. i.plane.rotateX(-Math.PI / 2),
  14852. i.plane.material.visible = !1,
  14853. i.add(i.plane),
  14854. i.updateMatrixWorld(),
  14855. V.showScreenshotLocations && e.data.images.forEach(function(e) {
  14856. if (e.metadata && e.metadata.camera_position) {
  14857. var t = e.metadata.camera_position
  14858. , n = new x.Mesh(new x.BoxGeometry(.3,.3,.3));
  14859. n.position = t.clone(),
  14860. i.add(n);
  14861. var r = e.metadata.camera_quaternion
  14862. , o = new x.Vector3(0,0,-1).applyQuaternion(r);
  14863. i.add(new x.ArrowHelper(o,t.clone(),1,16711680))
  14864. }
  14865. }),
  14866. V.showAxis && (i.add(new x.ArrowHelper(new x.Vector3(0,1,0),new x.Vector3(0,0,0),1,255)),
  14867. i.add(new x.ArrowHelper(new x.Vector3(0,0,1),new x.Vector3(0,0,0),1,16711680)),
  14868. i.add(new x.ArrowHelper(new x.Vector3(1,0,0),new x.Vector3(0,0,0),1,65280)));
  14869. //背景
  14870. if(!settings.transparentBg && !settings.bgImg){
  14871. i.skybox = new W
  14872. i.add(i.skybox)
  14873. }
  14874. var r = new te(i,t,z);
  14875. return r
  14876. }
  14877. function y(e, t) {
  14878. var i = e ? 1 : 1e3
  14879. , n = J.tilegen || J.imgopt ? 6 : 2;
  14880. n = F.valueFromHash("tileconc", n);
  14881. var r = new ne
  14882. , o = new ae({
  14883. concurrentDownloads: n
  14884. })
  14885. , a = new se
  14886. , s = new P
  14887. , l = new M
  14888. , c = new S(t)
  14889. , h = new R
  14890. , u = new O(i)
  14891. , d = new L
  14892. , p = new oe;
  14893. return {
  14894. qualityManager: r,
  14895. panoRenderer: a,
  14896. tileDownloader: o,
  14897. player: c,
  14898. director: l,
  14899. modelManager: s,
  14900. tagManager: p,
  14901. displayController: u,
  14902. labelDisplayController: d,
  14903. controls: h
  14904. }
  14905. }
  14906. function C(e, t, i, n) {
  14907. var r = i.controls
  14908. , o = i.qualityManager
  14909. , a = i.panoRenderer
  14910. , s = i.tileDownloader
  14911. , l = i.modelManager;
  14912. r.init(n, l),
  14913. ee.init(i.director, r, i.player, l, t),
  14914. o.init(l),
  14915. s.init(o),
  14916. a.init(t, s, o),
  14917. l.init(s, a, o),
  14918. l.addModel(e),
  14919. t.addComponent(G)
  14920. }
  14921. function I(e, t, i, n) {
  14922. var r = i.qualityManager
  14923. , o = i.panoRenderer
  14924. , a = i.tileDownloader
  14925. , s = i.modelManager
  14926. , l = i.player
  14927. , c = i.director
  14928. , h = i.tagManager
  14929. , u = i.displayController
  14930. , d = i.labelDisplayController
  14931. , p = i.controls;
  14932. t.scene.add(e),
  14933. t.qualityManager = r;
  14934. var f = {
  14935. camera: t.camera,
  14936. director: c,
  14937. modelManager: s,
  14938. tileDownloader: a,
  14939. panoRenderer: o,
  14940. qualityManager: r,
  14941. tagManager: h,
  14942. container: n,
  14943. controls: p
  14944. };
  14945. l.init(f),
  14946. l.setScene(t.scene),
  14947. h.init(s, l),
  14948. c.init(l, s),
  14949. u.init(c, l, s, h, n),
  14950. d.init(l, s, n),
  14951. z.bindEvents(l),
  14952. t.addComponent(h),
  14953. t.addComponent(l),
  14954. t.addComponent(o),
  14955. l.sceneRenderer = t; //xzw add 方便resize
  14956. }
  14957. function E(e, t, i, n) {
  14958. return de.info("Starting player in " + i.mode),
  14959. H.report(t.sid, "started-playing", n, i.quickstart),
  14960. e.start(i)
  14961. }
  14962. function b(e, t) {
  14963. de.error(t),
  14964. k.error(t),
  14965. H.report(e, "error-" + t)
  14966. }
  14967. function w(e) {
  14968. var t = F.details();
  14969. t && "Safari" === t.name && t.version > 500 && t.version < 600 ? (k.error("webgl-safari"),
  14970. H.report(e, "error-webgl-safari")) : (k.error("webgl-generic"),
  14971. H.report(e, "error-webgl-generic"))
  14972. }
  14973. function _(e, t, i) {
  14974. try {
  14975. e.start(t)
  14976. } catch (e) {
  14977. throw de.warn(e.message),
  14978. w(i.sid),
  14979. e
  14980. }
  14981. }
  14982. function T(e) {
  14983. e.stopPropagation(),
  14984. e.preventDefault()
  14985. }
  14986. //czj 判断someData 有没有hoticon字段 修改热点的样式
  14987. if (window.DATA.hoticon){
  14988. g_HotImage = {
  14989. point: window.DATA.hoticon.default || "https://super.4dage.com/images/4dagePoint2.png",
  14990. point2: window.DATA.hoticon.higt || "https://super.4dage.com/images/4dagePoint.png"
  14991. } ;
  14992. }
  14993. //czj 判断someData 有没有backgroundMusic 添加音乐
  14994. if (window.DATA.backgroundMusic && window.isLocal) {
  14995. window.DATA.backgroundMusic = manage.dealURL(window.DATA.backgroundMusic)
  14996. }else if (g_version === "one"){
  14997. window.DATA.backgroundMusic = manage.dealURL( g_Prefix+"/audio/"+"audio"+window.number + "/background.mp3")
  14998. }
  14999. if (window.DATA.backgroundMusic) {
  15000. SoundManager.setSrc('bgm', window.DATA.backgroundMusic )
  15001. $("#volume").show();
  15002. }
  15003. //隐藏公司logo
  15004. if(window.DATA.loadlogo){
  15005. showLogo();
  15006. }
  15007. // 隐藏顶部介绍
  15008. window.DATA.topText && topTextHide();
  15009. e("./lib/three75-shim"),
  15010. e("./lib/array-polyfill"),
  15011. e("./lib/performance-polyfill"),
  15012. e("./lib/shaders/CopyShader.js"),
  15013. e("./lib/shaders/HorizontalBlurShader.js"),
  15014. e("./lib/shaders/VerticalBlurShader.js"),
  15015. e("./lib/postprocessing/EffectComposer.js"),
  15016. e("./lib/postprocessing/RenderPass.js"),
  15017. e("./lib/postprocessing/MaskPass.js"),
  15018. e("./lib/postprocessing/ShaderPass.js"),
  15019. window.Promise || (window.Promise = e("promise-polyfill"));
  15020. var x = e("three")
  15021. , _x = e("three")
  15022. , S = (e("./util/sentry"),
  15023. e("./player"))
  15024. , M = e("./director")
  15025. , R = e("./controls/CameraControls")
  15026. , P = e("./model/ModelManager")
  15027. , O = e("./DisplayController")
  15028. , L = e("./label/LabelDisplayController")
  15029. , D = e("./enum/Viewmode")
  15030. , N = e("./util/logger")
  15031. , B = e("./showcase")
  15032. , F = e("./util/browser")
  15033. , V = e("./settings")
  15034. , U = e("./gui/gui")
  15035. , k = e("./gui/error")
  15036. , H = e("./analytics")
  15037. , G = e("./util/transitions")
  15038. , z = e("./effects")
  15039. , W = e("./objects/Skybox")
  15040. , j = e("./util/common")
  15041. , Y = (e("./util/PanoramaCollection"),
  15042. e("./util/math"),
  15043. e("./util/showcase"))
  15044. , X = e("./util/camera")
  15045. , Z = (e("./objects/Panorama"),
  15046. e("./cameras/PanoramaCamera"),
  15047. e("./preloaders"))
  15048. , q = e("events").EventEmitter
  15049. , K = e("./featureflags")
  15050. , Q = (e("./util/lerp"),
  15051. e("./util/ajax"))
  15052. , J = e("./ab")
  15053. , ee = e("./sdk/automation.js")
  15054. , te = e("./scene/SceneRenderer")
  15055. , ie = e("./scene/QuickstartManager")
  15056. , ne = e("./tile/QualityManager.js")
  15057. , re = e("./localization/localize")
  15058. , oe = e("./tag/tagManager")
  15059. , ae = e("./tile/TileDownloader")
  15060. , se = e("./tile/PanoRenderer")
  15061. , le = (e("./enum/PanoSizeClass"),
  15062. e("./enum/PanoramaEvents"),
  15063. e("./enum/SceneRendererEvents"))
  15064. , ce = e("./gui/memoryUsage")
  15065. , he = e("./enum/RenderLayers")
  15066. , ue = e("./TimingData")
  15067. , de = new N(t);
  15068. N.level = V.logLevel,
  15069. N.consoleEnabled = V.console,
  15070. i()
  15071. }
  15072. }
  15073. ).call(this, "/js/main.js")
  15074. }
  15075. , {
  15076. "./DisplayController": 1,
  15077. "./TimingData": 2,
  15078. "./ab": 3,
  15079. "./analytics": 4,
  15080. "./cameras/PanoramaCamera": 7,
  15081. "./controls/CameraControls": 9,
  15082. "./director": 15,
  15083. "./effects": 16,
  15084. "./enum/PanoSizeClass": 36,
  15085. "./enum/PanoramaEvents": 37,
  15086. "./enum/RenderLayers": 41,
  15087. "./enum/SceneRendererEvents": 43,
  15088. "./enum/Viewmode": 51,
  15089. "./featureflags": 59,
  15090. "./gui/error": 64,
  15091. "./gui/gui": 65,
  15092. "./gui/memoryUsage": 73,
  15093. "./label/LabelDisplayController": 91,
  15094. "./lib/array-polyfill": 92,
  15095. "./lib/performance-polyfill": 95,
  15096. "./lib/postprocessing/EffectComposer.js": 96,
  15097. "./lib/postprocessing/MaskPass.js": 97,
  15098. "./lib/postprocessing/RenderPass.js": 98,
  15099. "./lib/postprocessing/ShaderPass.js": 99,
  15100. "./lib/shaders/CopyShader.js": 100,
  15101. "./lib/shaders/HorizontalBlurShader.js": 101,
  15102. "./lib/shaders/VerticalBlurShader.js": 102,
  15103. "./lib/three75-shim": 103,
  15104. "./localization/localize": 108,
  15105. "./tag/tagManager": 124,
  15106. "./model/ModelManager": 140,
  15107. "./objects/Panorama": 148,
  15108. "./objects/Skybox": 152,
  15109. "./player": 155,
  15110. "./preloaders": 156,
  15111. "./scene/QuickstartManager": 157,
  15112. "./scene/SceneRenderer": 158,
  15113. "./sdk/automation.js": 164,
  15114. "./settings": 166,
  15115. "./showcase": 168,
  15116. "./tile/PanoRenderer": 169,
  15117. "./tile/QualityManager.js": 170,
  15118. "./tile/TileDownloader": 171,
  15119. "./util/PanoramaCollection": 178,
  15120. "./util/ajax": 181,
  15121. "./util/browser": 182,
  15122. "./util/camera": 183,
  15123. "./util/common": 185,
  15124. "./util/lerp": 188,
  15125. "./util/logger": 189,
  15126. "./util/math": 190,
  15127. "./util/sentry": 192,
  15128. "./util/showcase": 193,
  15129. "./util/transitions": 195,
  15130. events: 202,
  15131. "promise-polyfill": 213,
  15132. three: 217
  15133. }],
  15134. 117: [function(e, t, i) {
  15135. "use strict";
  15136. function n(e) {
  15137. e = e || {}
  15138. r.RawShaderMaterial.call(this, a.extendObject({
  15139. fragmentShader: o.cube.fragmentShader,
  15140. vertexShader: o.cube.vertexShader,
  15141. uniforms: r.UniformsUtils.clone(o.cube.uniforms),
  15142. name: "CubemapMaterial",
  15143. }, e))
  15144. }
  15145. var r = e("three")
  15146. , o = e("../shaders")
  15147. , a = e("../util/common");
  15148. n.prototype = Object.create(r.RawShaderMaterial.prototype),
  15149. n.prototype.constructor = n,
  15150. t.exports = n
  15151. }
  15152. , {
  15153. "../shaders": 167,
  15154. "../util/common": 185,
  15155. three: 217
  15156. }],
  15157. 118: [function(e, t, i) {
  15158. "use strict";
  15159. function n(e) {
  15160. e = e || {}
  15161. r.RawShaderMaterial.call(this, a.extendObject({
  15162. fragmentShader: o.model.fragmentShader,
  15163. vertexShader: o.model.vertexShader,
  15164. uniforms: r.UniformsUtils.clone(o.model.uniforms),
  15165. name: "ModelTextureMaterial",
  15166. }, e))
  15167. }
  15168. var r = e("three")
  15169. , o = e("../shaders")
  15170. , a = e("../util/common");
  15171. n.prototype = Object.create(r.RawShaderMaterial.prototype),
  15172. n.prototype.constructor = n,
  15173. n.prototype.setProjectedPanos = function(e, t, i) {
  15174. i && (this.uniforms.progress.value = 0),
  15175. e.ensureSkyboxReadyForRender(),
  15176. this.uniforms.pano0Map.value = e.getSkyboxTexture(),
  15177. this.uniforms.pano0Position.value.copy(e.position),
  15178. this.uniforms.pano0Matrix.value.copy(e.skyboxMesh.matrixWorld),
  15179. t.ensureSkyboxReadyForRender(),
  15180. this.uniforms.pano1Map.value = t.getSkyboxTexture(),
  15181. this.uniforms.pano1Position.value.copy(t.position),
  15182. this.uniforms.pano1Matrix.value.copy(t.skyboxMesh.matrixWorld)
  15183. }
  15184. /* n.prototype.setEyeDir = function(dir, pos) {//加
  15185. this.uniforms.eyeDir.value.copy(dir)
  15186. this.uniforms.eyePos.value.copy(pos)
  15187. }
  15188. n.prototype.setBendCameraQua = function(matrix) {//加
  15189. this.uniforms.cameraDeltaMatrix.value.copy(matrix)
  15190. } */
  15191. ,
  15192. t.exports = n
  15193. }
  15194. , {
  15195. "../shaders": 167,
  15196. "../util/common": 185,
  15197. three: 217
  15198. }],
  15199. 119: [function(e, t, i) {
  15200. (function(i) {
  15201. "use strict";
  15202. function n(e, t, i, n) {
  15203. this.div = null,
  15204. this.body = null,
  15205. this.label = e,
  15206. this.description = t,
  15207. this.parsedDescription = [],
  15208. this.media = i || {
  15209. type: null
  15210. },
  15211. this.loadingSpinner = null,
  15212. this.parser = new r({
  15213. supportLinks: !u.valueFromHash("mls"),
  15214. keepLinkLabels: !0
  15215. }),
  15216. this.state = I.CLOSED,
  15217. this.orientation = "",
  15218. this.initialTransform = "",
  15219. this.hovering = !1,
  15220. this.openTransition = null,
  15221. this.closeTransition = null,
  15222. this.openPromise = null,
  15223. this.closePromise = null,
  15224. this.animationTransition = null,
  15225. this.animationScale = 0
  15226. }
  15227. var r = e("../Parser/DescriptionParser")
  15228. , o = e("../Media/Link")
  15229. , a = e("../Media/Image")
  15230. , s = e("../Media/EmbedlyPlayer")
  15231. , l = e("../Media/EmbedlyEmbed")
  15232. , c = e("../../util/transitions")
  15233. , h = e("../../util/lerp")
  15234. , u = e("../../util/browser")
  15235. , d = e("./BillboardEvent")
  15236. , p = e("../Media/MediaEvent")
  15237. , f = e("../Parser/DescriptionChunkType")
  15238. , g = e("events").EventEmitter
  15239. , m = e("./billboardSettings")
  15240. , v = e("./overlaySettings")
  15241. , A = e("../../util/logger")
  15242. , y = new A(i)
  15243. , C = document.getElementById("tag-billboards");
  15244. C.addEventListener("touchend", function(e) {
  15245. C.style.pointerEvents = "none"
  15246. }),
  15247. C.addEventListener("touchcancel", function(e) {
  15248. C.style.pointerEvents = "none"
  15249. });
  15250. var I = {
  15251. CLOSED: "closed",
  15252. OPENING: "opening",
  15253. OPEN: "open",
  15254. CLOSING: "closing",
  15255. ACTIVE: "active"
  15256. };
  15257. n.prototype = Object.create(g.prototype),
  15258. n.prototype.build = function(e) {
  15259. this.parsedDescription = this.parser.parse(this.description);
  15260. var t = document.createElement("div");
  15261. t.className = "tag-container has-hotzone",
  15262. this.div = t,
  15263. this.body = document.createElement("div"),
  15264. this.body.className = "tag-body";
  15265. var i = document.createElement("div");
  15266. i.classList.add("tag-content");
  15267. var n = document.createElement("div");
  15268. n.classList.add("tag-text-content");
  15269. var r = document.createElement("div");
  15270. r.className = "tag-label",
  15271. r.textContent = this.label,
  15272. n.appendChild(r);
  15273. var o = document.createElement("div");
  15274. o.className = "tag-desc",
  15275. n.appendChild(o),
  15276. i.appendChild(n),
  15277. this.body.appendChild(i),
  15278. this.appendDescriptionElements(this.parsedDescription, o),
  15279. this.appendMedia(),
  15280. t.appendChild(this.body),
  15281. C.appendChild(t),
  15282. this.bindEvents(t, this.body)
  15283. }
  15284. ,
  15285. n.prototype.bindEvents = function(e, t) {
  15286. var i = function(e) {
  15287. return function(t) {
  15288. if (!this.div.classList.contains("overlay")) {
  15289. var i, n = document.getElementById("player");
  15290. try {
  15291. i = new MouseEvent(e,t)
  15292. } catch (n) {
  15293. i = document.createEvent("MouseEvents"),
  15294. 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)
  15295. }
  15296. n.dispatchEvent(i)
  15297. }
  15298. }
  15299. };
  15300. t.addEventListener("mousedown", function(e) {
  15301. e.stopPropagation()
  15302. }),
  15303. t.addEventListener("mouseup", function(e) {
  15304. e.stopPropagation()
  15305. }),
  15306. e.addEventListener("touchstart", function(e) {
  15307. C.style.pointerEvents = "auto"
  15308. }),
  15309. e.addEventListener("mousedown", i("mousedown").bind(this)),
  15310. e.addEventListener("mouseup", i("mouseup").bind(this)),
  15311. t.addEventListener("mouseover", function(t) {
  15312. this.state === I.OPEN && e.classList.remove("has-hotzone")
  15313. }
  15314. .bind(this)),
  15315. e.addEventListener("mouseenter", function(e) {
  15316. this.state !== I.CLOSING && (this.hovering = !0,
  15317. this.emit(d.ENTER))
  15318. }
  15319. .bind(this)),
  15320. e.addEventListener("mouseleave", function(e) {
  15321. this.hovering = !1,
  15322. this.emit(d.LEAVE)
  15323. }
  15324. .bind(this)),
  15325. e.addEventListener("gesturestart", function(e) {
  15326. e.preventDefault()
  15327. });
  15328. var n = e.querySelector(".tag-text-content")
  15329. , r = 0;
  15330. n.addEventListener("touchstart", function(e) {
  15331. r = e.changedTouches[0].clientY
  15332. }),
  15333. n.addEventListener("touchmove", function(t) {
  15334. function i(e) {
  15335. e && (0 === e.scrollTop && t.changedTouches[0].clientY > r || e.scrollTop + e.clientHeight - e.scrollHeight === 0 && t.changedTouches[0].clientY < r) && t.preventDefault()
  15336. }
  15337. return e.classList.contains("overlay") ? i(this.querySelector(".tag-desc")) : void i(this)
  15338. }),
  15339. e.addEventListener("touchmove", function(e) {
  15340. 0 === (n.compareDocumentPosition(e.target) & Node.DOCUMENT_POSITION_CONTAINED_BY) && e.preventDefault()
  15341. })
  15342. }
  15343. ,
  15344. n.prototype.appendDescriptionElements = function(e, t) {
  15345. e.length > 0 && this.div.classList.add("has-text"),
  15346. e.forEach(function(e, i) {
  15347. switch (e.type) {
  15348. case f.TEXT:
  15349. t.appendChild(this.createTextElement(e.text));
  15350. break;
  15351. case f.LINK:
  15352. t.appendChild(this.createLinkElement(e.link))
  15353. }
  15354. }
  15355. .bind(this))
  15356. }
  15357. ,
  15358. n.prototype.appendLoadingSpinner = function() {
  15359. this.loadingSpinner = document.createElement("div"),
  15360. this.loadingSpinner.classList.add("loading-spinner");
  15361. var e = document.createElement("div");
  15362. e.classList.add("gui-spinner-icon"),
  15363. this.loadingSpinner.appendChild(e),
  15364. this.body.appendChild(this.loadingSpinner)
  15365. }
  15366. ,
  15367. n.prototype.onMediaLoadFinished = function() {
  15368. this.loadingSpinner && (this.loadingSpinner.parentNode.removeChild(this.loadingSpinner),
  15369. this.applyOrientation(this.orientation),
  15370. this.loadingSpinner = null)
  15371. }
  15372. ,
  15373. n.prototype.appendMedia = function() {
  15374. if (this.media && this.media.type && "error" !== this.media.type && (!u.valueFromHash("mls", 0) || this.media.type === f.IMAGE)) {
  15375. this.appendLoadingSpinner();
  15376. var e = document.createElement("div");
  15377. e.classList.add("tag-media-content");
  15378. var t = document.createElement("i");
  15379. switch (["icon", "icon-close-thin", "close"].forEach(function(e) {
  15380. t.classList.add(e)
  15381. }),
  15382. this.body.appendChild(t),
  15383. this.body.appendChild(e),
  15384. this.media.type) {
  15385. case f.IMAGE:
  15386. e.appendChild(this.createImageElement(this.media, this.body));
  15387. break;
  15388. case f.VIDEO:
  15389. e.appendChild(this.createVideoElement(this.media, this.body));
  15390. break;
  15391. case f.RICH:
  15392. e.appendChild(this.createEmbedElement(this.media, this.body))
  15393. }
  15394. }
  15395. }
  15396. ,
  15397. n.prototype.createTextElement = function(e) {
  15398. var t = document.createElement("span");
  15399. return t.textContent = e,
  15400. t
  15401. }
  15402. ;
  15403. n.prototype.createLinkElement = function(e) {
  15404. var t = new o(e);
  15405. return t.on(p.LINK_CLICK, this.emit.bind(this, p.LINK_CLICK)),
  15406. t.createDomElement()
  15407. }
  15408. ,
  15409. n.prototype.createImageElement = function(e, t) {
  15410. function i() {
  15411. function e() {
  15412. m || (r.classList.remove("view-image"),
  15413. c.classList.add("overlay"),
  15414. i(),
  15415. window.addEventListener("resize", b),
  15416. c.addEventListener("click", a),
  15417. g.addEventListener("click", l),
  15418. f.addEventListener("click", s),
  15419. m = !0,
  15420. o.emit(p.IMAGE_OPENED))
  15421. }
  15422. function i() {
  15423. t.classList.add("show-info"),
  15424. h.classList.remove("collapsible"),
  15425. h.style.height = "";
  15426. var e = parseFloat(getComputedStyle(I).lineHeight)
  15427. , i = y + e
  15428. , r = c.clientWidth - 2 * v.boundaryWidth - C
  15429. , a = c.clientHeight - 2 * v.boundaryHeight - C - i
  15430. , s = a
  15431. , l = s * n.aspect;
  15432. l > r && (l = r,
  15433. s = l / n.aspect),
  15434. s > a && (s = a,
  15435. l = s * n.aspect),
  15436. l += C,
  15437. s += C + i,
  15438. t.style.width = l + "px",
  15439. t.style.height = s + "px",
  15440. u.style.paddingTop = e + C + "px",
  15441. o.description.length > 0 && (h.classList.add("collapsible"),
  15442. h.style.height = h.clientHeight + 12 + "px",
  15443. E.style.height = "calc(100% - " + I.clientHeight + "px)")
  15444. }
  15445. function a(e) {
  15446. e.target === c && s()
  15447. }
  15448. function s() {
  15449. m && (m = !1,
  15450. r.classList.add("view-image"),
  15451. c.classList.remove("overlay"),
  15452. h.style.height = "",
  15453. u.style.paddingTop = "",
  15454. t.style.width = "",
  15455. t.style.height = "",
  15456. window.removeEventListener("resize", b),
  15457. c.removeEventListener("click", a),
  15458. g.removeEventListener("click", l),
  15459. f.removeEventListener("click", s),
  15460. o.emit(p.IMAGE_CLOSED),
  15461. o.close(!0))
  15462. }
  15463. function l(e) {
  15464. t.classList.toggle("show-info")
  15465. }
  15466. var c = o.div
  15467. , h = c.getElementsByClassName("tag-content")[0]
  15468. , u = c.getElementsByClassName("tag-media-content")[0]
  15469. , f = t.getElementsByClassName("close")[0]
  15470. , g = h.getElementsByClassName("tag-label")[0];
  15471. c.classList.add("has-image"),
  15472. r.classList.add("view-image"),
  15473. c.classList.add(n.aspect >= 1 ? "image-landscape" : "image-portrait"),
  15474. o.applyOrientation(o.orientation);
  15475. var m = !1
  15476. , A = getComputedStyle(h)
  15477. , y = parseFloat(A.paddingTop) + parseFloat(A.paddingBottom)
  15478. , C = 2 * parseFloat(getComputedStyle(u).paddingLeft)
  15479. , I = h.querySelector(".tag-label")
  15480. , E = h.querySelector(".tag-desc")
  15481. , b = function() {
  15482. var e, t, n = 0;
  15483. return function() {
  15484. clearInterval(e),
  15485. clearTimeout(t),
  15486. e = setInterval(function() {
  15487. var e = c.clientHeight;
  15488. n !== e && (i(),
  15489. n = e)
  15490. }, 100),
  15491. t = setTimeout(clearInterval.bind(this, e), 1e3)
  15492. }
  15493. }();
  15494. n.on(p.IMAGE_OPENING, e),
  15495. o.on(d.ACTIVATE, e),
  15496. o.on(p.IMAGE_CLOSED, n.onClosed.bind(n)),
  15497. o.on(d.CLOSING, s)
  15498. }
  15499. var n = new a
  15500. , r = n.createDomElement();
  15501. this.once(d.OPENED, function() {
  15502. n.load(e.src).then(i).catch(function(t) {
  15503. y.warn("Failed to load image:", e.src),
  15504. y.warn("with error:", t)
  15505. }).then(this.onMediaLoadFinished.bind(this))
  15506. });
  15507. var o = this;
  15508. return r
  15509. }
  15510. ,
  15511. n.prototype.createVideoElement = function(e, t) {
  15512. var i = new s({
  15513. autoPlay: !0,
  15514. autoResume: !0,
  15515. startMuted: !1,
  15516. loop: !1
  15517. })
  15518. , n = i.createDomElement();
  15519. return this.once(d.OPENED, function() {
  15520. i.load(e.src).then(function() {
  15521. this.div.classList.add("has-video"),
  15522. this.state !== I.OPEN && this.state !== I.ACTIVE || (i.show(),
  15523. i.play()),
  15524. this.on(d.OPENING, i.show.bind(i)),
  15525. this.on(d.OPENED, i.play.bind(i)),
  15526. this.on(d.CLOSING, i.pause.bind(i)),
  15527. this.on(d.CLOSED, i.hide.bind(i))
  15528. }
  15529. .bind(this)).catch(function(t) {
  15530. y.warn("Failed to embed video:", e.src),
  15531. y.warn("with error:", t)
  15532. }).then(this.onMediaLoadFinished.bind(this))
  15533. }
  15534. .bind(this)),
  15535. n
  15536. }
  15537. ,
  15538. n.prototype.createEmbedElement = function(e, t) {
  15539. var i = new l
  15540. , n = i.createDomElement();
  15541. return this.once(d.OPENED, function() {
  15542. i.load(e.src).then(function() {
  15543. this.div.classList.add("has-embed"),
  15544. this.state !== I.OPEN && this.state !== I.ACTIVE || i.show(),
  15545. this.applyOrientation(this.orientation),
  15546. this.on(d.OPENING, i.show.bind(i)),
  15547. this.on(d.CLOSED, i.hide.bind(i))
  15548. }
  15549. .bind(this)).catch(function(t) {
  15550. y.warn("Failed to embed:", e.src),
  15551. y.warn("with error:", t)
  15552. }).then(this.onMediaLoadFinished.bind(this))
  15553. }
  15554. .bind(this)),
  15555. n
  15556. }
  15557. ,
  15558. n.prototype.open = function(e) {
  15559. return this.openPromise = $.Deferred(),
  15560. this.state === I.ACTIVE ? this.openPromise.resolve().promise() : (this.hovering || this.div.classList.add("has-hotzone"),
  15561. this.openTransition ? e && this.setActiveState() : this.openTransition = c.setTimeout(function() {
  15562. this.state !== I.OPEN && (this.emit(d.OPENING),
  15563. e && this.emit(d.ACTIVATING),
  15564. this.state = I.OPENING,
  15565. this.animateOpen(function() {
  15566. e && this.setActiveState(),
  15567. this.openPromise.resolve()
  15568. }
  15569. .bind(this)))
  15570. }
  15571. .bind(this), m.animation.openDelay),
  15572. c.cancel(this.closeTransition),
  15573. this.closePromise && this.closePromise.reject(),
  15574. this.closeTransition = void 0,
  15575. this.openPromise.promise())
  15576. }
  15577. ,
  15578. n.prototype.close = function(e) {
  15579. return this.closePromise = $.Deferred(),
  15580. !e && this.hovering ? this.closePromise.reject().promise() : (this.closeTransition || (this.closeTransition = c.setTimeout(function() {
  15581. this.state !== I.CLOSED && (this.emit(d.CLOSING),
  15582. this.state = I.CLOSING,
  15583. this.animateClose())
  15584. }
  15585. .bind(this), m.animation.closeDelay)),
  15586. c.cancel(this.openTransition),
  15587. this.openPromise && this.openPromise.reject(),
  15588. this.openTransition = void 0,
  15589. this.closePromise.resolve(),
  15590. this.closePromise.promise())
  15591. }
  15592. ,
  15593. n.prototype.setActiveState = function() {
  15594. this.state !== I.CLOSED && (this.state = I.ACTIVE,
  15595. this.emit(d.ACTIVATE),
  15596. this.div.classList.remove("has-hotzone"))
  15597. }
  15598. ,
  15599. n.prototype.animateOpen = function(e) {
  15600. if (this.state === I.OPENING) {
  15601. if (c.cancel(this.animationTransition),
  15602. u.detectSamsungNative())
  15603. return this.boardOrientation = null,
  15604. this.div.style.visibility = "visible",
  15605. this.emit(d.OPENED),
  15606. this.state = I.OPEN,
  15607. void (e && e());
  15608. this.div.style.webkitTransform = "scale(0)",
  15609. this.div.style.transform = "scale(0)",
  15610. this.div.style.visibility = "visible",
  15611. this.animationTransition = c.start(h.property(this, "animationScale", 1), m.animation.openDuration, function() {
  15612. this.emit(d.OPENED),
  15613. this.state = I.OPEN,
  15614. e && e()
  15615. }
  15616. .bind(this))
  15617. }
  15618. }
  15619. ,
  15620. n.prototype.animateClose = function(e) {
  15621. this.state === I.CLOSING && (c.cancel(this.animationTransition),
  15622. this.animationTransition = c.start(h.property(this, "animationScale", 0), m.animation.closeDuration, function() {
  15623. this.emit(d.CLOSED),
  15624. this.state = I.CLOSED,
  15625. this.div.style.visibility = "hidden",
  15626. this.div.classList.contains("has-hotzone") || this.div.classList.add("has-hotzone"),
  15627. e && e()
  15628. }
  15629. .bind(this)))
  15630. }
  15631. ,
  15632. n.prototype.needsUpdate = function() {
  15633. return this.state !== I.CLOSED
  15634. }
  15635. ,
  15636. n.prototype.update = function(e, t) {
  15637. if (this.needsUpdate()) {
  15638. var i = (this.updateOrientation(e),
  15639. this.calcScale(t))
  15640. , n = {
  15641. x: (e.x + 1) * $("#player").width() / 2,
  15642. y: (e.y + 1) * $("#player").height() / 2
  15643. };
  15644. this.div.screenTransform = this.initialTransform + " translate(" + n.x + "px, " + n.y + "px) scale(" + i * this.animationScale + ")",
  15645. this.div.style.webkitTransform = this.div.screenTransform,
  15646. this.div.style.transform = this.div.screenTransform
  15647. }
  15648. }
  15649. ,
  15650. n.prototype.getDimensions = function() {
  15651. return this.div.getBoundingClientRect()
  15652. }
  15653. ,
  15654. n.prototype.calcScale = function(e) {
  15655. return Math.sqrt(e / 40) * m.boardToDiscRatio
  15656. }
  15657. ,
  15658. n.prototype.updateOrientation = function(e) {
  15659. if (this.state !== I.ACTIVE) {
  15660. var t = 1 / 3
  15661. , i = e.y < -t ? 0 : e.y < t ? 1 : 2
  15662. , n = e.x < -t ? 0 : e.x < t ? 1 : 2
  15663. , r = "";
  15664. r += 0 === n ? "right" : 2 === n ? "left" : "",
  15665. r += 0 === i ? "-down" : 2 === i ? "-up" : "",
  15666. 1 === n && (r = 0 === i ? "bottom" : 2 === i ? "top" : "",
  15667. 1 === i && (r = $("#player").width() > $("#player").height() ? e.x < 0 ? "right" : "left" : e.y < 0 ? "bottom" : "top")),
  15668. 1 === n && 1 === i && r === this.orientation || this.applyOrientation(r)
  15669. }
  15670. }
  15671. ,
  15672. n.prototype.applyOrientation = function(e) {
  15673. this.div.style.transform = this.div.style.webkitTransform = "",
  15674. this.div.classList.remove("tag-container-" + this.orientation),
  15675. this.div.classList.add("tag-container-" + e);
  15676. var t = window.getComputedStyle(this.div);
  15677. this.initialTransform = t.transform || t.webkitTransform,
  15678. "none" === this.initialTransform && (this.initialTransform = "");
  15679. var i = t.transform.slice(7, -1).split(",")
  15680. , n = -i[4]
  15681. , r = -i[5];
  15682. this.div.style.webkitTransformOrigin = n + "px " + r + "px",
  15683. this.div.style.transformOrigin = n + "px " + r + "px",
  15684. this.orientation = e
  15685. }
  15686. ,
  15687. t.exports = n
  15688. }
  15689. ).call(this, "/js/tag/Billboard/Billboard.js")
  15690. }
  15691. , {
  15692. "../../util/browser": 182,
  15693. "../../util/lerp": 188,
  15694. "../../util/logger": 189,
  15695. "../../util/transitions": 195,
  15696. "../Media/EmbedlyEmbed": 125,
  15697. "../Media/EmbedlyPlayer": 126,
  15698. "../Media/Image": 128,
  15699. "../Media/Link": 129,
  15700. "../Media/MediaEvent": 131,
  15701. "../Parser/DescriptionChunkType": 133,
  15702. "../Parser/DescriptionParser": 134,
  15703. "./BillboardEvent": 120,
  15704. "./billboardSettings": 121,
  15705. "./overlaySettings": 122,
  15706. events: 202
  15707. }],
  15708. 120: [function(e, t, i) {
  15709. "use strict";
  15710. t.exports = Object.freeze({
  15711. ENTER: "billboard.enter",
  15712. LEAVE: "billboard.leave",
  15713. OPENING: "billboard.opening",
  15714. OPENED: "billboard.open",
  15715. CLOSING: "billboard.closing",
  15716. CLOSED: "billboard.closed",
  15717. ACTIVATING: "billboard.activating",
  15718. ACTIVATE: "billboard.activate"
  15719. })
  15720. }
  15721. , {}],
  15722. 121: [function(e, t, i) {
  15723. "use strict";
  15724. t.exports = Object.freeze({
  15725. animation: Object.freeze({
  15726. hoverOnClosing: !1,
  15727. openDelay: 100,
  15728. closeDelay: 50,
  15729. openDuration: 200,
  15730. closeDuration: 100
  15731. }),
  15732. boardToDiscRatio: 1.2
  15733. })
  15734. }
  15735. , {}],
  15736. 122: [function(e, t, i) {
  15737. "use strict";
  15738. t.exports = Object.freeze({
  15739. boundaryWidth: 30,
  15740. boundaryHeight: 0
  15741. })
  15742. }
  15743. , {}],
  15744. 123: [function(e, t, i) {//tag
  15745. (function(i) {
  15746. "use strict";
  15747. function n(e, t, i) {
  15748. var n = i.version || "0";
  15749. "0" !== n && I.info("tag defined using version " + n),
  15750. this.model = e,
  15751. this.sid = t,
  15752. this.color = (new r.Color).set(i.color || l.tagDefault),
  15753. this.hoverColor = l._darken(this.color, .2),
  15754. this.floor = null,
  15755. this.floorIndex = i.floor,
  15756. this.mode = s.PANORAMA,
  15757. i.preferred_camera && i.preferred_camera.mode && (this.mode = i.preferred_camera.mode),
  15758. this.obj3d = null,
  15759. this.disc = null,
  15760. this.materials = {
  15761. disc: null,
  15762. pole: null
  15763. },
  15764. this.position = (new r.Vector3).copy(i.position),
  15765. this.discPosition = (new r.Vector3).copy(i.stem.direction),
  15766. this.discWorldPosition = null,
  15767. this.discScale = .05,
  15768. this.poleEnabled = i.stem.enabled,
  15769. this.billboard = new o(i.label,i.description,i.media,this),
  15770. this.visibleTransition = null,
  15771. this.hoveringDisc = !1
  15772. }
  15773. var r = e("three")
  15774. , o = e("./Billboard/Billboard")
  15775. , a = e("../settings")
  15776. , s = e("../enum/Viewmode")
  15777. , l = e("../enum/Colors")
  15778. , c = e("../enum/RenderLayers")
  15779. , h = e("../enum/RenderOrder")
  15780. , u = (e("../util/common"),
  15781. e("../util/math"))
  15782. , d = e("../util/texture")
  15783. , p = e("../objects/Panorama")
  15784. , f = e("../shaders")
  15785. , g = e("../util/transitions")
  15786. , m = e("../util/lerp")
  15787. , v = e("../util/easing")
  15788. , A = e("./Billboard/BillboardEvent")
  15789. , y = e("events").EventEmitter
  15790. , C = e("../util/logger")
  15791. , I = new C(i)
  15792. , 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==")
  15793. , 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")
  15794. , w = new r.PlaneBufferGeometry(1,1);
  15795. n.prototype = Object.create(y.prototype),
  15796. n.raycaster = new r.Raycaster,
  15797. n.prototype.bindEvents = function() {
  15798. this.billboard.on(A.ENTER, this.setHoverState.bind(this)),
  15799. this.billboard.on(A.LEAVE, this.setFreeState.bind(this))
  15800. }
  15801. ,
  15802. n.prototype.build = function() {
  15803. return this.floor = this.model.floors.get(this.floorIndex) || this.model.floors.first(),
  15804. this.floor && (this.billboard.build(this.model.sid),
  15805. this.obj3d = this.buildObject3D(),
  15806. this.floor.add(this.obj3d)),
  15807. this
  15808. }
  15809. ,
  15810. n.prototype.buildObject3D = function() {
  15811. var e = new r.Object3D;
  15812. e.position.copy(this.position);
  15813. var t = r.UniformsUtils.clone(f.tagDisc.uniforms);
  15814. t.bg.value = b,
  15815. t.mask.value = E,
  15816. t.color.value.copy(this.color),
  15817. this.materials.disc = new r.RawShaderMaterial({
  15818. transparent: !0,
  15819. vertexShader: f.tagDisc.vertexShader,
  15820. fragmentShader: f.tagDisc.fragmentShader,
  15821. uniforms: t
  15822. }),
  15823. this.disc = new r.Mesh(w,this.materials.disc),
  15824. this.disc.layers.set(c.TAG),
  15825. this.disc.position.copy(this.discPosition),
  15826. this.disc.renderOrder = h.tagDisc,
  15827. this.disc.tag = this;
  15828. var i = this.buildPole();
  15829. return i.layers.set(c.TAG),
  15830. i.renderOrder = h.tagStem,
  15831. e.add(i),
  15832. e.layers.set(c.TAG),
  15833. e.add(this.disc)
  15834. }
  15835. ,
  15836. n.prototype.buildPole = function() {
  15837. var e = new r.BufferGeometry
  15838. , t = new Float32Array(6);
  15839. return t[0] = t[1] = t[2] = 0,
  15840. t[3] = this.discPosition.x,
  15841. t[4] = this.discPosition.y,
  15842. t[5] = this.discPosition.z,
  15843. e.addAttribute("position", new r.BufferAttribute(t,3)),
  15844. this.materials.pole = new r.LineBasicMaterial({
  15845. linewidth: a.tags.pole.width,
  15846. color: a.tags.pole.color,
  15847. opacity: 0,
  15848. visible: this.poleEnabled,
  15849. transparent: !0,
  15850. depthWrite: !1
  15851. }),
  15852. new r.Line(e,this.materials.pole)
  15853. }
  15854. ,
  15855. n.prototype.setFreeState = function(e) {
  15856. !e && this.hoveringDisc || this.billboard.close(e).then(function() {
  15857. this.materials.disc.uniforms.color.value = this.color
  15858. }
  15859. .bind(this))
  15860. }
  15861. ,
  15862. n.prototype.setHoverState = function(e) {
  15863. this.billboard.open(e),
  15864. this.materials.disc.uniforms.color.value = this.hoverColor
  15865. }
  15866. ,
  15867. n.prototype.hide = function(e, t) {
  15868. var i = $.Deferred();
  15869. if (0 === this.materials.disc.uniforms.opacity.value && !g.isRunning(this.visibleTransition))
  15870. return i.resolve().promise();
  15871. e = e || 0,
  15872. t = t || 0,
  15873. g.cancel(this.visibleTransition);
  15874. var n = this.materials.disc.uniforms.opacity.value / a.tags.disc.opacity
  15875. , r = t + e
  15876. , o = t / r;
  15877. return this.visibleTransition = g.start(function(e) {
  15878. var t = m.property(e.materials.disc.uniforms.opacity, "value", 0)
  15879. , i = m.property(e.materials.pole, "opacity", 0);
  15880. return function(n) {
  15881. t(n),
  15882. e.materials.pole && i(n)
  15883. }
  15884. }(this), r * n, function() {
  15885. i.resolve()
  15886. }, o, v[a.warp.blendEasing]),
  15887. i.promise()
  15888. }
  15889. ,
  15890. n.prototype.show = function(e, t) {
  15891. var i = $.Deferred();
  15892. if (this.materials.disc.uniforms.opacity.value === a.tags.disc.opacity && !g.isRunning(this.visibleTransition))
  15893. return i.resolve().promise();
  15894. e = e || 0,
  15895. t = t || 0,
  15896. g.cancel(this.visibleTransition);
  15897. var n = (a.tags.disc.opacity - this.materials.disc.uniforms.opacity.value) / a.tags.disc.opacity
  15898. , r = t + e
  15899. , o = t / r;
  15900. return this.visibleTransition = g.start(function(e) {
  15901. var t = m.property(e.materials.disc.uniforms.opacity, "value", a.tags.disc.opacity)
  15902. , i = m.property(e.materials.pole, "opacity", a.tags.pole.opacity);
  15903. return function(n) {
  15904. t(n),
  15905. e.materials.pole && i(n)
  15906. }
  15907. }(this), r * n, function() {
  15908. i.resolve()
  15909. }, o, v[a.warp.blendEasing]),
  15910. i.promise()
  15911. }
  15912. ,
  15913. n.prototype.closestPanoTowardTag = function(e, t) {
  15914. var i = []
  15915. , o = []
  15916. , l = this.disc.getWorldPosition();
  15917. if (e === s.PANORAMA) {
  15918. var c = .5
  15919. , h = t.position.clone().sub(l).normalize();
  15920. i.push(p.filters.isPanoAligned()),
  15921. i.push(p.filters.isNeighbourPanoTo(t)),
  15922. i.push(p.filters.inPanoDirection(l, h, c)),
  15923. o.push(p.scoreFunctions.direction(l, h))
  15924. }
  15925. var u = new r.Vector3
  15926. , d = function(e) {
  15927. u.copy(l).sub(e.position);
  15928. var t = -r.Math.radToDeg(Math.atan(u.y / Math.sqrt(u.x * u.x + u.z * u.z)))
  15929. , i = a.tags.navigate.tiltTolerance;
  15930. return a.insideLookLimitDown - i < t && t < a.insideLookLimitUp + i
  15931. }
  15932. , f = function(e) {
  15933. return Math.abs(e.position.x - l.x) > a.tags.visibility.cameraClearance || Math.abs(e.position.z - l.z) > a.tags.visibility.cameraClearance
  15934. };
  15935. i.push(f, d),
  15936. o.push(p.scoreFunctions.distanceSquared(this, -2));
  15937. var g = this.model.panos.sortByScore(i, o);
  15938. if (a.tags.navigate.lineOfSight) {
  15939. for (var m = 0; m < g.length; m++) {
  15940. var v = g[m].item
  15941. , A = v.position.distanceTo(l);
  15942. if (!a.tags.visibility.anyDistance && A > a.tags.visibility.visibleDistance)
  15943. return null;
  15944. n.raycaster.set(v.position, l.clone().sub(v.position).normalize());
  15945. var y = n.raycaster.intersectObjects(this.model.colliders);
  15946. if (0 === y.length || y[0].distance > A)
  15947. return v
  15948. }
  15949. return null
  15950. }
  15951. return g.length > 0 && g[0].item
  15952. }
  15953. ,
  15954. n.prototype.examine = function(e) {
  15955. var t = e.mode
  15956. , i = a.tags.navigate.nearestPano && this.closestPanoTowardTag(t, e.currentPano) || e.currentPano
  15957. , n = this.disc.getWorldPosition();
  15958. this.billboard.setActiveState();
  15959. var o = function() {
  15960. var t = this.billboard.getDimensions()
  15961. , n = new r.Vector3;
  15962. u.convertScreenPositionToNDC(t.left + t.width / 2, t.top + t.height / 2, n),
  15963. n.unproject(e.camera),
  15964. e.flyToPano({
  15965. pano: i,
  15966. lookAtPoint: n
  15967. })
  15968. }
  15969. .bind(this);
  15970. if (t === s.PANORAMA)
  15971. if (i !== e.currentPano) {
  15972. var l = {
  15973. pano: i,
  15974. lookAtPoint: n,
  15975. duration: null,
  15976. maxDistanceOverride: null,
  15977. skipWarpingCheck: !1
  15978. };
  15979. e.flyToPano(l, o)
  15980. } else
  15981. setTimeout(function() {
  15982. this.billboard.open().then(function() {
  15983. o()
  15984. })
  15985. }
  15986. .bind(this), 0);
  15987. else {
  15988. var c = {
  15989. pano: i
  15990. };
  15991. if (n) {
  15992. var h = (new r.Matrix4).lookAt(i.position, n, new r.Vector3(0,1,0));
  15993. c.quaternion = (new r.Quaternion).setFromRotationMatrix(h)
  15994. }
  15995. c.callback = o,
  15996. c.duration = 1500,
  15997. c.mode = s.PANORAMA,
  15998. e.flyToNewMode(c)
  15999. }
  16000. }
  16001. ,
  16002. n.prototype.update = function(e, t) {
  16003. var i = new r.Vector3;
  16004. return function(e, t) {
  16005. this.discWorldPosition = this.disc.getWorldPosition(),
  16006. this.updateDisc(e, t),
  16007. this.billboard.needsUpdate() && (i.copy(this.discWorldPosition).project(t),
  16008. i.z < 1 && (i.y *= -1,
  16009. this.billboard.update(i, this.getDiscRadius(i, t))))
  16010. }
  16011. }(),
  16012. n.prototype.updateDisc = function(e, t) {
  16013. var i = new r.Vector3
  16014. , o = new r.Vector3
  16015. , l = new r.Vector3
  16016. , c = new r.Vector3
  16017. , h = new r.Vector3;
  16018. return function(e, t) {
  16019. var u = a.tags.visibility
  16020. , d = a.tags.disc.scale
  16021. , p = e === s.DOLLHOUSE || e === s.FLOORPLAN ? a.tags.visibility.visibleDistance : t.position.distanceTo(this.discWorldPosition);
  16022. 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)),
  16023. this.obj3d.visible) {
  16024. this.disc.quaternion.copy(t.quaternion);
  16025. var f = d.maxSize - (d.maxSize - d.minSize) * r.Math.smoothstep(p, d.nearBound, d.farBound);
  16026. i.copy(this.discWorldPosition).project(t),
  16027. o.set($("#player").width() / 2, $("#player").height() / 2, 1).multiply(i),
  16028. l.set(f / 2, 0, 0).add(o),
  16029. c.set(2 / $("#player").width(), 2 / $("#player").height(), 1).multiply(l),
  16030. h.copy(c).unproject(t);
  16031. var g = h.distanceTo(this.discWorldPosition)
  16032. , m = 1 + a.tags.disc.scale.responsiveness / 100 * (n.viewportScale() - 1);
  16033. this.discScale = g * m,
  16034. this.disc.scale.set(this.discScale, this.discScale, this.discScale)
  16035. }
  16036. }
  16037. }(),
  16038. n.prototype.getDiscRadius = function(e, t) {
  16039. var i = new r.Vector3;
  16040. return function(e, t) {
  16041. return i.set(-this.discScale / 2, 0, 0).applyQuaternion(t.quaternion).add(this.discWorldPosition).project(t),
  16042. Math.abs(e.x - i.x) * $("#player").width()
  16043. }
  16044. }(),
  16045. n.prototype.tagVisibleOnCurrentFloor = function(e) {
  16046. return !(e === s.DOLLHOUSE || e === s.FLOORPLAN) || this.model.allFloorsVisible || !this.floor.hidden
  16047. }
  16048. ,
  16049. n.prototype.offScreen = function(e, t) {
  16050. var i = e.getWorldPosition().project(t);
  16051. return !(-1 < i.x && i.x < 1 && -1 < i.y && i.y < 1)
  16052. }
  16053. ,
  16054. n.viewportScale = function() {
  16055. return n.viewportWidth === $("#player").width() && n.viewportHeight === $("#player").height() || (n.viewportWidth = $("#player").width(),
  16056. n.viewportHeight = $("#player").height(),
  16057. n.currentViewportScale = Math.sqrt(Math.min(n.viewportWidth, n.viewportHeight) / a.tags.disc.scale.baseViewportSize)),
  16058. n.currentViewportScale
  16059. }
  16060. ,
  16061. t.exports = n
  16062. }
  16063. ).call(this, "/js/tag/tag.js")
  16064. }
  16065. , {
  16066. "../enum/Colors": 19,
  16067. "../enum/RenderLayers": 41,
  16068. "../enum/RenderOrder": 42,
  16069. "../enum/Viewmode": 51,
  16070. "../objects/Panorama": 148,
  16071. "../settings": 166,
  16072. "../shaders": 167,
  16073. "../util/common": 185,
  16074. "../util/easing": 186,
  16075. "../util/lerp": 188,
  16076. "../util/logger": 189,
  16077. "../util/math": 190,
  16078. "../util/texture": 194,
  16079. "../util/transitions": 195,
  16080. "./Billboard/Billboard": 119,
  16081. "./Billboard/BillboardEvent": 120,
  16082. events: 202,
  16083. three: 217
  16084. }],
  16085. 124: [function(e, t, i) {
  16086. (function(i) {
  16087. "use strict";
  16088. function n() {
  16089. this.tagState = y.IDLE,
  16090. this.intersectTag = null,
  16091. this.hoveredTag = null,
  16092. this.activeTag = null,
  16093. this.tagDiscs = [],
  16094. this.raycaster = new r.Raycaster,
  16095. this.modelManager = null,
  16096. this.player = null,
  16097. this.totaltags = 0,
  16098. this.navigatingViaTag = !1,
  16099. this.enabled = !1
  16100. }
  16101. var r = e("three")
  16102. , o = e("../util/logger")
  16103. , a = e("../util/common")
  16104. , s = e("../controls/serializer")
  16105. , l = e("../objects/Snapshot")
  16106. , c = e("../settings")
  16107. , h = e("./Billboard/BillboardEvent")
  16108. , u = e("./Media/MediaEvent")
  16109. , d = e("./Media/LinkType")
  16110. , p = e("../enum/Viewmode")
  16111. , f = e("../enum/WarpStyle")
  16112. , g = e("../enum/BlackoutStyle")
  16113. , m = e("../enum/ModelManagerEvents")
  16114. , v = e("../enum/tagEvents")
  16115. , A = e("../enum/PlayerEvents")
  16116. , y = (e("../util/lerp"),
  16117. e("../enum/TagStates"))
  16118. , C = e("events").EventEmitter
  16119. , I = new o(i);
  16120. a.extend(n, C),
  16121. n.prototype.init = function(e, t) {
  16122. this.modelManager = e,
  16123. this.player = t,
  16124. this.updateModel(),
  16125. this.bindEvents()
  16126. }
  16127. ,
  16128. n.prototype.update = function(e) {
  16129. this.updateTags(this.player.mode, this.player.camera, this.player.currentPano, this.player.flying)
  16130. }
  16131. ,
  16132. n.prototype.updateTags = function(e, t, i, n) {
  16133. for (var r in this.model.tags)
  16134. this.model.tags[r].update(e, t, i, n)
  16135. }
  16136. ,
  16137. n.prototype.updateModel = function() {
  16138. this.model = this.modelManager.getActiveModel(),
  16139. this.gettagsFromModel(),
  16140. this.totaltags = Object.keys(this.model.tags).length
  16141. }
  16142. ,
  16143. n.prototype.gettagsFromModel = function() {
  16144. this.tagDiscs = [];
  16145. for (var e in this.model.tags) {
  16146. var t = this.model.tags[e].disc;
  16147. t && this.tagDiscs.push(t)
  16148. }
  16149. }
  16150. ,
  16151. n.prototype.bindEvents = function() {
  16152. function e() {
  16153. Object.keys(this.model.tags).forEach(function(e) {
  16154. var t = this.model.tags[e];
  16155. t.bindEvents(),
  16156. t.billboard.on(u.LINK_CLICK, function(e) {
  16157. e.type === d.NAVIGATION && this.navigateViaLink(e.url)
  16158. }
  16159. .bind(this)),
  16160. t.billboard.on(u.IMAGE_OPENED, function() {
  16161. this.tagState = y.EXAMINE,
  16162. this.emit(u.IMAGE_OPENED)
  16163. }
  16164. .bind(this)),
  16165. t.billboard.on(h.CLOSING, this.dismissExaminedTag.bind(this))
  16166. }
  16167. .bind(this))
  16168. }
  16169. this.modelManager.on(m.ActiveModelChanged, this.updateModel.bind(this)),
  16170. this.modelManager.on(m.ActiveModelChanged, e.bind(this)),
  16171. this.player.on(A.ModeChanging, this.onPlayerModeChanging.bind(this)),
  16172. this.player.on(A.PanoChosen, this.onPanoChange.bind(this)),
  16173. this.player.on(A.Ready, this.onPlayerReady.bind(this)),
  16174. this.player.on(A.FlyingEnded, this.onPlayerFlyingEnded.bind(this)),
  16175. this.player.on(A.WarpStarted, this.handleWarpStart.bind(this)),
  16176. this.player.on(A.WarpInterrupted, this.handleWarpInterruption.bind(this)),
  16177. e.call(this)
  16178. }
  16179. ,
  16180. n.prototype.navigateViaLink = function(e) {
  16181. var t = s.deserialize(e);
  16182. if (t)
  16183. if (t.mode === p.PANORAMA) {
  16184. try {
  16185. this.player.model.panos.get(t.panoId)
  16186. } catch (e) {
  16187. return void I.warn("Unable to find panorama location", t.panoId)
  16188. }
  16189. this.player.warpToPanoById(t.panoId, t.quaternion, null, null, f.BLACK)
  16190. } else {
  16191. var i = {
  16192. cameraMode: t.mode,
  16193. position: t.position,
  16194. quaternion: t.quaternion,
  16195. scanId: t.panoId,
  16196. orthoZoom: t.zoom,
  16197. floorVisibility: t.floorVisibility,
  16198. thumbUrl: null,
  16199. name: null
  16200. };
  16201. this.player.flyToNewMode({
  16202. mode: t.mode,
  16203. duration: c.warp.outsideTime,
  16204. warpDest: new l(i),
  16205. force: !0
  16206. })
  16207. }
  16208. }
  16209. ,
  16210. n.prototype.handleWarpStart = function(e, t, i, n) {
  16211. this.dismissExaminedTag(),
  16212. t === f.BLACK && (null !== n && void 0 !== n || (n = c.warp.teleportTime),
  16213. e && (i = g.END),
  16214. this.hideShowTagsForBlackoutStyle(i, n))
  16215. }
  16216. ,
  16217. n.prototype.handleWarpInterruption = function(e, t, i) {
  16218. null !== i && void 0 !== i || (i = c.warp.teleportTime),
  16219. this.hideShowTagsForBlackoutStyle(t, i)
  16220. }
  16221. ,
  16222. n.prototype.hideShowTagsForBlackoutStyle = function(e, t) {
  16223. var i = 0
  16224. , n = 0
  16225. , r = t / 2;
  16226. switch (null !== e && void 0 !== e || (e = g.MIDDLE),
  16227. e) {
  16228. case g.END:
  16229. this.hideAlltags(r);
  16230. break;
  16231. case g.BEGINNING:
  16232. this.hideAlltags().done(this.showAlltags.bind(this, r));
  16233. break;
  16234. case g.NONE:
  16235. break;
  16236. case g.MIDDLE:
  16237. i = r,
  16238. n = r,
  16239. this.hideAlltags(n),
  16240. setTimeout(function() {
  16241. this.showAlltags(i)
  16242. }
  16243. .bind(this), n);
  16244. break;
  16245. case g.FADEIN:
  16246. setTimeout(function() {
  16247. this.showAlltags(r)
  16248. }
  16249. .bind(this), r)
  16250. }
  16251. }
  16252. ,
  16253. n.prototype.onPlayerModeChanging = function(e, t) {
  16254. t !== p.PANORAMA && this.dismissExaminedTag(),
  16255. t === p.PANORAMA && player.currentPano && !player.currentPano.isAligned() && (t = p.OUTDOOR);
  16256. var i = t !== p.OUTDOOR;
  16257. i !== this.model.tagsShown && (i ? this.showAlltags(c.tags.startup.fadeInDuration) : this.hideAlltags(c.tags.startup.fadeInDuration))
  16258. }
  16259. ,
  16260. n.prototype.onPanoChange = function(e, t) {
  16261. var i = this.navigatingViaTag;
  16262. if (this.navigatingViaTag = !1,
  16263. !i) {
  16264. this.dismissExaminedTag();
  16265. var n = e && !e.isAligned() ? p.OUTDOOR : p.PANORAMA
  16266. , r = t && !t.isAligned() ? p.OUTDOOR : p.PANORAMA;
  16267. n !== r && (r === p.PANORAMA ? this.showAlltags(c.tags.startup.fadeInDuration, null, !0) : this.hideAlltags(c.tags.startup.fadeInDuration))
  16268. }
  16269. }
  16270. ,
  16271. n.prototype.onPlayerReady = function(e, t, i) {
  16272. this.startAlltags(e, t ? i : null)
  16273. }
  16274. ,
  16275. n.prototype.onPlayerFlyingEnded = function(e, t) {
  16276. this.updateClosestTags(e)
  16277. }
  16278. ,
  16279. n.prototype.dismissExaminedTag = function() {
  16280. this.activeTag && this.tagState === y.EXAMINE && this.dismissActiveTag(),
  16281. this.hoveredTag && (this.hoveredTag.setFreeState(!0),
  16282. this.hoveredTag = null)
  16283. }
  16284. ,
  16285. n.prototype.startAlltags = function(e, t) {
  16286. this.model.shouldShowtags = c.tags.enabled,
  16287. this.enabled = !0,
  16288. e || (this.showAlltags(c.tags.startup.fadeInDuration, c.tags.startup.fadeInDelay),
  16289. t && setTimeout(function() {
  16290. this.activateTag(this.model.getTagBySid(t))
  16291. }
  16292. .bind(this), c.tags.startup.fadeInDuration / 2))
  16293. }
  16294. ,
  16295. n.prototype.showAlltags = function(e, t, i) {
  16296. function n() {
  16297. o++,
  16298. o === this.totaltags && (this.model.tagsShown = !0,
  16299. r.resolve())
  16300. }
  16301. var r = $.Deferred();
  16302. if (!i && this.player.mode === p.PANORAMA && this.player.currentPano && !this.player.currentPano.isAligned() || !this.model.shouldShowtags)
  16303. return r.resolve().promise();
  16304. var o = 0;
  16305. for (var a in this.model.tags) {
  16306. var s = this.model.tags[a];
  16307. s.show(e, t).done(n.bind(this))
  16308. }
  16309. return r.promise()
  16310. }
  16311. ,
  16312. n.prototype.hideAlltags = function(e, t) {
  16313. function i() {
  16314. r++,
  16315. r === this.totaltags && (this.model.tagsShown = !1,
  16316. n.resolve())
  16317. }
  16318. var n = $.Deferred()
  16319. , r = 0;
  16320. for (var o in this.model.tags) {
  16321. var a = this.model.tags[o];
  16322. a.hide(e, t).done(i.bind(this)),
  16323. a === this.activeTag && this.dismissActiveTag()
  16324. }
  16325. return n.promise()
  16326. }
  16327. ,
  16328. n.prototype.enableHovering = function() {
  16329. this.enabled = !0
  16330. }
  16331. ,
  16332. n.prototype.disableHovering = function() {
  16333. this.enabled = !1
  16334. }
  16335. ,
  16336. n.prototype.activateTag = function(e, t) {
  16337. t = t || y.EXAMINE,
  16338. this.activeTag = e,
  16339. this.activeTag.hoveringDisc = !0,
  16340. this.activeTag.setHoverState(t === y.EXAMINE),
  16341. this.tagState = t,
  16342. this.emit(v.TagActivated, e)
  16343. }
  16344. ,
  16345. n.prototype.dismissActiveTag = function() {
  16346. this.activeTag.hoveringDisc = !1,
  16347. this.activeTag.setFreeState(!0);
  16348. var e = this.activeTag;
  16349. this.activeTag = null,
  16350. this.tagState = y.IDLE,
  16351. this.emit(v.TagDismissed, e)
  16352. }
  16353. ,
  16354. n.prototype.clickedOnTag = function(e) {
  16355. var t = function() {
  16356. this.navigatingViaTag = !0,
  16357. this.activeTag.examine(this.player),
  16358. this.emit(v.TagNavigation, this.activeTag)
  16359. }
  16360. .bind(this);
  16361. return this.tagState !== y.EXAMINE ? (this.activateTag(this.intersectTag, y.EXAMINE),
  16362. this.activeTag = this.intersectTag,
  16363. t(),
  16364. !0) : (this.dismissActiveTag(),
  16365. !1)
  16366. }
  16367. ,
  16368. n.prototype.intersecttag = function() {
  16369. var e = new r.Vector3
  16370. , t = new r.Vector3
  16371. , i = new r.Vector3;
  16372. return function(n, r, o) {
  16373. if (!this.enabled)
  16374. return null;
  16375. var a = null
  16376. , s = this.tagDiscs.filter(function(e) {
  16377. return e.parent.visible
  16378. });
  16379. if (s.length > 0) {
  16380. var l = this.model.floors.reduce(function(e, t) {
  16381. return t.hidden ? e : e.concat(t.collider.children)
  16382. }, s);
  16383. e.set(n.x, n.y, -1).unproject(o),
  16384. t.set(n.x, n.y, 1).unproject(o),
  16385. i.copy(t).sub(e).normalize(),
  16386. this.raycaster.set(e, i);
  16387. var c = this.raycaster.intersectObjects(l);
  16388. c.length > 0 && s.indexOf(c[0].object) !== -1 && (a = c[0].object.tag)
  16389. }
  16390. return this.intersectTag = a,
  16391. r && (this.activeTag && a !== this.activeTag && (this.tagState === y.BROWSE || this.tagState === y.EXAMINE && a) && this.dismissActiveTag(),
  16392. a && a !== this.activeTag && (a.listeners(h.ENTER).length < 1 && (a.billboard.on(h.ENTER, function() {
  16393. this.hoveredTag = a
  16394. }
  16395. .bind(this)),
  16396. a.billboard.on(h.LEAVE, function() {
  16397. this.hoveredTag = null
  16398. }
  16399. .bind(this))),
  16400. this.activateTag(a, y.BROWSE))),
  16401. a
  16402. }
  16403. }(),
  16404. n.prototype.rankedtagInDirection = function() {
  16405. var e = []
  16406. , t = []
  16407. , i = new r.Vector3
  16408. , n = new r.Vector3
  16409. , o = new r.Vector3;
  16410. return function(r, a, s, l) {
  16411. var c = 0;
  16412. t.length = 0;
  16413. for (var h = 0; h < this.closesttags.length; h++) {
  16414. var u = this.closesttags[h];
  16415. n.copy(u.position),
  16416. n.add(u.discPosition),
  16417. i.copy(a),
  16418. i.sub(n).negate(),
  16419. i.normalize();
  16420. var d = i.dot(l);
  16421. if (d >= 0) {
  16422. o.copy(n),
  16423. o.project(s);
  16424. var p = this.intersecttag(o, !1, s);
  16425. if (p) {
  16426. if (c >= e.length)
  16427. for (var f = 0; f < 64; f++)
  16428. e.push({
  16429. tag: u,
  16430. dot: d
  16431. });
  16432. var g = e[c];
  16433. g.tag = u,
  16434. g.dot = d,
  16435. g.position = math.projectPositionToCanvas(n, s),
  16436. t.push(g),
  16437. c++
  16438. }
  16439. }
  16440. }
  16441. return t.sort(function(e, t) {
  16442. return e.dot > t.dot ? -1 : e.dot < t.dot ? 1 : 0
  16443. }),
  16444. r < t.length ? t[r].tag : null
  16445. }
  16446. }(),
  16447. n.prototype.updateClosestTags = function() {
  16448. var e = new r.Vector3
  16449. , t = 30;
  16450. return function(i) {
  16451. this.closesttags || (this.closesttags = []),
  16452. this.closesttags.length = 0;
  16453. var n = this.model.tags;
  16454. if (n)
  16455. for (var r in n)
  16456. if (n.hasOwnProperty(r)) {
  16457. var o = n[r]
  16458. , a = o.position;
  16459. e.copy(i),
  16460. e.sub(a).negate();
  16461. var s = e.lengthSq();
  16462. s < t && this.closesttags.push(o)
  16463. }
  16464. }
  16465. }(),
  16466. t.exports = n
  16467. }
  16468. ).call(this, "/js/tag/tagManager.js")
  16469. }
  16470. , {
  16471. "../controls/serializer": 14,
  16472. "../enum/BlackoutStyle": 18,
  16473. "../enum/tagEvents": 32,
  16474. "../enum/ModelManagerEvents": 33,
  16475. "../enum/PlayerEvents": 40,
  16476. "../enum/TagStates": 44,
  16477. "../enum/Viewmode": 51,
  16478. "../enum/WarpStyle": 52,
  16479. "../objects/Snapshot": 153,
  16480. "../settings": 166,
  16481. "../util/common": 185,
  16482. "../util/lerp": 188,
  16483. "../util/logger": 189,
  16484. "./Billboard/BillboardEvent": 120,
  16485. "./Media/LinkType": 130,
  16486. "./Media/MediaEvent": 131,
  16487. events: 202,
  16488. three: 217
  16489. }],
  16490. 125: [function(e, t, i) {
  16491. (function(i) {
  16492. "use strict";
  16493. function n() {
  16494. this.embedWrapper = null,
  16495. this.embedElement = null
  16496. }
  16497. var r = e("../../util/ajax")
  16498. , o = e("./mediaSettings")
  16499. , a = e("../../settings")
  16500. , s = e("../../util/logger")
  16501. , l = new s(i);
  16502. n.prototype.createDomElement = function() {
  16503. return this.embedWrapper = document.createElement("div"),
  16504. this.embedWrapper.classList.add("tag-embed"),
  16505. this.embedWrapper.classList.add("hidden"),
  16506. this.embedWrapper
  16507. }
  16508. ,
  16509. n.prototype.load = function(e) {
  16510. var t = "https://api.embedly.com/1/oembed?key=" + a.appConfig.embedly_key + "&url=" + encodeURIComponent(e) + "&maxwidth=" + o.maxEmbedWidth;
  16511. return new Promise(function(e, i) {
  16512. r.get(t).then(function(t) {
  16513. if (t = JSON.parse(t),
  16514. t.html && t.html.indexOf("<script") === -1) {
  16515. this.embedWrapper.innerHTML = t.html;
  16516. var n = Math.min(t.width, o.maxEmbedWidth) || o.maxEmbedWidth;
  16517. if (this.embedWrapper.style.width = n + "px",
  16518. t.height) {
  16519. var r = t.height / t.width;
  16520. this.embedWrapper.style.height = n * r + "px"
  16521. }
  16522. this.embedElement = this.embedWrapper.firstChild;
  16523. var a = [];
  16524. try {
  16525. a = [].slice.call(this.embedElement.querySelectorAll("a"))
  16526. } catch (e) {
  16527. l.debug("Error getting `a` elements for embed; was it an iframe?")
  16528. }
  16529. a.forEach(function(e) {
  16530. e.setAttribute("target", "_blank")
  16531. }),
  16532. this.embedElement.classList.add("hidden"),
  16533. this.embedWrapper.classList.remove("hidden"),
  16534. e()
  16535. } else
  16536. i("Not a valid embed")
  16537. }
  16538. .bind(this), function(e) {
  16539. i(e.response)
  16540. })
  16541. }
  16542. .bind(this))
  16543. }
  16544. ,
  16545. n.prototype.show = function() {
  16546. this.embedElement && this.embedElement.classList.remove("hidden")
  16547. }
  16548. ,
  16549. n.prototype.hide = function() {
  16550. this.embedElement && this.embedElement.classList.add("hidden")
  16551. }
  16552. ,
  16553. t.exports = n
  16554. }
  16555. ).call(this, "/js/tag/Media/EmbedlyEmbed.js")
  16556. }
  16557. , {
  16558. "../../settings": 166,
  16559. "../../util/ajax": 181,
  16560. "../../util/logger": 189,
  16561. "./mediaSettings": 132
  16562. }],
  16563. 126: [function(e, t, i) {
  16564. (function(i) {
  16565. "use strict";
  16566. function n(e) {
  16567. o.call(this),
  16568. this.options = e,
  16569. this.playerControls = null,
  16570. this.state = s.NOT_READY
  16571. }
  16572. var r = e("../../util/browser")
  16573. , o = e("./EmbedlyEmbed")
  16574. , a = e("../../util/logger")
  16575. , s = (new a(i),
  16576. Object.freeze({
  16577. NOT_READY: "player.not.ready",
  16578. CUED: "player.cued",
  16579. PLAYING: "player.playing",
  16580. PAUSED: "player.paused"
  16581. }));
  16582. n.prototype = Object.create(o.prototype),
  16583. n.prototype.createDomElement = function() {
  16584. return this.embedWrapper = document.createElement("div"),
  16585. this.embedWrapper.classList.add("tag-video"),
  16586. this.embedWrapper.classList.add("hidden"),
  16587. this.embedWrapper
  16588. }
  16589. ,
  16590. n.prototype.load = function(e) {
  16591. var t = function() {
  16592. function e(e) {
  16593. this.playerState = s.CUED,
  16594. this.options.startMuted && this.playerControls.mute()
  16595. }
  16596. function t(e) {
  16597. this.playerState = e
  16598. }
  16599. function i(e) {
  16600. this.playerControls.setCurrentTime(0),
  16601. this.options.loop ? this.playerControls.play() : this.playerControls.pause()
  16602. }
  16603. this.playerControls = new playerjs.Player(this.embedElement),
  16604. this.playerControls.on("ready", e.bind(this)),
  16605. this.playerControls.on("play", t.bind(this, s.PLAYING)),
  16606. this.playerControls.on("pause", t.bind(this, s.PAUSED)),
  16607. this.playerControls.on("ended", i.bind(this))
  16608. }
  16609. .bind(this);
  16610. return o.prototype.load.call(this, e).then(t.bind(this))
  16611. }
  16612. ,
  16613. n.prototype.play = function() {
  16614. var e = r.isMobile();
  16615. return function() {
  16616. this.playerState !== s.NOT_READY && this.playerControls && !e && (this.state === s.CUED && this.options.autoPlay || this.options.autoResume) && this.playerControls.play()
  16617. }
  16618. }(),
  16619. n.prototype.pause = function() {
  16620. this.playerState !== s.NOT_READY && this.playerControls && this.playerControls.pause()
  16621. }
  16622. ,
  16623. t.exports = n
  16624. }
  16625. ).call(this, "/js/tag/Media/EmbedlyPlayer.js")
  16626. }
  16627. , {
  16628. "../../util/browser": 182,
  16629. "../../util/logger": 189,
  16630. "./EmbedlyEmbed": 125
  16631. }],
  16632. 127: [function(e, t, i) {
  16633. (function(i) {
  16634. "use strict";
  16635. function n(e) {
  16636. function t() {
  16637. return a.debug("requesting file from embedly:", e.href),
  16638. r.get(e.href, {
  16639. responseType: e.responseType
  16640. }).then(function(t) {
  16641. return a.debug("requesting file finished:", e.href),
  16642. t
  16643. })
  16644. }
  16645. function i() {}
  16646. return s = new Promise(function(e, n) {
  16647. s.catch(i).then(function() {
  16648. t().then(e, n)
  16649. })
  16650. }
  16651. )
  16652. }
  16653. var r = e("../../util/ajax")
  16654. , o = (e("./mediaSettings"),
  16655. e("../../util/logger"))
  16656. , a = new o(i)
  16657. , s = Promise.resolve();
  16658. t.exports.enqueue = n
  16659. }
  16660. ).call(this, "/js/tag/Media/EmbedlyQueue.js")
  16661. }
  16662. , {
  16663. "../../util/ajax": 181,
  16664. "../../util/logger": 189,
  16665. "./mediaSettings": 132
  16666. }],
  16667. 128: [function(e, t, i) {
  16668. (function(i) {
  16669. "use strict";
  16670. function n() {
  16671. this.imageWrapper = null,
  16672. this.width = 0,
  16673. this.height = 0,
  16674. this.aspect = 1
  16675. }
  16676. var r = e("./MediaEvent")
  16677. , o = e("./EmbedlyQueue")
  16678. , a = e("events").EventEmitter
  16679. , s = e("../../util/logger")
  16680. , l = e("../../settings");
  16681. new s(i);
  16682. n.prototype = Object.create(a.prototype),
  16683. n.prototype.createDomElement = function() {
  16684. return this.imageWrapper = document.createElement("div"),
  16685. this.imageWrapper.classList.add("tag-image"),
  16686. this.imageWrapper.classList.add("hidden"),
  16687. this.imageWrapper.addEventListener("click", function(e) {
  16688. e.stopPropagation(),
  16689. this.emit(r.IMAGE_OPENING),
  16690. this.imageWrapper.style.pointerEvents = "none"
  16691. }
  16692. .bind(this)),
  16693. this.imageWrapper
  16694. }
  16695. ,
  16696. n.prototype.onClosed = function() {
  16697. this.imageWrapper.style.pointerEvents = "auto"
  16698. }
  16699. ,
  16700. n.prototype.load = function(e) {
  16701. var t = Math.max(window.screen.height, window.screen.width)
  16702. , i = "https://i.embed.ly/1/display/resize?key=" + l.appConfig.embedly_key + "&url=" + encodeURIComponent(e) + "&width=" + t + "&height=" + t;
  16703. return new Promise(function(e, t) {
  16704. function n(t) {
  16705. var i = t.target;
  16706. this.width = i.naturalWidth,
  16707. this.height = i.naturalHeight,
  16708. this.aspect = this.width / this.height;
  16709. var n = t.target.src;
  16710. this.imageWrapper.style.backgroundImage = 'url("' + n + '")',
  16711. this.imageWrapper.style.width = this.width + "px",
  16712. this.imageWrapper.style.height = this.height + "px",
  16713. this.imageWrapper.classList.remove("hidden"),
  16714. e()
  16715. }
  16716. o.enqueue({
  16717. href: i,
  16718. responseType: "arraybuffer"
  16719. }).then(function(e) {
  16720. var t = new Uint8Array(e)
  16721. , i = new Blob([t])
  16722. , r = new window.Image;
  16723. r.addEventListener("load", n.bind(this));
  16724. var o = URL.createObjectURL(i);
  16725. r.src = o
  16726. }
  16727. .bind(this), t)
  16728. }
  16729. .bind(this))
  16730. }
  16731. ,
  16732. t.exports = n
  16733. }
  16734. ).call(this, "/js/tag/Media/Image.js")
  16735. }
  16736. , {
  16737. "../../settings": 166,
  16738. "../../util/logger": 189,
  16739. "./EmbedlyQueue": 127,
  16740. "./MediaEvent": 131,
  16741. events: 202
  16742. }],
  16743. 129: [function(e, t, i) {
  16744. "use strict";
  16745. function n(e) {
  16746. this.label = e.label,
  16747. this.href = e.url,
  16748. this.type = this.updateLinkForType(),
  16749. this.domElement = null,
  16750. this.id = c++
  16751. }
  16752. var r = e("./LinkType")
  16753. , o = e("./MediaEvent")
  16754. , a = e("../../util/browser")
  16755. , s = e("../../analytics")
  16756. , l = e("events").EventEmitter
  16757. , c = 0;
  16758. n.prototype = Object.create(l.prototype),
  16759. n.prototype.updateLinkForType = function() {
  16760. function e(e) {
  16761. var t = new RegExp("[#&?]start=([^#&?]*)")
  16762. , i = t.exec(e);
  16763. return i[1]
  16764. }
  16765. function t(e) {
  16766. return e + "&play=1"
  16767. }
  16768. var i = a.valueFromHash("m") || a.valueFromHash("model");
  16769. 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),
  16770. r.NAVIGATION) : (this.href = t(this.href),
  16771. r.MODEL) : r.EXT_LINK
  16772. }
  16773. ;
  16774. var h = {};
  16775. n.prototype.createDomElement = function() {
  16776. function e(e) {
  16777. switch (e.stopPropagation(),
  16778. h[this.id] = !0,
  16779. s.trackAlways("click_tag_link", {
  16780. link_type: this.type,
  16781. link_count: c,
  16782. links_clicked: Object.keys(h).length
  16783. }),
  16784. this.type) {
  16785. case r.MODEL:
  16786. window.location.replace(this.href);
  16787. break;
  16788. case r.EXT_LINK:
  16789. window.open(this.href, "_blank")
  16790. }
  16791. this.emit(o.LINK_CLICK, {
  16792. type: this.type,
  16793. url: this.href
  16794. })
  16795. }
  16796. if (this.domElement = document.createElement("a"),
  16797. this.domElement.classList.add("tag-link"),
  16798. this.domElement.textContent = this.label,
  16799. this.type === r.EXT_LINK) {
  16800. this.domElement.textContent += " ";
  16801. var t = document.createElement("i");
  16802. t.classList.add("icon-ext-link"),
  16803. t.title = "Link to external web site",
  16804. this.domElement.appendChild(t)
  16805. }
  16806. return this.domElement.addEventListener("click", e.bind(this)),
  16807. this.domElement
  16808. }
  16809. ,
  16810. t.exports = n
  16811. }
  16812. , {
  16813. "../../analytics": 4,
  16814. "../../util/browser": 182,
  16815. "./LinkType": 130,
  16816. "./MediaEvent": 131,
  16817. events: 202
  16818. }],
  16819. 130: [function(e, t, i) {
  16820. "use strict";
  16821. t.exports = {
  16822. NAVIGATION: "navigation",
  16823. MODEL: "model",
  16824. EXT_LINK: "ext-link"
  16825. }
  16826. }
  16827. , {}],
  16828. 131: [function(e, t, i) {
  16829. "use strict";
  16830. t.exports = Object.freeze({
  16831. LINK_CLICK: "mtmedia.link",
  16832. IMAGE_LOADED: "mtmedia.image.loaded",
  16833. IMAGE_OPENING: "mtmedia.image.opening",
  16834. IMAGE_OPENED: "mtmedia.image.opened",
  16835. IMAGE_CLOSING: "mtmedia.image.closing",
  16836. IMAGE_CLOSED: "mtmedia.image.closed",
  16837. VIDEO_START: "mtmedia.video.start",
  16838. VIDEO_PAUSE: "mtmedia.video.pause",
  16839. VIDEO_ENDED: "mtmedia.video.end"
  16840. })
  16841. }
  16842. , {}],
  16843. 132: [function(e, t, i) {
  16844. "use strict";
  16845. t.exports = Object.freeze({
  16846. maxEmbedWidth: 350,
  16847. defaultAspectRatio: .75
  16848. })
  16849. }
  16850. , {}],
  16851. 133: [function(e, t, i) {
  16852. "use strict";
  16853. t.exports = Object.freeze({
  16854. TEXT: "text",
  16855. LINK: "link",
  16856. IMAGE: "photo",
  16857. VIDEO: "video",
  16858. RICH: "rich"
  16859. })
  16860. }
  16861. , {}],
  16862. 134: [function(e, t, i) {
  16863. "use strict";
  16864. function n(e) {
  16865. this.capabilities = {
  16866. links: {
  16867. enable: e.supportLinks,
  16868. keepLabels: e.keepLinkLabels
  16869. }
  16870. }
  16871. }
  16872. var r = e("./DescriptionChunkType");
  16873. n.prototype.parse = function(e, t) {
  16874. var i = []
  16875. , n = e.split("[").map(function(e, t) {
  16876. return 0 === t ? e : "[" + e
  16877. });
  16878. return n.forEach(function(e) {
  16879. var n = this.findMarkdown(e);
  16880. if (n) {
  16881. if (n.url.indexOf("javascript:") !== -1)
  16882. return;
  16883. this.addLinkChunk(i, n, t),
  16884. this.addTextChunk(i, e.slice(n.markdown.length))
  16885. } else
  16886. this.addTextChunk(i, e)
  16887. }
  16888. .bind(this)),
  16889. i
  16890. }
  16891. ,
  16892. n.prototype.findMarkdown = function(e) {
  16893. var t = /\[([^\]]*)\]\((.*)\)/
  16894. , i = e.match(t);
  16895. if (i) {
  16896. for (var n = i[2], r = 1, o = 0; o < n.length && ("(" === n[o] ? r++ : ")" === n[o] && r--,
  16897. 0 !== r); )
  16898. o++;
  16899. var a = n.length - o;
  16900. return {
  16901. markdown: i[0].substring(0, i[0].length - a),
  16902. label: i[1],
  16903. url: i[2].substring(0, o)
  16904. }
  16905. }
  16906. }
  16907. ,
  16908. n.prototype.addTextChunk = function(e, t) {
  16909. 0 !== t.length && e.push({
  16910. type: r.TEXT,
  16911. text: t
  16912. })
  16913. }
  16914. ,
  16915. n.prototype.addLinkChunk = function(e, t) {
  16916. if (!this.capabilities.links.enable)
  16917. return void (this.capabilities.links.keepLabels && this.addTextChunk(e, t.label));
  16918. var i = {
  16919. label: t.label,
  16920. url: t.url
  16921. };
  16922. i.url.indexOf("://") === -1 && (i.url = "http://" + i.url),
  16923. e.push({
  16924. type: r.LINK,
  16925. link: i
  16926. })
  16927. }
  16928. ,
  16929. t.exports = n
  16930. }
  16931. , {
  16932. "./DescriptionChunkType": 133
  16933. }],
  16934. 135: [function(e, t, i) {
  16935. (function(i) {
  16936. "use strict";
  16937. var n = e("../util/logger")
  16938. , r = new n(i)
  16939. , o = {
  16940. parseIdsFromChunkName: function(e, t) {
  16941. t.floorId = o.parseFloor(e),
  16942. t.roomId = o.parseRoom(e)
  16943. },
  16944. parseFloor: function(e) {
  16945. var t = e.match(/_group([0-9]+)/);
  16946. if (!t)
  16947. return 0;
  16948. try {
  16949. return parseInt(t[1], 10)
  16950. } catch (e) {
  16951. return r.warn('Non-int value "' + t[1] + '" for mesh group, defaulting to floor 0'),
  16952. 0
  16953. }
  16954. },
  16955. parseRoom: function(e) {
  16956. var t = e.match(/_sub([0-9]+)/);
  16957. if (!t)
  16958. return -1;
  16959. try {
  16960. return parseInt(t[1], 10)
  16961. } catch (e) {
  16962. return r.warn('Non-int value "' + t[1] + '" for mesh subgroup, defaulting to subgroup 0'),
  16963. 0
  16964. }
  16965. }
  16966. };
  16967. t.exports = o
  16968. }
  16969. ).call(this, "/js/model/Chunks.js")
  16970. }
  16971. , {
  16972. "../util/logger": 189
  16973. }],
  16974. 136: [function(e, t, i) {
  16975. (function(i) {
  16976. "use strict";
  16977. function n(e) {
  16978. s.call(this),
  16979. this.model = e,
  16980. this.exploded = !1
  16981. }
  16982. var r = e("../objects/Floor")
  16983. , o = (e("../settings"),
  16984. e("../util/logger"))
  16985. , a = e("../util/transitions")
  16986. , s = e("../util/IndexedCollection")
  16987. , l = e("../util/common")
  16988. , c = e("../util/easing");
  16989. new o(i);
  16990. l.inherit(n, s),
  16991. n.prototype.add = function(e) {
  16992. s.prototype.add.call(this, e),
  16993. this.model.add(e)
  16994. }
  16995. ,
  16996. n.prototype.getIndex = function(e) {
  16997. return e.floorIndex
  16998. }
  16999. ,
  17000. n.prototype.build = function() {
  17001. this.list.forEach(function(e) {
  17002. e.build()
  17003. })
  17004. }
  17005. ,
  17006. n.prototype.size = function() {
  17007. return this.length
  17008. }
  17009. ,
  17010. n.prototype.sort = function() {
  17011. s.prototype.sort.call(this, function(e, t) {
  17012. return e.floorIndex - t.floorIndex
  17013. })
  17014. }
  17015. ,
  17016. n.prototype.nextFloor = function(e, t) {
  17017. return this.index[e.floorIndex + t] || null
  17018. }
  17019. ,
  17020. n.prototype.getFloorAtPoint = function(e) {
  17021. for (var t = null, i = 1 / 0, n = 0; n < this.list.length; n++) {
  17022. var r = this.list[n]
  17023. , o = r.distanceToPoint(e);
  17024. (!t || i > o) && (i = o,
  17025. t = r)
  17026. }
  17027. return t
  17028. }
  17029. ,
  17030. n.prototype.getOrMakeFloor = function(e) {
  17031. var t = this.index[e];
  17032. return t || (t = new r(this.model,e),
  17033. this.add(t)),
  17034. t
  17035. }
  17036. ,
  17037. n.prototype.hide = function() {
  17038. this.list.forEach(function(e) {
  17039. e.hide()
  17040. })
  17041. }
  17042. ,
  17043. n.prototype.show = function() {
  17044. this.list.forEach(function(e) {
  17045. e.show()
  17046. })
  17047. }
  17048. ,
  17049. n.prototype.names = function() {
  17050. return this.list.reduce(function(e, t) {
  17051. return e.concat(t.name)
  17052. }, [])
  17053. }
  17054. ,
  17055. n.prototype.toggleExplodeHorizontal = function() {
  17056. function e(e, t) {
  17057. r.copy(e.position),
  17058. e.position.x = i[e.floorIndex] * t,
  17059. e.position.y = 1 * e.floorIndex * t,
  17060. r.sub(e.position).multiplyScalar(-1),
  17061. e.panos.forEach(function(e) {
  17062. e.translate(r)
  17063. })
  17064. }
  17065. var t, i = [], n = 0;
  17066. this.list.forEach(function(e, r, o) {
  17067. t = r > 0 ? Math.max(o[r - 1].boundingBox.max.x - e.boundingBox.min.x, e.boundingBox.size().x / 2) : 0,
  17068. n += t,
  17069. i[r] = n
  17070. }),
  17071. i = i.map(function(e) {
  17072. return e - n / 2
  17073. });
  17074. var r = this.list[0].position.clone();
  17075. this.exploded ? this.list.forEach(function(t) {
  17076. a.start(function(i) {
  17077. e(t, 1 - i)
  17078. }, 1500, null, 0, c.easeOutExpo)
  17079. }) : this.list.forEach(function(t) {
  17080. a.start(function(i) {
  17081. e(t, i)
  17082. }, 1500, null, 0, c.easeOutExpo)
  17083. }),
  17084. this.exploded = !this.exploded
  17085. }
  17086. ,
  17087. n.prototype.toggleExplodeVertical = function() {
  17088. function e(e, i) {
  17089. var n = n.copy(e.position);
  17090. e.position.y = (5 * e.floorIndex - t.y / 2) * i,
  17091. n.sub(e.position).multiplyScalar(-1),
  17092. e.panos.forEach(function(e) {
  17093. e.translate(n)
  17094. })
  17095. }
  17096. var t = this.model.size;
  17097. this.list[0].position.clone();
  17098. this.exploded ? this.list.forEach(function(t) {
  17099. a.start(function(i) {
  17100. e(t, 1 - i)
  17101. }, 1500, null, 0, c.easeOutExpo)
  17102. }) : this.list.forEach(function(t) {
  17103. a.start(function(i) {
  17104. e(t, i)
  17105. }, 1500, null, 0, c.easeOutExpo)
  17106. }),
  17107. this.exploded = !this.exploded
  17108. }
  17109. ,
  17110. t.exports = n
  17111. }
  17112. ).call(this, "/js/model/FloorCollection.js")
  17113. }
  17114. , {
  17115. "../objects/Floor": 146,
  17116. "../settings": 166,
  17117. "../util/IndexedCollection": 175,
  17118. "../util/common": 185,
  17119. "../util/easing": 186,
  17120. "../util/logger": 189,
  17121. "../util/transitions": 195
  17122. }],
  17123. 137: [function(e, t, i) {
  17124. (function(i) {
  17125. "use strict";
  17126. function n() {
  17127. c.call(this)
  17128. }
  17129. var r = e("../settings")
  17130. , o = e("../util/logger")
  17131. , a = e("../enum/Viewmode")
  17132. , s = e("../objects/Snapshot")
  17133. , l = (e("../util/math"),
  17134. e("../util/common"))
  17135. , c = e("../util/IndexedCollection")
  17136. , h = new o(i);
  17137. l.inherit(n, c),
  17138. n.prototype.getImage = function(e) {
  17139. return e && this.index.hasOwnProperty(e) ? this.index[e] : null
  17140. }
  17141. ,
  17142. n.prototype.filterByModesAndReel = function(e, t) {
  17143. for (var i = [], n = 0; n < t.length; n += 1) {
  17144. var r = t[n]
  17145. , o = this.index[r.sid];
  17146. o && i.push(o)
  17147. }
  17148. var s = e[a.DOLLHOUSE]
  17149. , l = e[a.FLOORPLAN];
  17150. i = i.filter(function(e) {
  17151. if (!e.metadata || void 0 === e.metadata.camera_mode)
  17152. return !0;
  17153. var t;
  17154. try {
  17155. t = a.convertWorkshopModeInt(e.metadata.camera_mode)
  17156. } catch (e) {
  17157. return h.debug(e.message),
  17158. !1
  17159. }
  17160. return t === a.PANORAMA || t === a.FLOORPLAN && l || t === a.DOLLHOUSE && s
  17161. }),
  17162. i.length !== this.list.length && h.info("Disallowed " + (this.list.length - i.length) + " highlight images"),
  17163. this.list = i,
  17164. this.reIndex()
  17165. }
  17166. ,
  17167. n.prototype.getHeroLocations = function(panos) {//改 增加二级location
  17168. if (0 === this.list.length)
  17169. return [];
  17170. var locations = [];
  17171. var deal = (info, container)=>{
  17172. var src = info.thumbnail_signed_src,
  17173. o = info.name || "";
  17174. if (info.metadata && void 0 !== info.metadata.camera_quaternion) {
  17175. if (!r.show360Views.enabled && info.metadata.scan_id) {
  17176. let a = panos.get(info.metadata.scan_id);
  17177. if (a && !a.isAligned()) return
  17178. }
  17179. var cameraMode = a.convertWorkshopModeInt(info.metadata.camera_mode);
  17180. if (cameraMode === a.MESH) return
  17181. if(window.isLocal)src = manage.dealURL(src)
  17182. else src = "one" === g_version ? g_Prefix + src + "?" + randomTime().getTime() : src + "?" + randomTime().getTime()
  17183. var l = {
  17184. cameraMode: cameraMode,
  17185. position: info.metadata.camera_position,
  17186. quaternion: info.metadata.camera_quaternion,
  17187. zoom: info.metadata.zoom,
  17188. panoId: info.metadata.scan_id,
  17189. orthoZoom: info.metadata.ortho_zoom,
  17190. floorVisibility: void 0 !== info.metadata.floor_visibility ? info.metadata.floor_visibility.slice(0) : [],
  17191. thumbUrl: src,
  17192. name: n.filterImageName(o),
  17193. sid: info.sid
  17194. }
  17195. var item = new s(l);
  17196. item.momentTour = info.momentTour
  17197. item.dontRot = info.dontRot
  17198. item.rotTime = info.rotTime
  17199. item.musicInfo = info.musicInfo || g_data2.tourAudio[info.sid] || {}//新的music数据统一写在每个info下,如果有musicInfo则覆盖g_data2.tourAudio
  17200. container.push(item)
  17201. return item
  17202. }
  17203. }
  17204. this.list.forEach(image=>{
  17205. if(image.images){
  17206. var folder = $.extend({}, image )
  17207. folder.heroLocations = [];
  17208. image.images.list.forEach(child=>{
  17209. deal(child, folder.heroLocations);
  17210. })
  17211. folder.musicInfo = folder.musicInfo || {}
  17212. locations.push(folder)
  17213. delete folder.images;
  17214. delete folder.locations;
  17215. }else{
  17216. var item = deal(image, locations);
  17217. }
  17218. })
  17219. return locations
  17220. }
  17221. ,
  17222. n.prototype.getIndex = function(e) {
  17223. return e.sid
  17224. }
  17225. ,
  17226. n.filterImageName = function(e) {
  17227. return "" === e || e.match(/^[0-9.]+_[0-9.]+$/) ? null : e
  17228. }
  17229. ,
  17230. t.exports = n
  17231. }
  17232. ).call(this, "/js/model/ImageCollection.js")
  17233. }
  17234. , {
  17235. "../enum/Viewmode": 51,
  17236. "../objects/Snapshot": 153,
  17237. "../settings": 166,
  17238. "../util/IndexedCollection": 175,
  17239. "../util/common": 185,
  17240. "../util/logger": 189,
  17241. "../util/math": 190
  17242. }],
  17243. 138: [function(e, t, i) {
  17244. (function(i) {
  17245. "use strict";
  17246. function n() {
  17247. u.call(this)
  17248. }
  17249. var r = e("../label/Label")
  17250. , o = e("../settings")
  17251. , a = e("../util/logger")
  17252. , s = e("../util/math")
  17253. , l = e("../util/ajax")
  17254. , c = e("./RoomCollection")
  17255. , h = e("../util/common")
  17256. , u = e("../util/IndexedCollection");
  17257. new a(i);
  17258. h.inherit(n, u),
  17259. n.prototype.getIndex = function(e) {
  17260. return e.labelId
  17261. }
  17262. ,
  17263. n.prototype.associateWithRooms = function(e) {
  17264. this.forEach(function(t) {
  17265. e.forEach(function(e) {
  17266. e.roomId === t.roomId && (t.room = e)
  17267. })
  17268. })
  17269. }
  17270. ,
  17271. n.prototype.createFromLabelData = function(e) {
  17272. e.forEach(function(e) {
  17273. var t = n.parseRoomIndexFromWorkshopRoomId(e.roomId);
  17274. t = c.generateRoomId(e.floorId, t);
  17275. var i = new r(e.sid,e.position || e.positions[0],e.text,e.floorId,t);
  17276. i.position = s.convertWorkshopVector(i.position),
  17277. this.add(i),
  17278. i.build()
  17279. }
  17280. .bind(this))
  17281. }
  17282. ,
  17283. n.prototype.load = function(e, t) {
  17284. return l.get(e, {
  17285. responseType: "json",
  17286. auth: t ? o.authorizationHeader : null
  17287. }).done(function(e) {
  17288. var t = [];
  17289. for (var i in e) {
  17290. var n = e[i];
  17291. t.push(n)
  17292. }
  17293. this.createFromLabelData(t)
  17294. }
  17295. .bind(this))
  17296. }
  17297. ,
  17298. n.parseRoomIndexFromWorkshopRoomId = function(e) {
  17299. var t = -1;
  17300. if (e) {
  17301. if(typeof e == 'number'){//add
  17302. t = parseInt(e)
  17303. }else{
  17304. var i = e.split("_");
  17305. t = parseInt(i[0])
  17306. }
  17307. }
  17308. return t
  17309. },
  17310. t.exports = n
  17311. }
  17312. ).call(this, "/js/model/LabelCollection.js")
  17313. }
  17314. , {
  17315. "../label/Label": 90,
  17316. "../settings": 166,
  17317. "../util/IndexedCollection": 175,
  17318. "../util/ajax": 181,
  17319. "../util/common": 185,
  17320. "../util/logger": 189,
  17321. "../util/math": 190,
  17322. "./RoomCollection": 141
  17323. }],
  17324. 139: [function(e, t, i) {
  17325. (function(i) {
  17326. "use strict";
  17327. function n(e, t) {
  17328. o.Object3D.call(this)
  17329. this.sid = window.number;//t.sid,
  17330. this.data = t,
  17331. this.options = e,
  17332. this.urls = new s(e.urlFiles),
  17333. this.isPublic = void 0 !== t.is_public && t.is_public,
  17334. //创建heroLocations
  17335. this.images = new _(this),
  17336. this.images.extend(t.images),
  17337. this.images.forEach((info)=>{
  17338. if(info.locations){
  17339. info.images = new _(this);
  17340. info.images.extend(info.locations)
  17341. }
  17342. })
  17343. this.heroLocations = []
  17344. //this.heroImage = this.images.getImage(t.icon), //初始画面沒有用到icon
  17345. this.outdoorPanoLocations = [],
  17346. this.floors = new d(this),
  17347. this.floorsEnabled = void 0 === e.floors || e.floors,
  17348. this.changingFloor = !1,
  17349. this.chunks = [],
  17350. this.panos = new A,
  17351. this.colliders = [],
  17352. this.loadPanosPromise = null,
  17353. this.loadMeshTexturesPromise = null,
  17354. this.auxDataPromise = null,
  17355. this.meshTexturesLoaded = !1,
  17356. this.meshTextures = [],
  17357. this.tags = {},
  17358. this.tagsShown = !1,
  17359. this.shouldShowtags = !1,
  17360. this.has360Views = !1,
  17361. this.showingLabels = f.labels.enabled && t.player_options.labels,
  17362. this.supportedModes = {},
  17363. this.supportedModes[c.PANORAMA] = !0,
  17364. this.supportedModes[c.DOLLHOUSE] = !t.player_options || t.player_options.dollhouse && w.valueFromHash("dh", 1),
  17365. this.supportedModes[c.FLOORPLAN] = !t.player_options || t.player_options.floor_plan && w.valueFromHash("dh", 1),
  17366. this.supportedModes[c.TRANSITIONING] = !0,
  17367. this.supportsTiles = this.configureTiling(),
  17368. // this.supportsVR = t.is_vr,
  17369. this.supportsVR = window.DATA.supportsVR || false//true; // 方奕卓 VR功能可配置
  17370. this.mode = c.DOLLHOUSE,
  17371. this.size = null,
  17372. this.center = null,
  17373. this.boundingBox = new o.Box3,
  17374. this.currentFloor = null,
  17375. this.allFloorsVisible = !0,
  17376. this.projectedPano0 = null,
  17377. this.projectedPano1 = null,
  17378. this.floorsEnabled && t.floors && t.floors.indexOf(",") !== -1 && t.floors.split(",").forEach(function(e, t) {
  17379. this.addFloor(new u(this,t,e.trim()))
  17380. }
  17381. .bind(this)),
  17382. this.waitQueue = [],
  17383. this.on("load", function(e) {
  17384. 0 !== this.waitQueue.length && (this.waitQueue = this.waitQueue.filter(function(e) {
  17385. return !e.isLoadedCallback()
  17386. }),
  17387. 0 === this.waitQueue.length && this.emit("waiting-done"))
  17388. }
  17389. .bind(this)),
  17390. this.setupCustomProperties()
  17391. this.hots = {};
  17392. }
  17393. function r() {
  17394. try {
  17395. var e = document.createElement("canvas")
  17396. , t = e.getContext("webgl");
  17397. t || (t = e.getContext("experimental-webgl"));
  17398. var i = t.getParameter(t.MAX_CUBE_MAP_TEXTURE_SIZE);
  17399. return i
  17400. } catch (e) {
  17401. return 0
  17402. }
  17403. }
  17404. var o = e("three")
  17405. , a = e("../util/ajax")
  17406. , s = e("../util/ModelUrls")
  17407. , l = e("../objects/BoundingTextureSkybox")
  17408. , c = e("../enum/Viewmode")
  17409. , h = e("../enum/RenderOrder")
  17410. , u = (e("../enum/AlignmentType"),
  17411. e("../objects/Floor"))
  17412. , d = e("./FloorCollection")
  17413. , p = e("../objects/Chunk")
  17414. , f = (e("../objects/Room"),
  17415. e("../objects/Snapshot"),
  17416. e("../label/Label"),
  17417. e("../util/math"),
  17418. e("../settings"))
  17419. ,ss = e("../shaders")
  17420. , g = e("../util/logger")
  17421. , m = e("../tag/tag")
  17422. , v = (e("../tag/tagManager"),
  17423. e("../objects/Panorama"))
  17424. , A = e("../util/PanoramaCollection")
  17425. , y = e("../loaders/ModelLoader")
  17426. , C = e("../loaders/ModelTextureLoader")
  17427. , I = e("../loaders/SweepDataLoader")
  17428. , E = e("../util/transitions")
  17429. , b = e("../util/common")
  17430. , es = e("../util/easing")
  17431. ,lerp = e("../util/lerp")
  17432. ,tex = e("../util/texture")
  17433. , w = e("./../util/browser")
  17434. , _ = e("./ImageCollection")
  17435. , T = e("./RoomCollection")
  17436. , x = e("./LabelCollection")
  17437. , S = e("./Chunks")
  17438. , cameraLight = e("./util/cameraLight")
  17439. , M = e("./../util/showcase")
  17440. , R = e("../exception/BasicException")
  17441. , P = (e("../constants")
  17442. ,e("events").EventEmitter)
  17443. ,GLCubeFaces = e("../enum/GLCubeFaces")
  17444. //,Hot = e("hot")
  17445. , O = new g(i);
  17446. n.prototype = Object.create(o.Object3D.prototype),
  17447. b.extend(n, P),
  17448. n.prototype.setupCustomProperties = function() {
  17449. var e = f.modelAlpha;
  17450. Object.defineProperty(this, "alpha", {
  17451. get: function() {
  17452. return e
  17453. },
  17454. set: function(t) {
  17455. e = t
  17456. //console.log(t)
  17457. this.chunks.forEach(function(chunk) {
  17458. if (chunk.material && chunk.material.uniforms.modelAlpha) {
  17459. chunk.material.uniforms.modelAlpha.value = e
  17460. //修改一下defines,为了在不需要map时不加载map。 by xzw
  17461. /* if (e>0) {
  17462. if (!('useModelMap' in chunk.material.defines)) {
  17463. chunk.material.defines.useModelMap = ''
  17464. chunk.material.needsUpdate = true
  17465. console.log('add useModelMap')
  17466. }
  17467. } else {
  17468. if ('useModelMap' in chunk.material.defines) {
  17469. delete chunk.material.defines.useModelMap
  17470. chunk.material.needsUpdate = true
  17471. chunk.material.uniforms.map.value.dispose() //防止崩溃(但是因为这样飞出要等待时间所以被去掉了)
  17472. console.log('delete useModelMap')
  17473. }
  17474. } */
  17475. }
  17476. })
  17477. }
  17478. })
  17479. }
  17480. ,
  17481. n.prototype.configureTiling = function() {
  17482. var e = r();
  17483. if (e < 2048)
  17484. return !1;
  17485. O.warn("Max cube texture size: " + e);
  17486. for (var t = 0; t < f.tiling.tilingFlagNames.length; t++) {
  17487. var i = f.tiling.tilingFlagNames[t];
  17488. if ("1" === w.valueFromHash(i, null))
  17489. return !0;
  17490. if ("0" === w.valueFromHash(i, null))
  17491. return !1
  17492. }
  17493. //--------------------------------------------许钟文-------------------------------------------
  17494. //return true;
  17495. return !!M.modelDataPromisesTiles(this.data) //免去访问mdoeldata.json的vision_version,不明白这是什么
  17496. //--------------------------------------------e n d -------------------------------------------
  17497. }
  17498. ,
  17499. n.prototype.toggleAlpha = function() {
  17500. this.alpha < 1 ? this.alpha = 1 : this.alpha = 0
  17501. }
  17502. ,
  17503. n.prototype.load = function(e) {
  17504. var t = function() {
  17505. return $.when(this.loadPanos(), this.loadMesh())
  17506. }
  17507. , i = this.urls.init().then(t.bind(this));
  17508. return e ? i = i.then(this.loadMeshTextures.bind(this)) : i.then(this.loadMeshTextures.bind(this)),
  17509. this.auxDataPromise = $.when( /*this.loadHighlightReel(), this.loadtags() */this.loadhots(), this.loadLabels()),
  17510. $.when(i, this.auxDataPromise).done(this.build.bind(this)) //不要另外使用active_reel文件
  17511. }
  17512. ,
  17513. n.prototype.loadMesh = function() {
  17514. function e(e) {
  17515. O.error(e),
  17516. n.reject("loading-failed")
  17517. }
  17518. function t(e, t) {
  17519. n.notify(e, t)
  17520. }
  17521. function i(e, t) {
  17522. if (0 === e.length) {
  17523. O.warn("No geometry found for model, loading faux geometry, disabling outside mode"),
  17524. r.supportedModes[c.DOLLHOUSE] = !1,
  17525. r.supportedModes[c.FLOORPLAN] = !1;
  17526. var i = new p({
  17527. geometry: new o.PlaneBufferGeometry(5,5,1,1)
  17528. });
  17529. i.material.visible = !1,
  17530. i.rotateX(-Math.PI / 2),
  17531. i.geometry.computeBoundingBox(),
  17532. e = [i]
  17533. }
  17534. e.forEach(function(e) {
  17535. var t = r.floorsEnabled ? S.parseFloor(e.name) : 0;
  17536. r.addChunk(t, e)
  17537. }),
  17538. r.floors.sort(),
  17539. n.resolve(r)
  17540. }
  17541. var n = $.Deferred()
  17542. , r = this;
  17543. return y.load(r.data.job.uuid, r.urls, i, t, e),
  17544. n.promise()
  17545. }
  17546. ,
  17547. n.prototype.loadMeshTextures = function() {
  17548. return this.loadTexturesPromise ? this.loadTexturesPromise : (this.loadTexturesPromise = C.load(this, this.meshTextures).then(function() {
  17549. this.meshTexturesLoaded = !0
  17550. }
  17551. .bind(this)),
  17552. this.loadTexturesPromise)
  17553. }
  17554. ,
  17555. /* n.prototype.loadtags = function() {//xzw改
  17556. var e = $.Deferred();
  17557. if (!f.tags.enabled)
  17558. return e.resolve();
  17559. //var t = this.options.urlBase + "/api/v1/jsonstore/model/tags/" + this.sid;
  17560. t = "data/" + this.sid + "/tags.json"
  17561. return a.get(t, {
  17562. responseType: "json",
  17563. auth: this.isPublic ? null : f.authorizationHeader
  17564. }).done(function(t) {
  17565. var i = 0
  17566. , n = 0;
  17567. for (var r in t) {
  17568. var o = t[r];
  17569. o.enabled && (n++,
  17570. (o.label.length || o.description.length) && (this.tags[r] = new m(this,r,o),
  17571. i++))
  17572. }
  17573. i !== n && O.warn("Disallowed " + (n - i) + " tags with no text data"),
  17574. e.resolve()
  17575. }
  17576. .bind(this)).fail(function() {
  17577. O.warn("Getting tags failed, not displaying tags."),
  17578. e.resolve()
  17579. }),
  17580. e
  17581. } */
  17582. n.prototype.shineHots = function(){ //xzw
  17583. E.trigger({
  17584. func: function(e) {
  17585. var opa = e <= .5 ? 2 * e : -2 * e + 2
  17586. for(var i in this.hots){
  17587. this.hots[i].mesh.material.uniforms.opac.value = opa;
  17588. }
  17589. }.bind(this),
  17590. cycling: true,
  17591. duration: 3000,
  17592. //easing: "easeInOutQuad",
  17593. name: "hotShine"
  17594. })
  17595. },
  17596. /* n.prototype.loadOverlays = function(overlays){
  17597. var overlays = window.data2 && window.data2.overlays
  17598. overlays && overlays.forEach((info)=>{
  17599. new Overlay(info)
  17600. })
  17601. Overlay.load()
  17602. }
  17603. */
  17604. n.prototype.loadhots = function() {//xzw
  17605. initHot(this)
  17606. this.roomLabels = []
  17607. this.hotsCount = 0;
  17608. var r = $.Deferred();
  17609. var t = g_Prefix+"data/" + this.sid + "/data2.js" +'?'+ randomTime().getTime();
  17610. return a.get(t, {
  17611. responseType: "json",
  17612. auth: this.isPublic ? null : f.authorizationHeader
  17613. }).done(function(e) {
  17614. window.data2 = e;
  17615. if(!e){
  17616. console.error("data2 is null")
  17617. }else{
  17618. g_data2 = hotMatcher(e);
  17619. let create = ()=>{
  17620. //因为热点保存后在hots里的顺序会被修改,所以使用order来记录顺序,这里要重排序:
  17621. if(e.hots){
  17622. var sids = Object.keys(e.hots).sort((a,b)=>{return e.hots[a].order - e.hots[b].order});
  17623. sids.forEach((sid)=>{
  17624. e.hots[sid].sid = sid
  17625. if(e.hots[sid].texType == 'photo' && !e.hots[sid].texSrc)return console.error('有photo热点无texSrc',e.hots[sid])
  17626. new Hot(e.hots[sid], e.hots[sid].version != 'multi' && "byHot" )
  17627. })
  17628. }
  17629. if(e.overlays){
  17630. e.overlays.forEach((info)=>{
  17631. //if(info.file.includes('m/data/762/edit/20210312_112357584.mp4') )return;
  17632. new Hot(info, 'byOverlay')
  17633. })
  17634. }
  17635. Hot.createHotList();
  17636. Hot.startLoad()
  17637. {
  17638. let maxCount = browser.isMobile() ? 200000 : 400000
  17639. let noVisiHots = this.hotGroup.children.filter(e=>!e.info.visiblePanos && e.info.texType != 'shine') //只看非热点的,否则数据太多
  17640. //let visiHots = this.hotGroup.children.filter(e=>e.info.visiblePanos)
  17641. let c = this.panos.list.length * this.colliders.length * noVisiHots.length
  17642. if(c > maxCount){ //防止加载时间过长,分批计算
  17643. console.log('hot分批setVisiblePanos')
  17644. Hot.visiPanosCountSlice = Math.ceil(maxCount / this.colliders.length / noVisiHots.length)
  17645. Hot.visiEveryDurSlice = browser.isMobile() ? 25 : 16;
  17646. let dur = Math.ceil(this.panos.list.length / Hot.visiPanosCountSlice) * Hot.visiEveryDurSlice
  17647. console.log(Hot.visiPanosCountSlice, Hot.visiEveryDurSlice, dur, Math.round(dur*noVisiHots.length))
  17648. if(noVisiHots.length){
  17649. let i = 0
  17650. let hotVisiInterval = setInterval(()=>{
  17651. noVisiHots[i].setVisiblePanos();
  17652. i++;
  17653. if(i>=noVisiHots.length){
  17654. clearInterval(hotVisiInterval)
  17655. }
  17656. }, dur)
  17657. }
  17658. }
  17659. }
  17660. if(DATA.roomLabels){
  17661. DATA.roomLabels.forEach((data)=>{
  17662. this.roomLabels.push(new RoomLabel(data))
  17663. })
  17664. }
  17665. }
  17666. if(player.currentPano){
  17667. create()
  17668. }else{
  17669. let f = ()=>{
  17670. window.bus.removeEventListener('playerAndModelReady',f)
  17671. create()
  17672. }
  17673. window.bus.addEventListener('playerAndModelReady',f)
  17674. }
  17675. g_index = w.valueFromHash("m");
  17676. }
  17677. /***************************方奕卓 请求data.js数据, 用于初始化热点列表 ****************************/
  17678. /* var dataJsPromise = $.Deferred();
  17679. var dataJsUrl = g_Prefix+"data/" + this.sid + "/hot/js/data.js" +'?'+ randomTime().getTime();
  17680. a.get(dataJsUrl,{
  17681. responseType: "json",
  17682. auth: this.isPublic ? null : f.authorizationHeader
  17683. }).done(function(data) {
  17684. window.hotData = data;
  17685. this.createHotItem(data, this.hots);
  17686. for(let i in this.hots){//add
  17687. data[i] && this.hots[i].initStyleImg(data[i]);
  17688. }
  17689. dataJsPromise.resolve();
  17690. }.bind(this)).fail(function(){
  17691. console.log('Data.js is empty');
  17692. dataJsPromise.resolve();
  17693. }) */
  17694. r.resolve();
  17695. }.bind(this)).fail(function() {
  17696. console.log('没有热点');
  17697. r.resolve()
  17698. }),
  17699. r
  17700. }
  17701. ,
  17702. n.prototype.loadPanos = function() {
  17703. if (this.loadPanosPromise)
  17704. return this.loadPanosPromise;
  17705. var e = new I(this);
  17706. return this.loadPanosPromise = e.load().then(function(e) {
  17707. return this.data.sweeps && Object.keys(this.data.sweeps).length > 0 && (e = e.filter(function(e) {
  17708. if(this.data.sweeps[e.uuid])return this.data.sweeps[e.uuid].enabled
  17709. else console.log(e.uuid)
  17710. }
  17711. .bind(this))),
  17712. this.panos.extend(e.map(function(e) {
  17713. return new v(this,e.uuid,e,this.supportsTiles)
  17714. }
  17715. .bind(this))),
  17716. this.panos.forEach(function(e) {
  17717. e.neighbourUUIDs && (e.neighbourUUIDs.forEach(function(t) {
  17718. var i = this.panos.get(t);
  17719. i && this.panos.setNeighbour(e, i, !0)
  17720. }
  17721. .bind(this)),
  17722. e.neighbourPanos = this.panos.getNeighbours(e) || this.panos.setNeighbour(e, e, !0))
  17723. }
  17724. .bind(this)),
  17725. 0 === this.panos.length && (O.warn("Model has no panos, turning off inside mode"),
  17726. this.supportedModes[c.PANORAMA] = !1),
  17727. $.when(this)
  17728. }
  17729. .bind(this)),
  17730. this.loadPanosPromise
  17731. }
  17732. ,
  17733. n.prototype.loadHighlightReel = function() {//xzw
  17734. var e = $.Deferred()
  17735. // , t = this.options.urlBase + "/api/v1/jsonstore/model/highlights/" + this.sid + "/active_reel";
  17736. ,t = this.options.urlBase + "data/" + this.sid + "/active_reel.json";
  17737. return a.get(t, {
  17738. responseType: "json",
  17739. auth: this.isPublic ? null : f.authorizationHeader
  17740. }).done(function(t) {
  17741. t.reel ? (O.info("Got highlight reel with " + t.reel.length + " items"),
  17742. this.images.filterByModesAndReel(this.supportedModes, t.reel)) : O.info("No highlight reel found"),
  17743. e.resolve()
  17744. }
  17745. .bind(this)).fail(function() {
  17746. O.warn("Getting highlight reel failed, no highlights available"),
  17747. e.resolve()
  17748. }),
  17749. e
  17750. }
  17751. ,
  17752. n.prototype.waitForLoad = function(e, t) {
  17753. t() || (this.waitQueue.push({
  17754. object: e,
  17755. isLoadedCallback: t
  17756. }),
  17757. 1 === this.waitQueue.length && this.emit("waiting"))
  17758. }
  17759. ,
  17760. n.prototype.hide = function() {
  17761. this.floors.hide()
  17762. }
  17763. ,
  17764. n.prototype.show = function() {
  17765. this.floors.show()
  17766. }
  17767. ,
  17768. n.prototype.floorNames = function() {
  17769. return this.floors.names()
  17770. }
  17771. ,
  17772. n.prototype.warpDestFloors = function(e, t) {
  17773. if (!e || this.floors.length !== e.length)
  17774. return void this.toggleAllFloors(!0);
  17775. var i = e.findIndex(function(e) {
  17776. return e
  17777. }
  17778. .bind(this));
  17779. i !== -1 && this.setFloor(this.floors.list[i], null, t)
  17780. }
  17781. ,
  17782. n.prototype.setFloor = function(e, t, i) {
  17783. this.allFloorsVisible && this.emit("allfloors.toggled", !1, this.currentFloor),
  17784. this.allFloorsVisible = !1,
  17785. this._setFloor(e, t, i)
  17786. }
  17787. ,
  17788. n.prototype.toggleAllFloors = function(e) {
  17789. this.allFloorsVisible = void 0 !== e ? e : !this.allFloorsVisible,
  17790. this.emit("allfloors.toggled", this.allFloorsVisible, this.currentFloor),
  17791. this._setFloor(this.currentFloor)
  17792. }
  17793. ,
  17794. n.prototype._setFloor = function(e, t, i) {
  17795. t = t || this.mode,
  17796. this.emit("floor.changed", e, t, this.currentFloor),
  17797. this.currentFloor = e;
  17798. var n;
  17799. if (t === c.PANORAMA) {
  17800. if (this.show(),
  17801. this.shouldShowtags && this.tagsShown)
  17802. for (n in this.tags)
  17803. this.tags[n].show(f.showFloorDuration)
  17804. } else if ((t === c.FLOORPLAN || t === c.DOLLHOUSE) && (this.floors.list.forEach(function(e, t) {
  17805. e.toggle(e === this.currentFloor || this.allFloorsVisible, i || this.allFloorsVisible)
  17806. }
  17807. .bind(this)),
  17808. this.shouldShowtags && this.tagsShown))
  17809. for (n in this.tags) {
  17810. var r = this.tags[n];
  17811. this.allFloorsVisible ? r.show(f.showFloorDuration) : r.floor === this.currentFloor ? r.show(f.showFloorDuration, f.showFloorDelay) : r.hide(f.hideFloorDuration, f.hideFloorDelay)
  17812. }
  17813. var o = this
  17814. , a = e;
  17815. E.start(function() {}, f.showFloorDelay, function() {
  17816. o.floors.forEach(function(e) {
  17817. e.chunks.forEach(function(t) {
  17818. t.renderOrder = e === a ? h.visibleFloor : h.ghostFloor
  17819. })
  17820. })
  17821. }
  17822. .bind(this))
  17823. }
  17824. ,
  17825. n.prototype.toggleExplode = function() {
  17826. this.floors.toggleExplodeHorizontal()
  17827. }
  17828. ,
  17829. n.prototype.toggleExplodeUp = function() {
  17830. this.floors.toggleExplodeVertical()
  17831. }
  17832. ,
  17833. n.prototype.nextFloor = function(e) {
  17834. return this.floors.nextFloor(this.currentFloor, e)
  17835. }
  17836. ,
  17837. n.prototype.addFloor = function(e) {
  17838. this.floors.add(e)
  17839. }
  17840. ,
  17841. n.prototype.getFloorAtPoint = function(e) {
  17842. return this.floors.getFloorAtPoint(e)
  17843. }
  17844. ,
  17845. n.prototype.getTagBySid = function(e) {
  17846. return this.tags[e]
  17847. }
  17848. ,
  17849. n.prototype.addChunk = function(e, t) {
  17850. this.floors.getOrMakeFloor(e).addChunk(t),
  17851. this.chunks.push(t)
  17852. }
  17853. ,
  17854. n.prototype.setMode = function(e) {
  17855. if (!this.supportedModes[e])
  17856. throw new R("Mode not supported for this model: " + e);
  17857. this.mode = e;
  17858. this.skybox.material.transparent = e == "panorama" ? false : true //xzw add // 如果skybox透明,会让其中其他mesh 如热点的透明出问题
  17859. this.chunks.forEach(function(t) {
  17860. t.setMode(e)
  17861. })
  17862. }
  17863. ,
  17864. n.prototype.build = function() {
  17865. this.heroLocations = this.images.getHeroLocations(this.panos);
  17866. var e = function() {
  17867. 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()
  17868. }
  17869. .bind(this)();
  17870. this.has360Views = f.show360Views.enabled && this.heroLocations.some(function(e) {
  17871. return e.cameraMode === c.PANORAMA && this.panos.get(e.panoId) && !this.panos.get(e.panoId).isAligned()
  17872. }
  17873. .bind(this)) || e,
  17874. null === this.heroImage && O.warn("No hero image defined."),
  17875. this.currentFloor = this.floors.last(),
  17876. this.floors.build(),
  17877. this.colliders = this.floors.reduce(function(e, t) {
  17878. return e.concat(t.collider.children)
  17879. }, []),
  17880. this.panos.forEach(function(e) {
  17881. e.build1(),
  17882. e.on("enter", function() {
  17883. e.floor !== this.currentFloor && this.setFloor(e.floor)
  17884. }
  17885. .bind(this))
  17886. }
  17887. .bind(this))
  17888. //有很多场景的floorPosition在地面之下,导致marker看不到,所以探测一下
  17889. let time1 = performance.now()
  17890. let downVec = new THREE.Vector3(0,-1,0)
  17891. this.panos.forEach((pano)=>{
  17892. player.raycaster.set(pano.position, downVec);
  17893. let collider = pano.floor.collider.children
  17894. let n = player.raycaster.intersectObjects(collider , true );//add true
  17895. if(n && n[0]){
  17896. if(n[0].point.y - pano.floorPosition.y > 0.03){
  17897. //console.error(`${pano.id}, 探测高度${n[0].point.y.toPrecision(5)} 原高度 ${pano.floorPosition.y.toPrecision(5)}, 相差 ${(n[0].point.y - pano.floorPosition.y).toPrecision(5)}`)
  17898. pano.originFloorY = pano.floorPosition.y
  17899. pano.floorPosition.y = n[0].point.y
  17900. }
  17901. }
  17902. //是否需要排除一下相差过高的?因为可能探测到的是长椅这样的
  17903. })
  17904. let time2 = performance.now()
  17905. console.log('探测时间',time2-time1)
  17906. this.panos.forEach(function(e) {
  17907. e.build2()
  17908. }),
  17909. this.floors.forEach(function(e) {
  17910. this.boundingBox.union(e.boundingBox)
  17911. }
  17912. .bind(this)),
  17913. this.size = this.boundingBox.size(),
  17914. this.center = this.boundingBox.center(),
  17915. this.floors.forEach(function(e) {
  17916. O.info("Floor " + e + ": " + e.children.length + " chunks, " + e.panos.length + " panos.")
  17917. }
  17918. .bind(this)),
  17919. this.panos.populate_path_graph(),
  17920. this.skybox = new l(this.boundingBox),
  17921. this.skybox.matrixWorldNeedsUpdate = !0,
  17922. this.add(this.skybox);
  17923. //因为一部分漫游点在模型外
  17924. {
  17925. let bounding = new THREE.Box3 //不包含pano的bound
  17926. this.floors.list.forEach(floor=>{
  17927. bounding.union(floor.conservativeBoundingBox)
  17928. })
  17929. this.boundWithoutPanos = bounding
  17930. this.sizeWithoutPanos = bounding.size()
  17931. this.centerWithoutPanos = bounding.center()
  17932. /* 如果想居中模型, bound不加pano:
  17933. this.boundingBox = bounding
  17934. this.size = bounding.size()
  17935. this.center = bounding.center() */
  17936. }
  17937. this.createFloorLogo()
  17938. return O.debug("Done building model"),
  17939. v.raycastsDone > 0 && (O.warn("raycasts: " + v.raycastsDone),
  17940. O.warn("raycasts skipped: " + v.raycastsSkipped)),
  17941. this.buildRooms(),
  17942. this.labels.associateWithRooms(this.rooms),
  17943. $.when(this)
  17944. }
  17945. ,
  17946. n.prototype.createFloorLogo = function(){
  17947. console.log('createFloorLogo')
  17948. if(this.floorLogos || !settings.floorlogoURL)return;
  17949. var url = settings.floorlogoURL
  17950. var map = tex.load(url);//可以追加done
  17951. this.floorLogos = [];
  17952. for(var i=0; i<2; i++){ //不可共用uniforms等 [0]在上一个位置,[1]是下一个位置、 是飞入及飞出后的位置
  17953. var material = new o.MeshBasicMaterial({
  17954. opacity:0,
  17955. map:map,
  17956. side: o.DoubleSide,
  17957. transparent: !0,
  17958. depthWrite: !1,
  17959. depthTest:false//改 在chunk\skybox外也可看到
  17960. });
  17961. var logo = new o.Mesh(new o.PlaneGeometry(2,2,1,1),material);
  17962. //var s = (Store.metadata.floorLogoSize || 100)/100;
  17963. //logo.scale.set(s,s,s);
  17964. logo.position.set(0,-1.5,0);
  17965. logo.lookAt(logo.position.clone().add(new o.Vector3(0,1,0)));
  17966. logo.renderOrder = 100;//cover the videoSkybox
  17967. //logo.layers.set(0)
  17968. this.add(logo);
  17969. this.floorLogos.push(logo);
  17970. }
  17971. this.floorLogos[1].visible = false;
  17972. }
  17973. n.prototype.adjustfloorLogoHeight = function(o){
  17974. var h = player.currentPano.floorPosition.y + 0.01;
  17975. this.floorLogos[1].position.setY(h);
  17976. this.floorLogos[0].position.setY(h);
  17977. //publicObjectSet.player.path.currentPanoMarker.mesh.position.y = h
  17978. },
  17979. n.prototype.changefloorLogoOpa = function(o){//改 i, opacity, time, delay
  17980. if(!this.floorLogos) return;
  17981. E.cancelById("flOpa_"+o.index);//先停止之前该logo的透明度变化
  17982. if(o.from!=void 0)this.floorLogos[o.index].material.opacity = o.from;//初始透明度
  17983. if(!o.dur){//立刻
  17984. //this.floorLogos[o.index].material.uniforms.opacity.value = o.opa;
  17985. this.floorLogos[o.index].material.opacity = o.opa;
  17986. }else{
  17987. //E.start(lerp.uniform(this.floorLogos[o.index], "opacity", o.opa), o.dur || 0, null,
  17988. E.start(lerp.property(this.floorLogos[o.index].material, "opacity", o.opa), o.dur || 0, null,
  17989. o.delay||0, es["easeInQuad"], "changefloorLogoOpa", "flOpa_"+o.index)
  17990. }
  17991. },
  17992. n.prototype.updateFloorlogo = function() { //xzw add 更新地标的旋转
  17993. var lastQ, lastP;
  17994. var equals = function(v1, v2, min){
  17995. return Math.abs(v1-v2) < min
  17996. }
  17997. var isSame = function(now, last, k){//如果和上次相同就不改变
  17998. if(!last)return false;
  17999. var R = k.sceneRenderer;
  18000. //var min = R.AFPS < 38 ? 0.005 : R.AFPS < 45 ? 0.0008 : R.AFPS < 50 ? 0.0006 : 0.0003;
  18001. //暂时:
  18002. var min = 0.0008
  18003. var same = equals(now.x , last.x, min) && equals(now.y , last.y, min) && equals(now.z , last.z, min)
  18004. && (now.w!=void 0 ? equals(now.w , last.w, min) : true)
  18005. return same;
  18006. }
  18007. return function(Q, k){
  18008. if(!Q)return;
  18009. /* if(Config.ifFish && window.lowFPS){
  18010. this.fLCompute++;
  18011. if(R.AFPS < 38){
  18012. if(k.flyingToTag && k.flying && k.fLCompute %4 !=1) return; //点击tag过渡
  18013. else if(k.flying && k.fLCompute%2 !=1) return;
  18014. k.fLCompute %= 4;
  18015. }else if(R.AFPS < 45){
  18016. if(k.flyingToTag && k.flying && k.fLCompute %3 !=1) return; //点击tag过渡
  18017. else if(k.flying && k.fLCompute%2 !=1) return;
  18018. k.fLCompute %= 6;
  18019. }else{
  18020. if(k.flyingToTag && k.flying && k.fLCompute %2 !=1) return;
  18021. //else if(k.flying && k.fLCompute%2 !=1) return;
  18022. k.fLCompute %= 2;
  18023. }
  18024. } */
  18025. var sameQ, sameP, quaternion, visible;
  18026. for(var i=0;i<2;i++){
  18027. var logo = this.floorLogos[i];
  18028. if(!logo.visible || logo.material.uniforms.opacity.value==0) continue;
  18029. visible = true;
  18030. }
  18031. if(!visible)return; //如果两个都不可见,就不更改,如果有一个可见,就都改
  18032. var c = k.cameraControls.activeControl;
  18033. var sameQ = c ? ( c.lat < 10 ? equals(c.lon, lastQ, 0.1) : equals(c.lon, lastQ, 1) ): false;
  18034. sameQ || (lastQ = c ? c.lon : null); //相机旋转是否改变了
  18035. for(var i=0;i<2;i++){
  18036. var logo = this.floorLogos[i];
  18037. if(!sameQ){
  18038. if(!quaternion){
  18039. var a = new THREE.Vector3(0,0,-1);
  18040. a.applyQuaternion(Q);
  18041. a.setY(0);
  18042. var _ = (new THREE.Matrix4).lookAt(a,new THREE.Vector3, new THREE.Vector3(0,1,0));
  18043. quaternion = (new THREE.Quaternion).setFromRotationMatrix(_)
  18044. var a = new THREE.Quaternion( 0, 0.7071067811865476, 0.7071067811865476 , 0)//计算得
  18045. quaternion.multiply(a);
  18046. }
  18047. logo.quaternion.copy(quaternion);
  18048. }
  18049. }
  18050. }
  18051. }()
  18052. n.prototype.loadLabels = function() {//xzw
  18053. this.labels = new x(this);
  18054. var e = $.Deferred();
  18055. //加载俯视图的标签 注释这个备注就会加载
  18056. //原先是labels, 改为showLabels,因为之前的somedata写的labels都是true
  18057. window.DATA.showingLabels ? this.showingLabels = true : '';
  18058. if (!this.showingLabels)
  18059. return e.resolve();
  18060. // var t = this.options.urlBase + "/api/v1/jsonstore/model/labels/" + this.sid;
  18061. var t = g_Prefix + "data/" + this.sid + "/labels.json";
  18062. return this.labels.load(t, !this.isPublic).done(e.resolve.bind(e)).fail(function() {
  18063. O.warn("Getting labels failed, not displaying labels."),
  18064. e.resolve()
  18065. }),
  18066. e
  18067. }
  18068. ,
  18069. n.prototype.buildRooms = function() {
  18070. this.rooms = new T(this),
  18071. this.rooms.createFromChunks(this.chunks),
  18072. this.rooms.calcRoomBoundaries()
  18073. }
  18074. ,
  18075. n.prototype.updateProjectedPanos = function() {
  18076. this.projectedPano0 && this.projectedPano1 && this.setProjectedPanos(this.projectedPano0, this.projectedPano1, !1)
  18077. }
  18078. ,
  18079. n.prototype.setProjectedPanos = function(e, t, i) {
  18080. void 0 !== i && null !== i || (i = !0),
  18081. i = !!i,
  18082. this.projectedPano0 = e,
  18083. this.projectedPano1 = t,
  18084. this.skybox.material.setProjectedPanos(e, t, i),
  18085. this.chunks.forEach(function(n) {
  18086. n.materialInside.setProjectedPanos(e, t, i)
  18087. })
  18088. }
  18089. ,
  18090. n.prototype.setSide = function(e) {
  18091. this.floors.forEach(function(t) {
  18092. t.collider.material.side = e
  18093. })
  18094. }
  18095. ,
  18096. n.prototype.heroCount = function() {
  18097. return this.heroLocations ? this.heroLocations.length : 0
  18098. }
  18099. ,
  18100. n.prototype.getHeroDescriptorByIndex = function(e=[]) {//改 因增加了二级目录
  18101. if (e[0] < 0)
  18102. return O.warn("Model.getHeroDescriptorByHeroIndex() -> heroIndex is less than 0."),
  18103. null;
  18104. if (this.heroCount() < 1)
  18105. return O.warn("Model.getHeroDescriptorByIndex() -> No hero locations in this model"),
  18106. null;
  18107. var t = this.heroLocations[e[0]];
  18108. if(t.heroLocations && e[1]!=void 0){
  18109. t = t.heroLocations[e[1]];
  18110. }
  18111. return void 0 === t ? (O.warn("Model.getHeroDescriptorByIndex() -> Index " + e + " is not a validindex"),
  18112. null) : t
  18113. }
  18114. ,
  18115. n.prototype.findPanoramicHero = function() {
  18116. for (var e in this.heroLocations)
  18117. if (this.heroLocations[e].cameraMode === c.PANORAMA)
  18118. return this.heroLocations[e];
  18119. return null
  18120. }
  18121. ,
  18122. n.prototype.listImagePanos = function() {
  18123. var e = []
  18124. , t = this;
  18125. return this.images.forEach(function(i) {
  18126. if (i.metadata && i.metadata.scan_id) {
  18127. var n = t.panos.get(i.metadata.scan_id);
  18128. n && (t.supportsTiles || n.isLoaded("high") || e.push(n))
  18129. }
  18130. }),
  18131. e
  18132. }
  18133. ,
  18134. n.prototype.fadePanoMarkers = function(/* e, t */opacity, dur, o = {}) {//改
  18135. //this.panos.fadeMarkerOpacity(e, t)
  18136. if(window.DATA.hideFloorMarker)return
  18137. var currentPano = player.currentPano
  18138. opacity = void 0 == opacity ? _settings.panorama.markerOpacity : opacity //不传opacity代表显示
  18139. var hideWhenFlyOut = () => {
  18140. var shows = [],
  18141. hides = []
  18142. player.model.panos.forEach(pano => {
  18143. hides.push(pano)
  18144. })
  18145. this.panos.fadeMarkerOpacity(0, dur, [{ toOp: 0, member: hides }])
  18146. }
  18147. if (opacity == 0) {
  18148. hideWhenFlyOut()
  18149. } else {
  18150. if (player.mode == 'panorama' && currentPano) {
  18151. var shows = [], hides = []
  18152. player.model.panos.forEach(pano => { //是邻近点就显示否则隐藏
  18153. if (currentPano.neighbourPanos[pano.id]) {
  18154. shows.push(pano)
  18155. } else {
  18156. hides.push(pano)
  18157. }
  18158. })
  18159. this.panos.fadeMarkerOpacity(opacity, dur, [
  18160. { toOp: opacity, member: shows },
  18161. { toOp: 0, member: hides },
  18162. ])
  18163. } else if (player.modeTran.split('-')[1] != 'panorama') {
  18164. //飞出后marker隐藏
  18165. hideWhenFlyOut()
  18166. }
  18167. }
  18168. }
  18169. ,
  18170. n.prototype.setSweepVisibility = function(e) {
  18171. this.panos.forEach(function(t) {
  18172. t.marker && (t.marker.visible = e)
  18173. })
  18174. }
  18175. ,
  18176. n.prototype.outsideAllowed = function() {
  18177. return this.supportedModes[c.DOLLHOUSE] && this.supportedModes[c.FLOORPLAN]
  18178. }
  18179. ,
  18180. n.prototype.addHighMapCube = function() {
  18181. //创建8*8的tile cube
  18182. if (player.qualityManager.getMaxZoomClass() == '4k' && player.qualityManager.maxRenderTargetSize == 2048) {
  18183. var geo = new THREE.PlaneGeometry(1, 1, 1, 1)
  18184. var cube = new THREE.Object3D()
  18185. cube.tiles = []
  18186. for (var cubeIndex = 0; cubeIndex < 6; cubeIndex++) {
  18187. var face = new THREE.Object3D()
  18188. for (var i = 0; i < 8; i++) {
  18189. for (var j = 0; j < 8; j++) {
  18190. var tile = new THREE.Mesh(geo, new THREE.MeshBasicMaterial({ side: 2 }))
  18191. tile.position.set(i - 3.5, j - 3.5, -4)
  18192. if (highMapAddColor) {
  18193. tile.material.opacity = 0.4
  18194. var colorHue = Math.random()
  18195. tile.material.color = new THREE.Color().setHSL(colorHue, 0.6, 0.9)
  18196. }
  18197. tile.material.transparent = true
  18198. tile.material.depthTest /* = tile.material.depthWrite */ = false //防止chunk比cube近从而被遮 且能不遮住box视频和热点等
  18199. tile.visible = false
  18200. tile.tileX = i
  18201. tile.tileY = j
  18202. tile.cubeFace = cubeIndex
  18203. tile.renderOrder = 2//RenderOrder.highTileCube
  18204. cube.tiles.push(tile)
  18205. face.add(tile)
  18206. }
  18207. }
  18208. switch (cubeIndex) {
  18209. case GLCubeFaces.GL_TEXTURE_CUBE_MAP_POSITIVE_X:
  18210. face.rotation.set(0, Math.PI / 2, 0)
  18211. break
  18212. case GLCubeFaces.GL_TEXTURE_CUBE_MAP_NEGATIVE_X:
  18213. face.rotation.set(0, -Math.PI / 2, 0)
  18214. break
  18215. case GLCubeFaces.GL_TEXTURE_CUBE_MAP_POSITIVE_Y:
  18216. var rot1 = new THREE.Quaternion().setFromAxisAngle(new THREE.Vector3(0, 1, 0), Math.PI)
  18217. var rot2 = new THREE.Quaternion().setFromAxisAngle(new THREE.Vector3(1, 0, 0), Math.PI / 2)
  18218. face.quaternion.copy(rot1).multiply(rot2)
  18219. //face.rotation.set(Math.PI/2,0,0);
  18220. break
  18221. case GLCubeFaces.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y:
  18222. //face.rotation.set(-Math.PI/2,0,0);
  18223. var rot1 = new THREE.Quaternion().setFromAxisAngle(new THREE.Vector3(0, 1, 0), Math.PI)
  18224. var rot2 = new THREE.Quaternion().setFromAxisAngle(new THREE.Vector3(1, 0, 0), -Math.PI / 2)
  18225. face.quaternion.copy(rot1).multiply(rot2)
  18226. break
  18227. case GLCubeFaces.GL_TEXTURE_CUBE_MAP_POSITIVE_Z:
  18228. face.rotation.set(0, Math.PI, 0)
  18229. break
  18230. case GLCubeFaces.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z:
  18231. face.rotation.set(0, 0, 0)
  18232. }
  18233. face.scale.set(1, -1, 1)
  18234. cube.add(face)
  18235. }
  18236. cube.name = 'highMapCube'
  18237. this.highMapCube = cube
  18238. this.add(cube)
  18239. cube.scale.set(0.21, 0.21, 0.21) //camera.near is 0.1
  18240. this.highMapCube.visible = false
  18241. this.highMapCube.texLoadedCount = 0
  18242. player.once("pano.chosen",()=>{//wait sceneRenderer
  18243. player.sceneRenderer.on('after-render', e => {
  18244. if (this.highMapCube.visibleTiles) {
  18245. this.updateTiles()
  18246. }
  18247. if (player && player.lastFrameChanged) {
  18248. common.intervalTool.isWaiting(
  18249. 'update4kTiles',
  18250. () => {
  18251. let vectorForward = player.getDirection()
  18252. this.updateTiles(vectorForward)
  18253. },
  18254. 500
  18255. )
  18256. }
  18257. })
  18258. })
  18259. }
  18260. }
  18261. /*
  18262. highMapCube会遮住场景中所有物体, 如果一定要显示的话,只能类似potree中的那样渲染一个深度贴图出来(model无需贴图),然后其他所有物体的shader中都加入一段代码。(貌似本身已经支持了?)
  18263. */
  18264. n.prototype.isHighMapLoaded = function(cubeFace, tileX, tileY){
  18265. var tile = this.highMapCube.children[cubeFace].children[tileX * 8 + tileY]
  18266. return !!tile.material.map
  18267. }
  18268. n.prototype.updateTiles = function(direction) {
  18269. if (!this.highMapCube || !this.highMapCube.visible) return
  18270. if (this.highMapCube.tiles.filter(e => e.image).length <= 10) return //加载的太少了
  18271. //performance.mark('updateTiles-start')
  18272. if (direction) {
  18273. let camera = player.cameraControls.cameras.panorama
  18274. let hfov = THREE.Math.degToRad(cameraLight.getHFOVForCamera(camera, $("#player").width(), $("#player").height())) / 2
  18275. let vfov = THREE.Math.degToRad(camera.fov) / 2
  18276. /* let hcos = Math.cos(hfov / 2)
  18277. let vcos = Math.cos(vfov / 2) */
  18278. let list = this.highMapCube.tiles
  18279. list.forEach(e => {
  18280. //屏幕外的不显示
  18281. let pos = e.getWorldPosition(new THREE.Vector3())
  18282. let dir = new THREE.Vector3().subVectors(pos, this.highMapCube.position).normalize()
  18283. let hcos_ = dir.clone().setY(direction.y).normalize().dot(direction) //在direction的斜面上水平角度差
  18284. let hRad = Math.acos(hcos_)
  18285. let vRad = -200
  18286. if (hRad > hfov + 0.08) {
  18287. e.score = -100
  18288. } else {
  18289. vRad = Math.abs(Math.acos(dir.y) - Math.acos(direction.y))
  18290. if (vRad > vfov + 0.08) {
  18291. e.score = -100
  18292. } else {
  18293. e.score = -(hRad / hfov + vRad / vfov)
  18294. }
  18295. }
  18296. e.scores = hRad.toFixed(3) + ', ' + vRad.toFixed(3)
  18297. if (e.score == -100) {
  18298. this.resetTile(e)
  18299. }
  18300. })
  18301. this.highMapCube.visibleTiles = list.filter(e => e.score > -100)
  18302. /* this.highMapCube.visibleTiles.sort((e,b)=>{return e.score-b.score})
  18303. this.highMapCube.visibleTiles = this.highMapCube.visibleTiles.slice(0,10)
  18304. */
  18305. //list.forEach(e=>e.scoreLabel.setText(e.scores))
  18306. }
  18307. let needRecover = this.highMapCube.visibleTiles.filter(e => !e.material.map)
  18308. if (needRecover.length) {
  18309. let maxCount = 1//common.getBestCount({ name: '4kmaxTileRecover', minCount: 0, maxCount: 2, durBound1: 1.5, durBound2: 6, ifLog: false, maxHistory: 2 })
  18310. let count = 0
  18311. needRecover.forEach((e, i) => {
  18312. //只更新若干个,因为太耗时了, 其余的等下帧更新
  18313. if (count >= maxCount) return
  18314. let r = this.recoverTile(e)
  18315. if (r) count++
  18316. })
  18317. }
  18318. }
  18319. n.prototype.getHighImage = function(image, cubeFace, tileX, tileY){
  18320. this.gotSomeHighImg = true; //标记,需要马上updateTiles
  18321. let tile = this.highMapCube.children[cubeFace].children[tileX * 8 + tileY]
  18322. tile.image = image //先记录下来
  18323. }
  18324. n.prototype.updateHighMap = function(image, cubeFace, tileX, tileY) {
  18325. let tile = this.highMapCube.children[cubeFace].children[tileX * 8 + tileY]
  18326. if (image) tile.image = image //先记录下来
  18327. if (tile.material.map) return
  18328. if (this.highMapCube.visibleTiles && !this.highMapCube.visibleTiles.includes(tile) ) {
  18329. return
  18330. }
  18331. //简易创建贴图
  18332. /* var tex = this.$app.core.get('SceneRenderer').initSizedTexture2D(512, THREE.ClampToEdgeWrapping)
  18333. //var loaded = this.$app.core.get('Player').model.isHighMapLoaded(tile.cubeFace, tile.tileX, tile.tileY)
  18334. this.$app.core.get('SceneRenderer').uploadTexture2D(image, tex, 0, 0, 512, 512) //只替换tex对应的img,不新建
  18335. */
  18336. var tex = new THREE.Texture()
  18337. tex.image = image
  18338. tex.flipY = false
  18339. tex.wrapS = tex.wrapT = THREE.ClampToEdgeWrapping
  18340. tex.generateMipmaps = false
  18341. tex.minFilter = THREE.LinearFilter
  18342. tex.needsUpdate = true
  18343. tile.material.map = tex
  18344. if (highMapAddColor) {
  18345. tile.material.opacity = 1
  18346. }
  18347. tile.visible = true
  18348. tile.material.needsUpdate = true //发现每次开始放大但还未放大到4k时也会把之前加载过的4k加载
  18349. //console.log( {level:1} , 'updateHighMap', cubeFace, tileX, tileY)
  18350. }
  18351. n.prototype.recoverTile = function(tile) {
  18352. if (tile.material.map) return
  18353. if (tile.image) {
  18354. this.updateHighMap(tile.image, tile.cubeFace, tile.tileX, tile.tileY)
  18355. return true
  18356. } else {
  18357. //console.log('no image')
  18358. }
  18359. }
  18360. n.prototype.resetTile = function(tile, kill) {
  18361. if (kill) {
  18362. //完全消灭
  18363. tile.image = null
  18364. }
  18365. let map = tile.material.map
  18366. if (map) {
  18367. map.dispose() //这句其实无效。本来可以使用three自带的deallocateTexture(texture),但因为创建的方式不是普通的new Texture,所以并没有onTextureDispose的侦听,故要自己写
  18368. map.loaded = !1
  18369. map.version = 0
  18370. //这两句才是真正释放贴图资源的 ,类似app.sceneRenderer.deallocateCubeTexture(tile.material.map)
  18371. var h = player.sceneRenderer.renderer.properties.get(map)
  18372. player.sceneRenderer.renderer.getContext().deleteTexture(h.__webglTexture)
  18373. tile.material.map = null
  18374. if (highMapAddColor) {
  18375. tile.material.opacity = 0.4
  18376. }
  18377. tile.material.needsUpdate = true
  18378. tile.visible = false
  18379. //this.highMapCube.texLoadedCount --
  18380. //console.log({level:1},'resetTile'/* , tile.cubeFace, tile.tileX, tile.tileY */)
  18381. }
  18382. }
  18383. n.prototype.resetHighMap = function() {
  18384. if (!this.highMapCube) return
  18385. this.highMapCube.children.forEach(e =>
  18386. e.children.forEach(tile => {
  18387. this.resetTile(tile, true)
  18388. })
  18389. )
  18390. //this.highMapCube.texLoadedCount = 0
  18391. this.highMapCube.visibleTiles = null
  18392. this.hideHighMap()
  18393. }
  18394. n.prototype.setHighMap = function(pano) {
  18395. if (!this.highMapCube) return
  18396. this.highMapCube.position.copy(pano.position)
  18397. this.highMapCube.quaternion.copy(pano.quaternion)
  18398. }
  18399. n.prototype.showHighMap = function() {
  18400. if (!this.highMapCube) return
  18401. this.highMapCube.visible = true
  18402. }
  18403. n.prototype.hideHighMap = function() {
  18404. if (!this.highMapCube) return
  18405. this.highMapCube.visible = false
  18406. }
  18407. //缩小后继续显示cube呢还是不显示? 不显示的话,就要把cube上的复制到renderTarget上……会不会又崩溃,or没加载的显示???
  18408. t.exports = n
  18409. }
  18410. ).call(this, "/js/model/Model.js")
  18411. }
  18412. , {
  18413. "../constants": 8,
  18414. "../enum/AlignmentType": 17,
  18415. "../enum/RenderOrder": 42,
  18416. "../enum/Viewmode": 51,
  18417. "../exception/BasicException": 55,
  18418. "../label/Label": 90,
  18419. "../loaders/ModelLoader": 105,
  18420. "../loaders/ModelTextureLoader": 106,
  18421. "../loaders/SweepDataLoader": 107,
  18422. "../tag/tag": 123,
  18423. "./util/cameraLight": 184,
  18424. "../tag/tagManager": 124,
  18425. "../objects/BoundingTextureSkybox": 143,
  18426. "../objects/Chunk": 144,
  18427. "../objects/Floor": 146,
  18428. "../objects/Panorama": 148,
  18429. "../objects/Room": 150,
  18430. "../objects/Snapshot": 153,
  18431. "../settings": 166,
  18432. "../shaders": 167,
  18433. "../util/ModelUrls": 177,
  18434. "../util/PanoramaCollection": 178,
  18435. "../util/ajax": 181,
  18436. "../util/common": 185,
  18437. "../util/easing": 186,
  18438. "../util/lerp": 188,
  18439. "../util/logger": 189,
  18440. "../util/math": 190,
  18441. "../util/texture": 194,
  18442. "../util/transitions": 195,
  18443. "./../util/browser": 182,
  18444. "./../util/showcase": 193,
  18445. "./Chunks": 135,
  18446. "./FloorCollection": 136,
  18447. "./ImageCollection": 137,
  18448. "./LabelCollection": 138,
  18449. "./RoomCollection": 141,
  18450. events: 202,
  18451. three: 217,
  18452. "hot": "hot" ,
  18453. "../enum/GLCubeFaces":25 ,
  18454. }],
  18455. 140: [function(e, t, i) {
  18456. "use strict";
  18457. function n() {
  18458. this.modelMap = {},
  18459. this.activeModel = null,
  18460. this.modelCount = 0,
  18461. this.tileDownloader = null,
  18462. this.panoRenderer = null
  18463. }
  18464. var r = (e("three"),
  18465. e("../util/common"))
  18466. , o = e("../exception/BasicException")
  18467. , a = e("../enum/ModelManagerEvents")
  18468. , s = e("../enum/PanoRendererEvents")
  18469. , l = e("events").EventEmitter;
  18470. n.prototype.init = function(e, t, i) {
  18471. this.tileDownloader = e,
  18472. this.panoRenderer = t,
  18473. this.qualityManager = i,
  18474. this.bindEvents()
  18475. }
  18476. ,
  18477. n.prototype.bindEvents = function() {
  18478. this.panoRenderer.on(s.TileRenderSuccess, this.onTileRendered.bind(this))
  18479. }
  18480. ,
  18481. n.prototype.onTileRendered = function(e, t, i, n) {}
  18482. ,
  18483. n.prototype.addModel = function(e) {
  18484. this.modelMap[e.sid] = e,
  18485. 0 === this.modelCount && this.activateModel(e.sid),
  18486. this.modelCount++,
  18487. this.emit(a.ModelAdded)
  18488. }
  18489. ,
  18490. n.prototype.getModel = function(e) {
  18491. return this.modelMap[e]
  18492. }
  18493. ,
  18494. n.prototype.activateModel = function(e) {
  18495. var t = this.modelMap[e];
  18496. if (!t)
  18497. throw new o("Tried to activate invalid model!");
  18498. var i = this.activeModel;
  18499. this.activeModel = t,
  18500. this.tileDownloader.setPanoData(t.panos, t.listImagePanos(), t.sid),
  18501. this.tileDownloader.setUrls(t.urls),
  18502. t.panos.forEach(function(e) {
  18503. e.attachToPanoRenderer(this.panoRenderer),
  18504. e.tileDownloader = this.tileDownloader,
  18505. e.qualityManager = this.qualityManager
  18506. }
  18507. .bind(this)),
  18508. this.emit(a.ActiveModelChanged, {
  18509. oldModel: i,
  18510. model: t
  18511. })
  18512. }
  18513. ,
  18514. n.prototype.getActiveModel = function() {
  18515. return this.activeModel
  18516. }
  18517. ,
  18518. r.extend(n, l),
  18519. t.exports = n
  18520. }
  18521. , {
  18522. "../enum/ModelManagerEvents": 33,
  18523. "../enum/PanoRendererEvents": 35,
  18524. "../exception/BasicException": 55,
  18525. "../util/common": 185,
  18526. events: 202,
  18527. three: 217
  18528. }],
  18529. 141: [function(e, t, i) {
  18530. (function(i) {
  18531. "use strict";
  18532. function n() {
  18533. s.call(this)
  18534. }
  18535. var r = e("../objects/Room")
  18536. , o = (e("../settings"),
  18537. e("../util/logger"))
  18538. , a = (e("../util/transitions"),
  18539. e("../util/easing"),
  18540. e("../util/common"))
  18541. , s = e("../util/IndexedCollection")
  18542. , l = e("./Chunks");
  18543. new o(i);
  18544. a.inherit(n, s),
  18545. n.prototype.getIndex = function(e) {
  18546. return e.roomId
  18547. }
  18548. ,
  18549. n.prototype.calcRoomBoundaries = function() {
  18550. this.forEach(function(e) {
  18551. e.calcBoundaries()
  18552. })
  18553. }
  18554. ,
  18555. n.prototype.createFromChunks = function(e) {
  18556. var t = {
  18557. floorId: -1,
  18558. roomId: -1
  18559. }
  18560. , i = {};
  18561. e.forEach(function(e) {
  18562. l.parseIdsFromChunkName(e.name, t);
  18563. var o = i[t.roomId];
  18564. if (!o) {
  18565. var a = n.generateRoomId(t.floorId, t.roomId);
  18566. o = new r(t.floorId,a),
  18567. this.add(o),
  18568. i[t.roomId] = o
  18569. }
  18570. o.addChunk(e)
  18571. }
  18572. .bind(this)),
  18573. this.calcRoomBoundaries()
  18574. }
  18575. ,
  18576. n.generateRoomId = function(e, t) {
  18577. return e + "_" + t
  18578. }
  18579. ,
  18580. t.exports = n
  18581. }
  18582. ).call(this, "/js/model/RoomCollection.js")
  18583. }
  18584. , {
  18585. "../objects/Room": 150,
  18586. "../settings": 166,
  18587. "../util/IndexedCollection": 175,
  18588. "../util/common": 185,
  18589. "../util/easing": 186,
  18590. "../util/logger": 189,
  18591. "../util/transitions": 195,
  18592. "./Chunks": 135
  18593. }],
  18594. 142: [function(e, t, i) {
  18595. "use strict";
  18596. function n(e, t, i) {
  18597. e = e.clone().expandByScalar(0.01);//改
  18598. var n = e.size()
  18599. , o = new r.BoxGeometry(n.x,n.y,n.z);
  18600. o.boundingBox = e,
  18601. r.Mesh.call(this, o, t),
  18602. this.position.copy(e.center()),
  18603. this.frustumCulled = !1,
  18604. i && this.add(new r.WireframeHelper(this))
  18605. }
  18606. var r = e("three");
  18607. n.prototype = Object.create(r.Mesh.prototype),
  18608. n.prototype.constructor = n,
  18609. t.exports = n
  18610. }
  18611. , {
  18612. three: 217
  18613. }],
  18614. 143: [function(e, t, i) {
  18615. (function(i) {
  18616. "use strict";
  18617. function n(e) {
  18618. h.time("Computing a nice bounding cubemap");
  18619. var t = new a({
  18620. side: r.BackSide,
  18621. transparent: !0
  18622. });
  18623. t.uniforms.modelAlpha.value = 0,
  18624. t.uniforms.opacity.value = 1 - s.modelAlpha,
  18625. this.renderOrder = l.boundingSkybox,
  18626. o.call(this, e, t),
  18627. h.timeEnd("Computing a nice bounding cubemap")
  18628. }
  18629. var r = e("three")
  18630. , o = (e("../enum/Viewmode"),
  18631. e("../shaders"),
  18632. e("./BoundingMesh"))
  18633. , a = e("../materials/ModelTextureMaterial")
  18634. , s = e("../settings")
  18635. , l = e("../enum/RenderOrder")
  18636. , c = e("../util/logger")
  18637. , h = new c(i);
  18638. n.prototype = Object.create(o.prototype),
  18639. n.prototype.constructor = n,
  18640. t.exports = n
  18641. }
  18642. ).call(this, "/js/objects/BoundingTextureSkybox.js")
  18643. }
  18644. , {
  18645. "../enum/RenderOrder": 42,
  18646. "../enum/Viewmode": 51,
  18647. "../materials/ModelTextureMaterial": 118,
  18648. "../settings": 166,
  18649. "../shaders": 167,
  18650. "../util/logger": 189,
  18651. "./BoundingMesh": 142,
  18652. three: 217
  18653. }],
  18654. 144: [function(e, t, i) {
  18655. "use strict";
  18656. function n(e) {
  18657. this.materialInside = new s({
  18658. side: r.DoubleSide
  18659. });
  18660. var t = r.UniformsUtils.clone(o.modelOutside.uniforms);
  18661. this.materialOutside = new r.RawShaderMaterial({
  18662. fragmentShader: o.modelOutside.fragmentShader,
  18663. vertexShader: o.modelOutside.vertexShader,
  18664. uniforms: t,
  18665. side: r.FrontSide,
  18666. name: "chunkOut"
  18667. }),
  18668. r.Mesh.call(this, e.geometry, this.materialInside),
  18669. this.name = e.name || "",
  18670. this.textureName = e.textureName,
  18671. this.meshUrl = e.meshUrl
  18672. }
  18673. var r = e("three")
  18674. , o = e("../shaders")
  18675. , a = e("../enum/Viewmode")
  18676. , s = e("../materials/ModelTextureMaterial");
  18677. n.prototype = Object.create(r.Mesh.prototype),
  18678. n.prototype.setTextureMap = function(e) {
  18679. this.materialInside.uniforms.map.value = e,
  18680. this.materialOutside.uniforms.map.value = e
  18681. }
  18682. ,
  18683. n.prototype.setMode = function(e) {
  18684. var t = e === a.DOLLHOUSE || e === a.FLOORPLAN ? this.materialOutside : this.materialInside;
  18685. t.side = e === a.PANORAMA ? r.DoubleSide : r.FrontSide,
  18686. t.transparent = this.material.transparent,
  18687. t.uniforms.opacity.value = this.material.uniforms.opacity.value,
  18688. this.material = t
  18689. }
  18690. ,
  18691. t.exports = n
  18692. }
  18693. , {
  18694. "../enum/Viewmode": 51,
  18695. "../materials/ModelTextureMaterial": 118,
  18696. "../shaders": 167,
  18697. three: 217
  18698. }],
  18699. 145: [function(e, t, i) {
  18700. "use strict";
  18701. function n(e) {
  18702. this.chunksize = e || 10,
  18703. this.chunks = {},
  18704. this.boundingBoxes = {},
  18705. this.children = [],
  18706. this.offset = new r.Vector3(0,.5,0),
  18707. this.material = new r.MeshBasicMaterial({
  18708. color: 16777215 * Math.random(),
  18709. side: r.DoubleSide
  18710. })
  18711. }
  18712. var r = e("three");
  18713. e("../enum/Viewmode");
  18714. n.prototype.add = function(e) {
  18715. var t, i, n, o, a, s, l, c, h, u, d, p, f, g, m = e.attributes;
  18716. m ? (t = m.position.array,
  18717. i = void 0 !== e.index ? e.index.array : void 0) : (t = e.vertices,
  18718. n = e.faces);
  18719. var v = new r.Vector3;
  18720. if (i)
  18721. for (o = 0,
  18722. a = i.length; o < a; o += 3) {
  18723. var A = 3 * i[o]
  18724. , y = 3 * i[o + 1]
  18725. , C = 3 * i[o + 2];
  18726. s = (t[A] + t[y] + t[C]) / 3,
  18727. l = (t[A + 1] + t[y + 1] + t[C + 1]) / 3,
  18728. c = (t[A + 2] + t[y + 2] + t[C + 2]) / 3,
  18729. h = Math.floor(s / this.chunksize),
  18730. u = Math.floor(l / this.chunksize),
  18731. d = Math.floor(c / this.chunksize),
  18732. p = h + "." + u + "." + d,
  18733. p in this.chunks ? (g = this.chunks[p],
  18734. f = this.boundingBoxes[p]) : (g = this.chunks[p] = [],
  18735. f = this.boundingBoxes[p] = new r.Box3),
  18736. 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]),
  18737. f.expandByPoint(v.set(t[A], t[A + 1], t[A + 2])),
  18738. f.expandByPoint(v.set(t[y], t[y + 1], t[y + 2])),
  18739. f.expandByPoint(v.set(t[C], t[C + 1], t[C + 2]))
  18740. }
  18741. else
  18742. for (o = 0,
  18743. a = t.length; o < a; o += 9)
  18744. s = (t[o] + t[o + 3] + t[o + 6]) / 3,
  18745. l = (t[o + 1] + t[o + 4] + t[o + 7]) / 3,
  18746. c = (t[o + 2] + t[o + 5] + t[o + 8]) / 3,
  18747. h = Math.floor(s / this.chunksize),
  18748. u = Math.floor(l / this.chunksize),
  18749. d = Math.floor(c / this.chunksize),
  18750. p = h + "." + u + "." + d,
  18751. p in this.chunks ? (g = this.chunks[p],
  18752. f = this.boundingBoxes[p]) : (g = this.chunks[p] = [],
  18753. f = this.boundingBoxes[p] = new r.Box3),
  18754. 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]),
  18755. f.expandByPoint(v.set(t[o], t[o + 1], t[o + 2])),
  18756. f.expandByPoint(v.set(t[o + 3], t[o + 4], t[o + 5])),
  18757. f.expandByPoint(v.set(t[o + 6], t[o + 7], t[o + 8]))
  18758. }
  18759. ,
  18760. n.prototype.build = function() {
  18761. var e = new r.Object3D;
  18762. e.material = this.material;
  18763. for (var t in this.chunks) {
  18764. var i = this.chunks[t]
  18765. , n = new r.BufferGeometry;
  18766. n.addAttribute("position", new r.BufferAttribute(new Float32Array(i),3)),
  18767. n.boundingBox = this.boundingBoxes[t];
  18768. var o = new r.Mesh(n,this.material);
  18769. o.material.visible = !1,
  18770. e.add(o),
  18771. this.chunks[t] = []
  18772. }
  18773. return e
  18774. }
  18775. ,
  18776. t.exports = n
  18777. }
  18778. , {
  18779. "../enum/Viewmode": 51,
  18780. three: 217
  18781. }],
  18782. 146: [function(e, t, i) {
  18783. "use strict";
  18784. var r = e("three")
  18785. , o = e("../settings")
  18786. , a = e("../util/common")
  18787. , s = e("../util/lerp")
  18788. , l = e("./ChunkedCollider")
  18789. , c = e("../util/transitions")
  18790. , h = e("../util/easing")
  18791. , u = (e("../objects/Panorama"),
  18792. e("../enum/RenderOrder"))
  18793. , d = e("../localization/localize");
  18794. function n(e, t, i) {
  18795. r.Object3D.call(this),
  18796. this.model = e,
  18797. this.floorIndex = t,
  18798. this.lang = o.languageTag,
  18799. this.name = i || o.languageTag === "cn" ? "Floor " + (t + 1) + "" : "第" + (t + 1) + "层",
  18800. this.panos = [],
  18801. this.chunks = [],
  18802. this.colliderBuilder = new l(3),
  18803. this.collider = null,
  18804. this.center = null,
  18805. this.boundingBox = new r.Box3,
  18806. this.size = null,
  18807. this.hidden = !1,
  18808. this.conservativeBoundingBox = new r.Box3,
  18809. this.debugColor = 16777215 * Math.random(),
  18810. this.transition = null
  18811. }
  18812. n.prototype = Object.create(r.Object3D.prototype),
  18813. n.prototype.enter = function(e) {
  18814. this.model.setFloor(this, e)
  18815. }
  18816. ,
  18817. n.prototype.hide = function(e) {
  18818. if (!this.hidden || this.transition) {
  18819. this.chunks.forEach(function(e) {
  18820. e.material.transparent = !0
  18821. }),
  18822. c.cancel(this.transition);
  18823. var t = e ? 0 : o.hideFloorDuration + o.hideFloorDelay
  18824. , i = e ? 0 : o.hideFloorDelay / t;
  18825. this.transition = c.start(s.allUniforms(this.chunks, "opacity", .08), t, function() {
  18826. this.hidden = !0
  18827. }
  18828. .bind(this), i, h.easeInOutQuad)
  18829. }
  18830. }
  18831. ,
  18832. n.prototype.show = function(e) {
  18833. if (this.hidden || this.transition) {
  18834. this.hidden = !1,
  18835. c.cancel(this.transition);
  18836. var t = e ? o.showFloorDuration : o.showFloorDuration + o.showFloorDelay
  18837. , i = e ? 0 : o.showFloorDelay / t;
  18838. this.transition = c.start(s.allUniforms(this.chunks, "opacity", 1), t, function() {
  18839. this.hidden || this.chunks.forEach(function(e) {
  18840. e.material.transparent = !1
  18841. })
  18842. }
  18843. .bind(this), i, h.easeInOutQuad)
  18844. }
  18845. }
  18846. ,
  18847. n.prototype.toggle = function(e, t) {
  18848. e = void 0 === e ? this.hidden : e,
  18849. e ? this.show(t) : this.hide(t)
  18850. }
  18851. ,
  18852. n.prototype.containsPoint = function(e) {
  18853. return this.collider.children.some(function(t) {
  18854. return t.geometry.boundingBox || t.geometry.computeBoundingBox(),
  18855. t.geometry.boundingBox.containsPoint(e)
  18856. })
  18857. }
  18858. ,
  18859. n.prototype.distanceToPoint = function(e) {
  18860. var t = null
  18861. , i = 1 / 0;
  18862. return this.collider.children.forEach(function(n) {
  18863. n.geometry.boundingBox || n.geometry.computeBoundingBox();
  18864. var r = n.geometry.boundingBox.distanceToPoint(e);
  18865. (!t || i > r) && (i = r,
  18866. t = n)
  18867. }),
  18868. i
  18869. }
  18870. ,
  18871. n.prototype.addChunk = function(e) {
  18872. e.renderOrder = u.ghostFloor,
  18873. this.add(e),
  18874. this.chunks.push(e),
  18875. this.boundingBox.union(e.geometry.boundingBox),
  18876. this.size = this.boundingBox.size(),
  18877. this.colliderBuilder.add(e.geometry)
  18878. }
  18879. ,
  18880. n.prototype.addPano = function(e) {
  18881. this.panos.push(e),
  18882. this.add(e.skyboxMesh),
  18883. e.marker && this.add(e.marker);
  18884. if(e.neighbourUUIDs && e.neighbourUUIDs.length){//add 有相邻点才算入bound 因为拍摄有bug,会出现floorPosition为000,且position位置很偏的点,它们一般都是不可见点。
  18885. var t = new r.Vector3(1,1,1)
  18886. , i = (new r.Box3).setFromCenterAndSize(e.position, t);
  18887. this.boundingBox.union(i)
  18888. }
  18889. }
  18890. ,
  18891. n.prototype.build = function() {
  18892. this.collider = this.colliderBuilder.build(!0),
  18893. this.add(this.collider),
  18894. this.center = this.boundingBox.center(),
  18895. this.conservativeBoundingBox.copy(this.boundingBox),
  18896. this.conservativeBoundingBox.min.y = a.lowerMedian(this.collider.children.map(function(e) {
  18897. return e.geometry.boundingBox.min.y
  18898. }), 5),
  18899. this.conservativeBoundingBox.max.y = a.lowerMedian(this.collider.children.map(function(e) {
  18900. return e.geometry.boundingBox.max.y
  18901. }), 5)
  18902. if(!settings.extractFloor || !settings.extractFloor[window.number]){
  18903. this.colliderBuilder = null
  18904. }
  18905. }
  18906. ,
  18907. n.prototype.toShortString = function() {
  18908. return a.nth(this.floorIndex + 1)
  18909. }
  18910. ,
  18911. n.prototype.toString = function() {
  18912. return this.name
  18913. }
  18914. ,
  18915. n.prototype.constructor = n, //add
  18916. t.exports = n
  18917. }
  18918. , {
  18919. "../enum/RenderOrder": 42,
  18920. "../localization/localize": 108,
  18921. "./strings-cn-CN": 109,
  18922. "../objects/Panorama": 148,
  18923. "../settings": 166,
  18924. "../util/common": 185,
  18925. "../util/easing": 186,
  18926. "../util/lerp": 188,
  18927. "../util/transitions": 195,
  18928. "./ChunkedCollider": 145,
  18929. three: 217
  18930. }],
  18931. 147: [function(e, t, i) {
  18932. "use strict";
  18933. function n(e) {
  18934. this.player = e,
  18935. this.obj3d = null,
  18936. this.UP = new r.Vector3(0,1,0)
  18937. }
  18938. var r = e("three")
  18939. , o = e("../settings");
  18940. n.prototype.prefs = {
  18941. linewidth: 3,
  18942. height: .07,
  18943. opacity: .45,
  18944. endScale: .05
  18945. },
  18946. n.prototype.discard = function() {
  18947. if (this.obj3d) {
  18948. var e = this.obj3d.parent;
  18949. e && e.remove(this.obj3d)
  18950. }
  18951. this.obj3d = null
  18952. }
  18953. ,
  18954. n.prototype.draw = function() {
  18955. if (this.discard(),
  18956. o.showNeighbors) {
  18957. var e = this.player.currentPano.floor;
  18958. this.obj3d = new r.Object3D;
  18959. var t = this.player.model.panos.getNeighbours(this.player.currentPano)
  18960. , i = this.player.currentPano.floorPosition.clone().sub(this.player.model.position);
  18961. i.y += this.prefs.height;
  18962. var n = .1525
  18963. , a = .127
  18964. , s = .0127
  18965. , l = .1
  18966. , c = .19
  18967. , h = .2032
  18968. , u = .2286
  18969. , d = .255
  18970. , p = new r.Matrix4;
  18971. for (var f in t)
  18972. if (t[f]) {
  18973. var g = this.player.model.panos.get(f)
  18974. , m = (g.position.clone().sub(this.player.model.position),
  18975. g.position.clone().sub(g.floorPosition))
  18976. , v = g.floorPosition.clone().sub(this.player.model.position);
  18977. v.y += this.prefs.height;
  18978. var A = new r.Geometry;
  18979. 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)),
  18980. 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)),
  18981. p.identity().setPosition(m),
  18982. A.applyMatrix(p),
  18983. A.vertices.push(new r.Vector3(0,-this.prefs.endScale,0)),
  18984. 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)),
  18985. p.lookAt(v, i, this.UP).setPosition(v),
  18986. A.applyMatrix(p),
  18987. A.vertices.push(v, i);
  18988. var y = new r.Line(A,new r.LineBasicMaterial({
  18989. color: g.debugColor.getHex(),
  18990. transparent: !0,
  18991. opacity: this.prefs.opacity,
  18992. depthWrite: !1,
  18993. name: "sLine" + f,
  18994. linewidth: this.prefs.linewidth
  18995. }));
  18996. this.obj3d.add(y)
  18997. }
  18998. e.add(this.obj3d)
  18999. }
  19000. }
  19001. ,
  19002. n.prototype.update = function() {
  19003. o.showNeighbors && this.obj3d && this.obj3d.updateMatrixWorld()
  19004. }
  19005. ,
  19006. t.exports = n
  19007. }
  19008. , {
  19009. "../settings": 166,
  19010. three: 217
  19011. }],
  19012. 148: [function(e, t, i) {
  19013. (function(i) {
  19014. "use strict";
  19015. function n(e, t, i, n) {
  19016. this.model = e,
  19017. this.id = t,
  19018. this.alignmentType = i.alignmentType || l.ALIGNED,
  19019. this.neighbourUUIDs = i.neighbours || null,
  19020. this.neighbourPanos = null,
  19021. this.floor = null,
  19022. this.floorIndex = i.floor,
  19023. this.failedLoadingAt = 0,
  19024. this.maxLoadRetries = 4,
  19025. this.origin = i.position.clone(),
  19026. this.position = this.alignmentType === l.UNALIGNED ? new r.Vector3(0,-5,0) : i.position.clone(),
  19027. this.quaternion = i.quaternion.clone(),
  19028. this.skyboxMesh = new r.Mesh(E),
  19029. this.skyboxMesh.position.copy(this.position),
  19030. this.skyboxMesh.quaternion.copy(this.quaternion),
  19031. this.skyboxMesh.name = "skybox",
  19032. this.skyboxMesh.visible = !1,
  19033. this.skyboxMesh.updateMatrix(),
  19034. this.skyboxMesh.updateMatrixWorld(),
  19035. this.marker = null,
  19036. this.showFloorMarker = !window.DATA.hideFloorMarker;
  19037. if(this.isAligned() ){
  19038. this.marker = new r.Mesh(b,new r.MeshBasicMaterial({
  19039. map: w,
  19040. side: r.DoubleSide,
  19041. opacity: 0,
  19042. transparent: !0,
  19043. depthWrite: !1
  19044. })),
  19045. this.marker.visible = false //改:先不显示,之后根据opacity显示
  19046. this.marker.renderOrder = s.panoMarker,
  19047. this.marker.name = "marker",
  19048. this.marker.pano = this,
  19049. this.marker.layers.set(v.PANOMARKERS),
  19050. this.marker.updateMatrixWorld()
  19051. if(!window.DATA.hideFloorMarker){//xzw
  19052. let opa = this.marker.material.opacity
  19053. Object.defineProperty(this.marker.material, 'opacity', {
  19054. get: function () {
  19055. return opa
  19056. },
  19057. set: (o)=>{
  19058. opa = o
  19059. convertTool.updateVisible(this.marker, 'hideWhenZeroOpa', o > 0)
  19060. //if(o==0)console.log('o==0',this.id,this.marker.visible)
  19061. //console.log(o,this.id,this.marker.visible)
  19062. },
  19063. })
  19064. }
  19065. a.colorMarkerOnLoad && this.on("load", function() {
  19066. this.marker.material.color.set(65280)
  19067. })
  19068. }
  19069. this.debugColor = (new r.Color).setHSL(.06 + .53 * Math.random(), .8 + .2 * Math.random(), .5 + .2 * Math.random()),
  19070. this.floorPosition = i.puck ? i.puck.clone() : null,
  19071. this.tiled = n,
  19072. this.tiled ? this.solidSkybox = null : (this.solidSkybox = new r.Texture([null, null, null, null, null, null]),
  19073. this.solidSkybox.flipY = !1,
  19074. a.minimalMemoryMode && (this.solidSkybox.minFilter = r.LinearFilter,
  19075. this.solidSkybox.magFilter = r.LinearFilter,
  19076. this.solidSkybox.generateMipmaps = !1)),
  19077. this.zoomed = !1,
  19078. this.panoRenderer = null,
  19079. this.qualityManager = null,
  19080. this.tileDownloader = null,
  19081. this.tiledPanoRenderTarget = null,
  19082. this.minimumTiledPanoLoaded = !1,
  19083. this.highestPartialTileRenderOpCompleted = 0,
  19084. this.highestFullTileRenderOpCompleted = 0,
  19085. this.shouldRedrawOnBaseLoaded = !1,
  19086. this.lockUntilRenderingComplete = !1,
  19087. a.colorMarkerOnLoad && this.on("load", function() {
  19088. this.marker.material.color.set(65280)
  19089. });
  19090. /********************************************************************fyz改vr from徐世廷*************************************************************/
  19091. var e = new r.TextureLoader;
  19092. e.setCrossOrigin(!0);
  19093. var g = e.load("images/texture.jpg");
  19094. if (this.vrMarker = new r.Mesh(new r.OctahedronGeometry(.1,0),new r.MeshLambertMaterial({
  19095. color: 16777215,
  19096. transparent: !0,
  19097. opacity: .75,
  19098. map: g
  19099. })),
  19100. this.vrMarker.boluoType = "vr",
  19101. this.vrMarker.position.z = 1,
  19102. this.vrMarker.enabled = !0,
  19103. this.vrMarker.visible = !1,
  19104. window.vrMarkers = window.vrMarkers || [],
  19105. window.vrMarkers.push(this.vrMarker),
  19106. this.marker && this.marker.add(this.vrMarker),
  19107. a.showAxis && (this.skyboxMesh.add(new r.ArrowHelper(new r.Vector3(0,1,0),new r.Vector3(0,0,0),1,255)),
  19108. this.skyboxMesh.add(new r.ArrowHelper(new r.Vector3(0,0,1),new r.Vector3(0,0,0),1,16711680)),
  19109. this.skyboxMesh.add(new r.ArrowHelper(new r.Vector3(1,0,0),new r.Vector3(0,0,0),1,65280))),
  19110. this.adjustAngleEnable) {
  19111. var i = new r.Quaternion;
  19112. i.setFromAxisAngle(new r.Vector3(1,0,0), this.adjustAngleX),
  19113. this.skyboxMesh.quaternion.multiply(i);
  19114. var m = new r.Quaternion;
  19115. m.setFromAxisAngle(new r.Vector3(0,1,0), this.adjustAngleY),
  19116. this.skyboxMesh.quaternion.multiply(m);
  19117. var n = new r.Quaternion;
  19118. n.setFromAxisAngle(new r.Vector3(0,0,1), this.adjustAngleZ),
  19119. this.skyboxMesh.quaternion.multiply(n),
  19120. this.skyboxMesh.updateMatrix(),
  19121. this.skyboxMesh.updateMatrixWorld(),
  19122. this.model.updateProjectedPanos()
  19123. }
  19124. /**************************************************************************************************************************************/
  19125. }
  19126. var r = e("three")
  19127. , o = e("../util/logger")
  19128. , a = e("../settings")
  19129. , s = (e("../enum/Viewmode"),
  19130. e("../enum/RenderOrder"))
  19131. , l = e("../enum/AlignmentType")
  19132. , c = (e("../util/common"),
  19133. e("../util/transitions"))
  19134. , h = e("../util/lerp")
  19135. , u = e("../util/ajax")
  19136. , d = e("../util/texture")
  19137. , p = e("../util/panorama")
  19138. , f = (e("../enum/TileDownloaderEvents"),
  19139. e("../enum/PanoramaEvents"))
  19140. , g = e("../enum/PanoRendererEvents")
  19141. , m = e("../enum/PanoSizeClass")
  19142. , v = e("../enum/RenderLayers")
  19143. , A = (e("../scene/SceneRenderer"),
  19144. e("../enum/GLCubeFaces"),
  19145. e("../exception/BasicException"))
  19146. , y = e("../tile/TileUtils")
  19147. , C = e("events").EventEmitter
  19148. , I = new o(i)
  19149. , E = new r.SphereBufferGeometry(.1)
  19150. , b = new r.PlaneBufferGeometry(.35,.35,1,1)
  19151. , w = d.load("images/marker.png");
  19152. w.anisotropy = browser.isMobile() ? 1 : 3 //add
  19153. n.prototype = Object.create(C.prototype),
  19154. n.prototype.enter = function() {
  19155. var e = null;
  19156. return function() {
  19157. this.setZoomed(!1),
  19158. this.emit("enter", {
  19159. oldPano: e,
  19160. newPano: this
  19161. }),
  19162. e = this
  19163. this.model.setHighMap(this) //add
  19164. }
  19165. }(),
  19166. n.prototype.exit = function() {
  19167. this.tiled ? (this.clearWaitDeferreds(),
  19168. this.minimumTiledPanoLoaded = !1,
  19169. this.tiledPanoRenderTarget = null,
  19170. this.setZoomed(!1),
  19171. this.panoRenderer.deactivateTiledPano(this),
  19172. this.highestPartialTileRenderOpCompleted = 0,
  19173. this.highestFullTileRenderOpCompleted = 0) : (this.solidSkybox.dispose(),
  19174. this.solidSkybox.loaded = !1,
  19175. this.solidSkybox.version = 0),
  19176. this.emit("exit")
  19177. }
  19178. ,
  19179. n.prototype.hoverOn = function(e) {
  19180. this.marker && (c.start(h.property(this.marker.material, "opacity", a[e].markerOpacityOnHover), 250),
  19181. a.navigation.panoScores & a.navigation.mouseDirection && this.addTextSprite("HIT", 12525854))
  19182. }
  19183. ,
  19184. n.prototype.hoverOff = function(e) {
  19185. this.marker && c.start(h.property(this.marker.material, "opacity", a[e].markerOpacity), 250)
  19186. }
  19187. ,
  19188. n.prototype.build1 = function() {
  19189. 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),
  19190. this.floor.addPano(this),
  19191. this.floorPosition = this.floorPosition || this.raycastFloorPosition(),
  19192. this.neighbourPanos = this.neighbourPanos || this.findNeighourPanos(),
  19193. a.colorMarkerByFloor && this.marker && this.marker.material.color.set(this.floor.debugColor)
  19194. }
  19195. ,
  19196. n.prototype.build2 = function() {
  19197. this.floorPosition = this.floorPosition || this.interpolateFloorPosition(),
  19198. this.height = this.position.distanceTo(this.floorPosition),
  19199. this.placeMarker()
  19200. }
  19201. ,
  19202. n.prototype.interpolateFloorPosition = function() {
  19203. var e = this.model.panos.filter(n.filters.isNeighbourPanoTo(this)).filter(function(e) {
  19204. return !!e.floorPosition
  19205. }).sort(function(e, t) {
  19206. return e.position.distanceTo(this.position) - t.position.distanceTo(this.position)
  19207. }
  19208. .bind(this))
  19209. , t = this.position.clone();
  19210. return e.length >= 2 ? t.y = (e[0].floorPosition.y + e[1].floorPosition.y) / 2 : t.add(a.noMeshFloorPositionOffset),
  19211. t
  19212. }
  19213. ,
  19214. n.prototype.raycastFloorPosition = function() {
  19215. I.warn("Performance warning: Raycasting to find floor position");
  19216. var e = new r.Raycaster(this.position,new r.Vector3(0,-1,0))
  19217. , t = e.intersectObjects(this.model.colliders);
  19218. return t.length ? t[0].point : null
  19219. }
  19220. ,
  19221. n.prototype.raycastToFindFloor = function() {
  19222. 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)];
  19223. return function() {
  19224. I.warn("Performance warning: Raycasting to find floor index");
  19225. for (var t = 0; t < e.length; t++) {
  19226. var i = new r.Raycaster(this.position.clone(),e[t].clone())
  19227. , n = i.intersectObjects(this.model.colliders);
  19228. if (n.length)
  19229. return n[0].object.parent.parent
  19230. }
  19231. return null
  19232. }
  19233. }(),
  19234. n.prototype.placeMarker = function() {
  19235. this.marker && (this.marker.position.copy(this.floorPosition),
  19236. //this.fixedFloorY != void 0 && this.marker.position.setY(this.fixedFloorY),//add
  19237. this.marker.position.y += settings.markerHeight,
  19238. this.marker.lookAt(new r.Vector3(0,1,0).add(this.marker.position)))
  19239. }
  19240. ,
  19241. n.prototype.translate = function(e) {
  19242. this.position.add(e),
  19243. this.floorPosition.add(e)
  19244. }
  19245. ,
  19246. n.prototype.findClosestMidtpointPanoTo = function(e) {
  19247. (new r.Vector3).addVectors(this.position, e.position).divideScalar(2);
  19248. return this.model.panos.find([n.filters.notIn([this, e])], [n.sortFunctions.distanceToPoint(point)])
  19249. }
  19250. ,
  19251. n.prototype.attachToPanoRenderer = function(e) {
  19252. this.panoRenderer = e,
  19253. this.panoRenderer.on(g.TileRenderSuccess, this.onTileRendered.bind(this)),
  19254. this.panoRenderer.on(g.PanoRenderComplete, this.onPanoRendered.bind(this)),
  19255. this.panoRenderer.on(g.TileRenderFailure, this.onTileRenderFail.bind(this)),
  19256. this.panoRenderer.on(g.UploadAttemptedForAllTiles, this.onUploadAttemptedForAllTiles.bind(this))
  19257. }
  19258. ;
  19259. var _ = {};
  19260. n.prototype.getWaitDeferred = function(e) {
  19261. var t = _[this.id];
  19262. t || (t = {},
  19263. _[this.id] = t);
  19264. var i = t[e];
  19265. return i || (i = {
  19266. deferred: $.Deferred(),
  19267. active: !1
  19268. },
  19269. t[e] = i),
  19270. i
  19271. }
  19272. ,
  19273. n.prototype.resetWaitDeferred = function(e) {
  19274. var t = this.getWaitDeferred(e);
  19275. t.active = !1,
  19276. t.deferred = $.Deferred()
  19277. }
  19278. ,
  19279. n.prototype.clearWaitDeferreds = function() {
  19280. var e = _[this.id];
  19281. e || (e = {},
  19282. _[this.id] = e);
  19283. for (var t in e)
  19284. if (e.hasOwnProperty(t)) {
  19285. var i = e[t];
  19286. i.active = !1,
  19287. i.deferred = $.Deferred()
  19288. }
  19289. }
  19290. ,
  19291. n.prototype.loadTiledPano = function() {
  19292. var e = (new r.Vector3,
  19293. [])
  19294. , t = [];
  19295. return function(i, n, r, o, a, s) {
  19296. null !== o && void 0 !== o || (o = !0),
  19297. null !== a && void 0 !== a || (a = !0);
  19298. var l = this.getWaitDeferred(i)
  19299. , c = l.deferred
  19300. , h = null
  19301. , u = null;
  19302. if (r && ("number" == typeof r ? h = r : (h = r.hFov,
  19303. u = r.vFov)),
  19304. !this.isLoaded(i)) {
  19305. if (!l.active) {
  19306. if (l.active = !0,
  19307. r) {
  19308. var d = y.matchingTilesInDirection(this, i, n, h, u);
  19309. e[this.id + ":" + i] = {
  19310. tileCount: 0,
  19311. targetTileCount: d
  19312. },
  19313. I.info("Loading partial pano: " + this.id + " with " + d + " tiles")
  19314. }
  19315. t[this.id] || (t[this.id] = !0,
  19316. this.on(f.LoadComplete, function(e, t) {
  19317. //console.warn('点位下载完成 ', 'id:'+this.id, 'count:'+t )
  19318. var i = this.getWaitDeferred(e).deferred;
  19319. i && "pending" === i.state() && this.highestPartialTileRenderOpCompleted >= e && (i.resolve(e, t),
  19320. this.resetWaitDeferred(e))
  19321. }
  19322. .bind(this)),
  19323. this.on(f.LoadFailed, function(e) {
  19324. var t = this.getWaitDeferred(e).deferred;
  19325. t && "pending" === t.state() && this.highestPartialTileRenderOpCompleted >= e && (t.reject(e),
  19326. this.resetWaitDeferred(e))
  19327. }
  19328. .bind(this)),
  19329. this.on(f.TileLoaded, function(t, i, n) {
  19330. //console.log('tileLoaded', 'id:'+this.id, 'size:'+t, 'index:'+i )
  19331. var r = this.getWaitDeferred(t).deferred;
  19332. if (r && "pending" === r.state()) {
  19333. r.notify(t, i, n);
  19334. var o = e[this.id + ":" + t];
  19335. o && (o.tileCount++,
  19336. o.tileCount === o.targetTileCount && (this.onPanoRendered(this.id, t, n, !0),
  19337. r.resolve(t, n),
  19338. this.resetWaitDeferred(t)))
  19339. }
  19340. }
  19341. .bind(this)))
  19342. }
  19343. this.tileDownloader.clearForceQueue(),
  19344. this.tileDownloader.forceQueueTilesForPano(this, i, n, h, u, s),
  19345. this.tiledPanoRenderTarget = this.panoRenderer.activateTiledPano(this, Math.min(2048, this.qualityManager.getMaxNavPanoSize()) , o), //不要超过2048否则漫游到下一个点时卡顿
  19346. this.panoRenderer.renderPanoTiles(this.id, n, a)
  19347. }
  19348. return c.promise()
  19349. }
  19350. }(),
  19351. n.prototype.onUploadAttemptedForAllTiles = function(e, t, i) {
  19352. if (e === this.id) {
  19353. var n = this.qualityManager.getPanoSize(m.BASE);
  19354. t === n && this.shouldRedrawOnBaseLoaded && (this.shouldRedrawOnBaseLoaded = !1,
  19355. this.panoRenderer.resetRenderStatus(this.id, !0, !1),
  19356. this.panoRenderer.renderPanoTiles(this.id, null, !0, !0))
  19357. }
  19358. }
  19359. ,
  19360. n.prototype.onTileRendered = function(e, t, i, n) {
  19361. e === this.id && this.emit(f.TileLoaded, t, i, n)
  19362. }
  19363. ,
  19364. n.prototype.onPanoRendered = function(e, t, i, n) {
  19365. e === this.id && (this.minimumTiledPanoLoaded = !0,
  19366. this.updateSkyboxForZoomLevel(),
  19367. t > this.highestPartialTileRenderOpCompleted && (this.highestPartialTileRenderOpCompleted = t),
  19368. !n && t > this.highestFullTileRenderOpCompleted && (this.highestFullTileRenderOpCompleted = t),
  19369. this.emit("load", t),
  19370. this.model.emit("load", this),
  19371. this.emit(f.LoadComplete, t, i))
  19372. }
  19373. ,
  19374. n.prototype.setZoomed = function(e) {
  19375. this.zoomed = e,
  19376. this.updateSkyboxForZoomLevel()
  19377. if(e){ //add
  19378. if(player.qualityManager.getNavZoomClass() != '1k' ){
  19379. this.model.showHighMap()
  19380. }
  19381. }else{
  19382. this.model.hideHighMap()
  19383. }
  19384. }
  19385. ,
  19386. n.prototype.ensureSkyboxReadyForRender = function() {
  19387. this.tiled || (this.solidSkybox.loaded || (this.solidSkybox.needsUpdate = !0),
  19388. this.solidSkybox.loaded = !0)
  19389. }
  19390. ,
  19391. n.prototype.updateSkyboxForZoomLevel = function() {
  19392. this.minimumTiledPanoLoaded && this.model.updateProjectedPanos()
  19393. }
  19394. ,
  19395. n.prototype.getSkyboxTexture = function() {
  19396. //return this.tiled ? this.minimumTiledPanoLoaded ? this.zoomed ? this.panoRenderer.zoomRenderTarget.texture : this.tiledPanoRenderTarget.texture : null : this.solidSkybox
  19397. if(!this.tiled){
  19398. return this.solidSkybox
  19399. }
  19400. if(this.minimumTiledPanoLoaded)
  19401. {
  19402. if(this.zoomed && (this.qualityManager.maxRenderTargetSize > this.qualityManager.maxNavPanoSize|| player.qualityManager.getNavZoomClass() == '4k' ))//change 如果放大后和不放大都是2k就不用这个
  19403. {
  19404. return this.panoRenderer.zoomRenderTarget.texture;
  19405. }
  19406. else
  19407. {
  19408. this.tiledPanoRenderTarget.texture.mapping = THREE.UVMapping//add
  19409. return this.tiledPanoRenderTarget.texture;
  19410. }
  19411. }
  19412. else
  19413. {
  19414. return null;
  19415. }
  19416. }
  19417. ,
  19418. n.prototype.onTileRenderFail = function(e, t, i) {
  19419. e === this.id && this.emit(f.LoadFailed, t)
  19420. }
  19421. ,
  19422. n.prototype.isLoaded = function(e) {
  19423. if (this.tiled) {
  19424. if (e && "string" == typeof e)
  19425. throw new A("Wrong panoSize given to Panorama.isLoaded(); a tiled pano uses PanoSizeClass");
  19426. return !!this.minimumTiledPanoLoaded && (!e || this.highestPartialTileRenderOpCompleted >= e)
  19427. }
  19428. if (e && "number" == typeof e)
  19429. throw new A("Wrong panoSize given to Panorama.isLoaded(); a non-tiled pano uses high/low.");
  19430. return !!this.solidSkybox.high || e in this.solidSkybox
  19431. }
  19432. ,
  19433. n.prototype.loadCube = function(e) {
  19434. if (this.isLoaded(e))
  19435. return I.info("Skipping load of pano, already loaded"),
  19436. $.when();
  19437. this.emit("loading", e),
  19438. this.model.emit("loading", this);
  19439. var t = p.getCubemapUrls(this.model.urls, this.id, e)
  19440. , i = t.filter(function(e) {
  19441. return !e
  19442. });
  19443. "low" === e && i.length > 0 && (I.info("Pano", this.id, "not available in low res, loading high res right away"),
  19444. e = "high",
  19445. t = p.getCubemapUrls(this.model.urls, this.id, e));
  19446. var n = 0
  19447. , r = [0, 1, 2, 3, 4, 5].map(function(e, i, n) {
  19448. return u.getImage(t[i])
  19449. }
  19450. .bind(this));
  19451. return $.when(r[0], r[1], r[2], r[3], r[4], r[5]).then(function(t, i, n, r, o, a) {
  19452. return this.solidSkybox[e] = [t, i, n, r, o, a],
  19453. "high" !== e && this.solidSkybox.high || (this.solidSkybox.image = this.solidSkybox[e],
  19454. this.solidSkybox.low = null),
  19455. this.solidSkybox.needsUpdate = !0,
  19456. this.emit("load", e),
  19457. this.model.emit("load", this),
  19458. this
  19459. }
  19460. .bind(this), function() {
  19461. I.error("Downloading cubemap for pano", this.id, "failed"),
  19462. this.failedLoadingAt = Date.now()
  19463. }
  19464. .bind(this), function() {
  19465. return $.when(++n, 6)
  19466. })
  19467. }
  19468. ,
  19469. n.raycastsSkipped = 0,
  19470. n.raycastsDone = 0,
  19471. n.prototype.findNeighourPanos = function() {
  19472. return this.model.panos.setNeighbour(this.id, this.id, !1),
  19473. this.model.panos.forEach(function(e) {
  19474. if (e !== this && (!this.model.panos.neighbourMap[this.id] || void 0 === this.model.panos.neighbourMap[this.id][e.id])) {
  19475. var t = this.position.distanceTo(e.position);
  19476. if (t > a.panoramaNeighbourMaxDistance)
  19477. return this.model.panos.setNeighbour(this, e, !1),
  19478. void n.raycastsSkipped++;
  19479. var i = e.position.clone().sub(this.position).normalize()
  19480. , o = new r.Raycaster(this.position,i.clone(),0,t)
  19481. , s = o.intersectObjects(this.model.colliders);
  19482. n.raycastsDone++,
  19483. this.model.panos.setNeighbour(this, e, 0 === s.length),
  19484. 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)))
  19485. }
  19486. }
  19487. .bind(this)),
  19488. this.model.panos.neighbourMap[this.id]
  19489. }
  19490. ,
  19491. n.prototype.worldPosition = function() {
  19492. return this.position
  19493. }
  19494. ,
  19495. n.prototype.addLabel = function() {
  19496. this.removeLabel()
  19497. this.label = new TextSprite({
  19498. sizeInfo: {
  19499. minSize: 100,
  19500. maxSize: 200,
  19501. nearBound: 0.7,
  19502. farBound: 10, //Math.max(20, player.model.size.length() / 3),
  19503. farBoundPlan: 100,
  19504. },
  19505. backgroundColor: { r: 255, g: 255, b: 255, a: 0.4 },
  19506. textColor: { r: 0, g: 0, b: 0, a: 1 },
  19507. borderRadius: 15,
  19508. renderOrder: 5,
  19509. text: this.id //`${this.id}-f${this.floorIndex}`
  19510. })
  19511. let position = this.floorPosition.clone()
  19512. position.y += 0.2
  19513. this.label.position.copy(position)
  19514. this.floor.add(this.label)
  19515. },
  19516. n.prototype.removeLabel = function() {
  19517. this.label && (this.floor.remove(this.label), this.label.material.dispose(), (this.label = null))
  19518. },
  19519. /* n.prototype.addTextSprite = function(e, t) {
  19520. this.removeTextSprite();
  19521. var i = document.createElement("canvas")
  19522. , n = i.getContext("2d");
  19523. i.width = 256,
  19524. i.height = 256;
  19525. var o = "Arial"
  19526. , a = 60;
  19527. n.font = "bold " + a + "px " + o,
  19528. n.fillStyle = "white";
  19529. var s = n.measureText(e).width;
  19530. n.fillText(e, (i.width - s) / 2, (i.height + a) / 2);
  19531. var l = new r.Texture(i);
  19532. l.needsUpdate = !0;
  19533. var c = new r.SpriteMaterial({
  19534. map: l,
  19535. color: t || 16428055
  19536. });
  19537. this.text3d = new r.Sprite(c),
  19538. this.text3d.position.copy(this.skyboxMesh.position),
  19539. this.floor.add(this.text3d)
  19540. }
  19541. ,
  19542. n.prototype.removeTextSprite = function() {
  19543. this.text3d && (this.floor.remove(this.text3d),
  19544. this.text3d = null)
  19545. }*/
  19546. n.prototype.isAligned = function() {
  19547. return this.alignmentType === l.ALIGNED
  19548. }
  19549. ,
  19550. n.filters = {
  19551. inDirection: function(e, t, i) {
  19552. return function(n) {
  19553. var r = n.position.clone().sub(e).normalize();
  19554. return r.dot(t) > i
  19555. }
  19556. },
  19557. inFloorDirection: function(e, t, i) {
  19558. return function(n) {
  19559. var r = n.floorPosition.clone().sub(e).normalize();
  19560. return r.dot(t) > i
  19561. }
  19562. },
  19563. inPanoDirection: function(e, t, i) {
  19564. return i = a.navigation.panoScores ? a.navigation.filterStrictness : i,
  19565. function(n) {
  19566. var r = n.floorPosition.clone().sub(e).normalize()
  19567. , o = n.position.clone().sub(e).normalize();
  19568. return r.dot(t) > i || o.dot(t) > i
  19569. }
  19570. },
  19571. atFloor: function(e) {
  19572. return function(t) {
  19573. return !e || t.floor === e
  19574. }
  19575. },
  19576. not: function(e) {
  19577. return function(t) {
  19578. return t !== e
  19579. }
  19580. },
  19581. notIn: function(e) {
  19582. return function(t) {
  19583. return e.indexOf(t) === -1
  19584. }
  19585. },
  19586. isLoaded: function() {
  19587. return function(e) {
  19588. return e.isLoaded()
  19589. }
  19590. },
  19591. isNotLoaded: function() {
  19592. return function(e) {
  19593. return !e.isLoaded()
  19594. }
  19595. },
  19596. isCloseEnoughTo: function(e, t) {
  19597. return function(i) {
  19598. return e.distanceTo(i.floorPosition) < t
  19599. }
  19600. },
  19601. hasMinimumHeightDifferenceTo: function(e, t) {
  19602. return function(i) {
  19603. return Math.abs(i.position.y - e.y) > t
  19604. }
  19605. },
  19606. isNotBehindNormal: function(e, t) {
  19607. var i = new r.Vector3;
  19608. return t = t.clone(),
  19609. function(n) {
  19610. var r = i.copy(n.position).sub(e).normalize();
  19611. return r.dot(t) > 0
  19612. }
  19613. },
  19614. isNeighbourPanoTo: function(e) {
  19615. return function(t) {
  19616. return !e || !e.neighbourPanos || !!e.neighbourPanos[t.id]
  19617. }
  19618. },
  19619. isNeighbourOfNeighbourTo: function(e) {
  19620. return function(t) {
  19621. return !!e.neighbourPanos[t.id] || e.neighbourUUIDs.some(function(i) {
  19622. var n = e.model.panos.get(i);
  19623. return !!n && n.neighbourPanos[t.id]
  19624. })
  19625. }
  19626. },
  19627. isNotRecentlyFailed: function(e) {
  19628. return function(t) {
  19629. return Date.now() - t.failedLoadingAt > e
  19630. }
  19631. },
  19632. isOnVisibleFloor: function() {
  19633. return function(e) {
  19634. return !e.floor.hidden
  19635. }
  19636. },
  19637. isPanoAligned: function() {
  19638. return function(e) {
  19639. return e.isAligned()
  19640. }
  19641. }
  19642. },
  19643. n.sortFunctions = {
  19644. distanceToPoint: function(e) {
  19645. return function(t, i) {
  19646. return t.position.distanceTo(e) - i.position.distanceTo(e)
  19647. }
  19648. },
  19649. floorDistanceToPoint: function(e) {
  19650. return function(t, i) {
  19651. return t.floorPosition.distanceTo(e) - i.floorPosition.distanceTo(e)
  19652. }
  19653. },
  19654. choose: function(e) {
  19655. return function(t, i) {
  19656. return e.id === t.id ? -1 : e.id === i.id ? 1 : 0
  19657. }
  19658. }
  19659. },
  19660. n.scoreFunctions = {
  19661. distance: function(e, t) {
  19662. return t = t || a.navigation.distanceFactor,
  19663. function(i) {
  19664. return e ? e.position.distanceTo(i.position) * t : 0
  19665. }
  19666. },
  19667. distanceSquared: function(e, t) {
  19668. return t = t || a.navigation.distanceFactor,
  19669. function(i) {
  19670. return e ? e.position.distanceToSquared(i.position) * t : 0
  19671. }
  19672. },
  19673. direction: function(e, t) {
  19674. return function(i) {
  19675. var n = i.position.clone().sub(e).normalize();
  19676. return n.dot(t) * a.navigation.directionFactor
  19677. }
  19678. },
  19679. angle: function(e, t) {
  19680. return function(i) {
  19681. var n = i.position.clone().sub(e).normalize();
  19682. return n.angleTo(t) * a.navigation.angleFactor
  19683. }
  19684. },
  19685. inFieldOfView: function(e, t) {
  19686. return function(i) {
  19687. var n = i.position.clone().sub(e).normalize();
  19688. return n.dot(t) > .75 ? 10 : -1
  19689. }
  19690. },
  19691. optionality: function(e) {
  19692. return function(t) {
  19693. var i = t.neighbourUUIDs.filter(function(t) {
  19694. return !(t in e.neighbourUUIDs) && t !== e.id
  19695. });
  19696. return i.length * a.navigation.optionalityFactor
  19697. }
  19698. },
  19699. penalizeHeightDifferenceUnder: function(e, t) {
  19700. return function(i) {
  19701. return e.y - i.position.y < t ? -20 : 0
  19702. }
  19703. }
  19704. },
  19705. t.exports = n
  19706. }
  19707. ).call(this, "/js/objects/Panorama.js")
  19708. }
  19709. , {
  19710. "../enum/AlignmentType": 17,
  19711. "../enum/GLCubeFaces": 25,
  19712. "../enum/PanoRendererEvents": 35,
  19713. "../enum/PanoSizeClass": 36,
  19714. "../enum/PanoramaEvents": 37,
  19715. "../enum/RenderLayers": 41,
  19716. "../enum/RenderOrder": 42,
  19717. "../enum/TileDownloaderEvents": 45,
  19718. "../enum/Viewmode": 51,
  19719. "../exception/BasicException": 55,
  19720. "../scene/SceneRenderer": 158,
  19721. "../settings": 166,
  19722. "../tile/TileUtils": 174,
  19723. "../util/ajax": 181,
  19724. "../util/common": 185,
  19725. "../util/lerp": 188,
  19726. "../util/logger": 189,
  19727. "../util/panorama": 191,
  19728. "../util/texture": 194,
  19729. "../util/transitions": 195,
  19730. events: 202,
  19731. three: 217
  19732. }],
  19733. 149: [function(e, t, i) {
  19734. "use strict";
  19735. function n(e) {
  19736. var t = r.UniformsUtils.clone(c.waypoint.uniforms);
  19737. t.map.value = d,
  19738. t.opacity.value = 0,
  19739. t.color.value.set(o.reticuleColor),
  19740. t.showMouseMarker = !window.DATA.hideMouseMarker;
  19741. r.Mesh.call(this, new r.PlaneBufferGeometry(.4,.4,1,1), new r.RawShaderMaterial({
  19742. side: r.DoubleSide,
  19743. depthWrite: !1,
  19744. depthTest: !1,
  19745. transparent: !0,
  19746. vertexShader: c.waypoint.vertexShader,
  19747. fragmentShader: c.waypoint.fragmentShader,
  19748. uniforms: t,
  19749. name: "waypoint",
  19750. opacity: 0,
  19751. visible: t.showMouseMarker // 显示/隐藏鼠标标志
  19752. })),
  19753. this.layers.set(h.RETICULE),
  19754. this.renderOrder = u.reticule,
  19755. this.player = e,
  19756. this.direction = new r.Vector3,
  19757. this.hidden = !0,
  19758. this.mouseLastMoveTime = Date.now()
  19759. }
  19760. var r = e("three")
  19761. , o = e("../settings")
  19762. , a = e("../util/transitions")
  19763. , s = e("../util/texture")
  19764. , l = e("../util/lerp")
  19765. , c = e("../shaders")
  19766. , h = e("../enum/RenderLayers")
  19767. , u = e("../enum/RenderOrder")
  19768. , d = s.load("images/reticule.png");
  19769. d.anisotropy = browser.isMobile() ? 1 : 4; //各向异性
  19770. n.prototype = Object.create(r.Mesh.prototype),
  19771. n.prototype.move = function(e, t, i) {
  19772. this.hidden = i,
  19773. this.mouseLastMoveTime = Date.now()
  19774. }
  19775. ,
  19776. n.prototype.hide = function() {
  19777. this.hidden || (this.hidden = !0,
  19778. a.start(l.property(this.material.uniforms.opacity, "value", 0), o.reticuleOpacityTransitionTime))
  19779. }
  19780. ,
  19781. n.prototype.show = function() {
  19782. this.hidden = !1,
  19783. this.material.opacity <= 0 && a.start(l.property(this.material.uniforms.opacity, "value", o[this.player.mode].reticuleOpacity), o.reticuleOpacityTransitionTime)
  19784. }
  19785. ,
  19786. n.prototype.update = function() {
  19787. Date.now() - this.mouseLastMoveTime > o.hideReticuleTimeout && !this.hidden && this.hide()
  19788. }
  19789. ,
  19790. n.prototype.updatePosition = function(e, t) {
  19791. if (!this.hidden) {
  19792. if (!t)
  19793. return this.hide();
  19794. var i = t.point
  19795. , n = e.distanceTo(i)
  19796. , r = 1 + .01 * n;
  19797. n < 1 && (r -= 1 - n),
  19798. this.show(),
  19799. this.scale.set(r, r, r),
  19800. this.direction = this.direction.multiplyScalar(.8),
  19801. this.direction.add(t.face.normal.clone().multiplyScalar(.2)),
  19802. this.position.copy(i).add(t.face.normal.clone().multiplyScalar(.01)),
  19803. this.lookAt(this.position.clone().add(this.direction))
  19804. }
  19805. }
  19806. ,
  19807. n.prototype.writeAstag = function() {
  19808. var e = Math.floor(4294967296 * (1 + Math.random())).toString(16) + Math.floor(16 * (1 + Math.random())).toString(16)
  19809. , t = new Date;
  19810. this.tagCount = "undefined" == typeof this.tagCount ? 1 : this.tagCount + 1;
  19811. var i = {
  19812. enabled: !0,
  19813. version: "0",
  19814. created: t.toISOString(),
  19815. created_by: "APITest",
  19816. position: this.position.clone(),
  19817. stem: {
  19818. enabled: o.tags.pole.enabled,
  19819. direction: this.direction.multiplyScalar(o.tags.pole.height)
  19820. },
  19821. label: "tag " + this.tagCount,
  19822. description: "Description " + e,
  19823. floor: function(e) {
  19824. if (e.currentFloor) {
  19825. var t = e.floors.indexOf(e.currentFloor);
  19826. return t > -1 ? t : void 0
  19827. }
  19828. }(this.player.model),
  19829. type: "info",
  19830. metadata: {
  19831. preferred_camera: {
  19832. mode: this.player.mode
  19833. }
  19834. }
  19835. };
  19836. console.log("--------------------------"),
  19837. console.log(JSON.stringify(i));
  19838. var n = this.player.model.addtag(e, i).build();
  19839. n && (n.disc && this.player.tagDiscs.push(n.disc),
  19840. n.visible || n.show(o.tags.startup.fadeInDuration))
  19841. }
  19842. ,
  19843. t.exports = n
  19844. }
  19845. , {
  19846. "../enum/RenderLayers": 41,
  19847. "../enum/RenderOrder": 42,
  19848. "../settings": 166,
  19849. "../shaders": 167,
  19850. "../util/lerp": 188,
  19851. "../util/texture": 194,
  19852. "../util/transitions": 195,
  19853. three: 217
  19854. }],
  19855. 150: [function(e, t, i) {
  19856. "use strict";
  19857. function n(e, t) {
  19858. this.chunks = [],
  19859. this.floorId = e,
  19860. this.roomId = t,
  19861. this.position = new r.Vector3
  19862. }
  19863. var r = e("three");
  19864. n.prototype.addChunk = function(e) {
  19865. this.chunks.push(e)
  19866. }
  19867. ,
  19868. n.prototype.calcBoundaries = function() {
  19869. 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++) {
  19870. var s = this.chunks[a]
  19871. , l = s.geometry.attributes.position;
  19872. if (l)
  19873. for (var c = 0; c < l.array.length; c += 3)
  19874. e.set(l.array[c], l.array[c + 1], l.array[c + 2]),
  19875. t.add(e),
  19876. 0 === c ? (i.copy(e),
  19877. n.copy(e)) : (i.max(e),
  19878. n.min(e)),
  19879. o++
  19880. }
  19881. o > 0 ? (t.multiplyScalar(1 / o),
  19882. this.average = t) : this.average = null,
  19883. this.boundsMax = i,
  19884. this.boundsMin = n,
  19885. this.center = new r.Vector3,
  19886. this.center.copy(i).sub(n).multiplyScalar(.5).add(n)
  19887. }
  19888. ,
  19889. t.exports = n
  19890. }
  19891. , {
  19892. three: 217
  19893. }],
  19894. 151: [function(e, t, i) {
  19895. (function(i) {
  19896. "use strict";
  19897. function n(e, t, i) {
  19898. this.obj3d = null,
  19899. this.nodes = [],
  19900. this.colorHull = [],
  19901. this.shortPaths = {},
  19902. this.floorHull = null,
  19903. this.cameraHull = null,
  19904. this.floorPathDistance = 0,
  19905. this.floorCurvePoints = null,
  19906. this.floorCurveColors = null,
  19907. this.camCurvePoints = null,
  19908. this.warpDestHeroLoc = null,
  19909. this.warpDestPano = null,
  19910. this.warpPathPoints = null,
  19911. this.warpPathLengths = [0],
  19912. this.warpLength = 0,
  19913. this.closeWarpDistance = 4,
  19914. this.UP = A.UP.clone(),
  19915. this.longestStep = 0,
  19916. this.upcomingTransType = null,
  19917. this.burnsDir = 1, //导览在DOLLHOUSE停留时的旋转方向 1 或 -1
  19918. this.prevNextDist = 0,
  19919. this.nextI = 0,
  19920. this.activeTransType = null,
  19921. this.lastTransType = null,
  19922. this.bunnyObj = null,
  19923. this.director = e,
  19924. this.player = t,
  19925. this.playerControls = i,
  19926. this.modelManager = t.modelManager,
  19927. this.updateModel(),
  19928. this.updateDefaultsFromModelData(),
  19929. this.bindEvents(),
  19930. this.warping = !1,
  19931. this.waitingToWarp = !1,
  19932. this.warpInterrupted = !1,
  19933. this.warpInterruptionBlackoutStyle = null,
  19934. this.warpInterruptionTravelTime = null
  19935. }
  19936. var r = e("three")
  19937. , o = e("../util/logger")
  19938. , a = e("../enum/Viewmode")
  19939. , s = e("../enum/RenderOrder")
  19940. , l = e("../enum/WarpStyle")
  19941. , c = e("../settings")
  19942. , h = e("../util/math")
  19943. , u = e("../util/lerp")
  19944. , d = e("../util/easing")
  19945. , p = e("../util/transitions")
  19946. , f = e("../objects/Snapshot")
  19947. , g = e("../effects")
  19948. , m = e("../shaders")
  19949. , v = (e("../gui/gui"),
  19950. e("../util/texture"))
  19951. , A = e("../enum/Vectors")
  19952. , y = (e("../model/ModelManager"),
  19953. new o(i))
  19954. , C = e("../enum/PlayerEvents")
  19955. , I = e("../enum/BlackoutStyle")
  19956. , E = e("../enum/ModelManagerEvents")
  19957. , b = e("../constants")
  19958. , w = {
  19959. 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"),
  19960. pathEnd: v.load("images/End.png"),
  19961. 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==")
  19962. };
  19963. n.prototype.setScene = function(e) {
  19964. this.createCpm(e),
  19965. this.createBunnyObj(e)
  19966. }
  19967. ,
  19968. n.prototype.updateModel = function() {
  19969. this.model = this.modelManager.getActiveModel()
  19970. }
  19971. ,
  19972. n.prototype.bindEvents = function() {
  19973. this.modelManager.on(E.ActiveModelChanged, this.updateModel.bind(this))
  19974. }
  19975. ,
  19976. n.prototype.updateDefaultsFromModelData = function() {
  19977. this.model.data
  19978. }
  19979. ,
  19980. n.prototype.pointPathDistance = function(e) {
  19981. for (var t = 0, i = 1; i < e.length; i += 1)
  19982. t += e[i - 1].distanceTo(e[i]);
  19983. return t
  19984. }
  19985. ,
  19986. n.prototype.pointPathLengths = function(e) {
  19987. for (var t = [0], i = 1; i < e.length; i += 1)
  19988. t.push(t[i - 1] + e[i - 1].distanceTo(e[i]));
  19989. return t
  19990. }
  19991. ,
  19992. n.prototype.interpAlongPath = function(e, t, i) {
  19993. var n, o = new r.Vector3, a = t[t.length - 1];
  19994. if (i < 1) {
  19995. n = i * a;
  19996. for (var s = 1; s < t.length; s += 1)
  19997. if (t[s] > n) {
  19998. var l = (n - t[s - 1]) / (t[s] - t[s - 1]);
  19999. return o.copy(e[s]),
  20000. o.sub(e[s - 1]),
  20001. o.multiplyScalar(l),
  20002. o.add(e[s - 1]),
  20003. o
  20004. }
  20005. } else
  20006. o.copy(e[e.length - 1]);
  20007. return o
  20008. }
  20009. ,
  20010. n.prototype.pathHeight = function() {
  20011. return this.player.mode !== a.FLOORPLAN ? c.path.height : c.path.outsideHeight
  20012. }
  20013. ,
  20014. n.prototype.createBunnyObj = function(e) {
  20015. this.bunnyObj || (this.bunnyObj = new r.AxisHelper(.1),
  20016. this.bunnyObj.visible = c.warp.showBunny),
  20017. this.bunnyObj.parent && this.bunnyObj.parent.remove(bunnyObj),
  20018. e.add(this.bunnyObj)
  20019. }
  20020. ,
  20021. n.prototype.createCpm = function(e) {
  20022. if (!this.currentPanoMarker) {
  20023. var t = this.makeWaypointObj(w.pathEnd, "Current");
  20024. t.material.uniforms.opacity.value = 0,
  20025. //变成一个定位sprite
  20026. /* let sprite = new THREE.Mesh(new THREE.PlaneBufferGeometry(0.4,0.4,1,1), new THREE.MeshBasicMaterial({
  20027. map: v.load('images/icon_address.png'), depthTest:false,
  20028. transparent:true,
  20029. }))
  20030. sprite.position.y = 0.3
  20031. let t = new THREE.Object3D()
  20032. t.add(sprite)
  20033. setTimeout(()=>{
  20034. window.player.on("view.changed",()=>{
  20035. player.path.currentPanoMarker.mesh.quaternion.copy(player.quaternion)
  20036. })
  20037. },1000)*/
  20038. this.currentPanoMarker = {
  20039. mesh: t,
  20040. placed: !1
  20041. }
  20042. }
  20043. this.currentPanoMarker.mesh.parent && this.currentPanoMarker.mesh.parent.remove(this.currentPanoMarker.mesh),
  20044. this.placeCpm(),
  20045. this.currentPanoMarker.mesh.parent || e.add(this.currentPanoMarker.mesh)
  20046. }
  20047. ,
  20048. n.prototype.placeCpm = function() {
  20049. if (c.path.mapGuides && this.player.currentPano && this.player.currentPano.isAligned()) {
  20050. var e = this.player.currentPano.floor;
  20051. this.currentPanoMarker.mesh.parent !== this.player.currentPano.floor && (this.currentPanoMarker.mesh.parent && this.currentPanoMarker.mesh.parent.remove(this.currentPanoMarker.mesh),
  20052. e.add(this.currentPanoMarker.mesh)),
  20053. this.currentPanoMarker.mesh.position.copy(this.player.currentPano.floorPosition).sub(e.position),
  20054. this.currentPanoMarker.mesh.position.y += this.pathHeight() ,
  20055. this.currentPanoMarker.placed = !0
  20056. } else
  20057. this.popOutCpm()
  20058. }
  20059. ,
  20060. n.prototype.fadeInCpm = function(e) {
  20061. //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.children[0].material/* .uniforms.opacity */, "opacity", 1), e)
  20062. 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)
  20063. }
  20064. ,
  20065. n.prototype.fadeOutCpm = function(e) {
  20066. //p.start(u.property(this.currentPanoMarker.mesh.children[0].material/* .uniforms.opacity */, "opacity", 0), e)
  20067. p.start(u.property(this.currentPanoMarker.mesh.material.uniforms.opacity, "value", 0), e)
  20068. }
  20069. n.prototype.popInCpm = function() {
  20070. c.path.mapGuides && this.currentPanoMarker.placed && this.fadeInCpm(2)
  20071. }
  20072. ,
  20073. n.prototype.popOutCpm = function() {
  20074. this.fadeOutCpm(2)
  20075. }
  20076. ,
  20077. n.prototype.brushPrefs = {
  20078. linewidth: 7,
  20079. strokeWidth: 15,
  20080. cvSegments: 48,
  20081. paveStep: .1,
  20082. paveWidth: .2,
  20083. lookBlendDist: 3,
  20084. maxTurn: r.Math.degToRad(2)
  20085. },
  20086. n.prototype.panoPathDistance = function(e) {
  20087. var t = this.model.panos;
  20088. if (!e || e.length < 2)
  20089. return 0;
  20090. for (var i = [], n = 0; n < e.length; n += 1)
  20091. i.push(t.get(e[n]).floorPosition);
  20092. return this.pointPathDistance(i)
  20093. }
  20094. ,
  20095. n.prototype.loadTileTexture = function(e) {
  20096. var t = v.load(e, function(t) {
  20097. t.wrapS = r.RepeatWrapping,
  20098. t.wrapT = r.RepeatWrapping,
  20099. t.needsUpdate = !0,
  20100. y.debug('path texture "' + e + '" is ready')
  20101. }, function() {
  20102. y.error('path texture "' + e + '" failed')
  20103. });
  20104. return t.mapping = r.UVMapping,
  20105. t
  20106. }
  20107. ,
  20108. n.prototype.buildWarpDestinationDescriptor = function(e, t, i, n, r, o) {
  20109. var a = {
  20110. cameraMode: n,
  20111. position: e,
  20112. quaternion: t,
  20113. panoId: i,
  20114. orthoZoom: o,
  20115. floorVisibility: r,
  20116. thumbUrl: null,
  20117. name: null
  20118. };
  20119. return new f(a)
  20120. }
  20121. ,
  20122. n.prototype.buildWarpDestinationDescriptorFromHero = function(e) {
  20123. return this.buildWarpDestinationDescriptor(e.position, e.quaternion, this.getHeroId(e), e.cameraMode, e.floorVisibility, e.orthoZoom)
  20124. }
  20125. ,
  20126. n.prototype.setWarpDestination = function(e) {
  20127. this.warpDestHeroLoc = e
  20128. }
  20129. ,
  20130. n.prototype.setWarpDestinationByHeroIndex = function(e) {
  20131. var t = this.getHeroDescriptorByHeroIndex(e);
  20132. return null !== t && (this.setWarpDestination(t),
  20133. !0)
  20134. }
  20135. ,
  20136. n.prototype.setWarpDestinationByPano = function(e, t) {
  20137. var i = this.model.panos.get(e.id);
  20138. return !!i && this.setWarpDestinationByPanoId(e.id, t)
  20139. }
  20140. ,
  20141. n.prototype.setWarpDestinationByPanoId = function(e, t) {
  20142. var i = this.model.panos.get(e);
  20143. if (i) {
  20144. t = t || new r.Quaternion;
  20145. var n = this.buildWarpDestinationDescriptor(i.position, t, i.id, "panorama", [], -1);
  20146. return this.setWarpDestination(n),
  20147. !0
  20148. }
  20149. return !1
  20150. }
  20151. ,
  20152. n.prototype.getHeroDescriptorByHeroIndex = function(e) {
  20153. var t = this.model.heroCount();
  20154. /* if (null !== this.warpDestHeroLoc && t < 2)
  20155. return y.info("ShowPath.getHeroDescriptorByHeroIndex() -> Only one hero location is available."),
  20156. this.model.getHeroDescriptorByIndex(0); */
  20157. var i = this.model.getHeroDescriptorByIndex(e);
  20158. if (i) {
  20159. var n = i.isPano() ? i.panoId : i.cameraMode;
  20160. y.debug('ShowPath.getHeroDescriptorByHeroIndex() -> New brush/warp destination: "' + n + '" out of ' + t + " choices.")
  20161. }
  20162. return i
  20163. }
  20164. ,
  20165. n.prototype.getHeroDescriptorByPano = function(e) {
  20166. var t = this.model.panos.get(e.id);
  20167. return t ? this.getHeroDescriptorByPanoId(e.id) : null
  20168. }
  20169. ,
  20170. n.prototype.getHeroDescriptorByPanoId = function(e) {
  20171. var t = this.getHeroIndexFromPanoId(e);
  20172. return this.getHeroDescriptorByHeroIndex(t)
  20173. }
  20174. ,
  20175. n.prototype.getHeroIndexFromPanoId = function(e) {
  20176. for (var t = 0; t < this.model.heroLocations.length; t++) {
  20177. var i = this.model.heroLocations[t]
  20178. , n = this.getHeroId(i);
  20179. if (n && n === e)
  20180. return t
  20181. }
  20182. return -1
  20183. }
  20184. ,
  20185. n.prototype.getHeroPano = function(e) {
  20186. if (null === e)
  20187. return y.warn("getHeroPano(): no destination"),
  20188. null;
  20189. var t = this.getHeroId(e)
  20190. , i = this.model.panos.get(t);
  20191. return void 0 === i && (i = null,
  20192. "" !== t && y.debug('unable to find pano "' + t + '"')),
  20193. i
  20194. }
  20195. ,
  20196. n.prototype.getHeroId = function(e) {
  20197. return e.panoId
  20198. }
  20199. ,
  20200. n.prototype.setWarpDestPano = function() {
  20201. return this.warpDestPano = this.getHeroPano(this.warpDestHeroLoc),
  20202. this.warpDestPano
  20203. }
  20204. ,
  20205. n.prototype.brushToWarpPano = function(e, t) {
  20206. if (this.discardPathObject(),
  20207. !this.setWarpDestPano())
  20208. return !1;
  20209. if (this.warpDestHeroLoc.cameraMode !== a.PANORAMA && y.warn("Can only brush from pano to pano"),
  20210. !this.warpDestPano)
  20211. return y.info("No brush"),
  20212. !1;
  20213. if (!this.player.currentPano)
  20214. return y.debug("No current pano, visibility undefined"),
  20215. !1;
  20216. if (!this.warpDestPano)
  20217. return y.info("No wPano, visibility undefined"),
  20218. !1;
  20219. if (!this.warpDestPano.isAligned())
  20220. return y.debug("Cannot brush to unaligned pano"),
  20221. !1;
  20222. var i = (e === l.STD || e === l.WALK) && c.path.mapGuides
  20223. , n = !0;
  20224. if (this.player.currentPano.id === this.warpDestPano.id)
  20225. y.debug("Already at destination pano");
  20226. else {
  20227. this.nodes = this.findShortestPath(this.player.currentPano, this.warpDestPano),
  20228. n = void 0 === this.nodes || null === this.nodes || this.nodes.length < 1,
  20229. this.obj3d = new r.Object3D,
  20230. y.debug('Brushing from "' + this.player.currentPano.id + '" to "' + this.warpDestPano.id + '" (' + (this.nodes ? this.nodes.length : 0) + ")"),
  20231. n ? (y.info('No "walkable" route, using fall-back warp style transition'),
  20232. e = t) : (this.setPathHulls(this.nodes),
  20233. this.setFloorCurves(),
  20234. 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)))),
  20235. this.player.currentPano.floor.add(this.obj3d);
  20236. var o = this.player.mode === a.DOLLHOUSE || this.player.mode === a.FLOORPLAN
  20237. , s = e === l.STD;
  20238. if (!n && (i || s)) {
  20239. if (o) {
  20240. var h = this.makeStartMarker(this.floorHull[0], this.floorCurvePoints);
  20241. this.obj3d.add(h)
  20242. }
  20243. var u = this.makeEndMarker(this.floorHull[this.floorHull.length - 1]);
  20244. this.obj3d.add(u)
  20245. }
  20246. this.appearSlow()
  20247. }
  20248. return this.upcomingTransType = e,
  20249. !n
  20250. }
  20251. ,
  20252. n.prototype.findShortestPath = function(e, t) {
  20253. if (!e || !t)
  20254. return null;
  20255. var i = c.warp.walkExtraPanosDistance
  20256. , n = e.id + ":" + t.id + ":" + i;
  20257. if (this.shortPaths.hasOwnProperty(n))
  20258. return this.shortPaths[n] ? this.shortPaths[n].slice() : null;
  20259. var r = t.id + ":" + e.id + ":" + i;
  20260. if (this.shortPaths.hasOwnProperty(r))
  20261. return this.shortPaths[r] ? this.shortPaths[r].slice().reverse() : null;
  20262. var o = this.model.panos.aStarSearch(e, t);
  20263. return this.model.panos.includeNodesNearPath(o, i),
  20264. this.shortPaths[n] = o ? o.slice() : null,
  20265. o
  20266. }
  20267. ,
  20268. n.prototype.makePathHulls = function(e) {
  20269. var t, i, n, r, o, a = 0, s = [], l = [], h = [], u = this.model.panos;
  20270. t = u.get(e[0]),
  20271. r = t.floor.floorIndex;
  20272. for (var d = 0; d < e.length; d += 1)
  20273. t = u.get(e[d]),
  20274. i = t.floorPosition.clone().sub(this.model.position),
  20275. i.y += this.pathHeight(),
  20276. s.push(i),
  20277. l.push(t.position.clone()),
  20278. n = t.floor.floorIndex,
  20279. h.push(n > r ? c.path.colorUp : n < r ? c.path.colorDown : c.path.color),
  20280. d > 0 && (o = l[d].distanceTo(l[d - 1]),
  20281. o > a && (a = o));
  20282. return a > this.longestStep && (this.longestStep = a,
  20283. y.debug("path contains " + a + " meter segment")),
  20284. {
  20285. floor: s,
  20286. camera: l,
  20287. color: h
  20288. }
  20289. }
  20290. ,
  20291. n.prototype.makeFloorCurves = function(e, t, i) {
  20292. var n = this.player.mode === a.PANORAMA ? c.path.waypointIndoorRadius : c.path.waypointRadius
  20293. , o = this.pointPathDistance(e) - 2 * n
  20294. , s = e.slice(0)
  20295. , l = s[1].clone().sub(s[0]);
  20296. l.y = 0,
  20297. l.normalize().multiplyScalar(n),
  20298. s[0] = (new r.Vector3).copy(s[0]).add(l),
  20299. l = s[s.length - 2].clone().sub(s[s.length - 1]),
  20300. l.y = 0,
  20301. l.normalize().multiplyScalar(n),
  20302. s[s.length - 1] = (new r.Vector3).copy(s[s.length - 1]).add(l);
  20303. var h = new r.CatmullRomCurve3(s)
  20304. , u = Math.floor(o / i);
  20305. u = 4 * Math.floor(u / 4),
  20306. u = Math.max(4, u);
  20307. for (var d, p, f, g = h.getSpacedPoints(u), m = [], v = new r.Vector3, A = 0; A < g.length; A += 1) {
  20308. f = 0,
  20309. d = g[A].distanceTo(e[0]);
  20310. for (var y = 1; y < e.length; y += 1)
  20311. v.copy(g[A]).sub(e[y]),
  20312. v.y *= 4,
  20313. p = v.length(),
  20314. p < d && (f = y);
  20315. m.push(t[f])
  20316. }
  20317. return {
  20318. distance: o,
  20319. points: g,
  20320. colors: m
  20321. }
  20322. }
  20323. ,
  20324. n.prototype.makeCameraCurvePoints = function(e, t) {
  20325. var i = this.pointPathDistance(e)
  20326. , n = new r.CatmullRomCurve3(e);
  20327. return n.getSpacedPoints(Math.max(2, Math.floor(i / t)))
  20328. }
  20329. ,
  20330. n.prototype.makeCameraCurveTangents = function(e, t) {
  20331. var i = this.pointPathDistance(e)
  20332. , n = new r.CatmullRomCurve3(e)
  20333. , o = Math.max(2, Math.floor(i / t));
  20334. o || (o = 5);
  20335. for (var a = [], s = 0; s <= o; s++)
  20336. a.push(n.getTangentAt(s / o));
  20337. return a
  20338. }
  20339. ,
  20340. n.prototype.setPathHulls = function(e) {
  20341. var t = this.makePathHulls(e);
  20342. this.floorHull = t.floor,
  20343. this.cameraHull = t.camera,
  20344. this.colorHull = t.color
  20345. }
  20346. ,
  20347. n.prototype.setFloorCurves = function() {
  20348. var e = this.makeFloorCurves(this.floorHull, this.colorHull, this.brushPrefs.paveStep);
  20349. this.floorPathDistance = e.distance,
  20350. this.floorCurvePoints = e.points,
  20351. this.floorCurveColors = e.colors
  20352. }
  20353. ,
  20354. n.prototype.setCameraCurvePoints = function() {
  20355. this.camCurvePoints = this.makeCameraCurvePoints(this.cameraHull, c.warp.stepFactor * this.brushPrefs.paveStep)
  20356. }
  20357. ,
  20358. n.prototype.chooseWarpPath = function(e) {
  20359. var t, i, n, o = this.playerControls.cameras[a.PANORAMA];
  20360. if (this.player.currentPano === this.warpDestPano || !e)
  20361. return this.warpPathPoints = null,
  20362. this.warpLength = 0,
  20363. !1;
  20364. this.nodes = this.findShortestPath(this.player.currentPano, this.warpDestPano),
  20365. void 0 === this.nodes || null === this.nodes || this.nodes.length < 1 ? (y.debug("warp path to unreachable node"),
  20366. t = this.warpDestPano.position.clone().sub(o.position),
  20367. i = t.clone().negate(),
  20368. t.multiplyScalar(.15).add(o.position),
  20369. i.multiplyScalar(.15).add(this.warpDestPano.position),
  20370. t.y = o.position.y,
  20371. i.y = this.warpDestPano.position.y,
  20372. n = new r.CubicBezierCurve3(o.position.clone(),t,i,this.warpDestPano.position.clone()),
  20373. this.warpPathPoints = n.getSpacedPoints(this.brushPrefs.cvSegments)) : (y.debug("follow warp path (path distance was " + this.nodes.length + " nodes, " + this.floorPathDistance + ")"),
  20374. this.setCameraCurvePoints(),
  20375. this.warpPathPoints = this.camCurvePoints.slice(0)),
  20376. this.warpLength = 0,
  20377. this.warpPathLengths = [0];
  20378. 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) {
  20379. s.copy(this.warpPathPoints[d - 1]).sub(this.warpPathPoints[d]);
  20380. var p = s.length();
  20381. s.y *= c.warp.climbEffort;
  20382. var f = s.length() / p;
  20383. if (d > 1) {
  20384. s.setY(0).normalize(),
  20385. l.copy(this.warpPathPoints[d - 2]).sub(this.warpPathPoints[d - 1]).setY(0).normalize();
  20386. var g = Math.min(1, s.dot(l))
  20387. , m = 1 + (c.warp.brakeStrength - 1) * (1 - r.Math.smoothstep(g, u, h));
  20388. f = Math.max(m, f)
  20389. }
  20390. this.warpLength += p * f,
  20391. this.warpPathLengths[d] = this.warpLength
  20392. }
  20393. return !0
  20394. }
  20395. ,
  20396. n.prototype.drawPathRibbon = function(e, t) {
  20397. this.bunnyObj.visible = c.warp.showBunny;
  20398. 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) {
  20399. h.copy(e[u]),
  20400. 0 === u ? h.sub(e[u + 1]) : h.sub(e[u - 1]).negate(),
  20401. h.normalize(),
  20402. n.crossVectors(h, A.UP),
  20403. n.multiplyScalar(i);
  20404. var d = (new r.Vector3).copy(e[u]).add(o);
  20405. d.sub(n),
  20406. l.vertices.push(d),
  20407. d = (new r.Vector3).copy(e[u]).add(o),
  20408. d.add(n),
  20409. l.vertices.push(d)
  20410. }
  20411. var p, f = 0;
  20412. for (u = 0; u < e.length - 1; u += 1) {
  20413. var g = 2 * u
  20414. , v = f;
  20415. f += e[u + 1].distanceTo(e[u]);
  20416. var y = f
  20417. , C = t[u]
  20418. , I = t[u + 1];
  20419. p = new r.Face3(g,g + 1,g + 2),
  20420. p.vertexColors = [new r.Color(C), new r.Color(C), new r.Color(I)],
  20421. l.faces.push(p),
  20422. l.faceVertexUvs[0].push([new r.Vector2(0,v), new r.Vector2(1,v), new r.Vector2(0,y)]),
  20423. p = new r.Face3(g + 2,g + 1,g + 3),
  20424. p.vertexColors = [new r.Color(I), new r.Color(C), new r.Color(I)],
  20425. l.faces.push(p),
  20426. l.faceVertexUvs[0].push([new r.Vector2(0,y), new r.Vector2(1,v), new r.Vector2(1,y)])
  20427. }
  20428. l.computeFaceNormals(),
  20429. l.computeVertexNormals();
  20430. var E, b;
  20431. this.player.mode === a.PANORAMA ? (b = r.UniformsUtils.clone(m.ribbon.uniforms),
  20432. b.map.value = w.path,
  20433. b.opacity.value = 0,
  20434. b.color.value.set(c.path.color),
  20435. E = new r.RawShaderMaterial({
  20436. side: r.DoubleSide,
  20437. depthWrite: !1,
  20438. transparent: !0,
  20439. vertexShader: m.ribbon.vertexShader,
  20440. fragmentShader: m.ribbon.fragmentShader,
  20441. uniforms: b,
  20442. name: "ribbonT",
  20443. opacity: 0
  20444. })) : E = new r.MeshBasicMaterial({
  20445. color: 16777215,
  20446. side: r.DoubleSide,
  20447. name: "ribbonOut",
  20448. vertexColors: r.VertexColors
  20449. });
  20450. var _ = new r.Mesh(l,E);
  20451. _.renderOrder = 10
  20452. return _.name = "ribbon",
  20453. this.player.mode === a.PANORAMA && (_.renderOrder = s.ribbon),
  20454. _
  20455. }
  20456. ,
  20457. n.prototype.drawPathPavement = function(e) {
  20458. for (var t, i = .25, n = new r.Vector3, o = new r.Geometry, s = new r.Vector3, l = 0; l < e.length; l += 1)
  20459. s.copy(e[l]),
  20460. 0 === l ? s.sub(e[l + 1]).negate() : s.sub(e[l - 1]),
  20461. s.normalize(),
  20462. n.crossVectors(s, A.UP),
  20463. n.multiplyScalar(this.brushPrefs.paveWidth),
  20464. t = (new r.Vector3).copy(e[l]),
  20465. t.sub(n),
  20466. o.vertices.push(t),
  20467. o.vertices.push((new r.Vector3).copy(e[l])),
  20468. t = (new r.Vector3).copy(e[l]),
  20469. t.add(n),
  20470. o.vertices.push(t);
  20471. var h, u, d;
  20472. for (l = 0; l < e.length - 1; l += 1)
  20473. h = 3 * l + 1,
  20474. u = l * i,
  20475. d = u + i,
  20476. o.faces.push(new r.Face3(h - 1,h,h + 3)),
  20477. o.faceVertexUvs[0].push([new r.Vector2(0,u), new r.Vector2(.5,u), new r.Vector2(.5,d)]),
  20478. o.faces.push(new r.Face3(h + 3,h + 2,h - 1)),
  20479. o.faceVertexUvs[0].push([new r.Vector2(.5,d), new r.Vector2(0,d), new r.Vector2(0,u)]),
  20480. o.faces.push(new r.Face3(h + 3,h,h + 1)),
  20481. o.faceVertexUvs[0].push([new r.Vector2(.5,d), new r.Vector2(.5,u), new r.Vector2(1,u)]),
  20482. o.faces.push(new r.Face3(h + 3,h + 1,h + 4)),
  20483. o.faceVertexUvs[0].push([new r.Vector2(.5,d), new r.Vector2(1,u), new r.Vector2(1,d)]);
  20484. var p = this.player.mode === a.PANORAMA ? new r.MeshBasicMaterial({
  20485. color: c.path.color,
  20486. side: r.DoubleSide,
  20487. transparent: !0,
  20488. depthWrite: !1,
  20489. opacity: 0,
  20490. name: "paveT",
  20491. map: w.path
  20492. }) : new r.MeshBasicMaterial({
  20493. color: c.path.color,
  20494. side: r.DoubleSide,
  20495. transparent: !0,
  20496. depthWrite: !1,
  20497. opacity: 1,
  20498. name: "paveO",
  20499. map: w.path
  20500. });
  20501. return new r.Mesh(o,p)
  20502. }
  20503. ,
  20504. n.prototype.hintPrefs = {
  20505. rad: .18,
  20506. width: .0125,
  20507. depth: .0625,
  20508. setBack: -.04,
  20509. markRad: .25,
  20510. markInnerRad: .16
  20511. },
  20512. n.prototype.makeWaypointObj = function(e, t) {
  20513. var i = new r.Geometry
  20514. , n = this.player.mode === a.PANORAMA ? c.path.waypointIndoorRadius : c.path.waypointRadius
  20515. , o = this.pathHeight();
  20516. 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)),
  20517. i.faces.push(new r.Face3(0,1,2), new r.Face3(2,3,0)),
  20518. i.faceVertexUvs[0].push([new r.Vector2(0,0), new r.Vector2(1,0), new r.Vector2(1,1)]),
  20519. i.faceVertexUvs[0].push([new r.Vector2(1,1), new r.Vector2(0,1), new r.Vector2(0,0)]);
  20520. var s = r.UniformsUtils.clone(m.waypoint.uniforms);
  20521. s.map.value = e,
  20522. s.opacity.value = 0,
  20523. s.color.value.set(c.path.color);
  20524. var l = {
  20525. side: r.DoubleSide,
  20526. depthWrite: !1,
  20527. transparent: !0,
  20528. vertexShader: m.waypoint.vertexShader,
  20529. fragmentShader: m.waypoint.fragmentShader,
  20530. uniforms: s,
  20531. name: "waypoint",
  20532. opacity: 0
  20533. };
  20534. this.player.mode !== a.PANORAMA && (l.depthTest = !1,
  20535. l.name = "wayPtOut");
  20536. var h = new r.RawShaderMaterial(l)
  20537. , u = new r.Mesh(i,h);
  20538. return u.name = t,
  20539. u
  20540. }
  20541. ,
  20542. n.prototype.makeStartMarker = function(e, t) {
  20543. var i = (new r.Vector3).copy(t[1]).sub(t[0]);
  20544. i.y = 0,
  20545. i.normalize();
  20546. var n = Math.acos(i.x)
  20547. , o = this.makeWaypointObj(w.pathStart, "Start");
  20548. return o.rotateOnAxis(new r.Vector3(0,1,0), n),
  20549. o.position.copy(e),
  20550. o
  20551. }
  20552. ,
  20553. n.prototype.makeEndMarker = function(e) {
  20554. var t = this.makeWaypointObj(w.pathEnd, "End")
  20555. , i = this.model.panos.get(this.nodes[0]).floor.floorIndex
  20556. , n = this.model.panos.get(this.nodes[this.nodes.length - 1]).floor.floorIndex;
  20557. return i < n ? t.material.uniforms.color.value.set(c.path.colorUp) : i > n && t.material.uniforms.color.value.set(c.path.colorDown),
  20558. t.position.copy(e),
  20559. t
  20560. }
  20561. ,
  20562. n.prototype.pathClean = function(e) {
  20563. if (e) {
  20564. for (var t in e.children)
  20565. this.pathClean(e.children[t]);
  20566. e.geometry && e.geometry.dispose(),
  20567. e.material && e.material.dispose()
  20568. }
  20569. }
  20570. ,
  20571. n.prototype.discardPathObject = function() {
  20572. if (this.obj3d) {
  20573. var e = this.obj3d.parent;
  20574. e && e.remove(this.obj3d),
  20575. this.pathClean(this.obj3d)
  20576. }
  20577. this.obj3d = null,
  20578. this.popInCpm()
  20579. }
  20580. ,
  20581. n.prototype.discardSlow = function() {
  20582. if (this.obj3d) {
  20583. if (this.player.mode !== a.PANORAMA)
  20584. return void this.discardPathObject();
  20585. for (var e, t = this, i = 0, n = function() {
  20586. this.discardPathObject()
  20587. }
  20588. .bind(this), r = 0; r < t.obj3d.children.length; r += 1)
  20589. e = t.obj3d.children[r],
  20590. 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]),
  20591. i += 1,
  20592. n = null);
  20593. 0 === i && this.discardPathObject(),
  20594. this.player.mode !== a.PANORAMA && this.fadeInCpm(c.path.fadeInTime - 3)
  20595. }
  20596. }
  20597. ,
  20598. n.prototype.appearSlow = function() {
  20599. var e, t = this;
  20600. this.fadeOutCpm(c.path.fadeInTime);
  20601. for (var i = this.player.mode === a.PANORAMA ? c.path.opacity : 1, n = 0; n < t.obj3d.children.length; n += 1)
  20602. e = t.obj3d.children[n],
  20603. 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]))
  20604. }
  20605. ,
  20606. n.prototype.update = function() {
  20607. this.obj3d && this.obj3d.updateMatrixWorld()
  20608. }
  20609. ,
  20610. n.prototype.calcBurnsAmount = function(e) {//计算导览点旋转角
  20611. var t = r.Math.degToRad(c.warp.burnsAngle);
  20612. if (this.player.mode === a.PANORAMA) {
  20613. var i = this.burnsDir * t;
  20614. if (this.upcomingTransType === l.BLACK)
  20615. return i;
  20616. var n = e;
  20617. if (null === n)
  20618. return y.warn("Transition request for non-highlight"),
  20619. i;
  20620. var o = this.getHeroDescriptorByHeroIndex(n);
  20621. if (null === o)
  20622. return i;
  20623. if (!o.isPano())
  20624. return i;
  20625. var s = this.getHeroPano(o)
  20626. , h = this.playerControls.cameras[a.PANORAMA]
  20627. , u = A.FORWARD.clone().applyQuaternion(h.quaternion).setY(0).normalize()
  20628. , d = Math.min(r.Math.degToRad(c.warp.minBurnsAngle), t)
  20629. , p = function(e) {
  20630. var i = Math.acos(Math.min(1, e.dot(u)))
  20631. , n = (new r.Vector3).crossVectors(u, e);
  20632. return Math.max(d, Math.min(Math.abs(i), t)) * Math.sign(n.y)
  20633. };
  20634. if (s === this.player.currentPano)
  20635. return i = p(A.FORWARD.clone().applyQuaternion(o.quaternion).setY(0).normalize());
  20636. var f = this.findShortestPath(this.player.currentPano, s);
  20637. if (void 0 === f || null === f || f.length < 1)
  20638. return y.debug("Empty path ahead..."),
  20639. i;
  20640. var g = this.makePathHulls(f)
  20641. , m = new r.CatmullRomCurve3(g.camera)
  20642. , v = Math.min(.1, c.warp.lookAheadDist / m.getLength());
  20643. return i = p(m.getPointAt(v).clone().sub(h.position).setY(0).normalize())
  20644. }
  20645. return this.player.mode === a.DOLLHOUSE ? .02 * this.burnsDir : this.burnsDir
  20646. }
  20647. ,
  20648. n.prototype.waitNextStep = function(e, t, time) {//xzw 改时间
  20649. var i = (time==void 0)? c.warp.tourStepDelay : time;
  20650. i==void 0 && (i = this.lastTransType === l.BLACK ? b.tourStepDelaySlideShow : b.tourStepDelayDefault);
  20651. var n = new r.Euler
  20652. , o = new r.Vector3;
  20653. y.debug("Starting wait: " + (void 0 !== t));
  20654. var currentLocation = this.model.getHeroDescriptorByIndex(this.director.currentItem)//this.model.heroLocations[this.director.currentItem[0]]
  20655. var s = currentLocation.dontRot || this.calcBurnsAmount(e)
  20656. , h = function() {
  20657. this.endWarpState(),
  20658. this.player.mode === a.DOLLHOUSE && (this.playerControls.cameras[a.DOLLHOUSE].controls.rotationAcceleration.x = 0),
  20659. t && t()
  20660. }
  20661. .bind(this)
  20662. , u = function(e, t) {
  20663. if (this.warpInterrupted)
  20664. return h(),
  20665. !0;
  20666. var r = t || 1e3 / 60;
  20667. if (c.warp.doBurns && !currentLocation.dontRot )
  20668. if (this.player.mode === a.PANORAMA) {
  20669. var l = this.playerControls.cameras[a.PANORAMA];
  20670. n.setFromQuaternion(l.quaternion, c.warp.eOrder);
  20671. var u = i == 0 ? s : r * s / i;
  20672. u = Math.sign(u) * Math.max(u, 0.0001) //add 如果音频长的话,使旋转可见,否则以为停住了
  20673. n.y += u,
  20674. o.set(0, 0, -1),
  20675. o.applyEuler(n),
  20676. o.add(l.position),
  20677. l.controls.lookAt(o),
  20678. l.controls.lookVector.copy(o)
  20679. ,l.lookAt(o)
  20680. } else
  20681. this.player.mode === a.DOLLHOUSE ? this.playerControls.controls[a.DOLLHOUSE].rotationAcceleration.x = s : this.playerControls.controls[a.FLOORPLAN].absoluteScale *= .9996
  20682. }
  20683. .bind(this);
  20684. this.startWarpState(),
  20685. p.start(u, i, h, 0, d.easeInOutQuad, "wait")
  20686. }
  20687. ,
  20688. n.prototype.warpToNonPano = function(e) {
  20689. if (this.discardPathObject(),
  20690. this.warpDestHeroLoc.cameraMode === a.DOLLHOUSE || this.warpDestHeroLoc.cameraMode === a.FLOORPLAN) {
  20691. var t = function() {
  20692. e && e()
  20693. }
  20694. .bind(this);
  20695. this.player.flyToNewMode({
  20696. mode: this.warpDestHeroLoc.cameraMode,
  20697. duration: c.warp.outsideTime,
  20698. warpDest: this.warpDestHeroLoc,
  20699. callback: t,
  20700. force: !0
  20701. })
  20702. } else
  20703. y.warn("no warp destination!!!"),
  20704. e && e()
  20705. }
  20706. ,
  20707. n.prototype._resetWarpShaderParams = function(e) {//
  20708. this.player.mode === a.PANORAMA && (void 0 !== e.material.uniforms.blackout && (e.material.uniforms.blackout.value = 0),
  20709. void 0 !== e.material.uniforms.modelAlpha && (e.material.uniforms.modelAlpha.value = 0))
  20710. /* if(momentTourBlackNewType && "newBlack" in e.material.defines){
  20711. delete e.material.defines.newBlack;
  20712. e.material.needsUpdate = true
  20713. } */
  20714. }
  20715. ,
  20716. n.prototype._clearWarpShading = function() {
  20717. for (var e = this.model.chunks, t = 0; t < e.length; t += 1)
  20718. this._resetWarpShaderParams(e[t]),
  20719. e[t].visible = !0;
  20720. this._resetWarpShaderParams(this.model.skybox)
  20721. }
  20722. ,
  20723. n.prototype._warpStopFlying = function() {
  20724. this.activeTransType = null,
  20725. this.placeCpm()
  20726. }
  20727. ,
  20728. n.prototype._wrapupTravelOnlyBits = function() {
  20729. this._warpStopFlying(),
  20730. this.warpPathPoints && (this.player.currentPano.exit(),
  20731. this.warpDestPano.enter(),
  20732. this.player.currentPano = this.warpDestPano),
  20733. this.player.spider.draw(),
  20734. this.placeCpm()
  20735. }
  20736. ,
  20737. n.prototype._wrapupTravel = function(e) {
  20738. this._wrapupTravelOnlyBits(),
  20739. this.warpCameraAim(e)
  20740. }
  20741. ,
  20742. n.prototype._wrapupWarpShading = function(e) {
  20743. this._clearWarpShading(),
  20744. this._wrapupTravel(e)
  20745. }
  20746. ,
  20747. n.prototype.wrapupWarpShadingOnly = function(e, t) {
  20748. t !== I.END && this._clearWarpShading(),
  20749. this._wrapupTravelOnlyBits(),
  20750. this.upcomingTransType = null,
  20751. e && e()
  20752. }
  20753. ,
  20754. n.prototype._warpCameraAim = function(e, t) {//到每个片段终点时转向终点朝向。
  20755. var i = this.warpDestHeroLoc.quaternion
  20756. , n = this.playerControls.cameras[a.PANORAMA]
  20757. , o = new r.Vector3(0,0,1).applyQuaternion(i).normalize()
  20758. , s = new r.Vector3(0,0,1).applyQuaternion(n.quaternion).normalize()
  20759. , l = s.dot(o)
  20760. , u = r.Math.radToDeg(Math.acos(l))
  20761. , f = new r.Euler(0,0,0,c.warp.eOrder).setFromQuaternion(i, c.warp.eOrder)
  20762. , g = (new r.Euler).setFromQuaternion(n.quaternion, c.warp.eOrder)
  20763. , m = new r.Euler(f.x - g.x,f.y - g.y,f.z - g.z,c.warp.eOrder);
  20764. m.y = h.constrainedTurn(m.y),
  20765. this.burnsDir = Math.sign(m.y);
  20766. var v = new r.Euler(0,0,0,c.warp.eOrder)
  20767. , A = new r.Vector3
  20768. , C = function(e, t) {
  20769. return !!this.warpInterrupted || (v.x = g.x + e * m.x,
  20770. v.y = g.y + e * m.y,
  20771. v.z = g.z + e * m.z,
  20772. A.set(0, 0, -1),
  20773. A.applyEuler(v),
  20774. A.add(n.position),
  20775. n.controls.lookAt(A),
  20776. n.controls.lookVector.copy(A),
  20777. void n.lookAt(A))
  20778. }
  20779. .bind(this);
  20780. /* return u > c.warp.minRotation ? (p.start(C, e, t, 0, d[c.warp.movementEasing])
  20781. ,(this.warpDestHeroLoc.zoom != this.player.zoomLevel) && //add 原地转向最终方位时
  20782. this.player.smoothZoomFovTo(null, this.warpDestHeroLoc.zoom , e)
  20783. ):
  20784. (y.info("Aim angle only is " + u.toPrecision(3) + " degrees, skipping explicit re-aim")
  20785. ,void (t && t())
  20786. ) */
  20787. (this.warpDestHeroLoc.zoom != this.player.zoomLevel) && //add 原地转向最终方位时
  20788. this.player.smoothZoomFovTo(null, this.warpDestHeroLoc.zoom , e)
  20789. return u > c.warp.minRotation ? p.start(C, e, t, 0, d[c.warp.movementEasing]) :
  20790. (y.info("Aim angle only is " + u.toPrecision(3) + " degrees, skipping explicit re-aim")
  20791. ,void (t && t())
  20792. )
  20793. }
  20794. ,
  20795. n.prototype._warpBendAim = function(e, t, i, n) {
  20796. var o = n || 0
  20797. , s = this.playerControls.cameras[a.PANORAMA]
  20798. , l = new r.Euler(0,0,0,c.warp.eOrder).setFromQuaternion(this.warpDestHeroLoc.quaternion, c.warp.eOrder)
  20799. , u = (new r.Euler).setFromQuaternion(s.quaternion, c.warp.eOrder)
  20800. , f = new r.Euler(l.x - u.x,l.y - u.y,l.z - u.z,c.warp.eOrder);
  20801. f.y = h.constrainedTurn(f.y);
  20802. var g = Math.min(r.Math.degToRad(c.warp.softBendTilt), Math.abs(f.x));
  20803. f.x = g * Math.sign(f.x),
  20804. g = Math.min(r.Math.degToRad(Math.max(0, c.warp.softBendAngle)), g),
  20805. this.burnsDir = Math.sign(f.y),
  20806. g *= Math.sign(f.y),
  20807. f.y = g;
  20808. var m = new r.Euler(0,0,0,c.warp.eOrder)
  20809. , v = new r.Vector3
  20810. , A = function(e, t) {
  20811. if (e < .5)
  20812. m.x = u.x + e * f.x,
  20813. m.y = u.y + e * f.y,
  20814. m.z = u.z + e * f.z;
  20815. else {
  20816. var i = (1 - e) * c.warp.softBendEnd;
  20817. m.x = l.x - i * f.x,
  20818. m.y = l.y - i * f.y,
  20819. m.z = l.z - i * f.z
  20820. }
  20821. v.set(0, 0, -1),
  20822. v.applyEuler(m),
  20823. v.add(s.position);
  20824. s.controls.lookAt(v),
  20825. s.controls.lookVector.copy(v),
  20826. s.lookAt(v);
  20827. }
  20828. .bind(this);
  20829. if(window.DATA.momentTourBlackNewType){
  20830. A(1)
  20831. }else return p.start(A, t, i, o, d[c.warp.movementEasing])
  20832. }
  20833. ,
  20834. n.prototype._warpStepCameraAim = function(e, t, i) {
  20835. var n = this.playerControls.cameras[a.PANORAMA]
  20836. , o = new r.Euler(0,0,0,c.warp.eOrder).setFromQuaternion(this.warpDestHeroLoc.quaternion, c.warp.eOrder)
  20837. , s = (new r.Euler).setFromQuaternion(n.quaternion, c.warp.eOrder)
  20838. , l = new r.Euler(o.x - s.x,o.y - s.y,o.z - s.z,c.warp.eOrder);
  20839. l.y = h.constrainedTurn(l.y),
  20840. this.burnsDir = Math.sign(l.y);
  20841. var u = new r.Euler(0,0,0,c.warp.eOrder)
  20842. , f = new r.Vector3
  20843. , g = function(e, t) {
  20844. e < .5 ? u.copy(s) : u.copy(o),
  20845. f.set(0, 0, -1),
  20846. f.applyEuler(u),
  20847. f.add(n.position),
  20848. n.controls.lookAt(f),
  20849. n.controls.lookVector.copy(f),
  20850. n.lookAt(f)
  20851. }
  20852. .bind(this);
  20853. return p.start(g, t, i, 0, d[c.warp.movementEasing])
  20854. }
  20855. ,
  20856. n.prototype.setBurnsDir = function() {
  20857. var e = this.playerControls.cameras[a.PANORAMA]
  20858. , t = new r.Euler(0,0,0,c.warp.eOrder).setFromQuaternion(this.warpDestHeroLoc.quaternion, c.warp.eOrder)
  20859. , i = (new r.Euler).setFromQuaternion(e.quaternion, c.warp.eOrder)
  20860. , n = new r.Euler(t.x - i.x,t.y - i.y,t.z - i.z,c.warp.eOrder);
  20861. n.y = h.constrainedTurn(n.y),
  20862. this.burnsDir = Math.sign(n.y)
  20863. }
  20864. ,
  20865. n.prototype.stepWarpPath = function(firstPos, e ) {
  20866. var i = this.playerControls.cameras[a.PANORAMA];
  20867. var n = this.warpPathPoints ? this.warpPathPoints[0] : firstPos
  20868. if (!n){
  20869. return i.position.copy(this.warpDestPano.position),
  20870. !0;
  20871. }
  20872. /* if (!this.warpPathPoints)
  20873. return i.position.copy(this.warpDestPano.position),
  20874. !0;
  20875. var n = this.warpPathPoints[0] */
  20876. var o = this.warpDestPano.position;
  20877. /* console.log(firstPos)
  20878. console.log(o) */
  20879. if (null !== this.nodes && this.cameraHull && this.cameraHull.length > 1) {
  20880. var s = new r.Vector3;
  20881. 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),
  20882. i.position.copy(s)
  20883. } else
  20884. e < .5 ? i.position.copy(n) : i.position.copy(o)
  20885. }
  20886. ,
  20887. n.prototype.interruptAndFastForward = function(e, t) {
  20888. this.warping && (this.warpInterrupted = !0,
  20889. this.warpInterruptionBlackoutStyle = e,
  20890. this.warpInterruptionTravelTime = t,
  20891. null !== this.warpInterruptionBlackoutStyle && void 0 !== this.warpInterruptionBlackoutStyle || (this.warpInterruptionBlackoutStyle = I.MIDDLE),
  20892. null !== this.warpInterruptionTravelTime && void 0 !== this.warpInterruptionTravelTime || (this.warpInterruptionTravelTime = c.minWarpTime))
  20893. }
  20894. ,
  20895. n.prototype.warpCameraAim = function(e) {
  20896. var t = c.warp.minWarpTime;
  20897. if (this.upcomingTransType === l.BLACK)
  20898. t = c.warp.teleportTime;
  20899. else {
  20900. var i = this.playerControls.cameras[a.PANORAMA]
  20901. , n = new r.Euler(0,0,0,c.warp.eOrder).setFromQuaternion(this.warpDestHeroLoc.quaternion, c.warp.eOrder)
  20902. , o = (new r.Euler).setFromQuaternion(i.quaternion, c.warp.eOrder)
  20903. , s = new r.Euler(n.x - o.x,n.y - o.y,n.z - o.z,c.warp.eOrder);
  20904. s.y = h.constrainedTurn(s.y);
  20905. var u = 1e3 * Math.abs(s.y) / r.Math.degToRad(c.warp.maxAimPerSec);
  20906. t = Math.max(t, u)
  20907. }
  20908. var d = function() {
  20909. this._warpStopFlying(),
  20910. this.discardSlow(),
  20911. e && e()
  20912. }
  20913. .bind(this);
  20914. this._warpCameraAim(t, d)
  20915. }
  20916. ,
  20917. n.prototype.warpCommonParameters = function(e, t, i, n) {
  20918. this.model.skybox.material.uniforms.blackout.value = n;
  20919. var r = u.uniform(this.model.skybox, "progress", 1)
  20920. , o = u.allUniforms(this.model.chunks, "progress", 1)
  20921. , a = !1
  20922. , s = function() {
  20923. if (this.warpInterrupted)
  20924. return a = !0,
  20925. !0
  20926. }
  20927. .bind(this)
  20928. , l = function(e, t) {
  20929. return i && a ? (this.model.skybox.material.uniforms.progress.value = 0,
  20930. !0) : void r(e, t)
  20931. }
  20932. .bind(this)
  20933. , h = function(e, t) {
  20934. return i && a ? (o(0),
  20935. !0) : void o(e, t)
  20936. }
  20937. .bind(this);
  20938. p.start(s, e, null, t, null, "safeHaltWatch"),
  20939. p.start(l, e, null, t, d[c.warp.blendEasing], "skyboxProgress"),
  20940. p.start(h, e, null, t, d[c.warp.blendEasing], "chunkProgress")
  20941. }
  20942. ,
  20943. n.prototype.warpTravel_STD = function(e) {
  20944. 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),
  20945. 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;
  20946. w += this.warpLength * c.warp.timePerMeter,
  20947. c.warp.flySpeed > .01 && (w = 1e3 * this.warpLength / c.warp.flySpeed);
  20948. var _ = !1
  20949. , T = this.warpDestHeroLoc.quaternion
  20950. , x = new r.Vector3(0,0,-1).applyQuaternion(T).normalize()
  20951. , S = this.warpPathPoints[this.warpPathPoints.length - 1].clone().sub(this.warpPathPoints[this.warpPathPoints.length - 2]).normalize()
  20952. , M = S.dot(x)
  20953. , R = r.Math.radToDeg(Math.acos(M))
  20954. , P = function(e) {
  20955. var t = o
  20956. , i = r.Math.smoothstep(e, 0, t) * (1 - r.Math.smoothstep(e, 1 - t, 1));
  20957. return i
  20958. }
  20959. , O = function() {
  20960. return E.lookAt(C, t, A.UP),
  20961. s.setFromRotationMatrix(E, c.warp.eOrder),
  20962. m.setFromQuaternion(n.quaternion, c.warp.eOrder),
  20963. b.set(s.x - m.x, s.y - m.y, s.z - m.z, c.warp.eOrder),
  20964. h.constrainedTurn(b.y)
  20965. }
  20966. .bind(this)
  20967. , L = function(e, t) {
  20968. if (this.warpInterrupted)
  20969. return _ = !0,
  20970. !0
  20971. }
  20972. .bind(this)
  20973. , D = function(e, t) {
  20974. return _ || !this.warpPathPoints ? (g.blur(0),
  20975. !0) : void g.blur(e)
  20976. }
  20977. .bind(this)
  20978. , N = u.allUniforms(this.model.chunks, "modelAlpha", 1)
  20979. , B = function(e, t) {
  20980. return _ || !this.warpPathPoints ? (N(0),
  20981. !0) : void N(e, t)
  20982. }
  20983. .bind(this)
  20984. , F = function(e, t) {
  20985. if (!this.warpPathPoints)
  20986. return n.position.copy(this.warpDestPano.position),
  20987. !0;
  20988. if (_)
  20989. return !0;
  20990. var i = this.interpAlongPath(this.warpPathPoints, this.warpPathLengths, e);
  20991. n.position.copy(i),
  20992. C = this.interpAlongPath(this.warpPathPoints, this.warpPathLengths, .99 * e)
  20993. }
  20994. .bind(this)
  20995. , V = function(e, n) {
  20996. return this.warpPathPoints ? !!_ || void (t = this.interpAlongPath(this.warpPathPoints, this.warpPathLengths, Math.min(e + i, 1))) : (y.debug("Lost bunny."),
  20997. !0)
  20998. }
  20999. .bind(this)
  21000. , U = function(e, o) {
  21001. if (_)
  21002. return y.debug(">>>> Walkthrough interupted at t=" + e),
  21003. !0;
  21004. if (!this.warpPathPoints)
  21005. return !0;
  21006. var a = this.warpLength * e
  21007. , l = r.Math.smoothstep(a, 0, this.brushPrefs.lookBlendDist)
  21008. , u = r.Math.smoothstep(a, this.warpLength - this.brushPrefs.lookBlendDist, this.warpLength);
  21009. c.warp.matchCam && (l *= 1 - u),
  21010. E.lookAt(C, t, A.UP),
  21011. s.setFromRotationMatrix(E, c.warp.eOrder),
  21012. m.setFromQuaternion(n.quaternion, c.warp.eOrder),
  21013. b.set(s.x - m.x, s.y - m.y, s.z - m.z, c.warp.eOrder),
  21014. b.y = h.constrainedTurn(b.y),
  21015. s.x = m.x + l * b.x,
  21016. s.y = m.y + l * b.y,
  21017. s.z = m.z + l * b.z,
  21018. b.set(s.x - v.x, s.y - v.y, s.z - v.z, c.warp.eOrder),
  21019. b.y = h.constrainedTurn(b.y);
  21020. var d = r.Math.degToRad(c.warp.maxTurnPerSec) * o / 1e3;
  21021. b.y = Math.sign(b.y) * Math.min(d, Math.abs(b.y)),
  21022. v.x = v.x + b.x * c.warp.turnFriction,
  21023. v.y = v.y + b.y * c.warp.turnFriction,
  21024. v.z = v.z + b.z * c.warp.turnFriction,
  21025. v.x = Math.max(r.Math.degToRad(c.warp.minDownAngle), v.x);
  21026. var p = t.clone().sub(C).normalize();
  21027. if (R < c.warp.maxAimRotation && u > 0) {
  21028. var g = 1 - u;
  21029. p.x = p.x * g + u * S.x,
  21030. p.y = p.y * g + u * S.y,
  21031. p.z = p.z * g + u * S.z,
  21032. p.normalize()
  21033. }
  21034. this.bunnyObj.position.copy(n.position).add(p),
  21035. f.set(0, 0, -1).applyEuler(v).normalize(),
  21036. f.multiplyScalar(8),
  21037. f.add(n.position),
  21038. e > 1 - i && c.warp.matchCam || (n.controls.lookAt(f),
  21039. n.controls.lookVector.copy(f),
  21040. n.lookAt(f))
  21041. }
  21042. .bind(this)
  21043. , k = function() {
  21044. _ ? (this.discardSlow(),
  21045. this.upcomingTransType = l.BLACK,
  21046. this.warpTravel_BLACK(-.5, this.warpInterruptionTravelTime, I.BEGINNING, e)) : this._wrapupWarpShading(e)
  21047. }
  21048. .bind(this);
  21049. V(0);
  21050. var H = c.warp.motionLeadTime + 1e3 * Math.abs(O()) / r.Math.degToRad(c.warp.maxTurnPerSec);
  21051. w += H;
  21052. var G = H / w;
  21053. this.warpCommonParameters(w, G, !0, I.NONE),
  21054. p.start(L, w, null, 0, null, "_haltWatcher"),
  21055. c.warp.blur > 0 && (g.blurStrength = c.warp.blur,
  21056. p.start(D, w, null, G, P, "blurring")),
  21057. p.start(B, w, null, G, P, "modelAlpha"),
  21058. p.start(F, w, null, G, d[c.warp.blendEasing], "followPath"),
  21059. p.start(V, w, null, G, d[c.warp.blendEasing], "goBunny"),
  21060. p.start(U, w, k, 0, d[c.warp.blendEasing], "lookAtBunny")
  21061. }
  21062. ,
  21063. n.prototype.warpTravel_BLACK = function(e, t, i, n) {
  21064. var r = e || 0;
  21065. void 0 !== t && null !== t || (t = c.warp.teleportTime)
  21066. //add
  21067. player.model.hotGroup.visible = false
  21068. let oldPano = this.player.currentPano
  21069. let toPano = this.player.model.panos.get(this.warpDestHeroLoc.panoId)
  21070. this.player.emit("pano.chosen", oldPano, toPano)
  21071. var done = ()=>{
  21072. this.player.transitionPos({type:"beforeFlytopano", pano:this.player.currentPano, dur:0, callback:()=>{
  21073. player.model.hotGroup.visible = true
  21074. Hot.updateVisibles([this.player.currentPano]) //更新热点显示
  21075. }})
  21076. this.player.emit("flying.ended",toPano.position, oldPano.position,toPano, oldPano)
  21077. }
  21078. if(window.DATA.momentTourBlackNewType){
  21079. player.sceneRenderer.effects.fastTranMaskPass.start(player.sceneRenderer)
  21080. var camera = this.playerControls.cameras[a.PANORAMA];
  21081. var end = this.warpDestHeroLoc.position
  21082. camera.position.copy(end)
  21083. setTimeout(()=>{
  21084. player.sceneRenderer.effects.fastTranMaskPass.stop()
  21085. this.wrapupWarpShadingOnly(n, i);
  21086. done()
  21087. },t)
  21088. }else{
  21089. var o = function() {
  21090. this.wrapupWarpShadingOnly(n, i);
  21091. done()
  21092. }
  21093. .bind(this);
  21094. var firstPos = this.player.position.clone()//add
  21095. p.start(this.stepWarpPath.bind(this, firstPos), t, o, r, d[c.warp.blendEasing], "stepMotion")
  21096. }
  21097. this.warpCommonParameters(t, r, !1, i)
  21098. this.model.chunks.concat(this.model.skybox).forEach(function(e) {// 改
  21099. if(window.DATA.momentTourBlackNewType){
  21100. e.material.uniforms.blackout.value = 5//i 改
  21101. //e.material.defines.newBlack = ''
  21102. //e.material.needsUpdate = true
  21103. }else{
  21104. e.material.uniforms.blackout.value = i
  21105. }
  21106. }),
  21107. this._warpBendAim(null, t, null, r);
  21108. }
  21109. ,
  21110. n.prototype.flightStepWalk = function(e, t, i) {
  21111. var n = .001
  21112. , o = 1
  21113. , a = 1.2
  21114. , s = new r.Vector3
  21115. , h = new r.Vector3
  21116. , u = function(e, t) {
  21117. //导览速度
  21118. var i = Math.min(this.player.position.distanceTo(e.position), c.transition.flytimeMaxDistanceThreshold)
  21119. // , r = i * c.transition.flytimeDistanceMultiplier + c.transition.flyTime;
  21120. , r = i * c.warp.flytimeDistanceMultiplier + c.warp.flyTime;
  21121. h.copy(A.FORWARD),
  21122. this.player.getDirection(h),
  21123. s.copy(t).sub(e.position).normalize();
  21124. var l = s.dot(h)
  21125. , u = Math.acos(l)
  21126. , d = u / r;
  21127. d > n && (r *= d / n,
  21128. u < o && (r *= a))
  21129. return r / DATA.tourWalkSpeed * 100 // 改
  21130. };
  21131. return function(e, t, i) {
  21132. if (this.warpInterrupted)
  21133. i && i();
  21134. else if (this.activeTransType !== l.WALK)
  21135. this._clearWarpShading(),
  21136. this._warpStopFlying(),
  21137. this.player.spider.draw(),
  21138. this.placeCpm(),
  21139. i && i();
  21140. else if (this.player.currentPano !== e) {
  21141. var n = {
  21142. pano: e,
  21143. lookAtPoint: t,
  21144. duration: null,
  21145. maxDistanceOverride: c.warp.walkMaxDist,
  21146. skipWarpingCheck: !1,
  21147. constantMoveSpeed: !0
  21148. };
  21149. if(e == this.warpDestPano){//到达终点前,放大到终点的zoom
  21150. n.zoomLevel = this.warpDestHeroLoc.zoom
  21151. }
  21152. n.duration = u.call(this, e, t),
  21153. this.player.nonInterruptingFlyToPano(n, i)
  21154. } else
  21155. i && i()
  21156. }
  21157. }(),
  21158. n.prototype.makeWalkFlightFunc = function(e, t, i) {
  21159. return this.flightStepWalk.bind(this, e, t, i)
  21160. }
  21161. ,
  21162. n.prototype.warpTravel_WALK = function() {
  21163. var e = [];
  21164. return function(t) {
  21165. var i = this.player.model.panos;
  21166. e.length = 0;
  21167. for (var n = null, o = !1, a = 0; a < this.nodes.length; a++) {
  21168. var s = this.nodes[a]
  21169. , l = i.get(s);
  21170. a === this.nodes.length - 1;
  21171. o = n && l.position.distanceTo(n.position) < c.warp.walkMinDist,
  21172. n && o || (e.push(s),
  21173. n = l)
  21174. }
  21175. o && this.nodes.length > 1 && (e[e.length - 1] = this.nodes[this.nodes.length - 1]);
  21176. var h = e.length
  21177. , u = i.get(e[h - 1])
  21178. , d = new Array(h + 1);
  21179. d[d.length - 1] = function() {
  21180. t && t()
  21181. }
  21182. .bind(this);
  21183. for (var p = h - 1, f = d.length - 1; f > 0; f -= 1) {
  21184. var g = e[p];
  21185. u = i.get(g);
  21186. var m = new r.Vector3;
  21187. this.getLookAtForWalkingTourNode(e, p, m),
  21188. d[f - 1] = this.makeWalkFlightFunc(u, m, d[f]),
  21189. p--
  21190. }
  21191. d[0]()
  21192. }
  21193. }(),
  21194. n.prototype.getLookAtForWalkingTourNode = function() {
  21195. var e = new r.Vector3
  21196. , t = new r.Vector3
  21197. , i = new r.Vector3
  21198. , n = new r.Vector3
  21199. , o = new r.Vector3
  21200. , a = .65
  21201. , s = .75
  21202. , l = .2
  21203. , c = .4
  21204. , h = .2
  21205. , u = 3;
  21206. return function(r, d, p) {
  21207. var f = r.length;
  21208. if (d >= f)
  21209. return !1;
  21210. var g = 1
  21211. , m = 1;
  21212. t.set(0, 0, 0),
  21213. o.set(0, 0, 0);
  21214. for (var v = null, A = d; A < d + u && !(A >= f); A++) {
  21215. if (v = this.player.model.panos.get(r[A]),
  21216. this.getOrientationForWalkingTourNode(r, A, i),
  21217. A === d && e.copy(i),
  21218. n.copy(i),
  21219. A > d) {
  21220. var y = n.dot(e) < a;
  21221. g *= y ? l : s,
  21222. m *= y ? h : c
  21223. }
  21224. i.multiplyScalar(g),
  21225. t.add(i),
  21226. o.lerp(v.position, m)
  21227. }
  21228. return t.normalize(),
  21229. p.copy(o),
  21230. p.add(t),
  21231. !0
  21232. }
  21233. }(),
  21234. n.prototype.getOrientationForWalkingTourNode = function(e, t, i) {
  21235. var n = e.length;
  21236. if (t >= n)
  21237. return !1;
  21238. if (t === n - 1)
  21239. i.copy(A.FORWARD).applyQuaternion(this.warpDestHeroLoc.quaternion);
  21240. else {
  21241. var r = this.player.model.panos.get(e[t])
  21242. , o = this.player.model.panos.get(e[t + 1]);
  21243. i.copy(o.position).sub(r.position)
  21244. }
  21245. return i.normalize(),
  21246. !0
  21247. }
  21248. ,
  21249. n.prototype.warpCameraTravel = function(e, t, i, n) {
  21250. if (this.activeTransType = this.upcomingTransType,
  21251. this.lastTransType = this.activeTransType,
  21252. this.upcomingTransType = null,
  21253. !e) {
  21254. var r = function() {
  21255. this._wrapupTravel(n)
  21256. }
  21257. .bind(this)
  21258. , o = {
  21259. pano: this.warpDestPano,
  21260. lookAtPoint: null,
  21261. duration: null,
  21262. maxDistanceOverride: null,
  21263. skipWarpingCheck: !1
  21264. };
  21265. return void this.player.flyToPano(o, r)
  21266. }
  21267. this.activeTransType === l.BLACK ? this.warpTravel_BLACK(null, i, t, n) : this.activeTransType === l.WALK ? this.warpTravel_WALK(function() {
  21268. this._clearWarpShading(),
  21269. this._warpStopFlying(),
  21270. this.player.spider.draw(),
  21271. this.placeCpm(),
  21272. n && n()
  21273. }
  21274. .bind(this)) : this.warpTravel_STD(n)
  21275. }
  21276. ,
  21277. n.prototype.startWarpState = function() {
  21278. this.warping = !0,
  21279. this.warpInterrupted = !1,
  21280. this.warpInterruptionBlackoutStyle = null,
  21281. this.warpInterruptionTravelTime = null
  21282. }
  21283. ,
  21284. n.prototype.endWarpState = function() {
  21285. this.warping = !1
  21286. this.director.emit('warp.end')//xzw add
  21287. }
  21288. ,
  21289. n.prototype.warpToPano = function(e, t, i, n) {
  21290. if (this.warping)
  21291. return void y.warn("Cannot warp when already warping");
  21292. if (this.upcomingTransType = e,
  21293. this.activeTransType = null,
  21294. !this.setWarpDestPano())
  21295. return this.upcomingTransType = null,
  21296. void this.warpToNonPano(n);
  21297. if (this.player.mode !== a.PANORAMA)
  21298. return this.upcomingTransType = null,
  21299. this.discardSlow(),
  21300. void this.player.flyToNewMode({
  21301. mode: a.PANORAMA,
  21302. pano: this.warpDestPano,
  21303. duration: c.warp.outsideTime,
  21304. warpDest: this.warpDestHeroLoc,
  21305. callback: n,
  21306. force: !0
  21307. });
  21308. if (!this.warpDestPano)
  21309. return y.warn("no warp destination, callback dropped"),
  21310. void (this.upcomingTransType = null);
  21311. 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)
  21312. , o = this.chooseWarpPath(r);
  21313. if (o && this.upcomingTransType !== l.WALK) {
  21314. var s = function() {
  21315. this.waitingToWarp = !1,
  21316. this.warpToPano(e, t, i, n)
  21317. }
  21318. .bind(this);
  21319. if (this.player.checkAndWaitForPanoLoad(this.warpDestPano, "high", "low", this.player.basePanoSize, s))
  21320. return void (this.waitingToWarp = !0)
  21321. }
  21322. this.player.currentPano || (y.warn("Arrived at a very strange spot!"),
  21323. this.player.currentPano = this.warpDestPano,
  21324. this.placeCpm(),
  21325. this.fadeOutCpm(c.path.fadeOutTime),
  21326. this.player.spider.draw()),
  21327. y.debug("Warping to pano ", this.warpDestPano.position),
  21328. this.upcomingTransType !== l.WALK && this.player.emit(C.PanoChosen, this.player.currentPano, this.warpDestPano),
  21329. this.startWarpState();
  21330. var h = function() {
  21331. this.endWarpState(),
  21332. n && n()
  21333. }
  21334. .bind(this);
  21335. o ? this.warpCameraTravel(r, t, i, h) : this.warpCameraAim(h)
  21336. //this.player.smoothZoomToDefault(c.zoom.restoreTime);
  21337. }
  21338. ,
  21339. t.exports = n
  21340. }
  21341. ).call(this, "/js/objects/ShowPath.js")
  21342. }
  21343. , {
  21344. "../constants": 8,
  21345. "../effects": 16,
  21346. "../enum/BlackoutStyle": 18,
  21347. "../enum/ModelManagerEvents": 33,
  21348. "../enum/PlayerEvents": 40,
  21349. "../enum/RenderOrder": 42,
  21350. "../enum/Vectors": 50,
  21351. "../enum/Viewmode": 51,
  21352. "../enum/WarpStyle": 52,
  21353. "../gui/gui": 65,
  21354. "../model/ModelManager": 140,
  21355. "../objects/Snapshot": 153,
  21356. "../settings": 166,
  21357. "../shaders": 167,
  21358. "../util/easing": 186,
  21359. "../util/lerp": 188,
  21360. "../util/logger": 189,
  21361. "../util/math": 190,
  21362. "../util/texture": 194,
  21363. "../util/transitions": 195,
  21364. three: 217
  21365. }],
  21366. 152: [function(e, t, i) {
  21367. "use strict";
  21368. function n() {
  21369. var e = new r.SphereBufferGeometry(a.skyboxRadius,20,5)
  21370. , t = new r.RawShaderMaterial({
  21371. fragmentShader: o.skysphere.fragmentShader,
  21372. vertexShader: o.skysphere.vertexShader,
  21373. uniforms: r.UniformsUtils.clone(o.skysphere.uniforms),
  21374. side: r.BackSide,
  21375. name: "skysphere"
  21376. });
  21377. t.uniforms.radius.value = e.parameters.radius,
  21378. r.Mesh.call(this, e, t)
  21379. }
  21380. var r = e("three")
  21381. , o = e("../shaders")
  21382. , a = e("../settings");
  21383. n.prototype = Object.create(r.Mesh.prototype),
  21384. n.prototype.constructor = n,
  21385. t.exports = n
  21386. }
  21387. , {
  21388. "../settings": 166,
  21389. "../shaders": 167,
  21390. three: 217
  21391. }],
  21392. 153: [function(e, t, i) {
  21393. (function(i) {
  21394. "use strict";
  21395. function n(e) {
  21396. o.call(this, e),
  21397. this.sid = e.sid,//xzw add
  21398. this.panoId = e.panoId,
  21399. this.orthoZoom = e.orthoZoom,
  21400. this.floorVisibility = e.floorVisibility,
  21401. this.thumbUrl = e.thumbUrl,
  21402. this.name = e.name,
  21403. this.zoom = e.zoom
  21404. }
  21405. var r = (e("three"),
  21406. e("../util/logger"))
  21407. , o = (e("../settings"),
  21408. e("../enum/Viewmode"),
  21409. e("../util/common"),
  21410. e("../util/transitions"),
  21411. e("../util/lerp"),
  21412. e("../util/ajax"),
  21413. e("../util/texture"),
  21414. e("./View"));
  21415. e("events").EventEmitter,
  21416. new r(i);
  21417. n.prototype = Object.create(o.prototype),
  21418. n.prototype.isPano = function() {
  21419. return this.panoId && "" !== this.panoId && this.panoId != "outside"
  21420. }
  21421. ,
  21422. t.exports = n
  21423. }
  21424. ).call(this, "/js/objects/Snapshot.js")
  21425. }
  21426. , {
  21427. "../enum/Viewmode": 51,
  21428. "../settings": 166,
  21429. "../util/ajax": 181,
  21430. "../util/common": 185,
  21431. "../util/lerp": 188,
  21432. "../util/logger": 189,
  21433. "../util/texture": 194,
  21434. "../util/transitions": 195,
  21435. "./View": 154,
  21436. events: 202,
  21437. three: 217
  21438. }],
  21439. 154: [function(e, t, i) {
  21440. (function(i) {
  21441. "use strict";
  21442. function n(e) {
  21443. e = e || {},
  21444. this.position = new r.Vector3,
  21445. this.quaternion = new r.Quaternion,
  21446. this.update(e)
  21447. }
  21448. var r = e("three")
  21449. , o = e("../util/logger")
  21450. , a = (e("../settings"),
  21451. e("../enum/Viewmode"),
  21452. e("../util/common"),
  21453. e("../util/transitions"),
  21454. e("../util/lerp"),
  21455. e("../util/ajax"),
  21456. e("../util/texture"),
  21457. e("events").EventEmitter);
  21458. new o(i);
  21459. n.prototype = Object.create(a.prototype),
  21460. n.prototype.isValid = function() {
  21461. return !!this.cameraMode
  21462. }
  21463. ,
  21464. n.prototype.update = function(e) {
  21465. return this.cameraMode = e.cameraMode || this.cameraMode,
  21466. this.pano = e.pano || this.pano,
  21467. e.position && this.position.copy(e.position),
  21468. e.quaternion && this.quaternion.copy(e.quaternion),
  21469. this
  21470. }
  21471. ,
  21472. t.exports = n
  21473. }
  21474. ).call(this, "/js/objects/View.js")
  21475. }
  21476. , {
  21477. "../enum/Viewmode": 51,
  21478. "../settings": 166,
  21479. "../util/ajax": 181,
  21480. "../util/common": 185,
  21481. "../util/lerp": 188,
  21482. "../util/logger": 189,
  21483. "../util/texture": 194,
  21484. "../util/transitions": 195,
  21485. events: 202,
  21486. three: 217
  21487. }],
  21488. 155: [function(e, t, i) {//player.js
  21489. (function(i) {
  21490. "use strict";
  21491. function n(e) {
  21492. this.currentPano = null,
  21493. this.nextPano = null,
  21494. this.camera = null,
  21495. this.paused = !1,
  21496. this.flying = !1,
  21497. this.sceneIntersectionPlane = null,
  21498. this.target = new r.Vector3,
  21499. this.mouse = new r.Vector3(1.1,1.1,.5),
  21500. this.mouseAtMouseDown = new r.Vector2,
  21501. this.mouseCouldBeClickToMove = !1,
  21502. this.mouseLastMoveTime = Date.now(),
  21503. this.mouseDown = !1,
  21504. this.mouseDownTimer = null,
  21505. this.couldBeLongTap = !1,
  21506. this.containsMouse = !1, //
  21507. this.isTouchEvent = !1,
  21508. this.isPanoHover = !1,
  21509. this.reticule = new a(this),
  21510. this.panoMarkers = [],
  21511. this.spider = new h(this),
  21512. this.quaternion = new r.Quaternion,
  21513. this.position = new r.Vector3(15,10,15),
  21514. this.previousState = null,
  21515. this.lastInsideView = new c,
  21516. this.last360View = new c,
  21517. this.raycaster = new r.Raycaster,
  21518. this.intersect = null,
  21519. this.lastChangeTime = Date.now(),
  21520. this.history = new I,
  21521. this.cameraControls = null,
  21522. this.path = null,
  21523. this.model = null,
  21524. this.domElement = null,
  21525. this.cachedPanoCandidates = null,
  21526. this.basePanoSize = 0,
  21527. this.standardPanoSize = 0,
  21528. this.highPanoSize = 0,
  21529. this.ultraHighPanoSize = 0,
  21530. this.zoomLevel = 1,
  21531. this.zooming = 0,
  21532. this.zoomSpeed = .5,
  21533. this.scrollZoomSpeed = .06,
  21534. this.zoomSpeedAdjust = .05,
  21535. this.defaultZoomIncrement = .2,
  21536. this.baseFov = f.insideFOV,
  21537. this.zoomFov = this.baseFov,
  21538. this.zoomEnabled = !0,
  21539. this.preRenderingEnabled = !1,
  21540. this.setupCustomProperties(e),
  21541. this.zoomStats = new L
  21542. window.player = this
  21543. this.modeTran = ''
  21544. }
  21545. var r = e("three")
  21546. , o = e("./util/logger")
  21547. , a = e("./objects/Reticule")
  21548. , s = e("./objects/Panorama")
  21549. , l = e("./objects/ShowPath")
  21550. , c = e("./objects/View")
  21551. , h = (e("./objects/Snapshot"),
  21552. e("./objects/NSpider"))
  21553. , u = e("./enum/Viewmode")
  21554. , d = (e("./enum/TagStates"),
  21555. e("./enum/Vectors"))
  21556. , p = e("./enum/Keys")
  21557. , f = (e("./enum/AlignmentType"),
  21558. e("./settings"))
  21559. , g = e("./util/common")
  21560. , m = (e("./util/browser"),
  21561. e("./util/math"))
  21562. , v = e("./util/lerp")
  21563. , A = e("./util/easing")
  21564. , y = e("./util/transitions")
  21565. , C = e("events").EventEmitter
  21566. , I = (e("./shaders"),
  21567. e("./util/history"))
  21568. , E = (e("./util/camera"),
  21569. e("./model/ModelManager"),
  21570. e("./enum/PathDiscardMode"))
  21571. , b = e("./enum/PathDisplayMode")
  21572. , w = e("./enum/PlayerEvents")
  21573. , _ = e("./enum/ControlEvents")
  21574. , T = e("./enum/ModelManagerEvents")
  21575. , x = e("./enum/WarpStyle")
  21576. , S = e("./enum/BlackoutStyle")
  21577. , M = e("./exception/BasicException")
  21578. , R = e("./enum/PanoSizeClass")
  21579. , P = (e("./tile/TileDownloader"),
  21580. e("./tile/TilePrioritizer"))
  21581. , O = (e("./enum/PanoramaEvents"),
  21582. e("./enum/ZoomEvents"))
  21583. , L = e("./util/ZoomStats")
  21584. , D = e("./constants")
  21585. , N = e("./util/common")
  21586. , B = e("./util/cameraLight")
  21587. //, Hot = e('hot')
  21588. , F = new o(i)
  21589. , V = Object.freeze({
  21590. FlyToPano: y.getUniqueId(),
  21591. FlyToNewMode: y.getUniqueId(),
  21592. FlyToSameMode: y.getUniqueId(),
  21593. FlyToViewFloor: y.getUniqueId(),
  21594. LookTransition: y.getUniqueId(),
  21595. ZoomTransition: y.getUniqueId()
  21596. });
  21597. n.prototype = Object.create(C.prototype),
  21598. n.prototype.init = function(e) {
  21599. this.modelManager = e.modelManager,
  21600. this.tileDownloader = e.tileDownloader,
  21601. this.panoRenderer = e.panoRenderer,
  21602. this.qualityManager = e.qualityManager,
  21603. this.domElement = e.container,
  21604. this.camera = e.camera,
  21605. this.tagManager = e.tagManager,
  21606. this.cameraControls = e.controls,
  21607. this.path = new l(e.director,this,e.controls),
  21608. this.basePanoSize = this.qualityManager.getPanoSize(R.BASE),
  21609. this.standardPanoSize = this.qualityManager.getPanoSize(R.STANDARD),
  21610. this.highPanoSize = this.qualityManager.getPanoSize(R.HIGH),
  21611. this.ultraHighPanoSize = this.qualityManager.getPanoSize(R.ULTRAHIGH),
  21612. this.tileDownloader.processPriorityQueue = !1,
  21613. this.tileDownloader.tilePrioritizer = new P(this.qualityManager,this.basePanoSize,this.standardPanoSize,this.highPanoSize,this.ultraHighPanoSize),
  21614. this.bindEvents(e.container),
  21615. this.updateModel()
  21616. //this.guider2 = new PanTransGuide(this)
  21617. }
  21618. //xzw add: 截图
  21619. function dataURLtoBlob(dataurl) {
  21620. var arr = dataurl.split(','), mime = arr[0].match(/:(.*?);/)[1],
  21621. bstr = atob(arr[1]), n = bstr.length, u8arr = new Uint8Array(n);
  21622. while(n--){
  21623. u8arr[n] = bstr.charCodeAt(n);
  21624. };
  21625. return new Blob([u8arr], {type:mime});
  21626. }
  21627. n.prototype.screenShot = function(o){
  21628. if(this.flying || this.flyingToTag) return;
  21629. var R = this.sceneRenderer;
  21630. R.updateScreenSize(o);
  21631. for(var i in this.model.panos.index){
  21632. if(!this.model.panos.index[i].marker) continue;
  21633. this.model.panos.index[i].marker.forceHide = this.model.panos.index[i].marker.visible;
  21634. this.model.panos.index[i].marker.visible = false;
  21635. }
  21636. for(var i in this.model.hots){
  21637. this.model.hots[i].mesh.visible = false;
  21638. }
  21639. this.reticule.visible = false;
  21640. this.reticule.forceUnvisible = true;
  21641. this.path.currentPanoMarker.mesh.visible = false;
  21642. setTimeout(function(){//因resize效用没办法立即生效(原因未知),故而延后
  21643. R.renderer.clear(true,true,true);
  21644. R.renderer.render(R.scene, R.camera);
  21645. var imgData = R.renderer.domElement.toDataURL(o.type,0.9);
  21646. o.f && o.f(imgData)
  21647. R.updateScreenSize({resize:true});
  21648. this.reticule.visible = true;
  21649. for(var i in this.model.hots){
  21650. this.model.hots[i].mesh.visible = true;
  21651. }
  21652. for(var i in this.model.panos.index){
  21653. this.model.panos.index[i].marker.visible = this.model.panos.index[i].marker.forceHide;
  21654. }
  21655. this.path.currentPanoMarker.mesh.visible = true;
  21656. R.renderer.render(R.scene, R.camera);
  21657. }.bind(this),30) //这个数字不能太小
  21658. }
  21659. var scaleImg = e("scaleImg");
  21660. var ResizeImg = function(img, option){
  21661. var img2; //不能直接改img 否则可能触发第二次img.onload
  21662. var compress = function(ratio,type){
  21663. var image = img2 || img;
  21664. var c = document.createElement('canvas');
  21665. c.width = image.width; c.height = image.height;
  21666. var ctx = c.getContext('2d');
  21667. ctx.drawImage(image,0,0,image.width,image.height);
  21668. img2 = scaleImg(ratio/* option.maxSize/oldSize */, c, type/* option.type||"png" */);//最大不能超过0.8M
  21669. }
  21670. var reCom = function(){ //如果有了img2 就只需要img2 否则创造新的img2
  21671. var image = img2 || img;
  21672. var blob = dataURLtoBlob(image.src);
  21673. if(option.maxWeight && blob.size > option.maxWeight){
  21674. compress(option.maxWeight/blob.size, "jpeg")
  21675. blob = dataURLtoBlob(image.src);
  21676. }
  21677. if(!img2){
  21678. img2 = new Image();
  21679. }
  21680. img2.base64Src = image.src;
  21681. img2.src = window.URL.createObjectURL(blob);
  21682. }
  21683. var oldSize = Math.max(img.width, img.height);
  21684. if(option.toType != "png"){//不是非要png的话
  21685. if(option.oldType == "jpeg"){//jpeg先判断尺寸,然后是尺寸
  21686. if(oldSize > option.maxSize){
  21687. compress(option.maxSize/oldSize, "jpeg");
  21688. }
  21689. reCom();
  21690. }else if(option.oldType == "png"){//png先判断数据量 如果数据量达标,就无视大小(有可能超出大小)
  21691. if(option.maxWeight && option.weight > option.maxWeight){//如果一开始大小不大就不压缩 还是png
  21692. compress(oldSize>option.maxSize ? option.maxSize/oldSize : 1, "jpeg");
  21693. reCom();
  21694. }
  21695. }
  21696. }else{
  21697. //?貌似png会越压缩越大?
  21698. }
  21699. return img2 || img;
  21700. }
  21701. var _fixType=function(type) {
  21702. type = type.toLowerCase().replace(/jpg/i, 'jpeg');
  21703. var r = type.match(/png|jpeg|bmp|gif/)[0];
  21704. return 'image/' + r;
  21705. };
  21706. var saveFile=function(data, filename){
  21707. var save_link = document.createElementNS('http://www.w3.org/1999/xhtml', 'a');
  21708. save_link.href = data;
  21709. save_link.download = filename;
  21710. var event = document.createEvent('MouseEvents');
  21711. event.initMouseEvent('click', true, false, window, 0, 0, 0, 0, 0, false, false, false, false, 0, null);
  21712. save_link.dispatchEvent(event);
  21713. };
  21714. n.prototype.getWrapShot = function(){ //获取导览点截图/初始画面和信息
  21715. var info = this.getSnapAngleInfo();
  21716. var str = ',{\r\t' + info;
  21717. var arg = arguments[0];
  21718. this.screenShot({ width:g_snapShotWidth*4, height:g_snapShotHeight*4, type:"image/jpeg", f:function(imgData){
  21719. if (arg && arg.__callback) {
  21720. return arg.__callback(imgData, info)
  21721. }
  21722. var img = new Image();
  21723. img.src = imgData;
  21724. img.onload = function(){
  21725. var img2 = ResizeImg(this,{maxSize: g_snapShotWidth, oldType:"jpeg"}); //暂定缩略图大小
  21726. img2.src.replace(_fixType("image/jpeg"),'image/octet-stream');
  21727. var filename = "snap" + (new Date()).getTime();
  21728. saveFile(img2.src,filename + ".jpg");
  21729. str +=(',\r\t"thumbnail_signed_src":"'+filename+'.jpg",');
  21730. str +=('\r\t"sid":"'+filename+'",');
  21731. str +=('\r\t"name":"'+filename+'"\r}');
  21732. logData(str)
  21733. }
  21734. }});
  21735. }
  21736. ,
  21737. n.prototype.getSnapAngleInfo = function(){
  21738. var info = {};
  21739. var str = '"metadata":{';
  21740. var q = this.camera.quaternion.clone();
  21741. switch (this.mode) {
  21742. case "panorama":
  21743. info.scan_id = this.currentPano.id;
  21744. str += ('"scan_id":"'+this.currentPano.id+'",');
  21745. break;
  21746. case "floorplan":
  21747. info.camera_mode = 1;
  21748. q = (new r.Quaternion).setFromAxisAngle(new r.Vector3(0,1,0), r.Math.degToRad(90))
  21749. q.multiply(this.camera.quaternion);
  21750. str += ('"camera_mode":1,');
  21751. //str += ('"ortho_zoom":'+m.toPrecision(this.cameraControls.activeControl.currentScale * $("#player").height() / $("#player").width() * D.workshopApsect * 16, 4)+",");
  21752. str += ('"ortho_zoom":'+ m.toPrecision(this.cameraControls.activeControl.currentScale, 4 )+",");
  21753. break;
  21754. case "dollhouse":
  21755. info.camera_mode = 2;
  21756. str += ('"camera_mode":2,');
  21757. break;
  21758. }
  21759. info.camera_position = m.toPrecision(this.camera.position.toArray(),4);
  21760. console.log(info.camera_position)
  21761. if(window.screenSta === 'tour'){ // fyz 导览截屏需要做额外的
  21762. /**fyz 对相机截屏的角度进行校对 */
  21763. var out = new r.Quaternion(q.x, q.y, q.z, q.w)
  21764. out.multiply(new r.Quaternion(Math.sqrt(2) / 2, Math.sqrt(2) / 2, 0, 0).conjugate())
  21765. out.x *= -1;
  21766. out.w *= -1;
  21767. info.camera_quaternion = m.toPrecision(out.toArray(),4);
  21768. }else{
  21769. info.camera_quaternion = m.toPrecision(q.toArray(),4);;
  21770. }
  21771. info.zoom = this.zoomLevel;
  21772. console.log(info.camera_quaternion)
  21773. // str += ( '"camera_position":['+ info.camera_position + '],"camera_quaternion":['+info.camera_quaternion+"]}");
  21774. // fyz 扩展编辑页面, 加上导览点缩放值
  21775. str += ( '"camera_position":['+ info.camera_position + '],"camera_quaternion":['+info.camera_quaternion+'], "zoom":' + info.zoom + '}');
  21776. return str;
  21777. }
  21778. //------end
  21779. n.prototype.setupCustomProperties = function(e) {
  21780. var t = e || u.PANORAMA;
  21781. Object.defineProperty(this, "mode", {
  21782. get: function() {
  21783. return t
  21784. },
  21785. set: function(e) {
  21786. var i = t;
  21787. t = e,
  21788. this.onModeUpdated(i, t)
  21789. }
  21790. })
  21791. }
  21792. ,
  21793. n.prototype.isInMode = function() {
  21794. for (var e = 0; e < arguments.length; e++)
  21795. if (this.mode === arguments[e])
  21796. return !0;
  21797. return !1
  21798. }
  21799. ,
  21800. n.prototype.isOutsideMode = function(e) {
  21801. return e = e || this.mode,
  21802. e === u.DOLLHOUSE || e === u.FLOORPLAN
  21803. }
  21804. ,
  21805. n.prototype.is360View = function(e, t) {
  21806. return e === u.PANORAMA && t && !t.isAligned()
  21807. }
  21808. ,
  21809. n.prototype.setScene = function(e) {
  21810. this.sceneIntersectionPlane = e.plane,
  21811. this.path.setScene(e),
  21812. this.moveReticuleToScene(e)
  21813. }
  21814. ,
  21815. n.prototype.moveReticuleToScene = function(e) {
  21816. this.reticule.parent && this.reticule.parent.remove(this.reticule),
  21817. e.add(this.reticule)
  21818. }
  21819. ,
  21820. n.prototype.updateModel = function() {
  21821. function e(e, t, n) {
  21822. this.mode === u.DOLLHOUSE && e !== n && i.call(this, e.center.y)
  21823. }
  21824. function t(e, t) {
  21825. if (this.mode === u.DOLLHOUSE) {
  21826. var n = e ? this.model.center.y : n = t.center.y;
  21827. i.call(this, n)
  21828. }
  21829. }
  21830. function i(e) {
  21831. var t = this.cameraControls.cameras[u.DOLLHOUSE]
  21832. , i = this.cameraControls.controls[u.DOLLHOUSE]
  21833. , n = t.position.y + (e - i.target.y)
  21834. , r = f.showFloorDuration + f.showFloorDelay;
  21835. y.start(v.property(i.target, "y", e), r, null, f.flydown.movementDelay, A[f.flydown.movementEasing], null, V.FlyToViewFloor),
  21836. y.start(v.property(t.position, "y", n), r, null, f.flydown.movementDelay, A[f.flydown.movementEasing], null, V.FlyToViewFloor)
  21837. }
  21838. this.model = this.modelManager.getActiveModel(),
  21839. this.model.on("floor.changed", e.bind(this)),
  21840. this.model.on("allfloors.toggled", t.bind(this)),
  21841. this.on(w.PanoChosen, this.model.setProjectedPanos.bind(this.model));
  21842. /*******************************************************************VR fyz改 from徐世廷*******************************************************************/
  21843. var e2 = this;
  21844. this.model.panos.list.forEach(function(a) {
  21845. a.vrMarker.addEventListener("click", function() {
  21846. e2.flyToPano({
  21847. pano: a
  21848. })
  21849. })
  21850. })
  21851. /********************************************************************************************************************************************/
  21852. this.model.addHighMapCube()//add
  21853. this.on(w.FlyingStarted, this.model.resetHighMap.bind(this.model))
  21854. }
  21855. ,
  21856. n.prototype.updateModelDependentData = function() {
  21857. this.cameraControls.setModelForControls(this.model),
  21858. this.getPanoMarkersFromModel(this.model)
  21859. }
  21860. ,
  21861. n.prototype.onModelChanged = function() {
  21862. this.updateModel(),
  21863. this.updateModelDependentData()
  21864. }
  21865. ,
  21866. n.prototype.getPanoMarkersFromModel = function(e) {
  21867. this.panoMarkers = e.panos.list.reduce(function(e, t) {
  21868. return t.marker ? e.concat(t.marker) : e
  21869. }, [])
  21870. }
  21871. ,
  21872. n.prototype.handleControlMove = function(e) {
  21873. this.emit(w.Move, e)
  21874. }
  21875. ,
  21876. n.prototype.handleControlInputStart = function(e) {
  21877. this.emit(w.InputStart, e)
  21878. }
  21879. ,
  21880. n.prototype.onModeUpdated = function(e, t) {
  21881. this.cameraControls.activateControls(t),
  21882. this.emit(w.ModeChanged, e, t)
  21883. }
  21884. ,
  21885. n.prototype.isWarping = function() {//是否导览缓慢走向某个点
  21886. return this.path.warping
  21887. }
  21888. ,
  21889. n.prototype.isWaitingToWarp = function() {
  21890. return this.path.waitingToWarp
  21891. }
  21892. ,
  21893. n.prototype.getLabelScaleFactor = function() {
  21894. if (this.isOutsideMode()) {
  21895. var e = 10
  21896. , t = Math.sqrt(this.cameraControls.controls[u.FLOORPLAN].currentScale / e);
  21897. return t
  21898. }
  21899. return .5
  21900. }
  21901. ,
  21902. /* n.prototype.changeMusic = function() {//xzw add
  21903. if(!this.director.tourIsPlaying) this.director.bgmReplay()
  21904. } */
  21905. n.prototype.bindEvents = function(e) {
  21906. e !== document && e.setAttribute("tabindex", -1),
  21907. e.addEventListener("mousedown", this.onMouseDown.bind(this)),
  21908. e.addEventListener("mousemove", this.onMouseMove.bind(this)),
  21909. e.addEventListener("mouseover", this.onMouseOver.bind(this)),
  21910. e.addEventListener("mouseout", this.onMouseOut.bind(this)),
  21911. e.addEventListener("mouseup", this.onMouseUp.bind(this)),
  21912. this.modelManager.on(T.ActiveModelChanged, this.onModelChanged.bind(this)),
  21913. e.addEventListener("touchstart", this.onTouchStart.bind(this)),
  21914. e.addEventListener("touchmove", this.onTouchMove.bind(this)),
  21915. e.addEventListener("touchend", this.onTouchEnd.bind(this)),
  21916. e.addEventListener("pointerdown", this.onPointerDown.bind(this)),
  21917. e.addEventListener("pointermove", this.onPointerMove.bind(this)),
  21918. e.addEventListener("pointerup", this.onPointerUp.bind(this)),
  21919. e.addEventListener("pointerout", this.onPointerOut.bind(this)),
  21920. e.addEventListener("pointercancel", this.onPointerCancel.bind(this)),
  21921. document.addEventListener("keydown", this.onKeyDown.bind(this)),
  21922. this.cameraControls.on(_.Move, this.handleControlMove.bind(this)),
  21923. this.cameraControls.on(_.InputStart, this.handleControlInputStart.bind(this)),
  21924. this.cameraControls.on(_.Pinch, this.handleControlPinch.bind(this)),
  21925. this.cameraControls.on(_.Scroll, this.handleControlScroll.bind(this)),
  21926. window.addEventListener("snapshotBegin", this.getWrapShot.bind(this)),//xzw add
  21927. //window.addEventListener("tourAudioEnded", this.changeMusic.bind(this));//xzw add
  21928. // lzb
  21929. window.getSeft && getSeft(this);
  21930. }
  21931. ,
  21932. n.prototype.onMouseDown = function(e) {
  21933. e.currentTarget !== document && e.currentTarget.focus(),
  21934. 0 === e.button && (this.handleInputStart.call(this, e.clientX, e.clientY, !1),
  21935. this.updateIntersect())
  21936. }
  21937. ,
  21938. n.prototype.onMouseMove = function(e) {
  21939. this.isTouchEvent = !1,
  21940. this.handleInputMove.call(this, e.clientX, e.clientY, !1)
  21941. }
  21942. ,
  21943. n.prototype.onMouseOver = function(e) {
  21944. this.containsMouse = !0,
  21945. !this.mouseDown || 0 !== e.which && 0 !== e.buttons || (this.mouseDown = !1)
  21946. if(this.intersectHot){
  21947. this.intersectHot.setHoverState(true)
  21948. }
  21949. }
  21950. ,
  21951. n.prototype.onMouseOut = function(e) {
  21952. this.containsMouse = !1
  21953. if(this.intersectHot){
  21954. this.intersectHot.setHoverState(false)
  21955. }
  21956. }
  21957. ,
  21958. n.prototype.onMouseUp = function(e) {
  21959. this.handleInputEnd.call(this, e.clientX, e.clientY, !1);
  21960. }
  21961. ,
  21962. n.prototype.onTouchStart = function(e) {
  21963. if (e.currentTarget !== document && e.currentTarget.focus(),
  21964. !this.mouseDown) {
  21965. this.couldBeLongTap = !0;
  21966. var t = g.average(e.changedTouches, "clientX")
  21967. , i = g.average(e.changedTouches, "clientY");
  21968. this.handleInputStart.call(this, t, i, !0),
  21969. this.mouseDownTimer = setTimeout(function() {
  21970. this.updateIntersect(),
  21971. this.handleInputEnd.call(this, t, i, !0)
  21972. }
  21973. .bind(this), f.input.longTapThreshold)
  21974. }
  21975. }
  21976. ,
  21977. n.prototype.onTouchMove = function(e) {
  21978. var t = g.average(e.changedTouches, "clientX")
  21979. , i = g.average(e.changedTouches, "clientY");
  21980. this.handleInputMove.call(this, t, i, !0)
  21981. }
  21982. ,
  21983. n.prototype.onTouchEnd = function(e) {
  21984. if (clearTimeout(this.mouseDownTimer),
  21985. this.mouseDown) {
  21986. this.couldBeLongTap = !1,
  21987. this.updateIntersect();
  21988. var t = g.average(e.changedTouches, "clientX")
  21989. , i = g.average(e.changedTouches, "clientY");
  21990. this.handleInputEnd.call(this, t, i, !0)
  21991. }
  21992. //add
  21993. if (this.intersectHot) this.intersectHot.setHoverState(false)
  21994. this.intersectHot = null
  21995. Hot.mobileAutoPlay(this)
  21996. }
  21997. ,
  21998. n.prototype.onPointerDown = function(e) {
  21999. return e.currentTarget !== document && e.currentTarget.focus(),
  22000. this.mouseDown || "mouse" === e.pointerType ? this.onMouseDown(e) : (this.couldBeLongTap = !0,
  22001. this.handleInputStart.call(this, e.clientX, e.clientY, !0),
  22002. void (this.mouseDownTimer = setTimeout(function() {
  22003. this.updateIntersect(),
  22004. this.handleInputEnd.call(this, e.clientX, e.clientY, !0)
  22005. }
  22006. .bind(this), f.input.longTapThreshold)))
  22007. }
  22008. ,
  22009. n.prototype.onPointerMove = function(e) {
  22010. "mouse" !== e.pointerType ? this.handleInputMove.call(this, e.clientX, e.clientY, !0) : this.onMouseMove(e)
  22011. }
  22012. ,
  22013. n.prototype.onPointerUp = function(e) {
  22014. return this.mouseDown && "mouse" !== e.pointerType ? (clearTimeout(this.mouseDownTimer),
  22015. this.couldBeLongTap = !1,
  22016. this.updateIntersect(),
  22017. void this.handleInputEnd.call(this, e.clientX, e.clientY, !0)) : this.onMouseUp(e)
  22018. }
  22019. ,
  22020. n.prototype.onPointerOut = function(e) {
  22021. this.mouseDown = !1
  22022. }
  22023. ,
  22024. n.prototype.onPointerCancel = function(e) {
  22025. this.mouseDown = !1
  22026. }
  22027. ,
  22028. n.prototype.onKeyDown = function(e) {
  22029. var t = function() {
  22030. this.cameraControls.activeControl && this.cameraControls.activeControl.emit(_.Move, "key")
  22031. }
  22032. .bind(this)
  22033. , i = e.which;
  22034. switch (i) {
  22035. case p.F:
  22036. t(),
  22037. this.changeFloor(-1);
  22038. break;
  22039. case p.R:
  22040. t(),
  22041. this.changeFloor(1)
  22042. }
  22043. if (this.mode === u.PANORAMA)
  22044. switch (i) {
  22045. case p.UPARROW:
  22046. case p.W:
  22047. this.flyLocalDirection(d.FORWARD.clone());
  22048. break;
  22049. case p.DOWNARROW:
  22050. case p.S:
  22051. this.flyLocalDirection(d.BACK.clone());
  22052. break;
  22053. case p.A:
  22054. this.flyLocalDirection(d.LEFT.clone());
  22055. break;
  22056. case p.D:
  22057. this.flyLocalDirection(d.RIGHT.clone())
  22058. }
  22059. }
  22060. ,
  22061. n.prototype.handleScrollPinchZoom = function() {
  22062. return function(e) {
  22063. var t = e
  22064. , i = this.zoomLevel;
  22065. this.zoomBy(t),
  22066. this.currentPano && this.zoomStats.addZoomAction(i, this.zoomLevel, this.currentPano.id)
  22067. }
  22068. }(),
  22069. n.prototype.handleControlPinch = function(e) {
  22070. f.zoom.enabled ? this.handleScrollPinchZoom(1 - e) : this.flyLocalDirection(new r.Vector3(0,0,e).normalize())
  22071. }
  22072. ,
  22073. n.prototype.handleControlScroll = function(e) {
  22074. f.zoom.enabled ? (e > 0 ? e = 1 + this.scrollZoomSpeed : e < 0 && (e = 1 - this.scrollZoomSpeed),
  22075. 0 !== e && this.handleScrollPinchZoom(e)) : this.flyLocalDirection(new r.Vector3(0,0,-e).normalize())
  22076. }
  22077. ,
  22078. n.prototype.handleInputStart = function(e, t, i) {
  22079. //许钟文加
  22080. var pad = this.handelPadding(e, t);
  22081. e = pad.x;
  22082. t = pad.y;
  22083. this.isTouchEvent = i,
  22084. m.convertScreenPositionToNDC(e, t, this.mouse),
  22085. m.convertScreenPositionToNDC(e, t, this.mouseAtMouseDown),
  22086. this.mouseCouldBeClickToMove = !0,
  22087. this.mouseDown = !0;
  22088. Hot.mobileAutoPlay(this)
  22089. }
  22090. ,
  22091. n.prototype.handelPadding = function(x, y) {
  22092. //去除player左边和上面的宽高,因为pc的player左上有其他element 许钟文
  22093. if (!this.pad)
  22094. this.pad = {//可以直接用$("#player")[0].getBoundingClientRect() , 因为body没有offset
  22095. x: dom.getOffset("left", $("#player")[0]),
  22096. y: dom.getOffset("top", $("#player")[0])
  22097. }
  22098. return {
  22099. x: x - this.pad.x,
  22100. y: y - this.pad.y
  22101. }
  22102. }
  22103. n.prototype.handleInputMove = function(e, t, i) {
  22104. //许钟文加
  22105. var pad = this.handelPadding(e, t);
  22106. e = pad.x;
  22107. t = pad.y;
  22108. this.isTouchEvent = i,
  22109. m.convertScreenPositionToNDC(e, t, this.mouse),
  22110. this.mouseAtMouseDown.distanceTo(this.mouse) > f.input.moveToleranceNDC && (this.mouseCouldBeClickToMove = !1,
  22111. this.couldBeLongTap = !1,
  22112. clearTimeout(this.mouseDownTimer)),
  22113. this.mouseLastMoveTime = Date.now(),
  22114. this.reticule.move(e, t, i)
  22115. }
  22116. ,
  22117. n.prototype.handleInputEnd = function(e, t, i) {//xzw
  22118. if (this.isTouchEvent = i,
  22119. this.mouseDown = !1,
  22120. this.cameraControls.controls[u.PANORAMA].emit("interaction.direct"),
  22121. !i && this.couldBeLongTap)
  22122. return !0;
  22123. if (this.handleLongTap())
  22124. return !0;
  22125. /* if(this.director.tourIsPlaying){
  22126. return !0;
  22127. } */
  22128. if (this.mouseCouldBeClickToMove) {
  22129. if (this.flying)
  22130. return this.path.activeTransType === x.WALK && this.emit(w.WarpInterruptedWithFlyTo, this.path.activeTransType), //停止导览
  22131. !0;
  22132. //add----
  22133. if(this.checkHotClick())//add
  22134. return !0;
  22135. if(this.hoveringPlane){
  22136. this.clickOverlay(this.hoveringPlane)
  22137. return;
  22138. }
  22139. if (this.cameraControls.activeControl && this.cameraControls.activeControl.emit(_.Move, this.isTouchEvent ? "touch" : "mouse"),
  22140. this.history.invalidate(),
  22141. this.intersect)
  22142. return this.flyToPanoClosestToMouse();
  22143. if (this.mode === u.PANORAMA) {
  22144. var n = this.closestPanoInDirection(this.getMouseDirection());
  22145. return n ? this.flyToPano({
  22146. pano: n
  22147. }) : this.bump(this.getMouseDirection())
  22148. }
  22149. }
  22150. //this.intersect && this.closestPano && this.closestPano.hoverOff(this.mode) //xzw 删,否则拖拽后就不高亮了
  22151. }
  22152. ,
  22153. n.prototype.handleLongTap = function() {
  22154. if (this.couldBeLongTap && (!this.isPanoHover || this.mode !== u.PANORAMA))
  22155. return this.cameraControls.activeControl && this.cameraControls.activeControl.emit(_.LongTap, "touch"),
  22156. !0
  22157. }
  22158. ,
  22159. n.prototype.checktagClick = function() {
  22160. if (this.tagManager.intersectTag) {
  22161. var e = this.isTouchEvent
  22162. , t = this.tagManager.clickedOnTag(e, this);
  22163. return e || t || y.cancelById(V.LookTransition),
  22164. !0
  22165. }
  22166. if (this.tagManager.activeTag)
  22167. return this.tagManager.dismissActiveTag(),
  22168. !1
  22169. }
  22170. ,
  22171. n.prototype.rankedtagInDirection = function(e, t) {
  22172. return this.tagManager.rankedtagInDirection(e, this.position, this.camera, t)
  22173. }
  22174. ,
  22175. n.prototype.start = function(e) {
  22176. //-------------------
  22177. //-------------------
  22178. var t = e.mode
  22179. , i = e.pano
  22180. , n = e.position
  22181. , rr = e.quaternion
  22182. , o = e.tag
  22183. , a = e.quickstart
  22184. , s = $.Deferred();
  22185. this.updateModelDependentData(),
  22186. this.updateFromControls(),
  22187. this.findDefaultViews();
  22188. var l = this.is360View(t, i);
  22189. return !this.model.outsideAllowed() || l || a ? this.startInside(i, n, rr, o, s) : this.startOutside(e, s),
  22190. s.done(function(e) {
  22191. this.emit(w.Ready, l, e, o)
  22192. }
  22193. .bind(this)),
  22194. s.promise()
  22195. }
  22196. ,
  22197. n.prototype.startOutside = function(e, t) {
  22198. var i = e.mode
  22199. , n = e.pano
  22200. , r = e.position
  22201. , o = e.quaternion
  22202. , a = e.zoom
  22203. , s = e.floorVisibility
  22204. , l = e.tag;
  22205. this.emit(w.StartOutside, f[i].transitionTime),
  22206. this.isOutsideMode(i) ? (this.model.warpDestFloors(s, !0),
  22207. y.cancelById(V.FlyToViewFloor),
  22208. i === u.FLOORPLAN ? this.floorplanMode(r, o, a) : this.dollhouseMode(r, o),
  22209. t.resolve(!1)) : this.startInsideWithFlyin(n, r, o, l, t)
  22210. }
  22211. ,
  22212. n.prototype.startInside = function(e, t, i, n, r) {
  22213. r = r || $.Deferred(),
  22214. this.currentPano = e;
  22215. window.bus.dispatchEvent({type:'playerAndModelReady'})
  22216. this.ready = true
  22217. var o = e && !e.isAligned();
  22218. if (t = o ? e.position : t || e.position,
  22219. i = i || e.quaternion,
  22220. e) {
  22221. var a = this.startInside.bind(this, e, t, i, n, r);
  22222. if (this.checkAndWaitForPanoLoad(e, "high", "low", this.basePanoSize, a))
  22223. return
  22224. }
  22225. //add
  22226. this.transitionPos({type:"beforeFlytopano", pano:this.currentPano, dur:0})
  22227. //this.updateHotVisible()
  22228. Hot.updateVisibles([this.currentPano])
  22229. this.modeTran = "panorama-panorama"
  22230. return this.mode = u.PANORAMA,
  22231. e.floor.enter(this.mode),
  22232. this.emit(w.PanoChosen, this.currentPano, this.currentPano),
  22233. this.switchCameraMode(this.mode, i),
  22234. this.emit(w.StartInside, o),
  22235. r.resolve(!0),
  22236. r
  22237. }
  22238. ,
  22239. n.prototype.startInsideWithFlyin = function(e, t, i, n, r) {
  22240. if (r = r || $.Deferred(),
  22241. this.dollhouseMode(),
  22242. !e)
  22243. return F.warn("Player.startInsideWithFlyin() -> targetPano is invalid."),
  22244. r.resolve(!1),
  22245. r;
  22246. t = t || e.position;
  22247. var o = i || this.cameraControls.activeControl.camera.quaternion
  22248. , a = e.position;
  22249. return this.fitDollhouse(a, t, o),
  22250. setTimeout(function(t) {
  22251. this.cameraControls.activeControl && (this.cameraControls.activeControl.maxDistance = t);
  22252. var n = {
  22253. mode: u.PANORAMA,
  22254. pano: e,
  22255. quaternion: i,
  22256. callback: function() {
  22257. this.emit(w.FlyinFinished),
  22258. r.resolve(!0)
  22259. }
  22260. .bind(this)
  22261. };
  22262. this.flyToNewMode(n)
  22263. }.bind(this, this.cameraControls.activeControl.maxDistance), f.startupFlyinDelay),
  22264. r
  22265. }
  22266. ,
  22267. n.prototype.checkAndWaitForPanoLoad = function() {
  22268. var e = {}
  22269. , t = {}
  22270. , i = 5e3
  22271. , n = function() {
  22272. for (var n in e)
  22273. if (e.hasOwnProperty(n) && e[n]) {
  22274. var r = performance.now() - t[n];
  22275. if (r < i)
  22276. return !0
  22277. }
  22278. return !1
  22279. };
  22280. return function(r, o, a, s, l, c, h, u, d, p) {
  22281. if (n())
  22282. return !0;
  22283. var f = function(t, i, n) {
  22284. N.delayOneFrame(function() {
  22285. e[t] = !1,
  22286. l && l(i, n)
  22287. }
  22288. .bind(this))
  22289. }
  22290. .bind(this, r.id)
  22291. , g = function(t, i) {
  22292. N.delayOneFrame(function() {
  22293. e[t] = !1,
  22294. c && c(i)
  22295. }
  22296. .bind(this))
  22297. }
  22298. .bind(this, r.id);
  22299. try {
  22300. return null !== u && void 0 !== u || (u = !0),
  22301. 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),
  22302. e[r.id] && (t[r.id] = performance.now()),
  22303. e[r.id]
  22304. } catch (n) {
  22305. throw e[r.id] = !1,
  22306. t[r.id] = performance.now() - i,
  22307. n
  22308. }
  22309. }
  22310. }(),
  22311. n.prototype.checkAndWaitForWholePanoLoad = function(e, t, i, n, r) {
  22312. if (!e)
  22313. throw new M("Player.checkAndWaitForWholePanoLoad() -> Cannot load texture for null pano.");
  22314. return r && this.model.waitForLoad(e, function() {
  22315. return e.isLoaded(i)
  22316. }),
  22317. !e.isLoaded(t) && (e.loadCube(t).done(n),
  22318. !0)
  22319. }
  22320. ,
  22321. n.prototype.checkAndWaitForTiledPanoLoad = function() {
  22322. var e = new r.Vector3;
  22323. return function(t, i, n, r, o, a, s, l) {
  22324. if (!t)
  22325. throw new M("Player.checkAndWaitForTiledPanoLoad() -> Cannot load texture for null pano.");
  22326. return e.copy(d.FORWARD),
  22327. this.getDirection(e),
  22328. !t.isLoaded(i) && (a && this.model.waitForLoad(t, function() {
  22329. return t.isLoaded(i)
  22330. }),
  22331. t.loadTiledPano(i, e, null, s, l).done(function(e, t) {
  22332. n && n(e, t)
  22333. }
  22334. .bind(this)).fail(function(e) {
  22335. r && r(e)
  22336. }
  22337. .bind(this)).progress(function(e, t, i) {
  22338. o && o(e, t, i)
  22339. }
  22340. .bind(this)),
  22341. !0)
  22342. }
  22343. }(),
  22344. n.prototype.switchCameraMode = function(e, t) {
  22345. var i = this.cameraControls.controls[e]
  22346. , n = i.camera;
  22347. switch (e) {
  22348. case u.PANORAMA:
  22349. n.position.copy(this.currentPano.position);
  22350. var o = t ? d.FORWARD.clone().applyQuaternion(t) : this.getDirection().setY(0).normalize();
  22351. i.lookAt(o.add(n.position));
  22352. break;
  22353. case u.DOLLHOUSE:
  22354. /* var a = this.position.clone();
  22355. 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),
  22356. n.position.copy(a),
  22357. i.target.copy(this.target.clone().setY(this.model.center.y));
  22358. break; */
  22359. //for多楼层 且 让模型刚好适应屏幕
  22360. var box = this.model.boundingBox.clone();
  22361. box.applyMatrix4(this.camera.matrixWorld);//将 boundingbox、也就是模型, 转换到当前相机朝向
  22362. var boxSize = box.size() //其中boxSize.x是模型在当前相机视角下的横向宽度,当飞出后,该宽度要刚好占满窗口宽度
  22363. var fov = B.getHFOVFromVFOV(f.insideFOV, n.aspect, 1); //获得在当前窗口的横向的fov
  22364. var distance = Math.abs(boxSize.x) / 2 / Math.tan(THREE.Math.degToRad(fov / 2))//根据上面获得的参数得到target到相机的距离
  22365. //console.log(boxSize.x,distance, boxSize.length() / 2)
  22366. distance += boxSize.length() / 2 //由于此时模型从中心向相机的部分由于近大远小仍超出屏幕,所以将target放在靠近模型靠近相机的这一端,故而再加上box的对角线长度的一半, 虽然本该加上Math.sqrt(boxSize.z*boxSize.z +boxSize.y+boxSize.y)/2,但是这样模型显得比较满
  22367. if(this.mode === u.PANORAMA){
  22368. i.target.copy(this.model.center);
  22369. var vec = this.getDirection().negate().setY(1).normalize()//获得朝向
  22370. }else{
  22371. i.target.copy(this.target.clone().setY(this.model.center.y))
  22372. var vec = d.DOWN.clone().applyQuaternion(this.quaternion).setY(1).normalize()
  22373. }
  22374. vec.multiplyScalar(distance )
  22375. n.position.copy(i.target.clone().add(vec))
  22376. break
  22377. case u.FLOORPLAN:
  22378. n.position.copy(this.model.center).setY(f.floorplan.cameraHeight),
  22379. i.target.copy(this.model.center).setY(0),
  22380. i.zoomToContain(this.model.size),
  22381. i.rotateToView(this.model.size, this.getDirection())
  22382. }
  22383. i.update(0)
  22384. }
  22385. ,
  22386. n.prototype.update = function() {
  22387. var e = (new r.Vector3,
  22388. {})
  22389. , t = [];
  22390. return function(i) {
  22391. this.updatePersistentZooming(i),
  22392. this.updateFromControls(i),
  22393. this.getCurrentNodePanos(t)
  22394. this.lastFrameChanged = false
  22395. if(this.hasChanged(e) ) {
  22396. this.lastFrameChanged = e.cameraChanged3 ? 'level3' : e.cameraChanged2 ? 'level2' : e.cameraChanged ? 'level1' : false
  22397. this.lastChangeTime = Date.now(),
  22398. !this.mouseDown && this.containsMouse && this.updateIntersect(),
  22399. this.emit(w.ViewChanged, e),
  22400. // 注意: player.cameraControls.activeControl.camera 的 matrix是错的
  22401. this.intersect && this.magnifier && this.magnifier.update(this.intersect.point)
  22402. }
  22403. if(e.cameraChanged2){ //变化要更大些
  22404. }
  22405. if(e.cameraChanged){
  22406. this.mode == "panorama" && window.cad && cad.setSign({ x: this.position.x, y: this.position.z }, this.cameraControls.controls.panorama.lon);
  22407. /* for(var i in this.model.hots){
  22408. this.model.hots[i].updateTitle(this)
  22409. } */
  22410. Hot.updateHots()
  22411. }
  22412. this.model.supportsTiles && (this.updateTileDownloader(t),
  22413. this.updatePanoRenderer(t)),
  22414. this.updatePreRendering(t),
  22415. this.reticule.update(),
  22416. this.path.update(),
  22417. this.spider.update(),
  22418. this.cachedPanoCandidates && f.navigation.panoScores && this.model.panos.showPanoScores(this.cachedPanoCandidates),
  22419. this.updateControlLocks(),
  22420. this.model.supportsTiles && this.updateZoomPano()
  22421. }
  22422. }(),
  22423. /* n.prototype.controlVideosPlay = function() {//判断box视频是否可见 不可见就暂停
  22424. var lastMode, lastPano;
  22425. return function(){
  22426. var mode = this.mode;
  22427. var pano = mode == "panorama" ? this.currentPano : "";
  22428. if(mode != "panorama" || pano != lastPano){
  22429. overlay.noBlock = null
  22430. }
  22431. this.overlayGroup.children.forEach((overlay)=>{
  22432. if(overlay.overlayType == "video" ){
  22433. var matrix = overlay.plane.matrixWorld;
  22434. var inSight = false;
  22435. var cameraDir = this.getDirection();
  22436. var planeDir = (new r.Vector3).copy(d.FORWARD).applyQuaternion(overlay.plane.quaternion)
  22437. var vertexes = []
  22438. if(cameraDir.angleTo(planeDir)>Math.PI/2){//朝向相机视线
  22439. for(let i=0; i<4; i++){
  22440. var vertex = overlay.plane.geometry.vertices[i].clone().applyMatrix4(matrix)
  22441. vertexes.push(vertex)
  22442. if(overlay.noBlock == null){
  22443. if(!m.ifShelter(vertex)){
  22444. overlay.noBlock = true
  22445. }
  22446. inSight = true; break;
  22447. }else{
  22448. overlay.noBlock = true
  22449. }
  22450. if(m.getPos2d(vertex, this.camera, $("#player")[0]).inSight){
  22451. inSight = true; break;
  22452. }
  22453. }
  22454. }
  22455. overlay.inSight = inSight
  22456. if(!inSight)overlay.plane.material.map.image.pause()
  22457. else overlay.plane.material.map.image.play()//maybe fail
  22458. }
  22459. })
  22460. lastMode = mode, lastPano = pano
  22461. }
  22462. }() */
  22463. n.prototype.updatePersistentZooming = function(e) {
  22464. 1 === this.zooming ? this.zoomBy(1 + this.zoomSpeed * e) : this.zooming === -1 && this.zoomBy(1 - this.zoomSpeed * e)
  22465. }
  22466. ,
  22467. n.prototype.updateControlLocks = function() {
  22468. this.currentPano && this.model.supportsTiles && (this.cameraControls.controls[u.PANORAMA].locked = !this.currentPano.highestFullTileRenderOpCompleted && this.currentPano.lockUntilRenderingComplete)
  22469. }
  22470. ,
  22471. n.prototype.updatePanoRenderer = function() {
  22472. var e = new r.Vector3;
  22473. return function(t) {
  22474. var i = this.nextPano || this.currentPano;
  22475. this.panoRenderer.hasQueuedTiles() && i && (e.copy(d.FORWARD),
  22476. this.getDirection(e),
  22477. this.panoRenderer.updateDirection(e))
  22478. }
  22479. }(),
  22480. n.prototype.cleanupInactivePanos = function() {
  22481. var e = []
  22482. , t = [];
  22483. return function() {
  22484. e.length = 0,
  22485. e.push(this.currentPano),
  22486. this.nextPano && e.push(this.nextPano),
  22487. t.length = 0;
  22488. for (var i = 0; i < this.panoRenderer.activePanos.length; i++)
  22489. t.push(this.panoRenderer.activePanos[i]);
  22490. for (var n = 0; n < t.length; n++) {
  22491. for (var r = t[n], o = !0, a = 0; a < e.length; a++)
  22492. r.id === e[a].id && (o = !1);
  22493. o && r.exit()
  22494. }
  22495. }
  22496. }(),
  22497. n.prototype.updatePreRendering = function() {
  22498. var e = {};
  22499. return function(t) {
  22500. if (1 === f.tiling.preRenderTourPanos && this.preRenderingEnabled) {
  22501. var i = this.nextPano || this.currentPano;
  22502. if (i && t && t.length > 1) {
  22503. var n = t.findIndex(function(e) {
  22504. if (e.id === i.id)
  22505. return !0
  22506. });
  22507. if (n >= 0 && n + 1 < t.length) {
  22508. var r = t[n + 1];
  22509. r.isLoaded(this.basePanoSize) || e[r.id] || (window.setTimeout(function(t) {
  22510. this.checkAndWaitForPanoLoad(t, "high", "low", this.basePanoSize, null, null, null, !1, !1, !1),
  22511. window.setTimeout(function(t) {
  22512. e[t.id] = !1
  22513. }
  22514. .bind(this, t), f.tiling.panoPreRenderRepeatDelay)
  22515. }
  22516. .bind(this, r), f.tiling.panoPreRenderDelay),
  22517. e[r.id] = !0)
  22518. }
  22519. }
  22520. }
  22521. }
  22522. }(),
  22523. n.prototype.enablePreRendering = function() {
  22524. this.preRenderingEnabled = !0
  22525. }
  22526. ,
  22527. n.prototype.disablePreRendering = function() {
  22528. this.preRenderingEnabled = !1,
  22529. this.cleanupInactivePanos()
  22530. }
  22531. ,
  22532. n.prototype.updateTileDownloader = function() {
  22533. var e = new r.Vector3;
  22534. return function(t) {
  22535. var i = this.nextPano || this.currentPano;
  22536. i && (e.copy(d.FORWARD),
  22537. this.getDirection(e),
  22538. this.tileDownloader.tilePrioritizer.updateCriteria(i, this.position, e, t.length > 0 ? t : null),
  22539. this.tileDownloader.processPriorityQueue = !0)
  22540. }
  22541. }(),
  22542. n.prototype.updateFromControls = function(e) {
  22543. null !== e && void 0 !== e || (e = 0),
  22544. this.cameraControls.activeControl && (this.cameraControls.activeControl.update(e),
  22545. this.quaternion.copy(this.cameraControls.activeControl.camera.quaternion),
  22546. this.position.copy(this.cameraControls.activeControl.camera.position),
  22547. this.target.copy(this.cameraControls.activeControl.target),
  22548. this.cameraControls.activeControl.camera.updateProjectionMatrix(),
  22549. this.camera.projectionMatrix.copy(this.cameraControls.activeControl.camera.projectionMatrix)),
  22550. this.camera.position.copy(this.position),
  22551. this.camera.quaternion.copy(this.quaternion),
  22552. this.camera.updateMatrix(),
  22553. this.camera.updateMatrixWorld()
  22554. }
  22555. ,
  22556. n.prototype.hasChanged = function(e) {
  22557. if (!this.previousState)
  22558. {
  22559. this.previousState = {
  22560. allFloorsVisible: this.model.allFloorsVisible,
  22561. position: this.position.clone(),
  22562. quaternion: this.quaternion.clone(),
  22563. mouse: this.mouse.clone(),
  22564. //labelScaleFactor: this.getLabelScaleFactor(),
  22565. currentFloor: this.model.currentFloor,
  22566. projectionMatrix: this.camera.projectionMatrix.clone(),
  22567. worldMatrix: this.camera.matrixWorld.clone(),
  22568. mode: this.mode,
  22569. modelPosition: this.model.position.clone(),
  22570. modelCenter: this.model.center.clone(),
  22571. zoomLevel: this.zoomLevel
  22572. };
  22573. e.cameraChanged = e.cameraChanged2 = true;
  22574. return !0;
  22575. }
  22576. //许钟文改 分成相机是否改变cameraChanged 和其他
  22577. 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)
  22578. 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 ;
  22579. e.cameraChanged = !a;
  22580. e.allFloorsVisible = this.model.allFloorsVisible !== this.previousState.allFloorsVisible,
  22581. e.moved = !this.position.equals(this.previousState.position),
  22582. e.rotated = !this.quaternion.equals(this.previousState.quaternion),
  22583. e.mouseMoved = !this.mouse.equals(this.previousState.mouse),
  22584. // e.labelScaleFactor = this.getLabelScaleFactor() !== this.previousState.labelScaleFactor,
  22585. e.floorChanged = this.model.currentFloor !== this.previousState.currentFloor,
  22586. e.cameraProjectionChanged = !this.camera.projectionMatrix.equals(this.previousState.projectionMatrix),
  22587. e.cameraWorldMatrixChanged = !this.camera.matrixWorld.equals(this.previousState.worldMatrix),
  22588. e.modeChanged = this.mode !== this.previousState.mode,
  22589. e.modelPositionChanged = !this.model.position.equals(this.previousState.modelPosition),
  22590. e.modelCenterChanged = !this.model.center.equals(this.previousState.modelCenter),
  22591. e.nextPanoActive = null !== this.nextPano,
  22592. e.zoomLevel = this.zoomLevel !== this.previousState.zoomLevel
  22593. /* if(e.cameraChanged){//
  22594. 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)
  22595. }else e.cameraChanged2 = false */
  22596. if(e.cameraChanged){
  22597. e.cameraChanged2 = e.cameraProjectionChanged || !MathLight.closeTo(this.quaternion, this.previousState.quaternion, 5) || !MathLight.closeTo(this.position, this.previousState.position, 4)
  22598. e.cameraChanged3 = e.cameraProjectionChanged || !MathLight.closeTo(this.quaternion, this.previousState.quaternion, 3) || !MathLight.closeTo(this.position, this.previousState.position, 3)
  22599. } else {
  22600. e.cameraChanged2 = false
  22601. e.cameraChanged3 = false
  22602. }
  22603. this.previousState.allFloorsVisible = this.model.allFloorsVisible,
  22604. this.previousState.position.copy(this.position),
  22605. this.previousState.quaternion.copy(this.quaternion),
  22606. this.previousState.mouse.copy(this.mouse),
  22607. //this.previousState.labelScaleFactor = this.getLabelScaleFactor(),
  22608. this.previousState.currentFloor = this.model.currentFloor,
  22609. this.previousState.projectionMatrix.copy(this.camera.projectionMatrix),
  22610. this.previousState.worldMatrix.copy(this.camera.matrixWorld),
  22611. this.previousState.mode = this.mode,
  22612. this.previousState.modelPosition.copy(this.model.position),
  22613. this.previousState.modelCenter.copy(this.model.center),
  22614. this.previousState.zoomLevel = this.zoomLevel;
  22615. //console.log("cameraChanged2 "+ e.cameraChanged2 + ", mouseMoved "+e.mouseMoved)
  22616. return !t
  22617. }
  22618. ,
  22619. n.prototype.updateIntersect = function() {
  22620. var e = this.flying || this.isWarping()
  22621. , t = this.isOutsideMode() && this.cameraControls.controls[this.mode].isEngaged()
  22622. , i = y.getById(V.LookTransition)
  22623. , n = !(e || t || this.isTouchEvent || i.length && i[0].running);
  22624. {//clear:
  22625. if(this.intersectHot) this.intersectHot.setHoverState(false)
  22626. this.intersectHot = null
  22627. CursorDeal.remove('hoverHot')
  22628. }
  22629. var deal = ()=>{
  22630. if(this.intersect && this.intersect.object.visible ){
  22631. if("hotSprite" == this.intersect.object.type){
  22632. this.intersectHot = this.intersect.object
  22633. while(!(this.intersectHot instanceof Hot)){
  22634. this.intersectHot = this.intersectHot.parent
  22635. }
  22636. $(`.toolRight .spotList ul li[data-spid=${this.intersectHot.sid}]`).addClass("active")
  22637. this.intersectHot.setHoverState(true)
  22638. }
  22639. }
  22640. }
  22641. if(this.model.hotGroup){
  22642. var hots = this.model.hotGroup.children.filter(e=> e.info.actionType.examine || e.info.actionType.fastTran || e.info.actionType.openHot || e.info.actionType.playAndPause)
  22643. let colliders = this.model.floors.reduce(function(e, t) {
  22644. return t.hidden ? e : e.concat(t.collider.children)
  22645. }, this.mode === 'panorama' ? this.panoMarkers : [])
  22646. this.intersect = this.getMouseIntersect(null, hots.concat(colliders/* this.model.colliders */));
  22647. if(this.intersect){
  22648. deal()
  22649. let intersect = this.intersect
  22650. if(this.intersectHot){
  22651. this.intersect = null
  22652. CursorDeal.add('hoverHot')
  22653. }else{
  22654. if(intersect.object.parent.parent.hidden ){//楼层已隐藏
  22655. this.intersect = null
  22656. }
  22657. }
  22658. }
  22659. }else{
  22660. this.intersect = this.getMouseIntersect()
  22661. }
  22662. this.intersect && this.updateClosestPano(this.intersect),
  22663. this.closestPano || this.closestPanoInDirection(this.getMouseDirection()) ? (this.reticule.updatePosition(this.position, this.intersect),
  22664. f.navigation.panoScores && !f.navigation.mouseDirection && this.closestPanoInDirection(this.getDirection())) : this.reticule.hide()
  22665. }
  22666. ,
  22667. n.prototype.checkHotClick = function() {
  22668. if(this.intersectHot){
  22669. if(this.intersectHot.texType == "video" && this.intersectHot.info.actionType.playAndPause){
  22670. this.intersectHot.switchPlay(!!this.intersectHot.pausedByUser)
  22671. }
  22672. this.intersectHot.examine(this)
  22673. return true;
  22674. }
  22675. },
  22676. n.prototype.getMouseDirection = function(e) {
  22677. e = e || this.mouse;
  22678. var t = new r.Vector3(e.x,e.y,-1).unproject(this.camera)
  22679. , i = new r.Vector3(e.x,e.y,1).unproject(this.camera);
  22680. return i.sub(t).normalize()
  22681. }
  22682. ,
  22683. n.prototype.hoverOverlay = function(mesh){
  22684. if(!mesh){
  22685. this.hoveringPlane = null;
  22686. $("#player").css("cursor",this.currentCursor || "" );
  22687. }else{
  22688. var overlay = mesh.parent;
  22689. $("#player").css("cursor","pointer");
  22690. this.hoveringPlane = overlay;
  22691. return true;
  22692. }
  22693. },
  22694. n.prototype.clickOverlay = function(overlay){
  22695. if(this.openOverlay && !overlay)return;
  22696. var plane = overlay.plane;
  22697. /* if(overlay.overlayType == "video"){
  22698. if(plane.material.map.image.paused) plane.material.map.image.play()
  22699. else plane.material.map.image.pause()
  22700. } */
  22701. if(overlay.overlayType == "video"){
  22702. overlay.switchPlay(!!overlay.pausedByUser)
  22703. }
  22704. /* if(window.EditOverlay &&EditOverlay.editing){
  22705. if(EditOverlay.editPlane && overlay != EditOverlay.editPlane) EditOverlay.closeOverlayPanel('cancel')
  22706. $('#overlayProp').removeClass('atRight').removeClass('hide')
  22707. EditOverlay.endAddPlane();
  22708. EditOverlay.updateOverlayPanel(overlay)
  22709. EditOverlay.controlSelectOverlay(overlay)
  22710. return;
  22711. } */
  22712. },
  22713. n.prototype.getMouseIntersect = function(e, t) {//xzw change
  22714. e = e || this.mouse.clone(),
  22715. t = t || this.model.floors.reduce(function(e, t) {
  22716. return t.hidden ? e : e.concat(t.collider.children)
  22717. }, this.mode === u.PANORAMA ? this.panoMarkers : []);
  22718. var i = new r.Vector3(e.x,e.y,-1).unproject(this.camera);
  22719. this.raycaster.set(i, this.getMouseDirection(e));
  22720. var n = this.raycaster.intersectObjects(t, true);//add true
  22721. var o = n[0];
  22722. if(o){
  22723. o.face && (o.normal = o.face.normal.applyQuaternion(o.object.quaternion),
  22724. this.position.clone().sub(o.point).dot(o.normal) < 0 && o.normal.negate(),
  22725. this.currentPano ? o.onFloor = o.point.y < this.position.y - .5 * this.currentPano.height : o.onFloor = o.point.y < this.position.y - .5,
  22726. o.horizontal = .8 < o.normal.y);
  22727. return o
  22728. }
  22729. }
  22730. ,
  22731. n.prototype.updateClosestPano = function(e) {
  22732. var t = [s.filters.isPanoAligned()];
  22733. if (this.mode === u.PANORAMA) {
  22734. if (!this.currentPano)
  22735. return;
  22736. t.push(s.filters.not(this.currentPano)),
  22737. t.push(s.filters.isNeighbourPanoTo(this.currentPano)),
  22738. t.push(s.filters.inFloorDirection(this.currentPano.floorPosition, this.getDirection(), .25)),
  22739. t.push(s.filters.isCloseEnoughTo(e.point, f.panoFloorClickRadius)),
  22740. t.push(s.filters.isNotBehindNormal(e.point, e.normal))
  22741. } else{
  22742. t.push(s.filters.isOnVisibleFloor()),
  22743. t.push(this.checkHasNeighbor)//add
  22744. this.mode !== u.FLOORPLAN && t.push(s.filters.inDirection(this.position, this.getDirection(), .25));
  22745. }
  22746. var i = this.model.panos.find(t, [s.sortFunctions.floorDistanceToPoint(e.point)]);
  22747. i !== this.closestPano ? (i && (this.isPanoHover = !0),
  22748. this.emit(w.ClosestPanoChanging, this.closestPano, i, this.mode),
  22749. this.closestPano = i,
  22750. this.closestPano && this.mode == 'panorama' ? CursorDeal.add('hoverPano' ) : CursorDeal.remove('hoverPano' ) //add
  22751. ) : this.isPanoHover = !1
  22752. }
  22753. ,
  22754. n.prototype.dollhouseMode = function(e, t) {
  22755. this.emit(w.ModeChanging, this.mode, u.DOLLHOUSE),
  22756. this.mode = u.DOLLHOUSE,
  22757. this.cameraControls.controls[u.DOLLHOUSE].reset();
  22758. var i = new r.Vector3(this.model.center.x,0,this.model.center.z)
  22759. , n = new r.Vector3(15,10,15);
  22760. if (e && t) {
  22761. var o = d.FORWARD.clone().applyQuaternion(t)
  22762. , a = this.model.center.clone().sub(e)
  22763. , s = a.dot(o);
  22764. s > 0 ? (i = o.clone().multiplyScalar(s).add(e),
  22765. n.copy(e)) : F.warn("Tried to initiate dollhouse mode that wasn't looking at the model", e, t)
  22766. }
  22767. this.cameraControls.controls[u.DOLLHOUSE].resetRanges(0, !0),
  22768. this.cameraControls.controls[u.DOLLHOUSE].target.copy(i),
  22769. this.cameraControls.cameras[u.DOLLHOUSE].position.copy(n),
  22770. this.updateFromControls(),
  22771. this.model.alpha = 1,
  22772. this.model.skybox.material.uniforms.opacity.value = 0
  22773. }
  22774. ,
  22775. n.prototype.insideMode = function(e, t) {
  22776. var i = $.Deferred()
  22777. , n = t || null;
  22778. if (this.mode !== u.PANORAMA && this.mode !== u.TRANSITIONING) {
  22779. var r = [s.filters.isPanoAligned()];
  22780. this.model.currentFloor && r.push(s.filters.atFloor(this.model.currentFloor)),
  22781. e = e || this.currentPano || this.model.panos.find(r, [s.sortFunctions.distanceToPoint(this.cameraControls.activeControl.target)]),
  22782. this.flyToNewMode({
  22783. mode: u.PANORAMA,
  22784. pano: e,
  22785. callback: n
  22786. }).done(i.resolve.bind(i)).fail(i.reject.bind(i))
  22787. } else {
  22788. var o = this.mode === u.PANORAMA ? "Already in panorama mode" : "Cannot change mode during mode transition";
  22789. i.reject(o)
  22790. }
  22791. return i.promise()
  22792. }
  22793. ,
  22794. n.prototype.fitDollhouse = function(e, t, i) {//许钟文改 飞入前寻找和初始视角最合适的位置
  22795. //if(urlHasValue('oldEntry')){
  22796. //搬自一代。
  22797. var maxY = this.model.boundingBox.max.y;
  22798. var n = d.FORWARD.clone().applyQuaternion(i)
  22799. , i = n.clone().add(e);
  22800. this.cameraControls.activeControl.target.copy(i),
  22801. this.cameraControls.activeControl.camera.position.set(0, maxY * 2.4, 0).add(e).add(n.multiplyScalar(-10))
  22802. //return;
  22803. /* //this.camera.position.copy(this.model.center);
  22804. //this.camera.updateMatrixWorld()
  22805. this.switchCameraMode("dollhouse", i) */
  22806. //}//下面是二代代码,看不太懂。因为有的场景在靠近一端的某个方向截取的初始视角会甩镜头,也就是不是下去之后的方向
  22807. //直接用一代的这个 效果和二代几乎一样,且不会甩
  22808. /* var n = d.FORWARD.clone().applyQuaternion(i);
  22809. this.cameraControls.activeControl.target.copy(n).add(e);
  22810. var o = d.RIGHT.clone().applyQuaternion(i)
  22811. , a = d.UP.clone()
  22812. , s = o.clone().applyAxisAngle(a, Math.PI / 2)
  22813. , l = this.model.boundingBox.max.clone()
  22814. , c = this.model.boundingBox.min.clone()
  22815. , 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)]
  22816. , u = 0
  22817. , p = 0
  22818. , g = 0;
  22819. h.forEach(function(e, t, i) {
  22820. var n = Math.abs(e.dot(o))
  22821. , r = e.dot(s);
  22822. n > u && (u = n,
  22823. p = r),
  22824. r > g && (g = r)
  22825. });
  22826. 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)))
  22827. , v = s.clone().multiplyScalar(p).add(t)
  22828. , A = s.clone().multiplyScalar(g).add(t);
  22829. p = u / Math.tan(this.cameraControls.activeControl.camera.fov / 2 * this.cameraControls.activeControl.camera.aspect * (Math.PI / 180));
  22830. g = m / Math.tan(this.cameraControls.activeControl.camera.fov / 2 * (Math.PI / 180));
  22831. p = Math.max(p, 10),
  22832. g = Math.max(g, 10);
  22833. var y = n.clone().multiplyScalar(-p).add(v).sub(t).length()
  22834. , C = n.clone().multiplyScalar(-g).add(v).sub(t).length();
  22835. this.cameraControls.activeControl.maxDistance = f.skyboxRadius - 1;
  22836. y >= C ? this.cameraControls.activeControl.camera.position.set(0, 6, 0).add(v).add(n.multiplyScalar(1.1 * -p))
  22837. : this.cameraControls.activeControl.camera.position.set(0, 6, 0).add(A).add(n.multiplyScalar(1.1 * -g))
  22838. */
  22839. }
  22840. ,
  22841. n.prototype.floorplanMode = function(e, t, i) {
  22842. this.mode = u.FLOORPLAN;
  22843. var n = this.cameraControls.controls[u.FLOORPLAN];
  22844. n.reset();
  22845. var r = e ? e : this.model.center;
  22846. if (n.target.copy(r).setY(0),
  22847. n.camera.position.copy(r).setY(f.floorplan.cameraHeight),
  22848. i ? (n.currentScale = i / ($("#player").width() / $("#player").height()),
  22849. n.absoluteScale = n.currentScale) : n.zoomToContain(this.model.size),
  22850. t) {
  22851. var o = d.LEFT.clone().applyQuaternion(t);
  22852. n.rotateLeft(-Math.atan2(o.x, o.z))
  22853. } else
  22854. n.rotateToView(this.model.size, this.getDirection());
  22855. n.update(0)
  22856. }
  22857. ,
  22858. n.prototype.nonInterruptingFlyToPano = function(e, t) {
  22859. return e.skipWarpingCheck = !0,
  22860. this.flyToPano(e, t)
  22861. }
  22862. ,
  22863. n.prototype.updateMarkerVisi = function() {//加
  22864. if(this.mode != "panorama")return;
  22865. this.model.panos.list.forEach((pano)=>{
  22866. if(!pano.marker)return;
  22867. pano.marker.material.visible = !!pano.neighbourPanos[this.currentPano.id];
  22868. })
  22869. }
  22870. ,
  22871. /* n.prototype.updateHotVisible = function(pano){
  22872. var hots = this.model.hots;
  22873. pano = pano || this.currentPano;
  22874. for (var index in hots){
  22875. var visible;
  22876. if(this.mode != "panorama"){
  22877. visible = true;
  22878. }else{
  22879. //hots[index].mesh.material.depthTest = false;
  22880. visible = !hots[index].visiblePanos || hots[index].visiblePanos.indexOf(pano.id) > -1
  22881. }
  22882. hots[index].mesh.visible = visible;
  22883. }
  22884. } */
  22885. n.prototype.flyToPano = function(e, t) {
  22886. var i = e.pano
  22887. , aim = e.lookAtPoint
  22888. , aimQua = e.quaternion //ADD
  22889. , o = e.duration
  22890. , a = e.aimDuration
  22891. , s = e.maxDistanceOverride
  22892. , l = e.skipWarpingCheck
  22893. , c = e.constantMoveSpeed
  22894. , h = null
  22895. , p = null
  22896. if (aim){
  22897. var _ = (new r.Matrix4).lookAt(i.position, aim, d.UP)
  22898. aimQua = (new r.Quaternion).setFromRotationMatrix(_)
  22899. }
  22900. else aimQua = aimQua
  22901. var zoomLevel = e.zoomLevel || 1 //add
  22902. if(this.flying) return t && t(e)
  22903. window.specialScene && specialScene.special().specifySpot && specialScene.special().specifySpot(i);
  22904. if (this.isWarping() && !l && (this.path.activeTransType === x.BLACK || this.path.activeTransType === x.STD))
  22905. return F.warn("Player.flyToPano() -> Cannot fly when warping"),
  22906. t && t(),
  22907. !1;
  22908. if (this.updateLastView(),
  22909. this.mode !== u.PANORAMA) {
  22910. var m;
  22911. return void this.flyToNewMode({
  22912. mode: u.PANORAMA,
  22913. pano: i,
  22914. duration: o,
  22915. quaternion: aimQua ,
  22916. callback: t
  22917. })
  22918. }
  22919. if (!i || (h = g.deepExtend(e),
  22920. p = function() {
  22921. N.delayOneFrame(function() {
  22922. this.flyToPano(h, t)
  22923. }
  22924. .bind(this))
  22925. }
  22926. .bind(this),
  22927. !this.checkAndWaitForPanoLoad(i, "high", "low", this.basePanoSize, p))) {
  22928. var C = function(e) {
  22929. t && t(e)
  22930. }
  22931. .bind(this);
  22932. this.currentPano || (this.currentPano = i,
  22933. this.path.placeCpm(),
  22934. this.path.fadeOutCpm(f.path.fadeOutTime),
  22935. this.spider.draw());
  22936. var I = o;
  22937. if ("number" != typeof o) {
  22938. var E = s || f.transition.flytimeMaxDistanceThreshold;
  22939. I = Math.min(this.currentPano.position.distanceTo(i.position), E) * f.transition.flytimeDistanceMultiplier + f.transition.flyTime
  22940. }
  22941. if (f.transition.flySpeed > .01 && (I = 1e3 * this.currentPano.position.distanceTo(i.position) / f.transition.flySpeed),
  22942. zoomLevel !== this.zoomLevel)
  22943. switch (f.zoom.transitionStyle) {
  22944. case 1:
  22945. this.smoothZoomFovTo(null, zoomLevel, zoomLevel == 1 ? I / 2 : I); //改
  22946. break;
  22947. case 2:
  22948. return h = g.deepExtend(e),
  22949. p = this.flyToPano.bind(this, h, t),
  22950. void this.smoothZoomFovTo(null, zoomLevel, f.zoom.restoreTime * (this.zoomLevel - 1), p)
  22951. }
  22952. if (aimQua) {
  22953. y.cancelById(V.LookTransition),
  22954. I *= f.transition.aimSlowFactor;
  22955. var b = this.cameraControls.activeControl.camera.quaternion.clone()
  22956. , S = b.clone()
  22957. , M = new r.Vector3;
  22958. if (i === this.currentPano) {
  22959. var R = d.FORWARD.clone().applyQuaternion(b)
  22960. , P = d.FORWARD.clone().applyQuaternion(aimQua)
  22961. , O = R.angleTo(P);
  22962. return void 0 !== a && null !== a || (a = 1 * Math.sqrt(O) / f.tags.navigate.rotateSpeedFactor * 1e3),
  22963. void y.start(function(e) {
  22964. S.copy(b),
  22965. v.quaternion(S, aimQua)(e),
  22966. M.copy(d.FORWARD).applyQuaternion(S).add(this.cameraControls.activeControl.camera.position),
  22967. this.cameraControls.activeControl.lookAt(M)
  22968. }
  22969. .bind(this), a, C, 0, A[f.transition.movementEasing], null, V.LookTransition)
  22970. }
  22971. }
  22972. if (i === this.currentPano )
  22973. return void C();
  22974. this.flying = !0;
  22975. var L = this.position.clone()
  22976. , D = this.currentPano;
  22977. F.debug("Flying to pano ", i.position),
  22978. this.emit(w.PanoChosen, this.currentPano, i),
  22979. this.emit(w.FlyingStarted, i.position, L, i, D)
  22980. //---------before fly--------------- add
  22981. this.transitionPos({type:"beforeFlytopano", pano:i, dur:I})//add
  22982. Hot.updateVisibles([this.currentPano, i],'every')
  22983. //地标变化
  22984. if(this.model.floorLogos){
  22985. this.model.changefloorLogoOpa({index:0, opa:0, dur: p, delay:0.7})//this.model.floorLogoFade(0, _duration*0.5, 0.7);
  22986. this.model.floorLogos[1].position.copy(i.floorPosition.clone().sub(this.model.position));
  22987. //this.model.adjustfloorLogoHeight();
  22988. this.model.floorLogos[1].material.opacity = 0;//uniforms.opacity.value = 0;
  22989. this.model.floorLogos[1].visible = true;
  22990. this.model.changefloorLogoOpa({index:1, opa:1, dur: 250})//this.model.floorLogoShow(1,250);
  22991. }
  22992. //=======================================
  22993. this.nextPano = i
  22994. let beginTran = ()=>{
  22995. aimQua && y.start(function(e) {
  22996. S.copy(b),
  22997. v.quaternion(S, aimQua)(e),
  22998. M.copy(d.FORWARD).applyQuaternion(S).add(this.cameraControls.activeControl.camera.position),
  22999. this.cameraControls.activeControl.lookAt(M)
  23000. }
  23001. .bind(this), I, null, 0, A[f.transition.movementEasing], null, V.LookTransition);
  23002. var B = c ? null : A[f.transition.movementEasing];
  23003. y.start(v.uniform(this.model.skybox, "progress", 1), I, null, 0, A[f.transition.blendEasing], "skyFly", V.FlyToPano),
  23004. y.start(v.allUniforms(this.model.chunks, "progress", 1), I, null, 0, A[f.transition.blendEasing], "chunkFly", V.FlyToPano),
  23005. y.start(v.vector(this.cameraControls.cameras[u.PANORAMA].position, i.position), I, function(e) {
  23006. this.flying = !1,
  23007. this.currentPano !== i && this.currentPano.exit(),
  23008. i.enter(),
  23009. this.currentPano = i,
  23010. this.nextPano = null,
  23011. this.path.placeCpm(),
  23012. this.path.fadeOutCpm(f.path.fadeOutTime),
  23013. this.spider.draw(),
  23014. this.emit(w.FlyingEnded, i.position, L, i, D),
  23015. this.updateMarkerVisi(),//add
  23016. C(e)
  23017. //add:
  23018. if(this.mode == "panorama" ){
  23019. if(this.model.floorLogos){
  23020. this.model.floorLogos[0].position.copy(this.model.floorLogos[1].position)
  23021. //this.model.adjustfloorLogoHeight()
  23022. this.model.changefloorLogoOpa({index:0,opa:1,dur:0});//this.model.floorLogos[0].material.uniforms.opacity.value = 1;
  23023. this.model.floorLogos[1].visible = false;
  23024. }
  23025. this.model.fadePanoMarkers()//add
  23026. Hot.updateVisibles([this.currentPano])//add
  23027. }
  23028. }
  23029. .bind(this), 0, B, "camFly", V.FlyToPano)
  23030. }
  23031. if(!this.model.supportsTiles && i.getSkyboxTexture().image[0].width > 1024 /* || this.qualityManager.getMaxZoomClass() == '4k' */){
  23032. setTimeout(()=>{
  23033. beginTran()
  23034. }, 50) //2048的非tile需要延迟到下一帧,因为需要时间载入贴图,否则掉帧
  23035. }else{
  23036. beginTran()
  23037. }
  23038. }
  23039. }
  23040. ,
  23041. n.prototype.warpToPano = function(o={}) {
  23042. }
  23043. n.prototype.blackToPano = function(o={},callback) {//add 瞬间过渡
  23044. //o.panoId = "8bc9156b288d48459e4e0f74d7051ef1"
  23045. if(this.flying || this.isWarping() )return;
  23046. let pano = o.pano || this.model.panos.index[o.panoId]
  23047. if (this.mode !== u.PANORAMA) {
  23048. var m;
  23049. void this.flyToNewMode({
  23050. mode: u.PANORAMA,
  23051. pano ,
  23052. duration: o.duration,
  23053. quaternion: o.quaternion ,
  23054. callback
  23055. })
  23056. }
  23057. let oldPos = this.position.clone();
  23058. let oldPano = this.currentPano
  23059. this.path.warpDestPano = pano
  23060. var retry = ()=>{
  23061. this.waitingToWarp = !1,
  23062. this.blackToPano(o,callback)
  23063. }
  23064. if (this.checkAndWaitForPanoLoad(pano, "high", "low", this.basePanoSize, retry))
  23065. return void (this.waitingToWarp = !0)
  23066. this.flying = true
  23067. this.nextPano = pano //提前加载高清图片
  23068. this.path.warpDestHeroLoc = {
  23069. panoId : pano.id,
  23070. position: pano.position,
  23071. quaternion: o.quaternion || this.quaternion.clone()
  23072. }
  23073. this.path.warpTravel_BLACK(null, 1500,1, ()=>{
  23074. pano != this.currentPano && this.currentPano.exit()
  23075. pano.enter()
  23076. this.currentPano = pano
  23077. this.flying = false
  23078. this.nextPano = null
  23079. this.updateMarkerVisi();//add
  23080. callback && callback()
  23081. } )
  23082. }
  23083. window._transitionPosId = 9999
  23084. n.prototype.transitionPos = function(o={}) {//渐变overlay和热点的位置
  23085. y.cancelById(_transitionPosId)
  23086. var begin = function(object, pos, qua, scale){
  23087. if(pos){
  23088. if(!same(object.position, pos, 0.01)){
  23089. y.start(v.vector(object.position, pos), o.dur, (e)=>{
  23090. object.updateScale()
  23091. },0, A[f.transition.movementEasing], "transitionPos", _transitionPosId)
  23092. }
  23093. if(qua && !same(object.quaternion, qua, 1e-6)){
  23094. y.start(v.quaternion(object.quaternion, qua), o.dur, (e)=>{
  23095. },0, A[f.transition.movementEasing], "transitionPos", _transitionPosId)
  23096. }
  23097. if(scale && !same(object.scale, scale, 0.001)){
  23098. y.start(v.vector(object.scale, scale), o.dur, (e)=>{
  23099. },0, A[f.transition.movementEasing], "transitionPos", _transitionPosId)
  23100. }
  23101. }
  23102. }
  23103. var same = function(vec1, vec2, diff){
  23104. var s = Math.abs(vec1.x-vec2.x) < diff && Math.abs(vec1.y-vec2.y) < diff && Math.abs(vec1.z-vec2.z) < diff
  23105. if(s && vec1.w) s = Math.abs(vec1.w-vec2.w) < diff
  23106. return s
  23107. }
  23108. var sid = o.pano != void 0 ? o.pano.id : "outside";
  23109. for(let i in this.model.hots){//是否判断visible?
  23110. var hot = this.model.hots[i];
  23111. var panoData = hot.info.transformAtPanos[sid];
  23112. var useCustom = !panoData
  23113. //if(hot.usingTransformData || !useCustom){
  23114. var pos = useCustom ? hot.info.position : panoData.pos;
  23115. var qua = hot.isSprite ? null : (useCustom ? hot.info.quaternion : panoData.qua);
  23116. var scale = useCustom ? hot.info.scale : panoData.scale;
  23117. begin(hot, pos , qua, scale )
  23118. //}
  23119. //hot.usingTransformData = !useCustom;
  23120. }
  23121. if(o.callback){
  23122. setTimeout(()=>{
  23123. o.callback()
  23124. },o.dur + 16) ;//姑且这么写
  23125. }
  23126. }
  23127. window._tranOutsideFocus = 4399
  23128. n.prototype.focusPoint = function(o={}){//当在外时,聚焦相机到这一点
  23129. console.log("focusPoint")
  23130. if(this.mode == "floorplan"){
  23131. var modelSize = o.modelSize || new THREE.Vector3(8,8,8);//可视范围
  23132. var control = this.cameraControls.controls.floorplan;
  23133. var absoluteScale = control.getDefaultAbsoluteScale(modelSize)
  23134. var currentScale = control.absoluteScale;
  23135. var currentTarget = control.target.clone()
  23136. y.cancelById(window._tranOutsideFocus, true);
  23137. y.start(function(progress){
  23138. control.absoluteScale = absoluteScale*progress + currentScale*(1-progress);
  23139. control.target = o.aim.clone().multiplyScalar(progress).add(currentTarget.clone().multiplyScalar(1-progress))
  23140. control.camera.position.copy(control.target.clone().add(control.offset)) //维持角度
  23141. }.bind(this) , o.dur || 600, null/* cancelFuc */, 0, A[f.transition.movementEasing], "outsideFocus", window._tranOutsideFocus, null/* cancelFuc */);
  23142. }else if(player.mode == "dollhouse"){
  23143. var control = player.cameraControls.controls.dollhouse;
  23144. var radius = o.radius || 8;
  23145. var currentTarget = control.target.clone()
  23146. var dir = control.offset.clone().normalize()
  23147. var currentRadius = control.offset.length();
  23148. y.cancelById(window._tranOutsideFocus, true);
  23149. y.start(function(progress){
  23150. control.target = o.aim.clone().multiplyScalar(progress).add(currentTarget.clone().multiplyScalar(1-progress))
  23151. let radius_ = radius*progress+currentRadius*(1-progress)
  23152. control.camera.position.copy(control.target.clone().add(dir.clone().multiplyScalar(radius_)))
  23153. }.bind(this) , o.dur || 600, null/* cancelFuc */, 0, A[f.transition.movementEasing], "outsideFocus", window._tranOutsideFocus, null/* cancelFuc */);
  23154. }else if(this.mode == 'panorama'){
  23155. this.flyToPano({
  23156. lookAtPoint: o.aim.clone() ,
  23157. pano: this.currentPano,
  23158. aimDuration: o.dur || 600
  23159. })
  23160. }
  23161. }
  23162. /*
  23163. 切换到某个模式后再执行函数
  23164. */
  23165. n.prototype.FlyToMode = function(mode, f1, duration){
  23166. var f2;
  23167. if (this.mode == mode) {
  23168. f1 && f1()
  23169. } else {
  23170. f2 = f1;
  23171. if (this.mode == "transitioning" && this.modeTran.split('-')[1] != mode) {//正飞向其他模式,就要先飞完再飞进来然后执行
  23172. this.afterCModeFuc = function() {
  23173. /* objects.gui.modeChange[mode](null, {
  23174. fuc: f2 这个写法会使得先添加的回调fuc取代之后添加的afterCModeFuc,所以统一改为afterCModeFuc
  23175. }); */
  23176. this.afterCModeFuc = f2
  23177. this.flyToNewMode({mode:mode, pano: mode == "panorama" && this.currentPano,
  23178. //callback : f2
  23179. });
  23180. //这个fuc在trainsitioning状态下传入是无效的,所以后面得用afterCModeFuc。但是执行完afterCModeFuc,afterCModeFuc会变为null,所以里面得用fuc。。orz
  23181. }.bind(this)
  23182. } else {
  23183. if(this.afterCModeFuc)console.log("已经有afterCModeFuc了!!!!!!!!!!!!!!!")
  23184. this.afterCModeFuc = f2;//飞入后执行
  23185. try{ //在场景刚开始加载 control还没建好时这句可能会报错所以用try。 不用callback而用 afterCModeFuc也是这个原因,因为会有别的函数可以飞入然后执行它
  23186. this.flyToNewMode({mode:mode, pano: mode == "panorama" && this.currentPano, duration:duration});
  23187. }catch(e){
  23188. console.log('FlyToMode遇到问题?')
  23189. }
  23190. }
  23191. }
  23192. }
  23193. n.prototype.fastForwardActivePanoFlight = function(e) {
  23194. e = e || f.transition.fastForwardFactor / 10 * 4 + 1
  23195. y.adjustSpeed(V.FlyToPano, e)
  23196. y.adjustSpeed(V.LookTransition, e)
  23197. }
  23198. ,
  23199. n.prototype.flyToPanoClosestToMouse = function() {
  23200. if (Date.now() - this.mouseLastMoveTime > 50 && (this.intersect = this.getMouseIntersect(),
  23201. this.intersect && this.updateClosestPano(this.intersect)),
  23202. this.closestPano)
  23203. return this.flyToPano({
  23204. pano: this.closestPano
  23205. });
  23206. var e = this.getMouseDirection();
  23207. this.flyDirection(e) || this.flyToPano({
  23208. pano: this.currentPano
  23209. })
  23210. }
  23211. ,
  23212. n.prototype.flyLocalDirection = function(e) {
  23213. var t = this.getDirection(e)
  23214. , i = 1 === e.z ? .4 : .75
  23215. , n = 1 === Math.abs(e.x);
  23216. return this.flyDirection(t, i, n)
  23217. }
  23218. ,
  23219. n.prototype.flyDirection = function(e, t, i) {
  23220. Hot.closePopup();//xzw add
  23221. var n = $.Deferred();
  23222. this.history.invalidate();
  23223. var r = this.closestPanoInDirection(e, t, i);
  23224. return r ? this.flyToPano({
  23225. pano: r
  23226. }, n.resolve.bind(n, !0)) : (this.bump(e),
  23227. n.resolve(!1)),
  23228. n.promise()
  23229. }
  23230. ,
  23231. n.prototype.closestPanoInDirection = function(e, t, i) {
  23232. return this.rankedPanoInDirection(0, e, t, i)
  23233. }
  23234. ,
  23235. n.prototype.rankedPanoInDirection = function() {
  23236. var e = {
  23237. pano: null,
  23238. candidates: []
  23239. };
  23240. return function(t, i, n, r) {
  23241. t || (t = 0),
  23242. n = void 0 !== n ? n : .75;
  23243. var o = r ? "angle" : "direction";
  23244. return this.model.panos.findRankedByScore(t,
  23245. [s.filters.isPanoAligned(),
  23246. s.filters.not(this.currentPano),
  23247. s.filters.isNeighbourPanoTo(this.currentPano),
  23248. s.filters.inPanoDirection(this.position, i, n)],
  23249. [s.scoreFunctions.distanceSquared(this.currentPano),
  23250. s.scoreFunctions[o](this.position, i)], e),
  23251. this.cachedPanoCandidates = e.candidates,
  23252. e.pano
  23253. }
  23254. }(),
  23255. n.prototype.bump = function(e) {
  23256. if (this.mode === u.PANORAMA && !this.flying && !this.isWarping()) {
  23257. 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;
  23258. if (s)
  23259. t = function() {
  23260. y.start(v.property(this.cameraControls.cameras[u.PANORAMA], "zoom", a > 0 ? 1.04 : .96), o, i, 0, A.easeInOutSine, "bumpZStart")
  23261. }
  23262. .bind(this),
  23263. i = function() {
  23264. y.start(v.property(this.cameraControls.cameras[u.PANORAMA], "zoom", 1), 5 * o, n, 0, A.easeInOutSine, "bumpZRelax")
  23265. }
  23266. .bind(this);
  23267. else {
  23268. var l = this.camera.position.clone()
  23269. , c = e.clone();
  23270. this.raycaster.set(l, c);
  23271. var h = this.model.floors.reduce(function(e, t) {
  23272. return e.concat(t.collider.children)
  23273. }, [])
  23274. , d = this.raycaster.intersectObjects(h)
  23275. , p = d.length > 0 ? d[0].distance / 25 : .04
  23276. , g = l.clone().add(c.multiplyScalar(p));
  23277. t = function() {
  23278. y.start(v.vector(this.cameraControls.cameras[u.PANORAMA].position, g), o, i, 0, A.easeInOutSine, "bumpTStart")
  23279. }
  23280. .bind(this),
  23281. i = function() {
  23282. y.start(v.vector(this.cameraControls.cameras[u.PANORAMA].position, l), 5 * o, n, 0, A.easeInOutSine, "bumpTRelax")
  23283. }
  23284. .bind(this)
  23285. }
  23286. n = function() {
  23287. this.flying = !1
  23288. }
  23289. .bind(this),
  23290. this.flying = !0,
  23291. t()
  23292. }
  23293. }
  23294. ,
  23295. n.prototype.changeFloor = function(e) {
  23296. if (!this.is360View(this.mode, this.currentPano))
  23297. if (this.mode === u.PANORAMA) {
  23298. var t = this.history.reversePano(e);
  23299. t && t.isAligned() ? this.flyToPano({
  23300. pano: t
  23301. }) : this.changeFloorByScore(e)
  23302. } else
  23303. this.model.setFloor(this.model.nextFloor(e) || this.model.currentFloor)
  23304. }
  23305. ,
  23306. n.prototype.changeFloorByScore = function() {
  23307. var e = {
  23308. pano: null,
  23309. candidates: []
  23310. };
  23311. return function(t) {
  23312. var i = this.model.nextFloor(t);
  23313. 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),
  23314. void (e.pano ? (this.cachedPanoCandidates = e.candidates,
  23315. this.history.push(t, this.currentPano),
  23316. this.flyToPano({
  23317. pano: e.pano
  23318. })) : F.warn("No pano found on selected floor, not moving there."))) : void F.debug("player.changeFloor(" + t + "): no such floor")
  23319. }
  23320. }(),
  23321. n.prototype.gotoFloor = function(e) {
  23322. var t = e - this.model.currentFloor.floorIndex;
  23323. this.changeFloor(t)
  23324. }
  23325. ,
  23326. n.prototype.getDirection = function(e) {
  23327. return e = e ? e : (new r.Vector3).copy(d.FORWARD),
  23328. e.applyQuaternion(this.camera.quaternion)
  23329. }
  23330. ,
  23331. n.prototype.flyToSameMode = function(e, t, i, n, o) {
  23332. if (o = o || $.Deferred(),
  23333. this.mode === u.TRANSITIONING)
  23334. return F.warn("should not be transitioning here"),
  23335. n && n(!1),
  23336. o.reject().promise();
  23337. var a = i || !1
  23338. , s = i ? i.position : this.position
  23339. , l = this.position.clone()
  23340. , c = this.currentPano;
  23341. if (F.debug("New pose in mode " + this.mode),
  23342. !e || (retryCallback = function() {
  23343. N.delayOneFrame(function() {
  23344. this.flyToSameMode(e, t, i, n, o)
  23345. }
  23346. .bind(this))
  23347. }
  23348. .bind(this),
  23349. !this.checkAndWaitForPanoLoad(e, "high", "low", this.basePanoSize, retryCallback))) {
  23350. var h = function() {
  23351. this.emit(w.FlyingEnded, s, l, e, c),
  23352. n && n(!0)
  23353. }
  23354. .bind(this)
  23355. , d = f[this.mode]
  23356. , p = void 0 !== t ? t : d.transitionTime
  23357. , g = new r.Vector3
  23358. , C = new r.Vector3;
  23359. if (this.emit(w.FlyingStarted, s, l, e, c),
  23360. this.mode === u.PANORAMA)
  23361. F.warn("we should not be here for panorama views");
  23362. else if (this.mode === u.DOLLHOUSE)
  23363. if (a) {
  23364. var I = new r.Vector3(0,1,0);
  23365. this.cameraControls.controls[u.DOLLHOUSE].resetRanges(1, !0),
  23366. this.model.warpDestFloors(i.floorVisibility),
  23367. C.copy(i.position);
  23368. var E = new r.Vector3(0,0,-1).applyQuaternion(i.quaternion)
  23369. , b = new r.Raycaster(C.clone(),E.clone(),0,1 / 0)
  23370. , _ = b.intersectObjects(this.model.colliders)
  23371. , T = 3;
  23372. _.length ? (g.copy(_[0].point),
  23373. T = .75 * C.distanceTo(g)) : (g.copy(E).multiplyScalar(3).add(C),
  23374. F.debug("Tried to restore dollhouse mode that did not intersect...", i.position, i.quaternion));
  23375. var x = (new r.Matrix4).lookAt(C, g, I)
  23376. , S = (new r.Euler).setFromRotationMatrix(x, f.warp.eOrder)
  23377. , M = g.distanceTo(C)
  23378. , R = (new r.Matrix4).lookAt(this.cameraControls.cameras[u.DOLLHOUSE].position, this.cameraControls.controls[u.DOLLHOUSE].target, I)
  23379. , P = (new r.Euler).setFromRotationMatrix(R, f.warp.eOrder)
  23380. , O = this.cameraControls.cameras[u.DOLLHOUSE].position.distanceTo(this.cameraControls.controls[u.DOLLHOUSE].target);
  23381. this.cameraControls.controls[u.DOLLHOUSE].resetRanges(Math.min(O, T), !0);
  23382. var L = new r.Euler(S.x - P.x,S.y - P.y,S.z - P.z,f.warp.eOrder);
  23383. L.y = L.y > Math.PI ? L.y -= 2 * Math.PI : L.y < -Math.PI ? L.y += 2 * Math.PI : L.y,
  23384. this.path.burnsDir = Math.sign(L.y);
  23385. var D = new r.Euler(0,0,0,f.warp.eOrder)
  23386. , B = new r.Vector3;
  23387. y.start(v.vector(this.cameraControls.controls[u.DOLLHOUSE].target, g), p, null, f.flydown.movementDelay, A[f.flydown.movementEasing], null, V.FlyToSameMode),
  23388. y.start(function(e, t) {
  23389. D.x = P.x + e * L.x,
  23390. D.y = P.y + e * L.y,
  23391. D.z = P.z + e * L.z;
  23392. var i = O + e * (M - O);
  23393. B.set(0, 0, i).applyEuler(D).add(this.cameraControls.controls[u.DOLLHOUSE].target),
  23394. this.cameraControls.cameras[u.DOLLHOUSE].position.copy(B).add(this.model.position)
  23395. }
  23396. .bind(this), p, null, f.flydown.movementDelay, A[f.flydown.movementEasing], null, V.FlyToSameMode),
  23397. y.start(function(e, t) {
  23398. this.cameraControls.controls[u.DOLLHOUSE].update(),
  23399. this.quaternion.copy(this.cameraControls.cameras[u.DOLLHOUSE].quaternion),
  23400. this.position.copy(this.cameraControls.cameras[u.DOLLHOUSE].position)
  23401. }
  23402. .bind(this), p, null, f.flydown.movementDelay, A[f.flydown.movementEasing], null, V.FlyToSameMode)
  23403. } else
  23404. F.warn("invalid warp destination in flyToSameMode()? ignore it then");
  23405. else if (this.path.placeCpm(),
  23406. this.path.fadeInCpm(f.path.fadeInTime),
  23407. i) {
  23408. this.model.warpDestFloors(i.floorVisibility);
  23409. var U = this.cameraControls.cameras[u.FLOORPLAN]
  23410. , k = this.cameraControls.controls[u.FLOORPLAN]
  23411. , H = k.target.clone()
  23412. , G = i.position.clone().sub(H)
  23413. , z = U.position.clone().sub(k.target)
  23414. , W = z.length()
  23415. , j = new r.Vector3(-1,0,0).applyQuaternion(i.quaternion).normalize()
  23416. , Y = Math.atan2(k.offset.x, k.offset.z)
  23417. , X = Math.atan2(j.x, j.z)
  23418. , Z = k.absoluteScale
  23419. , q = m.convertWorkshopOrthoZoom(i.orthoZoom);
  23420. y.start(function(e, t) {
  23421. k.target.copy(G).multiplyScalar(e).add(H);
  23422. var i = Y + (X - Y) * e;
  23423. k.offset.x = W * Math.sin(i),
  23424. k.offset.z = W * Math.cos(i),
  23425. U.position.copy(k.target).add(k.offset),
  23426. k.absoluteScale = Z + e * (q - Z),
  23427. k.update(),
  23428. this.quaternion.copy(U.quaternion),
  23429. this.position.copy(U.position),
  23430. this.target.copy(k.target),
  23431. this.camera.projectionMatrix.copy(U.projectionMatrix)
  23432. }
  23433. .bind(this), p, null, 0, A[f.flydown.movementEasing], null, V.FlyToSameMode)
  23434. } else
  23435. F.info("flyToSameMode() funny floorplan view? skipping");
  23436. return y.setTimeout(function(e) {
  23437. this.mode = e,
  23438. h(),
  23439. o.resolve(!0)
  23440. }
  23441. .bind(this, this.mode), p, V.FlyToSameMode),
  23442. this.mode = u.TRANSITIONING,
  23443. o.promise()
  23444. }
  23445. }
  23446. ,
  23447. n.prototype.flyToNewMode = function(e, t) {
  23448. Hot.closePopup();//xzw add
  23449. e = e || {};
  23450. var i = e.mode
  23451. , n = e.pano
  23452. , o = e.duration
  23453. , a = e.warpDest
  23454. , s = e.callback
  23455. , l = e.force
  23456. , c = e.quaternion;
  23457. if (t = t || $.Deferred(),
  23458. this.isWarping())
  23459. return F.warn("Player.flyToNewMode() -> Cannot fly when warping"),
  23460. s && s(!1),
  23461. t.reject("Cannot change mode during tour transition").promise();
  23462. if (this.mode === u.TRANSITIONING)
  23463. return s && s(!1),
  23464. t.reject("Cannot change mode during mode transition").promise();
  23465. if (i === this.mode)
  23466. return l ? (this.flyToSameMode(n, o, a, s).done(t.resolve.bind(t)).fail(t.reject.bind(t)),
  23467. t.promise()) : (s && s(!1),
  23468. t.reject("Already in " + i + " mode").promise());
  23469. var h = a || !1;
  23470. F.debug("Switching mode to " + i);
  23471. if (window.vrEnabled && i != 'panorama'){
  23472. return s && s(!1), t.reject("vr不允许飞出").promise();
  23473. }
  23474. var d = function() {
  23475. N.delayOneFrame(function() {
  23476. this.flyToNewMode(e, t)
  23477. }
  23478. .bind(this))
  23479. }
  23480. .bind(this);
  23481. if (n && this.checkAndWaitForPanoLoad(n, "low", "low", this.basePanoSize, d))
  23482. return t.promise();
  23483. if (!this.model.meshTexturesLoaded && this.isOutsideMode(i))
  23484. return F.info("Waiting for model textures to be loaded before going out to dollhouse"),
  23485. this.model.waitForLoad(this.model, function() {
  23486. return this.model.meshTexturesLoaded;
  23487. }
  23488. .bind(this)),
  23489. this.model.loadMeshTextures().done(d),
  23490. t.promise();
  23491. this.history.invalidate(),
  23492. this.updateLastView();
  23493. var p = this.mode
  23494. , C = this.cameraControls.cameras[i];
  23495. e = g.deepExtend({}, f[i], f[p + "-" + i]);
  23496. var I = void 0 !== o ? o : e.transitionTime;
  23497. this.emit(w.ModeChanging, p, i, n, I),
  23498. n && (this.currentPano = n),
  23499. this.switchCameraMode(i, c),
  23500. y.cancelById(V.LookTransition);
  23501. //before fly---------------------
  23502. this.modeTran = p + "-" + i; //add
  23503. if(this.mode == "panorama"){
  23504. if(this.model.floorLogos){
  23505. this.model.floorLogos[0].visible = false;
  23506. this.model.floorLogos[1].visible = false;
  23507. }
  23508. }
  23509. if(i == "panorama"){
  23510. this.transitionPos({type:"beforeFlyIn", pano:n, dur:I})//add
  23511. }else{
  23512. this.transitionPos({type:"beforeFlyOut", dur:I/2})//add
  23513. }
  23514. window.bus.dispatchEvent({type:'playerAndModelReady'})
  23515. this.ready = true
  23516. //------------------------------------
  23517. var beginTran = ()=>{
  23518. var _ = (new r.Vector3).copy(this.position);
  23519. if (i === u.PANORAMA){
  23520. this.emit(w.PanoChosen, n, n),
  23521. setTimeout(function() {
  23522. n.floor.enter(i)
  23523. }
  23524. .bind(this), I / 2),
  23525. this.path.fadeOutCpm(f.path.fadeOutTime);
  23526. if(this.model.floorLogos){
  23527. this.model.floorLogos[0].position.copy(n.floorPosition.clone().sub(this.model.position));//改
  23528. this.model.floorLogos[1].position.copy(this.model.floorLogos[0].position);//for floorIcon position
  23529. }
  23530. }else if (i === u.DOLLHOUSE) {
  23531. if (h && (this.model.stayPut = !0),
  23532. a ? (this.cameraControls.controls[u.DOLLHOUSE].resetRanges(1, !0),
  23533. this.model.warpDestFloors(a.floorVisibility)) : this.model.toggleAllFloors(!0),
  23534. this.path.placeCpm(),
  23535. this.path.fadeInCpm(f.path.fadeInTime),
  23536. h) {
  23537. var T = new r.Vector3(this.model.center.x,0,this.model.center.z);
  23538. _.set(15, 10, 15);
  23539. var M = new r.Vector3(0,0,-1).applyQuaternion(a.quaternion)
  23540. , R = new r.Raycaster(a.position.clone(),M.clone(),0,1 / 0)
  23541. , P = R.intersectObjects([this.sceneIntersectionPlane]);
  23542. P.length ? (T.copy(P[0].point),
  23543. _.copy(a.position),
  23544. 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),
  23545. this.cameraControls.controls[u.DOLLHOUSE].resetRanges(3, !0)),
  23546. this.cameraControls.controls[u.DOLLHOUSE].target.copy(T),
  23547. _.add(this.model.position),
  23548. C.position.copy(_),
  23549. this.cameraControls.controls[u.DOLLHOUSE].update()
  23550. }
  23551. } else if (this.path.placeCpm(),
  23552. this.path.fadeInCpm(f.path.fadeInTime),
  23553. a) {
  23554. this.model.warpDestFloors(a.floorVisibility);
  23555. var O = this.cameraControls.cameras[u.FLOORPLAN]
  23556. , L = this.cameraControls.controls[u.FLOORPLAN]
  23557. , D = O.position.clone().sub(L.target)
  23558. , B = new r.Vector3(-1,0,0).applyQuaternion(a.quaternion).normalize()
  23559. , U = Math.atan2(B.x, B.z);
  23560. L.target.copy(a.position);
  23561. var k = D.length();
  23562. L.offset.x = k * Math.sin(U),
  23563. L.offset.y = 0,
  23564. L.offset.z = k * Math.cos(U),
  23565. O.position.copy(L.target).add(L.offset);
  23566. L.target.clone().sub(C.position);
  23567. C.quaternion.copy(a.quaternion),
  23568. L.currentScale = m.convertWorkshopOrthoZoom(a.orthoZoom),
  23569. L.absoluteScale = L.currentScale,
  23570. L.update()
  23571. } else
  23572. this.model.currentFloor.enter(i);
  23573. var H = this.currentPano
  23574. , G = this.position.clone();
  23575. this.emit(w.FlyingStarted, _, G, n, this.currentPano),
  23576. this.flying = !0,
  23577. this.isOutsideMode(i) && this.is360View(p, H) ? (h || i !== u.DOLLHOUSE || (C.position.set(15, 10, 15),
  23578. C.controls.target.set(this.model.center.x, 0, this.model.center.z),
  23579. C.controls.update()),
  23580. e.blackoutStyle = S.FADEIN,
  23581. I = f.show360Views.transitionTime,
  23582. this.fade360View(I, C, e)) : this.isOutsideMode(p) && this.is360View(i, n) ? (h && this.switchCameraMode(i, h.quaternion),
  23583. this.mode = i,
  23584. this.path && this.path.popOutCpm(),
  23585. e.blackoutStyle = S.END,
  23586. I = f.show360Views.transitionTime,
  23587. this.fade360View(I, C, e)) : (y.start(v.property(this.model, "alpha", e.modelAlpha, null), I * e.modelAlphaLength, null, e.modelAlphaDelay, null, V.FlyToNewMode),
  23588. y.start(v.vector(this.position, C.position), I, null, f.flydown.movementDelay, A[f.flydown.movementEasing], null, V.FlyToNewMode),
  23589. y.start(v.quaternion(this.quaternion, C.quaternion), I * e.rotationDuration, null, e.rotationDelay, A[f.flydown.rotationEasing], null, V.FlyToNewMode),
  23590. y.start(v.matrix4(this.camera.projectionMatrix, C.projectionMatrix), I * e.cameraMatrixDuration, null, e.cameraMatrixDelay, e.cameraMatrixEase, null, V.FlyToNewMode),
  23591. y.start(v.uniform(this.model.skybox, "opacity", e.skyboxOpacity), I * e.skyboxOpacityLength, null, e.skyboxOpacityDelay, null, V.FlyToNewMode),
  23592. y.start(v.property(this.reticule.material.uniforms.opacity, "value", 0), I, null, V.FlyToNewMode)),
  23593. y.setTimeout(function() {
  23594. this.flying = !1,
  23595. p === u.PANORAMA && i !== u.PANORAMA ? this.currentPano.exit() : p !== u.PANORAMA && i === u.PANORAMA && (this.currentPano !== H && H.exit(),
  23596. this.currentPano.enter(),
  23597. this.path.placeCpm(),
  23598. this.path.fadeOutCpm(f.path.fadeOutTime),
  23599. this.spider.draw()),
  23600. p === u.DOLLHOUSE && this.cameraControls.controls[u.DOLLHOUSE].resetRanges(),
  23601. this.mode = i,
  23602. this.emit(w.FlyingEnded, _, G, this.currentPano, H)
  23603. //add:
  23604. this.updateMarkerVisi() ;
  23605. //(this.mode == u.PANORAMA) && this.updateHotVisible(),
  23606. this.mode == u.PANORAMA&&this.model.floorLogos&&(
  23607. this.model.changefloorLogoOpa({index:0, from:0, opa:1, dur: 150 }),//this.model.floorLogoShow(0,150);
  23608. this.model.floorLogos[0].visible = true
  23609. )
  23610. if (this.afterCModeFuc) {
  23611. //手动加的函数
  23612. var cf = this.afterCModeFuc;
  23613. this.afterCModeFuc = null;//因为可能在执行afterCModeFuc时需要再添加afterCModeFuc所以要置空的话提前
  23614. cf();
  23615. }
  23616. if(this.mode == u.PANORAMA){
  23617. Hot.updateVisibles([this.currentPano])
  23618. this.model.fadePanoMarkers()
  23619. }else{
  23620. Hot.updateVisibles(true)
  23621. this.model.hotGroup.children.forEach(overlay=>{
  23622. if(overlay.animateInfo){
  23623. GifTexDeal.start(overlay.animation)
  23624. }
  23625. })
  23626. }
  23627. h && p !== u.PANORAMA && i === u.PANORAMA ? this.startWarp(b.Retain, E.Retain, x.BLACK, null, null, s) : (s && s(),
  23628. t.resolve())
  23629. }
  23630. .bind(this), I, V.FlyToNewMode)
  23631. }
  23632. if( i == "panorama" && !this.model.supportsTiles && n.getSkyboxTexture().image[0].width > 1024){
  23633. setTimeout(()=>{
  23634. beginTran()
  23635. },16) //2048的非tile需要延迟到下一帧,因为需要时间载入贴图,否则掉帧
  23636. }else{
  23637. beginTran()
  23638. }
  23639. this.mode = u.TRANSITIONING
  23640. //p == "panorama" && this.updateHotVisible(),
  23641. return t.promise()
  23642. }
  23643. ,
  23644. n.prototype.fade360View = function(e, t, i) {
  23645. this.tagManager.hideShowTagsForBlackoutStyle(i.blackoutStyle, e),
  23646. $(this.domElement).fadeOut(.5 * e, function() {
  23647. this.model.skybox.material.uniforms.opacity.value = i.skyboxOpacity,
  23648. this.model.alpha = i.modelAlpha,
  23649. this.position.copy(t.position),
  23650. this.quaternion.copy(t.quaternion),
  23651. this.camera.projectionMatrix.copy(t.projectionMatrix),
  23652. $(this.domElement).fadeIn(.5 * e)
  23653. }
  23654. .bind(this))
  23655. }
  23656. ,
  23657. n.prototype.findDefaultViews = function() {
  23658. this.findDefaultView(this.lastInsideView, !0),
  23659. this.findDefaultView(this.last360View, !1)
  23660. }
  23661. ,
  23662. n.prototype.findDefaultView = function(e, t) {
  23663. var i, n = this.model.heroLocations, r = this.model.panos, o = n.findIndex(function(e) {
  23664. if (e.cameraMode !== u.PANORAMA)
  23665. return !1;
  23666. var i = r.get(e.panoId);
  23667. return i && i.isAligned() === t
  23668. });
  23669. o >= 0 ? (i = r.get(n[o].panoId),
  23670. e.update({
  23671. cameraMode: u.PANORAMA,
  23672. pano: i,
  23673. position: n[o].position,
  23674. quaternion: n[o].quaternion
  23675. })) : (o = r.list.findIndex(function(e) {
  23676. return e.isAligned() === t
  23677. }),
  23678. o >= 0 ? (i = r.list[o],
  23679. e.update({
  23680. cameraMode: u.PANORAMA,
  23681. pano: i,
  23682. position: i.position
  23683. })) : F.warn("There are no", t ? "inside" : "360º", "views in this model"))
  23684. }
  23685. ,
  23686. n.prototype.updateLastView = function() {
  23687. if (this.mode === u.PANORAMA) {
  23688. var e = this.currentPano.isAligned() ? this.lastInsideView : this.last360View;
  23689. e.update({
  23690. pano: this.currentPano,
  23691. position: this.position,
  23692. quaternion: this.quaternion
  23693. })
  23694. }
  23695. }
  23696. ,
  23697. n.prototype.goToLastView = function(e, t) {
  23698. var i = $.Deferred()
  23699. , n = i.resolve.bind(i)
  23700. , r = i.reject.bind(i)
  23701. , o = e ? this.lastInsideView : this.last360View;
  23702. return this.isInMode(u.PANORAMA) && this.currentPano.isAligned() !== e && this.updateLastView(),
  23703. this.isInMode(u.PANORAMA) ? (this.path && this.path.popOutCpm(),
  23704. this.fadeToView(e, o, f.show360Views.transitionTime, t).done(n).fail(r)) : this.isOutsideMode() && this.flyToNewMode({
  23705. mode: o.cameraMode,
  23706. pano: o.pano,
  23707. quaternion: o.quaternion,
  23708. callback: t
  23709. }).done(n).fail(r),
  23710. i.promise()
  23711. }
  23712. ,
  23713. n.prototype.fadeToView = function(e, t, i, n) {
  23714. var r = $.Deferred()
  23715. , o = r.resolve.bind(r)
  23716. , a = r.reject.bind(r);
  23717. if (!t.isValid() || t.cameraMode === u.PANORAMA && !t.pano)
  23718. return F.warn("Tried to fade to an illegal view", t.cameraMode),
  23719. a("Cannot go to illegal view"),
  23720. r.promise();
  23721. var s = (f[t.cameraMode],
  23722. function() {
  23723. $(this.domElement).fadeIn(.5 * i),
  23724. n && n(),
  23725. o()
  23726. }
  23727. .bind(this))
  23728. , l = e ? S.FADEIN : S.END;
  23729. return this.tagManager.hideShowTagsForBlackoutStyle(l, i),
  23730. $(this.domElement).fadeOut(.5 * i, function() {
  23731. this.model.fadePanoMarkers(e ? f.panorama.markerOpacity : 0),
  23732. t.cameraMode === u.PANORAMA ? this.flyToPano({
  23733. pano: t.pano,
  23734. lookAtPoint: d.FORWARD.clone().applyQuaternion(t.quaternion).add(t.pano.position),
  23735. duration: 0
  23736. }, s) : this.flyToNewMode({
  23737. mode: t.cameraMode,
  23738. quaternion: t.quaternion,
  23739. duration: 0,
  23740. callback: s
  23741. })
  23742. }
  23743. .bind(this)),
  23744. r.promise()
  23745. }
  23746. ,
  23747. n.prototype.startWarp = function(e, t, i, n, r, o) {
  23748. if (this.cameraControls.activeControl && (this.cameraControls.activeControl.enabled = !1),
  23749. this.flying)
  23750. return F.warn("Player.startWarp() -> Cannot warp when flying"),
  23751. o && o(),
  23752. !1;
  23753. null !== e && void 0 !== e || (e = b.Show),
  23754. this.history.invalidate()
  23755. e !== b.Retain ? this.path.brushToWarpPano(i, x.BLACK) || (i = x.BLACK) : i = this.path.upcomingTransType;
  23756. var a = this.path.warpDestPano && !this.path.warpDestPano.isAligned();
  23757. return this.emit(w.WarpStarted, a, i, n, r),
  23758. n = n || S.MIDDLE,
  23759. this.path.warpToPano(i, n, r, function() {
  23760. t === E.Slow ? this.path.discardSlow() : t === E.Standard && this.path.discardPathObject(),
  23761. this.emit(w.WarpEnded, i),
  23762. this.cameraControls.activeControl && (this.cameraControls.activeControl.enabled = !0),
  23763. o && o()
  23764. }
  23765. .bind(this)),
  23766. e === b.Hide && this.path.discardPathObject(),
  23767. !0
  23768. }
  23769. ,
  23770. n.prototype.warpToPanoById = function(e, t, i, n, r, o, a, s) {
  23771. return this.path.setWarpDestinationByPanoId(e, t) ? this.startWarp(i, n, r, o, a, s) : (F.warn("Player.warpToPanoById() -> Could not setWarpDestinationByPanoId()"),
  23772. s && s(),
  23773. !1)
  23774. }
  23775. ,
  23776. n.prototype.warpToPanoByHeroIndex = function(e, t, i, n, r, o, a) {
  23777. return this.path.setWarpDestinationByHeroIndex(e) ? this.startWarp(t, i, n, r, o, a) : (F.warn("Player.warpToPanoByHeroIndex() -> Could not setWarpDestinationByHeroIndex()"),
  23778. a && a(),
  23779. !1)
  23780. }
  23781. ,
  23782. n.prototype.warpToPano = function(e, t, i, n, r, o, a, s) {
  23783. return this.warpToPanoById(e.id, t, i, n, r, o, a, s)
  23784. }
  23785. ,
  23786. n.prototype.warpToNonPanoByHeroIndex = function(e, t) {
  23787. return this.path.setWarpDestinationByHeroIndex(e) ? (this.path.warpToNonPano(t),
  23788. !0) : (F.warn("Player.warpToNonPanoByHeroIndex() -> Could not setWarpDestinationByHeroIndex()"),
  23789. t && t(),
  23790. !1)
  23791. }
  23792. ,
  23793. n.prototype.aimTourCamera = function(e, t, i, n) {
  23794. return F.debug("player.aimTourCamera(" + e + ") calling warpToPanoByHeroIndex(" + e + ")"),
  23795. this.warpToPanoByHeroIndex(e, t, i, null, null, null, n)
  23796. }
  23797. ,
  23798. n.prototype.showPathToHeroLocation = function(e) {
  23799. this.path.setWarpDestinationByHeroIndex(e) && this.path.brushToWarpPano(x.STD, x.BLACK)
  23800. }
  23801. ,
  23802. n.prototype.tourInterlude = function(e, t) {
  23803. //return //xzw add
  23804. this.history.invalidate();
  23805. this.path.discardSlow();
  23806. //xzw:
  23807. var defaultRotTime = DATA.tourRotTime * 1000
  23808. var timeEachItem = 2e3 / (DATA.tourWalkSpeed + DATA.tourBlackSpeed) * 200 //预估时间假设每个item飞的时间(如果距离远就少了)
  23809. var currentLocation = this.model.getHeroDescriptorByIndex(this.director.currentItem)
  23810. var currentLocation0 = this.model.heroLocations[this.director.currentItem[0]]
  23811. //zeg 标注一下
  23812. //var currentLocation = this.model.heroLocations[this.director.currentItem[0]]
  23813. var rotTime
  23814. if(currentLocation.rotTime == void 0 || currentLocation.rotTime == ''){
  23815. var restChildCount = currentLocation0.heroLocations ? (currentLocation0.heroLocations.length-this.director.currentItem[1]-1) : 0
  23816. var hasMusic = currentLocation0 && currentLocation0.musicInfo.music
  23817. if(hasMusic){
  23818. var audioObj = SoundManager.list.find(e=>e.name == 'tour')
  23819. var current = audioObj.audio.currentTime * 1e3 // || 0 //g_tourAudio ? 1e3 * g_tourAudio.currentTime : 0
  23820. rotTime = currentLocation0.musicInfo.time - current
  23821. if(restChildCount){//如果当前folder中还有剩下的item,平分一下时间
  23822. rotTime = (rotTime-timeEachItem*restChildCount) / (restChildCount+1);
  23823. }
  23824. }else{
  23825. rotTime = defaultRotTime
  23826. }
  23827. rotTime = Math.max(0, rotTime)
  23828. Log("rotTime "+rotTime +" at item "+this.director.currentItem + (hasMusic ? (",musicCurrentTime:"+current+'音乐总长:'+currentLocation0.musicInfo.time) : ''),"#E8E")
  23829. }else{
  23830. rotTime = currentLocation.rotTime * 1000
  23831. Log("rotTime "+rotTime +" at item "+this.director.currentItem,"#E8E")
  23832. }
  23833. this.path.waitNextStep(e, function() {
  23834. t && t()
  23835. }.bind(this), rotTime)
  23836. }
  23837. ,
  23838. n.prototype.stopInterlude = function() {
  23839. this.interruptAndFastForward(null, 0)
  23840. }
  23841. ,
  23842. n.prototype.interruptAndFastForward = function(e, t) {
  23843. //Log('interruptAndFastForward' , '#f00')
  23844. this.isWarping() && this.emit(w.WarpInterrupted, this.path.activeTransType, e, t),
  23845. this.flying && this.emit(w.FlyingInterrupted),
  23846. this.path.interruptAndFastForward(e, t)
  23847. }
  23848. ,
  23849. n.prototype.setSize = function(e, t) {
  23850. var i = e / t;
  23851. this.baseFov = B.clampVFOV(f.insideFOV, f.insideFOVMax, e, t);
  23852. var n = B.getHFOVFromVFOV(f.insideFOV, e, t);
  23853. n > f.insideFOVMax ? this.baseFov = B.getVFOVFromHFOV(f.insideFOVMax, e, t) : this.baseFov = f.insideFOV;
  23854. for (var r in this.cameraControls.cameras) {
  23855. var o = this.cameraControls.cameras[r];
  23856. o.fov = this.baseFov * (1 / this.zoomLevel),
  23857. o.updateAspect(i)
  23858. }
  23859. }
  23860. ,
  23861. n.prototype.toJSON = function() {
  23862. var e = {};
  23863. return this.cameraControls.activeControl ? (e = this.cameraControls.activeControl.toJSON(),
  23864. e.camera_mode = u.toInt(this.mode),
  23865. this.isOutsideMode() ? this.model.allFloorsVisible ? e.floor_visibility = [] : e.floor_visibility = this.model.floors.list.map(function(e) {
  23866. return e.hidden ? 0 : 1
  23867. }) : u.PANORAMA && (e.scan_id = this.currentPano.id),
  23868. e) : e
  23869. }
  23870. ,
  23871. n.prototype.getCurrentNodePanos = function(e) {
  23872. this.model.panos.map;
  23873. if (e.length = 0, this.path.nodes){
  23874. var momentTour = this.director.getMomentTour(this.director.destinationItem)
  23875. if(momentTour == 'black'){ //改 upcomingPanos如果是black的只需要起点和终点
  23876. if(this.path.nodes.length){
  23877. e.push(this.model.panos.get(this.path.nodes[0]))
  23878. }
  23879. if(this.path.nodes.length>1){
  23880. e.push(this.model.panos.get(this.path.nodes[this.path.nodes.length-1]))
  23881. }
  23882. }else{
  23883. for (var t = 0; t < this.path.nodes.length; t++) {
  23884. var i = this.path.nodes[t];
  23885. e.push(this.model.panos.get(i))
  23886. }
  23887. }
  23888. }
  23889. }
  23890. ,
  23891. n.prototype.zoomIncrementally = function(e) {
  23892. var t = this.zoomLevel;
  23893. this.zoomTo(this.zoomLevel + e),
  23894. t !== this.zoomLevel && this.currentPano && this.zoomStats.addZoomAction(t, this.zoomLevel, this.currentPano.id)
  23895. }
  23896. ,
  23897. n.prototype.zoomInIncrementally = function(e) {
  23898. e = e || this.defaultZoomIncrement,
  23899. this.zoomIncrementally(e)
  23900. }
  23901. ,
  23902. n.prototype.zoomOutIncrementally = function(e) {
  23903. e = e || -this.defaultZoomIncrement,
  23904. this.zoomIncrementally(e)
  23905. }
  23906. ,
  23907. n.prototype.zoomBy = function(e) {
  23908. this.zoomTo(this.zoomLevel * e)
  23909. }
  23910. ,
  23911. n.prototype.zoomIn = function() {
  23912. this.zoomBy(1 + this.zoomSpeed)
  23913. }
  23914. ,
  23915. n.prototype.zoomOut = function() {
  23916. this.zoomBy(1 - this.zoomSpeed)
  23917. }
  23918. ,
  23919. n.prototype.zoomTo = function(e, t) {
  23920. if (t || f.zoom.enabled && this.mode === u.PANORAMA && this.zoomEnabled) {
  23921. if (e < f.zoom.min && (e = f.zoom.min),
  23922. e > f.zoom.max && (e = f.zoom.max),
  23923. e > this.zoomLevel ? (this.emit(O.ZoomIn),
  23924. e === f.zoom.max && this.emit(O.ZoomMax)) : e < this.zoomLevel && (this.emit(O.ZoomOut),
  23925. e === f.zoom.min && this.emit(O.ZoomMin)),
  23926. this.cameraControls.activeControl) {
  23927. var i = this.cameraControls.activeControl.camera;
  23928. this.zoomLevel = e,
  23929. i.fov = this.baseFov * (1 / this.zoomLevel),
  23930. i.updateProjectionMatrix(),
  23931. this.zoomFov = i.fov
  23932. }
  23933. }
  23934. }
  23935. ,
  23936. n.prototype.increaseZoomSpeed = function() {
  23937. this.zoomSpeed = this.clampZoomSpeed(this.zoomSpeed + this.zoomSpeedAdjust)
  23938. }
  23939. ,
  23940. n.prototype.decreaseZoomSpeed = function() {
  23941. this.zoomSpeed = this.clampZoomSpeed(this.zoomSpeed - this.zoomSpeedAdjust)
  23942. }
  23943. ,
  23944. n.prototype.clampZoomSpeed = function(e) {
  23945. return e < 0 ? 0 : e
  23946. }
  23947. ,
  23948. n.prototype.activatePersistentZooming = function(e) {
  23949. this.zooming = e ? 1 : -1
  23950. }
  23951. ,
  23952. n.prototype.deactivatePersistentZooming = function() {
  23953. this.zooming = 0
  23954. }
  23955. ,
  23956. n.prototype.zoomDefault = function() {
  23957. this.zoomTo(1, !0)
  23958. }
  23959. ,
  23960. window.fovTranId = 333;//add
  23961. n.prototype.smoothZoomToDefault = function(e, t) {
  23962. y.cancelById(window.fovTranId)
  23963. var i, n = this.zoomLevel,
  23964. r = function(e) {
  23965. e > 1 && (e = 1),
  23966. i = n * (1 - e) + e,
  23967. this.zoomTo(i, !0)
  23968. }.bind(this),
  23969. o = function() {
  23970. this.zoomDefault(),
  23971. t && window.setTimeout(t, 50)
  23972. }.bind(this);
  23973. y.start(r, e, o, null, 0, A[f.transition.blendEasing], null, window.fovTranId)
  23974. }
  23975. n.prototype.smoothZoomFovTo = function (fov, zoomLevel, dur, callback) {//add
  23976. y.cancelById(window.fovTranId)
  23977. console.log("smoothZoomFovTo "+zoomLevel)
  23978. var i,
  23979. n = this.zoomLevel,
  23980. aimLevel = zoomLevel || this.baseFov / fov
  23981. if (n == aimLevel) return
  23982. var fun = function (e) {
  23983. e > 1 && (e = 1), (i = n * (1 - e) + e * aimLevel),
  23984. this.zoomTo(i, !0)
  23985. }.bind(this)
  23986. y.start(fun, dur, callback, null, 0, A[f.transition.blendEasing], null, window.fovTranId)
  23987. }
  23988. n.prototype.updateZoomPano = function() {
  23989. if (!this.panoRenderer.zoomPanoRenderingDisabled && this.mode === u.PANORAMA && this.currentPano) {
  23990. let navTileClass = this.qualityManager.getNavZoomClass()
  23991. let tileClass = this.qualityManager.getMaxZoomClass()
  23992. if(navTileClass == '4k'){
  23993. var r = true
  23994. }else{
  23995. var levelThreshold1 = navTileClass == '1k' ? 1.1 : 1.5 , levelThreshold2 = 1.8 //levelThreshold2不能比zoom.max大也就是不能超过2,否则zoom.max将无法提升到3
  23996. var t = this.zoomLevel > levelThreshold1
  23997. , i = this.flying && this.nextPano && this.nextPano !== this.currentPano
  23998. , n = !i && !this.isWarping()
  23999. , r = t //&& n ; // 允许flying状态下加载4K图
  24000. }
  24001. this.tileDownloader.tilePrioritizer.setZoomingActive(r),
  24002. this.panoRenderer.setZoomingActive(r, this.currentPano, !0);
  24003. var o = function(pano, ifZoom) {
  24004. this.panoRenderer.resetRenderStatus(pano.id, !1, !0, this.qualityManager.getMaxNavPanoSize()),
  24005. this.panoRenderer.clearAllQueuedUploadsForPano(pano.id),
  24006. this.panoRenderer.renderPanoTiles(pano.id, null, !1, !1),
  24007. pano.setZoomed(ifZoom)
  24008. }.bind(this);
  24009. if(navTileClass == '4k'){
  24010. if (!this.currentPano.zoomed) {
  24011. o(this.currentPano, !0);
  24012. this.panoRenderer.enableUltraHighQualityMode(function() {//开启4k getMaxZoomPanoSize
  24013. this.qualityManager.useUltraHighResolutionPanos && (f.zoom.max = D.ultraHighQualityMaxZoom);
  24014. o(this.currentPano, !0)
  24015. }
  24016. .bind(this));
  24017. }
  24018. }else{
  24019. let zoomLevelRes = this.qualityManager.zoomLevelResolution
  24020. if (r && (!this.currentPano.zoomed || zoomLevelRes && zoomLevelRes != '4k')) {//needZoom
  24021. this.currentPano.zoomed || o(this.currentPano, !0);
  24022. if(navTileClass == '1k' && tileClass != '1k' && this.zoomLevel < levelThreshold2){
  24023. this.panoRenderer.enableHighQuality( function() {//开启2k
  24024. if(tileClass != '4k'){
  24025. o(this.currentPano, !0);
  24026. }
  24027. }.bind(this));
  24028. }else{
  24029. this.panoRenderer.enableUltraHighQualityMode(function() {//开启4k getMaxZoomPanoSize
  24030. this.qualityManager.useUltraHighResolutionPanos && !f.zoom.overridemax && (f.zoom.max = D.ultraHighQualityMaxZoom)
  24031. o(this.currentPano, !0)
  24032. }.bind(this));
  24033. }
  24034. } else {
  24035. !t && this.currentPano.zoomed && o(this.currentPano, !1);
  24036. }
  24037. //有三个级别的话,需要标记zoomLevelResolution,以便更新maxZoomPanoSize判断能下载的最高级别
  24038. if(r && navTileClass == '1k' && tileClass == '4k' ){ //目前只有手机端navTileClass == '1k'
  24039. var change = (zoomedFlag)=>{
  24040. this.qualityManager.updateMaximums()//更新maxZoomPanoSize
  24041. this.panoRenderer.setupZoomRenderTarget() //更新renderTarget
  24042. //this.currentPano.setZoomed(t);//更新uniforms贴图
  24043. if(this.qualityManager.zoomLevelResolution == '4k'){
  24044. this.model.showHighMap()
  24045. }else{
  24046. this.model.hideHighMap()
  24047. }
  24048. }
  24049. this.qualityManager.zoomLevelResolution = this.zoomLevel >= levelThreshold2 ? '4k' : this.zoomLevel > levelThreshold1? '2k' : '1k'
  24050. if(this.oldZoomLevel < levelThreshold2 && this.zoomLevel >= levelThreshold2){//1k/2k-4k
  24051. change()
  24052. o(this.currentPano, t)
  24053. }else if(this.oldZoomLevel <= levelThreshold1 && this.zoomLevel > levelThreshold1){//1k-2k
  24054. change()
  24055. }else if(this.oldZoomLevel > levelThreshold2 && this.zoomLevel <= levelThreshold2){//4k-2k/1k
  24056. change()
  24057. o(this.currentPano, t)
  24058. }else if(this.oldZoomLevel > levelThreshold1 && this.zoomLevel <= levelThreshold1){//2k-1k
  24059. change()
  24060. }
  24061. this.oldZoomLevel = this.zoomLevel
  24062. }
  24063. }
  24064. }
  24065. }
  24066. n.prototype.checkHasNeighbor = function(pano){//add
  24067. for(var i in pano.neighbourPanos ){
  24068. if(i == pano.id)continue;
  24069. if(pano.neighbourPanos[i]){
  24070. return true;
  24071. }
  24072. }
  24073. }
  24074. ,
  24075. t.exports = n
  24076. }
  24077. ).call(this, "/js/player.js")
  24078. }
  24079. , {
  24080. "./constants": 8,
  24081. "./enum/AlignmentType": 17,
  24082. "./enum/BlackoutStyle": 18,
  24083. "./enum/ControlEvents": 21,
  24084. "./enum/Keys": 30,
  24085. "./enum/ModelManagerEvents": 33,
  24086. "./enum/PanoSizeClass": 36,
  24087. "./enum/PanoramaEvents": 37,
  24088. "./enum/PathDiscardMode": 38,
  24089. "./enum/PathDisplayMode": 39,
  24090. "./enum/PlayerEvents": 40,
  24091. "./enum/TagStates": 44,
  24092. "./enum/Vectors": 50,
  24093. "./enum/Viewmode": 51,
  24094. "./enum/WarpStyle": 52,
  24095. "./enum/ZoomEvents": 53,
  24096. "./exception/BasicException": 55,
  24097. "./model/ModelManager": 140,
  24098. "./objects/NSpider": 147,
  24099. "./objects/Panorama": 148,
  24100. "./objects/Reticule": 149,
  24101. "./objects/ShowPath": 151,
  24102. "./objects/Snapshot": 153,
  24103. "./objects/View": 154,
  24104. "./settings": 166,
  24105. "./shaders": 167,
  24106. "./tile/TileDownloader": 171,
  24107. "./tile/TilePrioritizer": 172,
  24108. "./util/ZoomStats": 179,
  24109. "./util/browser": 182,
  24110. "./util/camera": 183,
  24111. "./util/cameraLight": 184,
  24112. "./util/common": 185,
  24113. "./util/easing": 186,
  24114. "./util/history": 187,
  24115. "./util/lerp": 188,
  24116. "./util/logger": 189,
  24117. "./util/math": 190,
  24118. "./util/transitions": 195,
  24119. "hot":"hot",
  24120. "scaleImg":"scaleImg",
  24121. events: 202,
  24122. three: 217
  24123. }],
  24124. "scaleImg":[function(t, e){// xzw
  24125. var OUTPUT = e;
  24126. (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")}
  24127. function n(t){if(t){var e,a=G.getImageData(0,0,s,f),i=a.data;for(e=0;at>e;e+=4)
  24128. 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}
  24129. return G.getImageData(0,0,s,f)}
  24130. 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}
  24131. a||(a=t.input,i=t.output,r=t.inputRemovable,t.scale&&(t=t.scale));var u,d;if(a.src)
  24132. if(u=document.createElement("canvas"),null!=a.naturalWidth)
  24133. 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}
  24134. else
  24135. 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)
  24136. 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)
  24137. for(h(),J=n(),K=J.data,x=0;f>x;x++)
  24138. 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)
  24139. 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)
  24140. W=new Float32Array(at);else
  24141. for(W=[],et=0;at>et;++et)
  24142. W[et]=0;for(b=0;w>b;b++)
  24143. 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)
  24144. 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;}
  24145. delete p,h(),J=n(W)}
  24146. 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}
  24147. if("png-src"===i||"jpeg-src"===i)
  24148. return B.toDataURL("image/"+i.split("-")[0],0.85)}
  24149. return B}
  24150. var e=this;"undefined"!=typeof exports?("undefined"!=typeof module&&module.exports&&(exports=module.exports=t),exports.scale=t):c=t}).call(this);
  24151. OUTPUT.exports = c;
  24152. }, {}
  24153. ],
  24154. 156: [function(e, t, i) {
  24155. (function(i) {
  24156. "use strict";
  24157. function n(e, t) {
  24158. this.model = e,
  24159. this.panos = e.panos,
  24160. this.player = t,
  24161. this.imagePanos = this.listImagePanos(),
  24162. this.retryMinimumTime = 1e4
  24163. }
  24164. var r = (e("three"),
  24165. e("./enum/Viewmode"))
  24166. , o = (e("./settings"),
  24167. e("./objects/Panorama"))
  24168. , a = e("./util/logger")
  24169. , s = new a(i);
  24170. n.prototype.start = function() {
  24171. this.loadNextPano(function(e) {
  24172. e ? this.start() : (s.debug("No suitable pano loaded, waiting a little while before looking again"),
  24173. setTimeout(function() {
  24174. this.start()
  24175. }
  24176. .bind(this), 1e3))
  24177. }
  24178. .bind(this))
  24179. }
  24180. ,
  24181. n.prototype.validLoadTarget = function(e) {
  24182. return e && !e.isLoaded("high") && Date.now() - e.failedLoadingAt > this.retryMinimumTime
  24183. }
  24184. ,
  24185. n.prototype.listImagePanos = function() {
  24186. var e = []
  24187. , t = this;
  24188. return this.model.images.forEach(function(i) {
  24189. if (i.metadata && i.metadata.scan_id) {
  24190. var n = t.model.panos.get(i.metadata.scan_id);
  24191. n && !n.isLoaded("high") && e.push(n)
  24192. }
  24193. }),
  24194. e
  24195. }
  24196. ,
  24197. n.prototype.nextNotLoadedImage = function() {
  24198. for (; this.imagePanos.length > 0; ) {
  24199. var e = this.imagePanos[0];
  24200. if (!e.isLoaded("high"))
  24201. return e;
  24202. this.imagePanos.shift()
  24203. }
  24204. return null
  24205. }
  24206. ,
  24207. n.prototype.loadNextPano = function(e) {
  24208. var t, i, n = this.model.waitQueue.filter(function(e) {
  24209. return e.object instanceof o
  24210. });
  24211. n.length > 0 ? (t = n[0].object,
  24212. s.debug("Overrode pano selection: Flying to an unloaded pano " + t.id)) : this.validLoadTarget(this.player.currentPano) ? (t = this.player.currentPano,
  24213. s.debug("Overrode pano selection: Currently at an unloaded pano " + t.id)) : this.validLoadTarget(this.player.closestPano) ? (t = this.player.closestPano,
  24214. s.debug("Overrode pano selection: Hovering over an unloaded pano " + t.id)) : this.validLoadTarget(this.nextNotLoadedImage()) ? (i = "high",
  24215. t = this.imagePanos[0],
  24216. 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())]),
  24217. t && s.debug("Normal pano selection: neighbor " + t.id)),
  24218. t ? (i = i || t.isLoaded("low") ? "high" : "low",
  24219. s.debug("Preloading " + i + "-res pano " + t.id),
  24220. t.loadCube(i).done(e).fail(function() {
  24221. s.warn("Failed preloading pano", t.id, ", marking it as failed and forgetting it for a while"),
  24222. e()
  24223. })) : e && e(null)
  24224. }
  24225. ,
  24226. t.exports = n
  24227. }
  24228. ).call(this, "/js/preloaders.js")
  24229. }
  24230. , {
  24231. "./enum/Viewmode": 51,
  24232. "./objects/Panorama": 148,
  24233. "./settings": 166,
  24234. "./util/logger": 189,
  24235. three: 217
  24236. }],
  24237. 157: [function(e, t, i) {
  24238. (function(i) {
  24239. "use strict";
  24240. function n(e, t, i, n, r) {
  24241. this.qualityManager = e,
  24242. this.scene = t,
  24243. this.camera = i,
  24244. this.container = r,
  24245. this.controls = n,
  24246. this.controls.enabled = !0,
  24247. this.controls.locked = !0,
  24248. this.quickstartCamera = n.camera,
  24249. this.quickstartCamera.fov = h.clampVFOV(a.insideFOV, a.insideFOVMax, $("#player").width(), $("#player").height()),
  24250. this.skybox = null
  24251. }
  24252. var r = e("three")
  24253. , o = e("../util/logger")
  24254. , a = e("../constants")
  24255. , s = (e("../util/transitions"),
  24256. e("../util/lerp"),
  24257. e("../util/easing"),
  24258. e("../enum/Vectors"))
  24259. , l = e("../enum/PanoSizeClass")
  24260. , c = (e("../materials/ModelTextureMaterial"),
  24261. e("../materials/CubemapMaterial"))
  24262. , h = (e("../cameras/PanoramaCamera"),
  24263. e("../controls/PanoramaControls"),
  24264. e("../tile/TileUtils"),
  24265. e("../util/camera"),
  24266. e("../util/cameraLight"))
  24267. , u = (e("../util/browser"),
  24268. e("../settings"),
  24269. e("../gui/helpManager"),
  24270. new o(i));
  24271. n.prototype.load = function(e) {
  24272. e.pano.shouldRedrawOnBaseLoaded = !0;
  24273. var t, i, n = this, r = s.FORWARD.clone().applyQuaternion(e.quaternion), o = r.clone().negate();
  24274. this.controls.lookAt(r.add(this.quickstartCamera.position));
  24275. var a = this.qualityManager.getPanoSize(l.BASE)
  24276. , c = this.qualityManager.getPanoSize(l.STANDARD);
  24277. if (e.pano.tiled) {
  24278. u.warn("Loading startPano, TILED", e.pano.id);
  24279. var d = h.getHFOVForCamera(this.quickstartCamera, $("#player").width(), $("#player").height())
  24280. , p = this.quickstartCamera.fov;
  24281. u.warn("Quickstart loading tiles in frustum: [horizontal FOV: " + d + ", vertical FOV: " + p + "]"),
  24282. t = e.pano.loadTiledPano(c, r, {
  24283. hFov: d,
  24284. vFov: p
  24285. }, !1, !1, !0),
  24286. i = e.pano.loadTiledPano(a, o, null, !1, !1, !0)
  24287. } else
  24288. u.warn("Loading startPano", e.pano.id),
  24289. t = e.pano.loadCube("high");
  24290. return $.when(t).then(function() {
  24291. n.init(e.pano, e.quaternion),
  24292. e.pano.tiled ? i.done(function() {
  24293. e.pano.lockUntilRenderingComplete = !1,
  24294. this.controls.locked = !1
  24295. }
  24296. .bind(this)) : this.controls.locked = !1
  24297. }
  24298. .bind(this))
  24299. }
  24300. ,
  24301. n.prototype.init = function(e, t) {
  24302. u.info("Quickstart done loading, adding scene objects"),
  24303. e.lockUntilRenderingComplete = !0,
  24304. this.skybox = new r.Mesh(new r.CubeGeometry(1,1,1),new c({
  24305. side: r.BackSide
  24306. })),
  24307. this.skybox.material.uniforms.map.value = e.getSkyboxTexture(),
  24308. this.skybox.quaternion.copy(e.quaternion),
  24309. this.scene.add(this.skybox),
  24310. $(this.container).show()
  24311. }
  24312. ,
  24313. n.prototype.update = function(e) {
  24314. this.controls.update(e),
  24315. this.camera.copy(this.quickstartCamera)
  24316. }
  24317. ,
  24318. n.prototype.setSize = function(e, t) {
  24319. this.quickstartCamera.updateAspect(e / t)
  24320. }
  24321. ,
  24322. n.prototype.destroy = function() {
  24323. this.scene.remove(this.skybox)
  24324. }
  24325. ,
  24326. t.exports = n
  24327. }
  24328. ).call(this, "/js/scene/QuickstartManager.js")
  24329. }
  24330. , {
  24331. "../cameras/PanoramaCamera": 7,
  24332. "../constants": 8,
  24333. "../controls/PanoramaControls": 13,
  24334. "../enum/PanoSizeClass": 36,
  24335. "../enum/Vectors": 50,
  24336. "../gui/helpManager": 68,
  24337. "../materials/CubemapMaterial": 117,
  24338. "../materials/ModelTextureMaterial": 118,
  24339. "../settings": 166,
  24340. "../tile/TileUtils": 174,
  24341. "../util/browser": 182,
  24342. "../util/camera": 183,
  24343. "../util/cameraLight": 184,
  24344. "../util/easing": 186,
  24345. "../util/lerp": 188,
  24346. "../util/logger": 189,
  24347. "../util/transitions": 195,
  24348. three: 217
  24349. }],
  24350. 158: [function(e, t, i) {
  24351. "use strict";
  24352. function n(e, t, i) {
  24353. this.scene = e,
  24354. this.camera = t,
  24355. this.renderer = null,
  24356. this.effects = i,
  24357. this.animateCallback = null,
  24358. this.composer = null,
  24359. this.qualityManager = null,
  24360. e.renderWidth = 0,
  24361. e.renderHeight = 0,
  24362. this.updateClock = new r.Clock,
  24363. this.components = [],
  24364. this.updateListeners = [],
  24365. this.resizeListeners = [],
  24366. this.forceUpdateSize = !1,
  24367. this.started = !1,
  24368. this.textures = {},
  24369. this.suspendedObjects = []
  24370. }
  24371. var r = e("three")
  24372. , o = e("../shaders")
  24373. , a = e("../enum/SceneRendererEvents")
  24374. , s = e("../enum/GLTextureType")
  24375. , l = e("../enum/GLCubeFaces")
  24376. , c = e("../exception/BasicException")
  24377. , h = e("../exception/RendererCreationException")
  24378. /**********************************************************************fyz改 from徐世廷**********************************************************************/
  24379. , m = e("../util/browser")
  24380. /**************************************************************************************************************************************************/
  24381. , u = e("../settings")
  24382. , d = e("events").EventEmitter;
  24383. window.requestAnimationFrame = window.requestAnimationFrame || window.webkitRequestAnimationFrame,
  24384. n.prototype = Object.create(d.prototype),
  24385. n.prototype.addComponent = function(e) {
  24386. this.components.push(e),
  24387. e.update && this.updateListeners.push(e),
  24388. e.setSize && (this.resizeListeners.push(e),
  24389. this.forceUpdateSize = !0)
  24390. }
  24391. ,
  24392. n.prototype.removeComponent = function(e) {
  24393. var t = function(t) {
  24394. return t !== e
  24395. };
  24396. this.components = this.components.filter(t),
  24397. this.updateListeners = this.updateListeners.filter(t),
  24398. this.resizeListeners = this.resizeListeners.filter(t)
  24399. }
  24400. ,
  24401. n.prototype.start = function(e) {
  24402. if (this.started)
  24403. throw new c("Can't start SceneRenderer, already started");
  24404. this.createContext(e),
  24405. /***************************************************VR fyz改 from徐世廷**********************************************************************/
  24406. /* m.isMobile() && */this.boluoVrInit(),
  24407. /*******************************************************************************************************************************/
  24408. this.initComposer(),
  24409. this.started = !0,
  24410. (p = p.bind(this))()
  24411. }
  24412. ,
  24413. n.prototype.createContext = function(e) {
  24414. var transparent = !!(settings.transparentBg || settings.bgImg)
  24415. try {
  24416. this.renderer = new r.WebGLRenderer({antialias: !m.isMobile(), alpha:transparent}),
  24417. this.renderer.autoClear = !0,
  24418. this.renderer.setPixelRatio(window.devicePixelRatio ? window.devicePixelRatio : 1),
  24419. this.renderer.setSize($("#player").width(), $("#player").height(), false), //改
  24420. transparent && this.renderer.setClearColor( 0x000000, 0 ); //透明
  24421. this.emit(a.ContextCreated)
  24422. } catch (e) {
  24423. throw new h("Unable to create a WebGL rendering context")
  24424. }
  24425. u.profiling.enabled && this.overrideTextures(),
  24426. e.appendChild(this.renderer.domElement)
  24427. /* window.stats = new Stats();
  24428. e.appendChild( stats.dom ); */
  24429. }
  24430. ,
  24431. n.prototype.overrideTextures = function() {
  24432. var e = this.renderer.context
  24433. , t = 0
  24434. , i = e.createTexture;
  24435. e.createTexture = function() {
  24436. var n = i.call(e);
  24437. return n.id = t++,
  24438. this.textures[n.id] = n,
  24439. n
  24440. }
  24441. .bind(this);
  24442. var n = e.texImage2D;
  24443. e.texImage2D = function(t, i, r, o, a, l, c, h, u) {
  24444. var d, p = this.getTextureTypeFromTarget(e, t);
  24445. d = p === s.TextureCube ? e.getParameter(e.TEXTURE_BINDING_CUBE_MAP) : e.getParameter(e.TEXTURE_BINDING_2D),
  24446. void 0 !== c ? n.call(e, t, i, r, o, a, l, c, h, u) : (c = o,
  24447. h = a,
  24448. u = l,
  24449. o = u.naturalWidth,
  24450. a = u.naturalHeight,
  24451. n.call(e, t, i, r, c, h, u));
  24452. var f = this.textures[d.id];
  24453. f.width = p === s.TextureCube ? 6 * o : o,
  24454. f.height = a
  24455. }
  24456. .bind(this);
  24457. var r = e.deleteTexture;
  24458. e.deleteTexture = function(t) {
  24459. delete this.textures[t.id],
  24460. r.call(e, t)
  24461. }
  24462. .bind(this)
  24463. }
  24464. ,
  24465. n.prototype.updateTextureMemory = function() {
  24466. var e = null;
  24467. return function() {
  24468. var t = 0;
  24469. for (var i in this.textures) {
  24470. var n = this.textures[i];
  24471. n.width && n.height && (t += n.width * n.height * 4)
  24472. }
  24473. t !== e && this.emit(a.MemoryUsageUpdated, t),
  24474. e = t
  24475. }
  24476. }(),
  24477. n.prototype.getTextureTypeFromTarget = function(e, t) {
  24478. switch (t) {
  24479. case e.TEXTURE_CUBE_MAP_POSITIVE_X:
  24480. case e.TEXTURE_CUBE_MAP_NEGATIVE_X:
  24481. case e.TEXTURE_CUBE_MAP_POSITIVE_Y:
  24482. case e.TEXTURE_CUBE_MAP_NEGATIVE_Y:
  24483. case e.TEXTURE_CUBE_MAP_POSITIVE_Z:
  24484. case e.TEXTURE_CUBE_MAP_NEGATIVE_Z:
  24485. return s.TextureCube;
  24486. case e.TEXTURE_2D:
  24487. return s.Texture2D;
  24488. default:
  24489. return null
  24490. }
  24491. }
  24492. ,
  24493. n.prototype.initComposer = function() {
  24494. this.composer = new r.EffectComposer(this.renderer),
  24495. this.composer.addPass(new r.RenderPass(this.scene,this.camera)),
  24496. //this.composer.addPass(this.effects.hblurPass),
  24497. //this.composer.addPass(this.effects.vblurPass)
  24498. this.composer.addPass(this.effects.fastTranMaskPass)//add
  24499. }
  24500. ,
  24501. n.prototype.setSize = function(e, t, devicePixelRatio) {
  24502. this.renderWidth = e,
  24503. this.renderHeight = t,
  24504. this.effects.aspect = e / t,
  24505. /* this.renderer.setSize(e, t), -----MP */
  24506. this.renderer.setSize(e, t, false, devicePixelRatio), //改 为了防止给canvas设置宽高
  24507. this.composer.setSize(e, t);
  24508. for (var i = 0; i < this.resizeListeners.length; i++)
  24509. this.resizeListeners[i].setSize(e, t)
  24510. }
  24511. ,
  24512. n.prototype.render = function() {
  24513. //this.effects.currentBlur > 0 ? this.composer.render() : this.renderer.render(this.scene, this.camera)
  24514. this.effects.fastTranMaskPass.enabled ? this.composer.render() : this.renderer.render(this.scene, this.camera)
  24515. }
  24516. /******************************************************************************************************徐世廷**********************************************************************/
  24517. var vrPermission = {};
  24518. var vrPermissionCallBack = function(info1,info2){
  24519. if(info1 == "reset"){
  24520. vrPermission = {};
  24521. }else{
  24522. vrPermission[info1] = info2
  24523. if(Object.keys(vrPermission).length == 2 && (vrPermission.deviceMotion != "granted" || vrPermission.deviceOrientation != "granted")){
  24524. alert("运动和方向访问失败。这会导致画面视角一直固定。您需要完全关闭此应用,然后再次打开,并允许访问运动与方向。" )
  24525. }
  24526. }
  24527. }
  24528. n.prototype.boluoVrInit = function() {
  24529. console.log("boluoVrInit")
  24530. //webxr.init(this.renderer)
  24531. this.isHuawei5X = m.detectHUAWEI5X(),
  24532. this.oldRenderer = this.renderer,
  24533. this.newRenderer = new this.vrRenderer(this.renderer,this,this.camera);
  24534. window.panoCamera = this.camera;
  24535. var a = this;
  24536. window._vrEnabled = !1,
  24537. Object.defineProperty(window, "vrEnabled", {
  24538. get: function() {
  24539. return window._vrEnabled
  24540. },
  24541. set: function(b) {
  24542. //if(webxr.xrType)return webxr.enterVR()
  24543. b = !!b
  24544. b ? (a.renderer = a.newRenderer,
  24545. window.vrMarkers.forEach(function(a) {
  24546. a.visible = !0
  24547. })) : (a.renderer = a.oldRenderer,
  24548. window.vrMarkers.forEach(function(a) {
  24549. a.visible = !1
  24550. })),
  24551. a.cursor.visible = b,
  24552. a.setSize(window.innerWidth, window.innerHeight)
  24553. window._vrEnabled = b
  24554. $('.cad').css('visibility',b?'hidden':'')
  24555. b ? browser.requestFullscreen(document.body) : browser.exitFullscreen()
  24556. a.setSizeFitGlass()
  24557. setTimeout(()=>{
  24558. console.log('ch',document.body.clientWidth, document.body.clientHeight, window.innerWidth, window.innerHeight )//全屏后得到的才准确
  24559. a.setSizeFitGlass()
  24560. },600)
  24561. if(b){
  24562. setTimeout(function(){
  24563. console.log("orientEnable"+window.orientEnable)
  24564. if(window.vrEnabled && !window.orientEnable){//很可能没能触发陀螺仪事件
  24565. if(m.detectIOS()/* && m.detectSafari() */){
  24566. var b = m.iosVersion();//{major: 10, minor: 3, patch: 1}
  24567. console.log("开始获取权限 major"+b.major)
  24568. if(b.major == 12 && b.minor>=2){
  24569. if(browser.detectSafari()) alert("浏览器未能检测到转动。为完整体验VR效果,请打开 “设置” > “Safari” > “隐私和安全” 下的 “运动和方向访问” 开关,然后刷新此页面。")
  24570. else{//app??
  24571. alert("浏览器未能检测到转动。请在手机或浏览器设置中开启了运动和方向访问等设置,然后刷新此页面。")
  24572. }
  24573. }else if(b.major >= 13){
  24574. if(!window.location.href.includes("https://")){
  24575. console.log("需要https");
  24576. alert("当前网页下,高于ios12的浏览器版本可能不支持陀螺仪开启。")
  24577. return;
  24578. }
  24579. var hasFailed = window.vrPermission && (window.vrPermission.deviceMotion != "granted" || window.vrPermission.deviceOrientation != "granted")
  24580. setTimeout(()=>{//如果使用了alert会阻断这个事件,报以下错requusting device orientation or motion access requires a user gesture
  24581. if(!window.vrEnabled || window.orientEnable)return;
  24582. vrPermissionCallBack("reset")
  24583. console.log(window.DeviceMotionEvent)
  24584. if ( window.DeviceMotionEvent && window.DeviceMotionEvent.requestPermission && typeof window.DeviceMotionEvent.requestPermission === 'function') {
  24585. console.log("开始获取权限1")
  24586. ///注意:需要https 本地服务器permissionState会得到denied
  24587. window.DeviceMotionEvent.requestPermission().then(permissionState => {
  24588. console.log("permissionState1: "+permissionState)
  24589. vrPermissionCallBack("deviceMotion", permissionState)
  24590. }).catch(function(e){
  24591. vrPermissionCallBack("deviceMotion", false)
  24592. console.log(e)
  24593. })
  24594. }else{
  24595. console.log("window.DeviceMotionEvent undefined")
  24596. vrPermissionCallBack("deviceMotion", false)
  24597. }
  24598. if ( window.DeviceOrientationEvent && window.DeviceOrientationEvent.requestPermission && typeof window.DeviceOrientationEvent.requestPermission === 'function') {
  24599. console.log("开始获取权限2")
  24600. window.DeviceOrientationEvent.requestPermission().then(permissionState => {
  24601. console.log("permissionState2: "+permissionState)
  24602. vrPermissionCallBack("deviceOrientation", permissionState)
  24603. }).catch(function(e){
  24604. vrPermissionCallBack("deviceOrientation", false)
  24605. console.log(e)
  24606. })
  24607. }else{
  24608. console.log("window.DeviceOrientationEvent undefined")
  24609. vrPermissionCallBack("deviceOrientation", false)
  24610. }
  24611. },hasFailed ? 0 : 150)
  24612. /* /* setTimeout(function(){
  24613. if(settings.vrEnabled && !window.orientEnable){
  24614. $alert("若画面视角一直固定,您需要完全关闭Safari浏览器,然后再次打开以开启运动和方向访问。")
  24615. }
  24616. },4000) */
  24617. }else console.log("陀螺仪未能启用 ios "+b.major+"."+b.minor)
  24618. }else{
  24619. //$alert("浏览器未能检测到转动", "请在手机或浏览器设置中开启了运动和方向访问等设置,然后刷新此页面。")
  24620. }
  24621. }else{
  24622. //已经触发了
  24623. }
  24624. },200);
  24625. }else {
  24626. if(player.mode == 'panorama'){ //xzw add
  24627. player.cameraControls.controls.panorama.endRotation()
  24628. }
  24629. }
  24630. }
  24631. }),
  24632. this.createCursor(.5, !1, 1, 16777215, 0);
  24633. var b = {
  24634. setSize: function(b, c) {
  24635. a.camera.aspect = b / c
  24636. }
  24637. };
  24638. this.resizeListeners.push(b),
  24639. this.vrLoadingInit()
  24640. document.addEventListener('fullscreenchange', (e)=>{
  24641. this.setSizeFitGlass()
  24642. })
  24643. }
  24644. ,
  24645. n.prototype.vrLoadingInit = function() {
  24646. var a = function(camera) {
  24647. var a = this
  24648. , b = new r.RingGeometry(1.3,1.5,32,32,0,1.2 * Math.PI)
  24649. , c = new r.MeshBasicMaterial({
  24650. color: 4967932,
  24651. side: r.DoubleSide
  24652. })
  24653. , d = new r.Mesh(b,c);
  24654. this.mesh = d,
  24655. d.position.z = -2,
  24656. d.scale.set(.08, .08, .08),
  24657. d.visible = !1,
  24658. camera.add(d),
  24659. //window.player.camera.add(d),
  24660. a.enabled = !1,
  24661. this.update = function(b) {
  24662. 1 == a.enabled && (d.rotation.z += 15 * b)
  24663. }
  24664. }
  24665. , a = new a(this.camera);
  24666. window.Loading = a,
  24667. this.updateListeners.push(a)
  24668. }
  24669. ,
  24670. n.prototype.createCursor = function(a, b, c, d, e) {
  24671. var g, h = new r.SpriteMaterial({
  24672. opacity: c,
  24673. color: d,
  24674. transparent: b,
  24675. map: this.boluoGetTexture("images/cursor.png"),
  24676. needsUpdate: !0,
  24677. side: r.DoubleSide
  24678. });
  24679. h.map.offset = new r.Vector2(1 / 17 * e,0),
  24680. h.map.repeat = new r.Vector2(1 / 17,1),
  24681. h.depthTest = !1,
  24682. h.blending = r.AdditiveBlending,
  24683. g = new r.Sprite(h),
  24684. // g.scale.set(a, a, a),
  24685. g.scale.set(.3,.3,.3)
  24686. g.position.z = -2,
  24687. g.visible = !1,
  24688. g.name = "cursor",
  24689. this.camera.add(g),
  24690. this.scene.add(this.camera),
  24691. this.cursor = g;
  24692. var i = new this.CursorAnimation(this.scene,g,this.camera);
  24693. this.cursor.triggerTargetEvent = i.triggerTargetEvent,
  24694. this.updateListeners.push(i)
  24695. }
  24696. n.prototype.setSizeFitGlass = function(){//add 现在大多数手机过长,可能超出眼镜范围,导致看不全眩晕。另外注意调节和镜头的距离。
  24697. let verti = window.orientation == 0 || window.orientation == 180//竖屏
  24698. console.log('setSizeFitGlass')
  24699. if( document.fullscreenElement && !verti && window.vrEnabled && !browser.isMobile()){
  24700. let longW = Math.max(document.body.clientWidth, document.body.clientHeight)
  24701. let shortW = Math.min(document.body.clientWidth, document.body.clientHeight)
  24702. const hopeRatio = 1.84 //因为无法知道手机长度,只能估计,若长宽比较大,很可能过长,所以缩短点。
  24703. let r = longW / shortW
  24704. if(r > hopeRatio){
  24705. let w = shortW*hopeRatio
  24706. window.player.domElement.style.width = w + 'px' //缩短
  24707. window.player.domElement.style.transform = `translate(${(longW-w)*0.5}px,0)` //居中。但我手机荣耀自带浏览器会向右多偏移一些不知为何
  24708. }
  24709. }else{
  24710. window.player.domElement.style.width = ''
  24711. window.player.domElement.style.transform = ''
  24712. }
  24713. }
  24714. ,
  24715. window.orientEnable = 0; //是否能触发deviceorientation
  24716. n.prototype.CursorAnimation = function(a, b, c) {
  24717. function d() {
  24718. g.orient = r.Math.degToRad(window.orientation || 0)
  24719. player.sceneRenderer.setSizeFitGlass()
  24720. }
  24721. function e(a) {
  24722. if(!window.vrEnabled && window.orientEnable) return;
  24723. window.orientEnable || (window.orientEnable = 1);
  24724. var b = r.Math.degToRad(a.alpha)
  24725. , c = r.Math.degToRad(a.beta)
  24726. , d = r.Math.degToRad(a.gamma);
  24727. if (this.isHuawei5X ? (-1e3 === g.alpha && (g.alpha = b),
  24728. -1e3 === g.beta && (g.beta = c),
  24729. -1e3 === g.gamma && (g.gamma = d),
  24730. Math.abs(b - g.alpha) > .06 && (g.alpha = b),
  24731. Math.abs(c - g.beta) > .006 && (g.beta = c),
  24732. Math.abs(d - g.gamma) > .006 && (g.gamma = d)) : (g.alpha = b,
  24733. g.beta = c,
  24734. g.gamma = d),
  24735. n.vrDebug) {
  24736. $("#info-device-orientation").css("display", "block");
  24737. var e = "";
  24738. e += "alpha=(" + g.alpha + ")<BR/>",
  24739. e += "beta=(" + g.beta + ")<BR/>",
  24740. e += "gamma=" + g.gamma + "<BR/>",
  24741. document.getElementById("info-device-orientation").innerHTML = e
  24742. }
  24743. }
  24744. this.cursor = b,
  24745. this.raycaster = new r.Raycaster,
  24746. this.targetEventObj = {},
  24747. this.type = 1,
  24748. this.tweenFlag = !0;
  24749. var g = this;
  24750. this.target = c,
  24751. console.log(c.uuid),
  24752. this.euler = new r.Euler,
  24753. this.q0 = new r.Quaternion,
  24754. this.q1 = new r.Quaternion(-Math.sqrt(.5),0,0,Math.sqrt(.5)),
  24755. this.zee = new r.Vector3(0,0,1),
  24756. this.alpha = -1e3,
  24757. this.beta = -1e3,
  24758. this.gamma = -1e3,
  24759. this.orient = r.Math.degToRad(window.orientation || 0),
  24760. window.addEventListener("orientationchange", d),
  24761. window.addEventListener("deviceorientation", e),
  24762. this.setObjectQuaternion = function(a, b, d, e, f) {
  24763. if (b == -1000) return //防止打开就歪着
  24764. g.euler.set(d, b, -e, "YXZ"),
  24765. a.setFromEuler(g.euler),
  24766. a.multiply(g.q1),
  24767. a.multiply(g.q0.setFromAxisAngle(g.zee, -f)),
  24768. c.updateMatrixWorld()
  24769. }
  24770. ,
  24771. parent !== window && window.addEventListener("message", function(a) {
  24772. var b = JSON.parse(a.data)
  24773. , c = -1 !== window.navigator.userAgent.indexOf("KIW-TL00H");
  24774. b && b.alpha && b.beta && b.gamma && function(a) {
  24775. var c = r.Math.degToRad(b.alpha)
  24776. , d = r.Math.degToRad(b.beta)
  24777. , e = r.Math.degToRad(b.gamma);
  24778. a ? (-1e3 === g.alpha && (g.alpha = c),
  24779. -1e3 === g.beta && (g.beta = d),
  24780. -1e3 === g.gamma && (g.gamma = e),
  24781. Math.abs(c - g.alpha) > .06 && (g.alpha = c),
  24782. Math.abs(d - g.beta) > .006 && (g.beta = d),
  24783. Math.abs(e - g.gamma) > .006 && (g.gamma = e)) : (g.alpha = c,
  24784. g.beta = d,
  24785. g.gamma = e)
  24786. }(c)
  24787. }),
  24788. this.update = function(a) {
  24789. TWEEN.update()
  24790. if (window.vrEnabled) {
  24791. if (window.ifTest || !browser.isMobile()) this.triggerTargetEvent()//测试时不根据陀螺仪来转向
  24792. else {
  24793. this.setObjectQuaternion(this.target.quaternion, this.alpha, this.beta, this.gamma, this.orient)
  24794. this.triggerTargetEvent()
  24795. }
  24796. }
  24797. }
  24798. ,
  24799. this.triggerTargetEvent = function() {
  24800. var a = this.choseObj()
  24801. , b = a ? a.object : void 0;
  24802. this.targetEventObj.currentObj = b,
  24803. b !== this.targetEventObj.lastObj && (b && this.autoCursorPosition(a),
  24804. 1 === this.type ? (this.cursorAnimate && this.cursorAnimate.stop(),
  24805. b && b.enabled && this.startAnimate(function() {
  24806. this.clickCallback(b)
  24807. }
  24808. .bind(this))) : this.type,
  24809. this.targetEventObj.lastObj = b)
  24810. }
  24811. ,
  24812. this.choseObj = function() {
  24813. this.raycaster.setFromCamera({
  24814. x: 0,
  24815. y: 0
  24816. }, c);
  24817. var a = (this.raycaster.ray,
  24818. window.vrMarkers)
  24819. , b = this.raycaster.intersectObjects(a);
  24820. if (b.length > 0)
  24821. return b[0]
  24822. }
  24823. ,
  24824. this.clickCallback = function(a) {
  24825. this.runTHREEAction(a, "onclick")
  24826. }
  24827. ,
  24828. this.runTHREEAction = function(a, b) {
  24829. switch (b) {
  24830. case "onclick":
  24831. a._listeners && a._listeners.click && a._listeners.click.forEach(function(a) {
  24832. a()
  24833. });
  24834. break;
  24835. case "onhover":
  24836. a._listeners && a._listeners.hover && a._listeners.hover.forEach(function(a) {
  24837. a()
  24838. });
  24839. break;
  24840. case "onout":
  24841. a._listeners && a._listeners.out && a._listeners.out.forEach(function(a) {
  24842. a()
  24843. })
  24844. }
  24845. }
  24846. ,
  24847. this.startAnimate = function(a) {
  24848. this.tweenFlag && this.initAnimation(a)
  24849. }
  24850. ,
  24851. this.initAnimation = function(a) {
  24852. var b = this
  24853. , c = this.cursor.material.map.offset
  24854. , d = function(a) {
  24855. return Math.floor(17 * a) / 17
  24856. };
  24857. b.tweenFlag = !1,
  24858. this.cursorAnimate = new TWEEN.Tween(c).to({
  24859. x: 1
  24860. }, 1e3).onStart(function() {
  24861. b.tweenFlag = !1
  24862. }).onStop(function() {
  24863. b.tweenFlag = !0,
  24864. this.x = 0,
  24865. c.x = 0
  24866. }).onUpdate(function() {}).onComplete(function() {
  24867. a(),
  24868. c.x = 0,
  24869. setTimeout(function() {
  24870. b.tweenFlag = !0
  24871. }, 1500)
  24872. }),
  24873. this.cursorAnimate.easing(d),
  24874. this.cursorAnimate.start()
  24875. }
  24876. ,
  24877. this.autoCursorPosition = function(a) {
  24878. // var b = Math.abs(a.distance - 10);
  24879. // this.cursor.position.z = -b,
  24880. // b /= 10;
  24881. // alert(b);
  24882. // this.cursor.scale.set(b, b, b)
  24883. this.cursor.scale.set(.3,.3,.3)
  24884. }
  24885. }
  24886. ,
  24887. n.prototype.vrRenderer = function(a, b, c) {
  24888. var d = new b.vrCamera(c);
  24889. d.bananaAspect = 0.75// fov origin:0.8
  24890. this.width,
  24891. this.height;
  24892. var b = this;
  24893. this.setSize = function(c, d) {
  24894. a.setSize.call(this, c, d),
  24895. b.width = c,
  24896. b.height = d
  24897. }
  24898. ,
  24899. this.render = function(b, c, e, f) {
  24900. window.cameraQua = c.quaternion.clone();
  24901. var g, h;
  24902. if (c.__RESS__SKIP__STEREO__)
  24903. return a.render(b, c, e, f);
  24904. if ("PerspectiveCamera" === c.type)
  24905. g = d.cameraL,
  24906. h = d.cameraR,
  24907. b.updateMatrixWorld(),
  24908. null === c.parent && c.updateMatrixWorld(),
  24909. d.vrCameraUpdate(c);
  24910. else {
  24911. if ("OrthographicCamera" !== c.type)
  24912. return DEBUG && console.error("Unsupported renderer: ", c.type);
  24913. g = h = c
  24914. }
  24915. a.setScissorTest(!0),
  24916. a.setScissor(0, 0, this.width / 2, this.height),
  24917. a.setViewport(0, 0, this.width / 2, this.height),
  24918. a.render.call(this, b, g, e, f),
  24919. a.setScissor(this.width / 2, 0, this.width / 2, this.height),
  24920. a.setViewport(this.width / 2, 0, this.width / 2, this.height),
  24921. a.render.call(this, b, h, e, f),
  24922. a.setScissorTest(!1)
  24923. }
  24924. ,
  24925. this.__proto__ = {
  24926. __proto__: a
  24927. }
  24928. }
  24929. ,
  24930. n.prototype.vrCamera = function(a) {
  24931. this.type = "StereoCamera",
  24932. this._aspect = 1,
  24933. this._overlap = .064,
  24934. this.cameraL = new r.PerspectiveCamera,
  24935. this.cameraL.layers.enable(1),
  24936. this.cameraL.near = 0.01,//xzw add
  24937. this.cameraL.matrixAutoUpdate = !1,
  24938. this.cameraR = new r.PerspectiveCamera,
  24939. this.cameraR.layers.enable(2),
  24940. this.cameraR.near = 0.01,//xzw add
  24941. this.cameraR.matrixAutoUpdate = !1,
  24942. this.eyeRight = new r.Matrix4,
  24943. this.eyeLeft = new r.Matrix4,
  24944. this.vrCameraNeedsUpdate = !0,
  24945. window.vrCameraL = this.cameraL; // fyz 记录vr相机
  24946. Object.defineProperty(this, "bananaAspect", {
  24947. get: function() {
  24948. return this._aspect
  24949. },
  24950. set: function(a) {
  24951. this._aspect !== a && (this.vrCameraNeedsUpdate = !0),
  24952. this._aspect = a
  24953. }
  24954. }),
  24955. Object.defineProperty(this, "overlap", {//瞳距
  24956. get: function() {
  24957. return this._overlap
  24958. },
  24959. set: function(a) {
  24960. this._overlap !== a && (this.vrCameraNeedsUpdate = !0),
  24961. this._overlap = a
  24962. }
  24963. }),
  24964. this.vrCameraUpdate = function(a) {
  24965. this.vrCameraNeedsUpdate = true;
  24966. if (this.vrCameraNeedsUpdate = this.vrCameraNeedsUpdate || this.bananaFov !== a.fov || this.bananaReal_aspect !== a.aspect * this.bananaAspect || this.bananaNear !== a.near || this.bananaFar !== a.far,
  24967. this.vrCameraNeedsUpdate) {
  24968. this.vrCameraNeedsUpdate = !1,
  24969. //console.debug("vrCameraUpdate"),
  24970. this.bananaFocus = a.focus,
  24971. this.bananaFov = a.fov,
  24972. this.bananaReal_aspect = a.aspect * (window.ban || this.bananaAspect),
  24973. this.bananaNear = a.near,
  24974. this.bananaFar = a.far,
  24975. //console.debug(a.aspect),
  24976. this.bananaFocus = 10;
  24977. 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);
  24978. this.eyeLeft.elements[12] = -e,
  24979. this.eyeRight.elements[12] = e,
  24980. b = -g * this.bananaReal_aspect + f,
  24981. c = g * this.bananaReal_aspect + f,
  24982. d.elements[0] = 2 * this.bananaNear / (c - b),
  24983. d.elements[8] = (c + b) / (c - b),
  24984. this.cameraL.projectionMatrix.copy(d),
  24985. b = -g * this.bananaReal_aspect - f,
  24986. c = g * this.bananaReal_aspect - f,
  24987. d.elements[0] = 2 * this.bananaNear / (c - b),
  24988. d.elements[8] = (c + b) / (c - b),
  24989. this.cameraR.projectionMatrix.copy(d)
  24990. }
  24991. this.cameraL.matrixWorld.copy(a.matrixWorld).multiply(this.eyeLeft),
  24992. this.cameraR.matrixWorld.copy(a.matrixWorld).multiply(this.eyeRight)
  24993. }
  24994. }
  24995. ,
  24996. n.prototype.boluoGetTexture = function(a) {
  24997. var b = new r.TextureLoader;
  24998. return b.crossOrigin = "anonymous",
  24999. b.load(a)
  25000. }
  25001. /* let webxr = {
  25002. init(renderer) {
  25003. this.renderer = renderer
  25004. renderer.xr = new THREE.WebXRManager(renderer, renderer.getContext());
  25005. renderer.xr.enabled = true
  25006. if ('xr' in navigator && 'isSessionSupported' in navigator.xr) {
  25007. //pico firefox
  25008. var mode = 'immersive-vr'
  25009. navigator.xr
  25010. .isSessionSupported(mode)
  25011. .then(supported => {
  25012. if (!supported) {
  25013. this.xrNotFound('isSessionSupported not supported')
  25014. } else {
  25015. this.xrType = 'xr' //showEnterXR();
  25016. }
  25017. })
  25018. .catch(this.xrNotFound.bind(this, 'isSessionSupported error'))
  25019. } else if ('getVRDisplays' in navigator) {
  25020. //pico 的vr browser是这个
  25021. console.log('getVRDisplays')
  25022. let setDevice = device => {
  25023. this.xrType = 'vr'
  25024. this.device = device
  25025. this.renderer.xr.setDevice(device) //新版是renderer.vr
  25026. }
  25027. window.addEventListener(
  25028. 'vrdisplayconnect',
  25029. function (event) {
  25030. setDevice(event.display)
  25031. },
  25032. false
  25033. )
  25034. window.addEventListener(
  25035. 'vrdisplaydisconnect',
  25036. function ( ) {
  25037. console.log('vrdisplaydisconnect')
  25038. window.bus.dispatchEvent({type:'exitWebXR'})
  25039. },
  25040. false
  25041. )
  25042. window.addEventListener(
  25043. 'vrdisplaypresentchange',
  25044. function (event) {
  25045. console.log('vrdisplaypresentchange', event.display.isPresenting ? 'EXIT VR' : 'ENTER VR')
  25046. event.display.isPresenting || window.bus.dispatchEvent({type:'exitWebXR'})
  25047. },
  25048. false
  25049. )
  25050. window.addEventListener(
  25051. 'vrdisplayactivate',
  25052. function (event) {
  25053. event.display.requestPresent([{ source: this.renderer.domElement }])
  25054. },
  25055. false
  25056. )
  25057. navigator
  25058. .getVRDisplays()
  25059. .then(function (displays) {
  25060. if (displays.length > 0) {
  25061. setDevice(displays[0])
  25062. } else {
  25063. this.xrNotFound('no displays')
  25064. }
  25065. })
  25066. .catch(this.xrNotFound.bind(this, 'getVRDisplays error'))
  25067. } else {
  25068. this.xrNotFound('xr not supported')
  25069. }
  25070. },
  25071. enterVR() {
  25072. if (!this.xrType) return //不支持
  25073. console.log('enterVR', this.xrType)
  25074. if (this.xrType == 'vr') {
  25075. this.device.isPresenting ? this.device.exitPresent() : this.device.requestPresent([{ source: renderer.domElement }])
  25076. } else if (this.xrType == 'xr') {
  25077. if (this.currentSession == void 0) {
  25078. console.log('this.currentSession == void 0 ')
  25079. function getXRSessionInit(mode, options) {
  25080. var space = (options || {}).referenceSpaceType || 'local-floor'
  25081. var sessionInit = (options && options.sessionInit) || {}
  25082. // Nothing to do for default features.
  25083. if (space == 'viewer') return sessionInit
  25084. if (space == 'local' && mode.startsWith('immersive')) return sessionInit
  25085. // If the user already specified the space as an optional or required feature, don't do anything.
  25086. if (sessionInit.optionalFeatures && sessionInit.optionalFeatures.includes(space)) return sessionInit
  25087. if (sessionInit.requiredFeatures && sessionInit.requiredFeatures.includes(space)) return sessionInit
  25088. // The user didn't request the reference space type as a feature. Add it to a shallow copy
  25089. // of the user-supplied sessionInit requiredFeatures (if any) to ensure it's valid to
  25090. // request it later.
  25091. var newInit = Object.assign({}, sessionInit)
  25092. newInit.requiredFeatures = [space]
  25093. if (sessionInit.requiredFeatures) {
  25094. newInit.requiredFeatures = newInit.requiredFeatures.concat(sessionInit.requiredFeatures)
  25095. }
  25096. return newInit
  25097. }
  25098. let onSessionEnded = ( ) => {
  25099. console.log('onSessionEnded')
  25100. this.currentSession.removeEventListener('end', onSessionEnded)
  25101. setTimeout(()=>{
  25102. this.renderer.xr.setSession(null)
  25103. this.currentSession = null
  25104. window.bus.dispatchEvent({type:'exitWebXR'})
  25105. },1)//延迟原因:先使THREE里的onSessionEnded执行
  25106. }
  25107. let onSessionStarted = session => {
  25108. console.log('onSessionStarted')
  25109. session.addEventListener('end', onSessionEnded)
  25110. this.renderer.xr.setSession(session)
  25111. this.currentSession = session
  25112. }
  25113. var mode = 'immersive-vr'
  25114. var sessionInit = getXRSessionInit(mode)
  25115. navigator.xr.requestSession(mode, sessionInit).then(onSessionStarted)
  25116. } else {
  25117. console.log('this.currentSession.end()', this.currentSession)
  25118. this.currentSession.end()
  25119. }
  25120. }
  25121. },
  25122. xrNotFound(text) {
  25123. console.log('xrNotFound:', text)
  25124. },
  25125. } */
  25126. /***********************************************************************************************************************************************************************************/
  25127. n.prototype.updateScreenSize = function() {//xzw 改 为了截屏 要改canvas大小 以及缩放时不模糊
  25128. var W,H;//当截屏时有setTimeout 期间不能恢复大小,所以要用W,H记录正常大小
  25129. return function(o){
  25130. var render = false;
  25131. var ratio;
  25132. var w, h; //记录应当render的大小
  25133. if(o && !o.resize && o.width!= void 0 && o.height!= void 0){
  25134. w = o.width, h = o.height, render = true, ratio=1;
  25135. }else{
  25136. w = $('#player').width();
  25137. h = $('#player').height();
  25138. o && o.resize && (W = this.renderWidth, H = this.renderHeight);
  25139. (w !== W || h !== H || this.forceUpdateSize) &&
  25140. (W = w, H = h, render = true, ratio = window.devicePixelRatio);
  25141. }
  25142. if(render){
  25143. this.setSize(w, h, ratio);
  25144. this.forceUpdateSize = !1
  25145. }
  25146. }
  25147. }()
  25148. ,
  25149. n.prototype.updateComponents = function() {
  25150. for (var e = Math.min(1, this.updateClock.getDelta()), t = 0; t < this.updateListeners.length; t++)
  25151. this.updateListeners[t].update(e)
  25152. }
  25153. ,
  25154. n.prototype.suspend = function() {
  25155. this.started = !1,
  25156. this.suspendedObjects = this.scene.children.map(function(e) {
  25157. return this.scene.remove(e),
  25158. e
  25159. }
  25160. .bind(this)),
  25161. this.render()
  25162. }
  25163. ,
  25164. n.prototype.resume = function() {
  25165. this.suspendedObjects.forEach(function(e) {
  25166. this.scene.add(e)
  25167. }
  25168. .bind(this)),
  25169. this.suspendedObjects = [],
  25170. this.started = !0,
  25171. p()
  25172. }
  25173. ;
  25174. var p = function() {
  25175. this.started && (window.requestAnimationFrame(p),
  25176. this.updateScreenSize(), // fyz resize
  25177. this.updateComponents(),
  25178. this.updateTextureMemory(),
  25179. this.render(),
  25180. window.stats && (window.fps = stats.update()),
  25181. this.emit(a.AfterRender))
  25182. };
  25183. n.prototype.getImageData = function() {
  25184. var e = document.createElement("canvas")
  25185. , t = e.getContext("2d");
  25186. return function(i, n, r) {
  25187. return e.width === n && e.height === r || (e.width = n,
  25188. e.height = r),
  25189. t.drawImage(i, 0, 0, n, r),
  25190. t.getImageData(0, 0, n, r)
  25191. }
  25192. }(),
  25193. n.prototype.initSizedTexture2D = function(e, t, i) {
  25194. var n = this.renderer
  25195. , o = n.context
  25196. , a = n.state
  25197. , s = new r.Texture(null);
  25198. s.flipY = !1,
  25199. i !== !0 && (i = !1),
  25200. s.generateMipmaps = i;
  25201. var l = n.paramThreeToGL(s.format)
  25202. , c = n.paramThreeToGL(s.type)
  25203. , h = n.properties.get(s)
  25204. , u = o.createTexture();
  25205. a.bindTexture(o.TEXTURE_2D, u),
  25206. o.pixelStorei(o.UNPACK_FLIP_Y_WEBGL, s.flipY),
  25207. o.texImage2D(o.TEXTURE_2D, 0, l, e, e, 0, l, c, null),
  25208. s.wrapS = t,
  25209. s.wrapT = t;
  25210. var d = n.paramThreeToGL(t);
  25211. return o.texParameteri(o.TEXTURE_2D, o.TEXTURE_WRAP_S, d),
  25212. o.texParameteri(o.TEXTURE_2D, o.TEXTURE_WRAP_T, d),
  25213. i ? (s.magFilter = r.LinearFilter,
  25214. s.minFilter = r.LinearMipMapLinearFilter,
  25215. o.texParameteri(o.TEXTURE_2D, o.TEXTURE_MAG_FILTER, o.LINEAR),
  25216. o.texParameteri(o.TEXTURE_2D, o.TEXTURE_MIN_FILTER, o.LINEAR_MIPMAP_NEAREST),
  25217. o.generateMipmap(o.TEXTURE_2D)) : (s.magFilter = r.LinearFilter,
  25218. s.minFilter = r.LinearFilter,
  25219. o.texParameteri(o.TEXTURE_2D, o.TEXTURE_MAG_FILTER, o.LINEAR),
  25220. o.texParameteri(o.TEXTURE_2D, o.TEXTURE_MIN_FILTER, o.LINEAR)),
  25221. a.bindTexture(o.TEXTURE_2D, null),
  25222. h.__webglTexture = u,
  25223. s
  25224. }
  25225. ,
  25226. n.prototype.initSizedCubeMap = function(e, t) {
  25227. var i = this.renderer
  25228. , n = i.context
  25229. , o = i.state
  25230. , a = new r.CubeTexture([null, null, null, null, null, null]);
  25231. a.flipY = !1,
  25232. a.generateMipmaps = t;
  25233. var s = i.paramThreeToGL(a.format)
  25234. , l = i.paramThreeToGL(a.type)
  25235. , c = i.properties.get(a)
  25236. , h = n.createTexture();
  25237. o.bindTexture(n.TEXTURE_CUBE_MAP, h),
  25238. n.pixelStorei(n.UNPACK_FLIP_Y_WEBGL, a.flipY);
  25239. for (var u = 0; u < 6; u++)
  25240. n.texImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X + u, 0, s, e, e, 0, s, l, null);
  25241. return t ? (a.magFilter = r.LinearFilter,
  25242. a.minFilter = r.LinearMipMapLinearFilter,
  25243. n.texParameteri(n.TEXTURE_CUBE_MAP, n.TEXTURE_MAG_FILTER, n.LINEAR),
  25244. n.texParameteri(n.TEXTURE_CUBE_MAP, n.TEXTURE_MIN_FILTER, n.LINEAR_MIPMAP_LINEAR),
  25245. n.texParameteri(n.TEXTURE_CUBE_MAP, n.GENERATE_MIPMAP, n.TRUE),
  25246. n.generateMipmap(n.TEXTURE_CUBE_MAP)) : (a.magFilter = r.LinearFilter,
  25247. a.minFilter = r.LinearFilter,
  25248. n.texParameteri(n.TEXTURE_CUBE_MAP, n.TEXTURE_MAG_FILTER, n.LINEAR),
  25249. n.texParameteri(n.TEXTURE_CUBE_MAP, n.TEXTURE_MIN_FILTER, n.LINEAR)),
  25250. o.bindTexture(n.TEXTURE_CUBE_MAP, null),
  25251. c.__image__webglTextureCube = h,
  25252. a
  25253. }
  25254. ,
  25255. n.prototype.deallocateCubeTexture = function(e) {
  25256. var t = this.renderer
  25257. , i = t.context
  25258. , n = t.properties.get(e);
  25259. i.deleteTexture(n.__image__webglTextureCube)
  25260. }
  25261. ,
  25262. n.prototype.uploadTexture2D = function(e, t, i, n, r, o) {
  25263. var a = this.renderer
  25264. , s = a.context
  25265. , l = a.state
  25266. , c = a.properties.get(t);
  25267. l.bindTexture(s.TEXTURE_2D, c.__webglTexture),
  25268. s.pixelStorei(s.UNPACK_FLIP_Y_WEBGL, t.flipY),
  25269. s.pixelStorei(s.UNPACK_PREMULTIPLY_ALPHA_WEBGL, t.premultiplyAlpha),
  25270. s.pixelStorei(s.UNPACK_ALIGNMENT, t.unpackAlignment),
  25271. s.texParameteri(s.TEXTURE_2D, s.TEXTURE_WRAP_S, a.paramThreeToGL(t.wrapS)),
  25272. s.texParameteri(s.TEXTURE_2D, s.TEXTURE_WRAP_T, a.paramThreeToGL(t.wrapT)),
  25273. s.texParameteri(s.TEXTURE_2D, s.TEXTURE_MAG_FILTER, a.paramThreeToGL(t.magFilter)),
  25274. s.texParameteri(s.TEXTURE_2D, s.TEXTURE_MIN_FILTER, a.paramThreeToGL(t.minFilter)),
  25275. s.texSubImage2D(s.TEXTURE_2D, 0, i, n, s.RGBA, s.UNSIGNED_BYTE, e),
  25276. t.generateMipmaps && s.generateMipmap(s.TEXTURE_2D),
  25277. l.bindTexture(s.TEXTURE_2D, null)
  25278. }
  25279. ,
  25280. n.prototype.uploadTexture3D = function(e, t, i, n, r, o, a) {
  25281. var s = this.renderer
  25282. , l = s.context
  25283. , c = s.state
  25284. , h = s.properties.get(t);
  25285. c.bindTexture(l.TEXTURE_CUBE_MAP, h.__image__webglTextureCube),
  25286. l.pixelStorei(l.UNPACK_FLIP_Y_WEBGL, t.flipY),
  25287. l.texSubImage2D(r, 0, i, n, l.RGBA, l.UNSIGNED_BYTE, e),
  25288. t.generateMipmaps && l.generateMipmap(l.TEXTURE_CUBE_MAP),
  25289. c.bindTexture(l.TEXTURE_CUBE_MAP, null)
  25290. }
  25291. ,
  25292. n.prototype.rebuildMipMaps2D = function(e) {
  25293. var t = this.renderer
  25294. , i = t.context
  25295. , n = t.state;
  25296. t.properties.get(e);
  25297. i.generateMipmap(i.TEXTURE_2D),
  25298. n.bindTexture(i.TEXTURE_2D, null)
  25299. }
  25300. ,
  25301. n.prototype.rebuildMipMaps3D = function(e) {
  25302. var t = this.renderer
  25303. , i = t.context
  25304. , n = t.state
  25305. , r = t.properties.get(e);
  25306. n.bindTexture(i.TEXTURE_CUBE_MAP, r.__image__webglTextureCube),
  25307. i.generateMipmap(i.TEXTURE_CUBE_MAP),
  25308. n.bindTexture(i.TEXTURE_CUBE_MAP, null)
  25309. }
  25310. ,
  25311. n.prototype.renderToCubeMap = function() {
  25312. var e = !1
  25313. , t = null
  25314. , i = null
  25315. , n = null
  25316. , a = null
  25317. , s = null
  25318. , l = 1;
  25319. return function(c, h, u, d, p, f, g, m, v, A, y, C, I, E, b, w) {
  25320. var _ = this.renderer;
  25321. _.context;
  25322. e || (i = new r.OrthographicCamera(l / -2,l / 2,l / 2,l / -2,-200,200),
  25323. i.position.z = 150,
  25324. t = new r.Scene,
  25325. t.add(i),
  25326. n = new r.ShaderMaterial({
  25327. uniforms: {
  25328. tDiffuse: {
  25329. type: "t",
  25330. value: null
  25331. },
  25332. alpha: {
  25333. type: "f",
  25334. value: 1
  25335. }
  25336. },
  25337. vertexShader: o.basicTextured.vertexShader,
  25338. fragmentShader: o.basicTextured.fragmentShader,
  25339. depthWrite: !1,
  25340. depthTest: !1,
  25341. side: r.DoubleSide
  25342. }),
  25343. a = new r.PlaneBufferGeometry(l,l),
  25344. s = new r.Mesh(a,n),
  25345. s.position.z = 0,
  25346. t.add(s),
  25347. e = !0);
  25348. var T = a.getAttribute("uv");
  25349. T.setDynamic(!0),
  25350. T.needsUpdate = !0;
  25351. var x = T.array
  25352. , S = p / u
  25353. , M = f / d
  25354. , R = g / u
  25355. , P = m / d;
  25356. x[0] = S,
  25357. x[1] = M + P,
  25358. x[2] = S + R,
  25359. x[3] = M + P,
  25360. x[4] = S,
  25361. x[5] = M,
  25362. x[6] = S + R,
  25363. x[7] = M;
  25364. var O = a.getAttribute("position");
  25365. O.setDynamic(!0),
  25366. O.needsUpdate = !0;
  25367. var L = O.array
  25368. , D = v / h.width - l / 2
  25369. , N = A / h.height - l / 2
  25370. , B = y / h.width
  25371. , F = C / h.height;
  25372. L[0] = D,
  25373. L[1] = N + F,
  25374. L[3] = D + B,
  25375. L[4] = N + F,
  25376. L[6] = D,
  25377. L[7] = N,
  25378. L[9] = D + B,
  25379. L[10] = N;
  25380. this.renderer.properties.get(c);
  25381. n.uniforms.tDiffuse.value = c,
  25382. n.blending = E || r.NoBlending,
  25383. n.transparent = !!b,
  25384. void 0 !== w && null !== w || (w = 1),
  25385. n.uniforms.alpha.value = w,
  25386. n.needUpdate = !0,
  25387. h.activeCubeFace = I,
  25388. h.viewport.set(0, 0, h.width, h.height);
  25389. var V = this.renderer.autoClear;
  25390. this.renderer.autoClear = !1,
  25391. this.renderer.render(t, i, h, !1),
  25392. this.renderer.autoClear = V
  25393. }
  25394. }(),
  25395. n.prototype.copyCubeMap = function() {
  25396. var e = !1
  25397. , t = null
  25398. , i = null
  25399. , a = null
  25400. , s = null
  25401. , l = null
  25402. , c = new r.Euler;
  25403. new r.Vector3;
  25404. return function(h, u, d, p, f, g, m, v, A) {
  25405. if(f > this.qualityManager.maxRenderTargetSize) return; //add
  25406. this.renderer;
  25407. if (!e) {
  25408. var y = 2;
  25409. i = new r.OrthographicCamera(y / -2,y / 2,y / 2,y / -2,0,200),
  25410. i.position.set(0, 0, 0),
  25411. t = new r.Scene,
  25412. t.add(i),
  25413. a = new r.ShaderMaterial({
  25414. uniforms: {
  25415. tDiffuse: {
  25416. type: "t",
  25417. value: null
  25418. },
  25419. alpha: {
  25420. type: "f",
  25421. value: 1
  25422. }
  25423. },
  25424. vertexShader: o.copyCubeMap.vertexShader,
  25425. fragmentShader: o.copyCubeMap.fragmentShader,
  25426. depthWrite: !1,
  25427. depthTest: !1,
  25428. side: r.DoubleSide
  25429. }),
  25430. s = new r.BoxGeometry(y,y,y),
  25431. l = new r.Mesh(s,a),
  25432. t.add(l),
  25433. e = !0
  25434. }
  25435. for (var C = 0; C < 6; C++)
  25436. n.getCubeOrientationForCubeFace(C, c),
  25437. l.rotation.copy(c),
  25438. l.matrixWorldNeedsUpdate = !0,
  25439. l.updateMatrixWorld(),
  25440. a.uniforms.tDiffuse.value = h,
  25441. a.blending = m || r.NoBlending,
  25442. a.transparent = !!v,
  25443. void 0 !== A && null !== A || (A = 1),
  25444. a.uniforms.alpha.value = A,
  25445. a.needUpdate = !0,
  25446. u.activeCubeFace = C,
  25447. u.viewport.set(0, 0, f, g),
  25448. this.renderer.render(t, i, u, !1)
  25449. }
  25450. }(),
  25451. n.getLookAtForCubeFace = function(e, t) {
  25452. switch (e) {
  25453. case l.GL_TEXTURE_CUBE_MAP_POSITIVE_X:
  25454. t.set(1, 0, 0);
  25455. break;
  25456. case l.GL_TEXTURE_CUBE_MAP_NEGATIVE_X:
  25457. t.set(-1, 0, 0);
  25458. break;
  25459. case l.GL_TEXTURE_CUBE_MAP_POSITIVE_Y:
  25460. t.set(0, 1, 0);
  25461. break;
  25462. case l.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y:
  25463. t.set(0, -1, 0);
  25464. break;
  25465. case l.GL_TEXTURE_CUBE_MAP_POSITIVE_Z:
  25466. t.set(0, 0, 1);
  25467. break;
  25468. case l.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z:
  25469. t.set(0, 0, -1)
  25470. }
  25471. }
  25472. ,
  25473. n.getCubeOrientationForCubeFace = function(e, t) {
  25474. switch (e) {
  25475. case l.GL_TEXTURE_CUBE_MAP_POSITIVE_X:
  25476. t.set(0, -Math.PI / 2, 0);
  25477. break;
  25478. case l.GL_TEXTURE_CUBE_MAP_NEGATIVE_X:
  25479. t.set(0, Math.PI / 2, 0);
  25480. break;
  25481. case l.GL_TEXTURE_CUBE_MAP_POSITIVE_Y:
  25482. t.set(Math.PI / 2, Math.PI, 0);
  25483. break;
  25484. case l.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y:
  25485. t.set(-Math.PI / 2, Math.PI, 0);
  25486. break;
  25487. case l.GL_TEXTURE_CUBE_MAP_POSITIVE_Z:
  25488. t.set(0, -Math.PI, 0);
  25489. break;
  25490. case l.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z:
  25491. t.set(0, 0, 0)
  25492. }
  25493. }
  25494. ,
  25495. t.exports = n
  25496. }
  25497. , {
  25498. "../enum/GLCubeFaces": 25,
  25499. "../enum/GLTextureType": 26,
  25500. "../enum/SceneRendererEvents": 43,
  25501. "../exception/BasicException": 55,
  25502. "../exception/RendererCreationException": 57,
  25503. "../settings": 166,
  25504. "../shaders": 167,
  25505. /********************************************************************fyz改 from徐世廷**********************************************************************/
  25506. "../util/browser": 182,
  25507. /************************************************************************************************************************************************/
  25508. events: 202,
  25509. three: 217
  25510. }],
  25511. 159: [function(e, t, i) {
  25512. "use strict";
  25513. function n(e) {
  25514. this.messenger = new a(e),
  25515. this.clientKey = null
  25516. }
  25517. var r = e("../util/ajax")
  25518. , o = e("./PostMessageType")
  25519. , a = e("./postmessage")
  25520. , s = e("./VersionInfo")
  25521. , l = e("events").EventEmitter
  25522. , c = window.location.origin + "/api/v1/user/";
  25523. n.prototype = Object.create(l.prototype),
  25524. n.prototype.bindEvents = function() {
  25525. this.messenger.on(o.ACTION, this.onMessageReceived.bind(this))
  25526. }
  25527. ,
  25528. n.prototype.waitForConnection = function() {
  25529. var e = new Promise(function(e, t) {
  25530. this.messenger.on(o.CONNECT, function(i) {
  25531. this.onConnectionReceived(i).then(e.bind(this, i.sdkVersion), t.bind())
  25532. }
  25533. .bind(this))
  25534. }
  25535. .bind(this));
  25536. return e
  25537. }
  25538. ,
  25539. n.prototype.onConnectionReceived = function(e) {
  25540. return this.messenger.setTarget(e.source, e.origin),
  25541. this.verifyConnection(e).then(function(t, i) {
  25542. this.messenger.send({
  25543. type: o.ACCEPT,
  25544. toId: e.fromId,
  25545. warning: i
  25546. }),
  25547. this.clientKey = t,
  25548. this.messenger.removeAllListeners(o.CONNECT),
  25549. this.bindEvents()
  25550. }
  25551. .bind(this), function(t) {
  25552. this.messenger.send({
  25553. type: o.REJECT,
  25554. toId: e.fromId,
  25555. reason: t
  25556. }),
  25557. this.messenger.setTarget()
  25558. }
  25559. .bind(this))
  25560. }
  25561. ,
  25562. n.prototype.verifyConnection = function(e) {
  25563. return new Promise(function(t, i) {
  25564. var n;
  25565. if (s.isDeprecated(e.sdkVersion))
  25566. n = "这个版本正在被弃用";
  25567. else if (!s.isSupported(e.sdkVersion))
  25568. return i("不支持此版本的SDK");
  25569. var o = {
  25570. cache: !1,
  25571. headers: {
  25572. "X-port-Application-Key": e.applicationKey,
  25573. "X-port-Referrer": e.origin
  25574. }
  25575. };
  25576. r.get(c, o).done(t.bind(this, e.applicationKey, n)).fail(i.bind(this, "key/referrer mismatch"))
  25577. }
  25578. )
  25579. }
  25580. ,
  25581. n.prototype.onMessageReceived = function(e) {
  25582. if (this.validateClientApplicationKey(e.applicationKey)) {
  25583. var t = this;
  25584. e.onDone = function(i) {
  25585. i.toId = e.fromId,
  25586. i.uid = e.uid,
  25587. i.type = o.RESPONSE,
  25588. t.messenger.send(i)
  25589. }
  25590. ,
  25591. this.emit(o.ACTION, e)
  25592. }
  25593. }
  25594. ,
  25595. n.prototype.validateClientApplicationKey = function(e) {
  25596. return this.clientKey === e
  25597. }
  25598. ,
  25599. n.prototype.sendEvent = function(e, t) {
  25600. this.messenger.send({
  25601. type: o.EVENT,
  25602. eventType: e,
  25603. eventData: t
  25604. })
  25605. }
  25606. ,
  25607. t.exports = n
  25608. }
  25609. , {
  25610. "../util/ajax": 181,
  25611. "./PostMessageType": 160,
  25612. "./VersionInfo": 163,
  25613. "./postmessage": 165,
  25614. events: 202
  25615. }],
  25616. 160: [function(e, t, i) {
  25617. "use strict";
  25618. t.exports = Object.freeze({
  25619. CONNECT: "postmessage.connect",
  25620. ACCEPT: "postmessage.accept",
  25621. REJECT: "postmessage.reject",
  25622. ACTION: "postmessage.action",
  25623. RESPONSE: "postmessage.response",
  25624. EVENT: "postmessage.event"
  25625. })
  25626. }
  25627. , {}],
  25628. 161: [function(e, t, i) {
  25629. "use strict";
  25630. t.exports = Object.freeze({
  25631. MOVE: "sdk.move",
  25632. ENTER_PANO: "sdk.enterpano",
  25633. MODEL_LOADED: "sdk.modelloaded"
  25634. })
  25635. }
  25636. , {}],
  25637. 162: [function(e, t, i) {
  25638. "use strict";
  25639. t.exports = Object.freeze({
  25640. FLY: "transition.fly",
  25641. FADEOUT: "transition.fade",
  25642. INSTANT: "transition.instant"
  25643. })
  25644. }
  25645. , {}],
  25646. 163: [function(e, t, i) {
  25647. "use strict";
  25648. t.exports = {
  25649. current: "1.0",
  25650. supported: ["1.0"],
  25651. deprecated: [],
  25652. isSupported: function(e) {
  25653. return this.supported.indexOf(e) !== -1
  25654. },
  25655. isDeprecated: function(e) {
  25656. return this.deprecated.indexOf(e) !== -1
  25657. },
  25658. isValid: function(e) {
  25659. return this.isSupported(e) || this.isDeprecated(e)
  25660. }
  25661. }
  25662. }
  25663. , {}],
  25664. 164: [function(e, t, i) {
  25665. (function(i) {
  25666. "use strict";
  25667. function n(e, t, i) {
  25668. e && (e = e.toLowerCase().trim());
  25669. var n = new I.UP.clone
  25670. , r = Math.PI / 3
  25671. , o = Math.PI / 2;
  25672. switch (e) {
  25673. case "left":
  25674. i.copy(t),
  25675. i.applyAxisAngle(n, o);
  25676. break;
  25677. case "right":
  25678. i.copy(t),
  25679. i.applyAxisAngle(n, -o);
  25680. break;
  25681. case "forwardleft":
  25682. i.copy(t),
  25683. i.applyAxisAngle(n, r);
  25684. break;
  25685. case "forwardright":
  25686. i.copy(t),
  25687. i.applyAxisAngle(n, -r);
  25688. break;
  25689. case "forward":
  25690. default:
  25691. i.copy(t)
  25692. }
  25693. return i
  25694. }
  25695. function r(e, t) {
  25696. if (e) {
  25697. var i = {
  25698. pano: e,
  25699. lookAtPoint: null,
  25700. duration: null,
  25701. maxDistanceOverride: null,
  25702. skipWarpingCheck: !1
  25703. };
  25704. this.player.flyToPano(i, function() {
  25705. t && t({
  25706. success: !0,
  25707. message: "Transition complete."
  25708. })
  25709. })
  25710. } else
  25711. R.warn("Showcase -> clickPanoObject: Unable to find pano."),
  25712. t && t({
  25713. success: !1,
  25714. error: "Unable to find pano."
  25715. })
  25716. }
  25717. function o(e, t) {
  25718. var i = this.findRankedPano(e, t);
  25719. return i >= 0 ? this.handleToObject[i] : (R.warn("Showcase -> findRankedPanoObject: Unable to find nearby pano."),
  25720. null)
  25721. }
  25722. function a(e, t) {
  25723. var i = this.findRankedtag(e, t);
  25724. return i >= 0 ? this.handleToObject[i] : (R.warn("Showcase -> findRankedtagObject: Unable to find nearby tag."),
  25725. null)
  25726. }
  25727. function s(e, t) {
  25728. t.copy(I.FORWARD),
  25729. e.getDirection(t)
  25730. }
  25731. function l(e) {
  25732. function t(e) {
  25733. var t = (new c.Euler).setFromQuaternion(e.quaternion, "YXZ");
  25734. return {
  25735. x: c.Math.radToDeg(t._x),
  25736. y: c.Math.radToDeg(t._y),
  25737. z: c.Math.radToDeg(t._z)
  25738. }
  25739. }
  25740. var i = function(e) {
  25741. return e.alignmentType !== m.ALIGNED ? null : {
  25742. x: e.position.x,
  25743. y: e.position.y,
  25744. z: e.position.z
  25745. }
  25746. };
  25747. return {
  25748. panos: e.panos.list.map(function(n) {
  25749. var r = y.getCubemapUrls(e.urls, n.id, "high")[C.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z];
  25750. return {
  25751. uuid: n.id,
  25752. aligned: n.alignmentType === m.ALIGNED,
  25753. neighbourUUIDs: n.neighbourUUIDs.slice(),
  25754. position: i(n),
  25755. rotation: t(n),
  25756. thumbnail: r
  25757. }
  25758. })
  25759. }
  25760. }
  25761. var c = e("three")
  25762. , h = e("./ApiHost")
  25763. , u = e("../util/logger")
  25764. , d = e("../util/common")
  25765. , p = e("../util/math")
  25766. , f = e("../enum/ModelManagerEvents")
  25767. , g = e("./PostMessageType")
  25768. , m = e("../enum/AlignmentType")
  25769. , v = e("../enum/Direction")
  25770. , A = e("./TransitionStyles")
  25771. , y = e("../util/panorama")
  25772. , C = e("../enum/GLCubeFaces")
  25773. , I = e("../enum/Vectors")
  25774. , E = e("../enum/Viewmode")
  25775. , b = e("../enum/WarpStyle")
  25776. , w = (e("../enum/Keys"),
  25777. e("../enum/PlayerEvents"))
  25778. , _ = e("../sdk/SdkEvents")
  25779. , I = e("../enum/Vectors")
  25780. , T = e("../enum/ControlEvents")
  25781. , x = e("../enum/RenderLayers")
  25782. , S = (e("../constants"),
  25783. e("../settings"))
  25784. , M = e("../lib/jpeg_encoder")
  25785. , R = new u(i)
  25786. , P = function() {
  25787. var e = function e() {
  25788. e.playerDirection.copy(e.player.mode === E.FLOORPLAN ? I.UP : I.FORWARD),
  25789. e.player.getDirection(e.playerDirection),
  25790. e.projectVectors();
  25791. var t = e.playerDirection.angleTo(e.lastFacingDirection);
  25792. if (e.angleTravelled += Math.abs(t),
  25793. e.angleTravelled >= Math.abs(e.angle)) {
  25794. if (e.active = !1,
  25795. e.onDone) {
  25796. var i = e.onDone;
  25797. i()
  25798. }
  25799. } else
  25800. e.lastFacingDirection.copy(e.playerDirection),
  25801. window.setTimeout(e, 4)
  25802. };
  25803. return e.active = !1,
  25804. e.angle = 0,
  25805. e.angleTravelled = 0,
  25806. e.playerDirection = new c.Vector3,
  25807. e.lastFacingDirection = new c.Vector3,
  25808. e.onDone = null,
  25809. e.player = null,
  25810. e.start = function(t, i, n, r) {
  25811. e.active = !0,
  25812. t && i && (i = 0),
  25813. e.angle = t || i,
  25814. e.xAngle = t,
  25815. e.yAngle = i,
  25816. e.angleTravelled = 0,
  25817. e.playerDirection.copy(n.mode === E.FLOORPLAN ? I.UP : I.FORWARD),
  25818. n.getDirection(e.playerDirection),
  25819. e.lastFacingDirection.copy(e.playerDirection),
  25820. e.projectVectors(),
  25821. e.onDone = r,
  25822. e.player = n,
  25823. e()
  25824. }
  25825. ,
  25826. e.projectVectors = function() {
  25827. e.xAngle && (e.playerDirection.projectOnPlane(I.UP),
  25828. e.lastFacingDirection.projectOnPlane(I.UP))
  25829. }
  25830. ,
  25831. e
  25832. }()
  25833. , O = function() {
  25834. var e = new c.Vector3;
  25835. return function(t) {
  25836. t ? (e.copy(t.position),
  25837. e.add(t.discPosition),
  25838. p.projectPositionToCanvas(e, this.player.camera, e),
  25839. this.click(e.x, e.y)) : R.warn("Showcase -> clicktagObject: Unable to find tag.")
  25840. }
  25841. }()
  25842. , L = function() {
  25843. return this.player.mode === E.PANORAMA ? S.insideLookLimitUp : this.player.mode === E.DOLLHOUSE ? 90 - c.Math.radToDeg(S.dollhouseDefault.minPolarAngle) : null
  25844. }
  25845. , D = function() {
  25846. return this.player.mode === E.PANORAMA ? S.insideLookLimitDown : this.player.mode === E.DOLLHOUSE ? 90 - c.Math.radToDeg(S.dollhouseDefault.maxPolarAngle) : null
  25847. }
  25848. , N = function(e) {
  25849. var t = new c.Vector3;
  25850. return function(e) {
  25851. var i = this.player.getDirection();
  25852. t.copy(i);
  25853. var n = t.y;
  25854. t.y = 0,
  25855. t.normalize();
  25856. var r = c.Math.radToDeg(t.angleTo(i)) * (n < 0 ? -1 : 1);
  25857. if (this.player.mode !== E.DOLLHOUSE && this.player.mode !== E.PANORAMA)
  25858. return 0 !== e && R.warn("Cannot rotate in y direction when in " + this.player.mode + " mode"),
  25859. 0;
  25860. this.player.mode === E.DOLLHOUSE && (r = -r);
  25861. var o = L.call(this) - .1
  25862. , a = D.call(this) + .1
  25863. , s = r + e;
  25864. s > o ? s = o : s < a && (s = a);
  25865. var l = s - r;
  25866. return e > 0 && l < .01 && (l = 0),
  25867. e < 0 && l > -.01 && (l = 0),
  25868. l
  25869. }
  25870. }()
  25871. , B = function() {
  25872. var e = new c.Euler;
  25873. return function(t) {
  25874. return e.setFromQuaternion(t.quaternion, "YXZ"),
  25875. {
  25876. position: {
  25877. x: t.position.x,
  25878. y: t.position.y,
  25879. z: t.position.z
  25880. },
  25881. rotation: {
  25882. x: c.Math.radToDeg(e.x),
  25883. y: c.Math.radToDeg(e.y),
  25884. z: 0
  25885. },
  25886. pano: t.currentPano ? t.currentPano.id : null,
  25887. mode: t.mode
  25888. }
  25889. }
  25890. }()
  25891. , F = null;
  25892. t.exports = {
  25893. init: function(e, t, i, n, r) {
  25894. V.init(e, t, i, r),
  25895. F = new Promise(function(e, t) {
  25896. i.on(w.Ready, function() {
  25897. e()
  25898. })
  25899. }
  25900. .bind(this));
  25901. var o = new h(window)
  25902. , a = o.waitForConnection();
  25903. a.then(function(e) {
  25904. o.on(g.ACTION, V.onMessageReceive.bind(V))
  25905. });
  25906. var s = function() {
  25907. var e = Date.now();
  25908. return function() {
  25909. if (!(Date.now() - e < 100)) {
  25910. var t = B(i);
  25911. o.sendEvent(_.MOVE, {
  25912. state: t
  25913. }),
  25914. e = Date.now()
  25915. }
  25916. }
  25917. }();
  25918. i.on(w.Move, s),
  25919. i.on(w.ViewChanged, s),
  25920. n.on(f.ActiveModelChanged, function(e) {
  25921. function t(e) {
  25922. var t, i = e.newPano.id;
  25923. e.oldPano && (t = e.oldPano.id),
  25924. i !== t && o.sendEvent(_.ENTER_PANO, {
  25925. oldPano: t,
  25926. newPano: i
  25927. })
  25928. }
  25929. var i = e.model
  25930. , n = e.oldModel;
  25931. V.model = i,
  25932. a.then(function() {
  25933. o.sendEvent(_.MODEL_LOADED, {
  25934. metadata: l(i)
  25935. })
  25936. }),
  25937. n && n.panos.forEach(function(e) {
  25938. e.removeEventListener("enter", t)
  25939. }),
  25940. i.panos.forEach(function(e) {
  25941. e.on("enter", t)
  25942. })
  25943. })
  25944. }
  25945. };
  25946. var V = {
  25947. director: null,
  25948. player: null,
  25949. controls: null,
  25950. sceneRenderer: null,
  25951. model: null,
  25952. init: function(e, t, i, n) {
  25953. this.director = e,
  25954. this.player = i,
  25955. this.controls = t,
  25956. this.sceneRenderer = n
  25957. },
  25958. handleToObject: {},
  25959. objectToHandle: {},
  25960. handleCount: 0,
  25961. onMessageReceive: function(e) {
  25962. if (e) {
  25963. var t = e.targetFunction
  25964. , i = e.params
  25965. , n = e.onDone;
  25966. t && this[t] && this[t](i, n)
  25967. }
  25968. },
  25969. waitForInit: function(e, t) {
  25970. F.then(t.bind({
  25971. success: !0,
  25972. message: "Init complete."
  25973. }))
  25974. },
  25975. moveToPano: function(e, t) {
  25976. var i = new c.Euler(0,0,0,"YXZ")
  25977. , n = new c.Quaternion;
  25978. return function(e, t) {
  25979. var r = e.pano
  25980. , o = e.rotation
  25981. , a = e.transition;
  25982. if (!this.model)
  25983. return t({
  25984. success: !1,
  25985. error: "The model has not been loaded yet"
  25986. });
  25987. var s = this.model.panos.get(r);
  25988. if (!s)
  25989. return t({
  25990. success: !1,
  25991. error: r + " does not exist in this model"
  25992. });
  25993. if (!o)
  25994. return t({
  25995. sucess: !1,
  25996. erorr: o + " is not a valid rotation"
  25997. });
  25998. i.set(c.Math.degToRad(o.x || 0), c.Math.degToRad(o.y || 0), c.Math.degToRad(o.z || 0), "YXZ"),
  25999. console.log(o.z);
  26000. var l = {
  26001. success: !0,
  26002. message: r
  26003. };
  26004. if (a === A.FADEOUT)
  26005. n.setFromEuler(i),
  26006. this.player.warpToPano(s, n, null, null, b.BLACK, null, null, t.bind(this, l));
  26007. else {
  26008. var h, u;
  26009. a === A.INSTANT && (h = 0,
  26010. u = 0);
  26011. var d = I.FORWARD.clone().applyEuler(i).add(s.position);
  26012. this.player.flyToPano({
  26013. pano: s,
  26014. lookAtPoint: d,
  26015. duration: h,
  26016. aimDuration: u
  26017. }, t.bind(this, l))
  26018. }
  26019. }
  26020. }(),
  26021. moveInDirection: function(e, t) {
  26022. var i = e.direction;
  26023. return "undefined" == typeof v[i] ? (R.warn("Showcase -> moveInDirection: Cannot move in invalid direction."),
  26024. void (t && t({
  26025. success: !1,
  26026. error: "Invalid direction."
  26027. }))) : void this.player.flyLocalDirection(I[i].clone()).then(function(e) {
  26028. t(e ? {
  26029. success: !0,
  26030. message: "moved " + i
  26031. } : {
  26032. success: !1,
  26033. error: "Cannot move in direction: " + i
  26034. })
  26035. })
  26036. },
  26037. getPose: function(e, t) {
  26038. this.player.camera.position,
  26039. (new c.Euler).setFromQuaternion(this.player.camera.quaternion, "YXZ");
  26040. return t({
  26041. success: !0,
  26042. message: B(this.player)
  26043. })
  26044. },
  26045. takeScreenShot: function() {
  26046. var e = new c.PerspectiveCamera
  26047. , t = new c.WebGLRenderTarget;
  26048. return function(i, n) {
  26049. if (!i.resolution)
  26050. return n({
  26051. success: !1,
  26052. error: "An invalid resolution was specified"
  26053. });
  26054. if (i.resolution.width === -1 || i.resolution.height === -1) {
  26055. var r = this.sceneRenderer.renderer.getSize();
  26056. i.resolution.width = r.width,
  26057. i.resolution.height = r.height
  26058. }
  26059. e.layers.set(x.DEFAULT),
  26060. i.visibleObjects && (i.visibleObjects.showtags && e.layers.enable(x.TAG),
  26061. i.visibleObjects.showPucks && e.layers.enable(x.PANOMARKERS),
  26062. i.visibleObjects.showReticule && e.layers.enable(x.RETICULE));
  26063. var o = i.resolution.width
  26064. , a = i.resolution.height
  26065. , s = o / a;
  26066. e.position.copy(this.sceneRenderer.camera.position),
  26067. e.quaternion.copy(this.sceneRenderer.camera.quaternion),
  26068. e.projectionMatrix.copy(this.player.camera.projectionMatrix),
  26069. e.projectionMatrix.elements[0] = this.player.camera.projectionMatrix.elements[5] / s,
  26070. t.setSize(o, a),
  26071. this.sceneRenderer.renderer.render(this.sceneRenderer.scene, e, t);
  26072. var l = new Uint8Array(o * a * 4);
  26073. this.sceneRenderer.renderer.readRenderTargetPixels(t, 0, 0, o, a, l);
  26074. var c = M.encode({
  26075. data: l,
  26076. width: o,
  26077. height: a,
  26078. heading: 180,
  26079. pitch: 0
  26080. }, {
  26081. quality: 75,
  26082. flipY: !0
  26083. })
  26084. , h = "data:image/jpg;base64," + d.uint8ToBase64(c.data);
  26085. n({
  26086. success: !0,
  26087. message: h
  26088. })
  26089. }
  26090. }(),
  26091. findRankedPano: function(e, t) {
  26092. var i = new c.Vector3
  26093. , r = new c.Vector3;
  26094. return function(e, t) {
  26095. s(this.player, r),
  26096. n(t, r, i);
  26097. var o = this.player.rankedPanoInDirection(e, i);
  26098. if (o) {
  26099. var a = this.objectToHandle[o.id];
  26100. return a || (this.objectToHandle[o.id] = a = this.handleCount++,
  26101. this.handleToObject[a] = o),
  26102. a
  26103. }
  26104. return R.warn("Showcase -> findRankedPano: Unable to find nearby pano."),
  26105. -1
  26106. }
  26107. }(),
  26108. findRankedtag: function(e, t) {
  26109. var i = new c.Vector3
  26110. , r = new c.Vector3;
  26111. return function(e, t) {
  26112. s(this.player, r),
  26113. n(t, r, i);
  26114. var o = this.player.rankedtagInDirection(e, i);
  26115. if (o) {
  26116. var a = this.objectToHandle[o.sid];
  26117. return a || (this.objectToHandle[o.sid] = a = this.handleCount++,
  26118. this.handleToObject[a] = o),
  26119. a
  26120. }
  26121. return R.warn("Showcase -> findRankedtag: Unable to find nearby tag."),
  26122. -1
  26123. }
  26124. }(),
  26125. clickNearesttag: function(e) {
  26126. this.clickRankedtag(0, e)
  26127. },
  26128. clickRankedtag: function(e, t) {
  26129. var i = a.call(this, e, t);
  26130. i && O.call(this, i)
  26131. },
  26132. clickNearestPano: function(e, t) {
  26133. this.clickRankedPano(0, e, t)
  26134. },
  26135. clickRankedPano: function(e, t, i) {
  26136. var n = o.call(this, e, t);
  26137. n ? r.call(this, n, i) : i(null)
  26138. },
  26139. clickPano: function(e, t) {
  26140. var i = this.handleTable[e];
  26141. i ? r.call(this, i, t) : t(null)
  26142. },
  26143. rotateDirection: function() {
  26144. return function(e, t) {
  26145. var i = e.direction
  26146. , n = e.angle;
  26147. if (!P.active) {
  26148. var r = 0
  26149. , o = 0
  26150. , a = 0
  26151. , s = 0;
  26152. if (!n || isNaN(n))
  26153. return R.warn("Showcase -> rotateDirection: Invalid rotation angle."),
  26154. void (t && t({
  26155. success: !1,
  26156. error: "Invalid rotation angle."
  26157. }));
  26158. if (this.player.mode === E.TRANSITIONING)
  26159. return R.warn("Automation -> rotateDirection: Cannot rotate while transitioning"),
  26160. void (t && t({
  26161. success: !1,
  26162. error: "Cannot rotate while transitioning"
  26163. }));
  26164. if (i === v.RIGHT || i === v.LEFT)
  26165. i === v.RIGHT && (n = -n),
  26166. r = n > 0 ? -1 : 1,
  26167. a = n;
  26168. else {
  26169. if (i !== v.UP && i !== v.DOWN)
  26170. return R.warn("Showcase -> rotateDirection: Invalid direction for rotation: " + i),
  26171. void (t && t({
  26172. success: !1,
  26173. error: "Invalid direction for rotation."
  26174. }));
  26175. if (this.player.mode === E.FLOORPLAN)
  26176. return R.warn("Showcase -> rotateDirection: Cannot rotate " + i + " in floorplan mode"),
  26177. void (t && t({
  26178. success: !1,
  26179. error: "Cannot rotate " + i + " in floorplan mode"
  26180. }));
  26181. if (i === v.DOWN && (n = -n),
  26182. n = N.call(this, n),
  26183. 0 === n)
  26184. return R.warn("Showcase -> rotateDirection: Already at maximum rotation in direction: " + i),
  26185. void (t && t({
  26186. success: !1,
  26187. error: "Already at maximum rotation in direction: " + i
  26188. }));
  26189. o = n > 0 ? 1 : -1,
  26190. s = n
  26191. }
  26192. var l = n;
  26193. n = c.Math.degToRad(n),
  26194. a = c.Math.degToRad(a),
  26195. s = c.Math.degToRad(s);
  26196. var h = this.controls.activeControl
  26197. , u = function() {
  26198. h.stopRotating(!0),
  26199. t && t({
  26200. success: !0,
  26201. message: "Rotated " + l.toFixed(2) + "° in direction: " + e.direction
  26202. })
  26203. };
  26204. h.startRotating(r, o),
  26205. P.start(a, s, this.player, u)
  26206. }
  26207. }
  26208. }(),
  26209. rotate: function() {
  26210. var e = new c.Vector3
  26211. , t = new c.Vector3;
  26212. return function(i, n) {
  26213. var r = i.xAngle
  26214. , o = i.yAngle;
  26215. if (!P.active) {
  26216. if (r = r || 0,
  26217. o = o || 0,
  26218. isNaN(r) || isNaN(o))
  26219. return R.warn("Showcase -> rotate: Invalid rotation angle."),
  26220. void (n && n({
  26221. success: !1,
  26222. error: "Invalid rotation angle."
  26223. }));
  26224. if (this.player.mode === E.TRANSITIONING)
  26225. return R.warn("Automation -> rotate: Cannot rotate while transitioning"),
  26226. void (n && n({
  26227. success: !1,
  26228. error: "Cannot rotate while transitioning"
  26229. }));
  26230. Math.abs(r) < .01 && (r = 0),
  26231. Math.abs(o) < .01 && (o = 0);
  26232. var a = o;
  26233. o = N.call(this, o),
  26234. r = -r;
  26235. var s = a > 0 ? "UP" : "DOWN";
  26236. if (!r && a && !o)
  26237. return R.warn("Showcase -> rotate: Already at maximum rotation in direction: " + s),
  26238. void (n && n({
  26239. success: !1,
  26240. error: "Already at maximum rotation in direction: " + s
  26241. }));
  26242. a > o && R.warn("Showcase -> rotate: Reached maximum rotation in direction: " + s);
  26243. var l = o;
  26244. o = c.Math.degToRad(o),
  26245. r = c.Math.degToRad(r),
  26246. e.copy(this.player.mode === E.FLOORPLAN ? I.UP : I.FORWARD),
  26247. this.player.getDirection(e),
  26248. t.copy(e).applyAxisAngle(I.UP, r),
  26249. t.applyAxisAngle(I.RIGHT, o);
  26250. var h = (e.angleTo(t),
  26251. r > 0 ? -1 : r < 0 ? 1 : 0)
  26252. , u = o > 0 ? 1 : o < 0 ? -1 : 0;
  26253. Math.abs(r) > Math.abs(o) ? u *= Math.abs(o / r) : Math.abs(o) > Math.abs(r) && (h *= Math.abs(r / o));
  26254. var d = this.controls.activeControl
  26255. , p = function() {
  26256. d.stopRotating(!0),
  26257. n && n({
  26258. success: !0,
  26259. message: "Rotated " + i.xAngle.toFixed(2) + "° horizontally, " + l.toFixed(2) + "° vertically"
  26260. })
  26261. };
  26262. d.startRotating(h, u),
  26263. P.start(r, o, this.player, p)
  26264. }
  26265. }
  26266. }(),
  26267. panCamera: function(e, t) {
  26268. function i(e) {
  26269. switch (r.removeAllListeners(T.AutoPanComplete),
  26270. r.removeAllListeners(T.AutoPanInterrupt),
  26271. r.removeAllListeners(T.AutoPanClamped),
  26272. e) {
  26273. case T.AutoPanInterrupt:
  26274. t({
  26275. success: !0,
  26276. message: "Camera panning interrupted."
  26277. });
  26278. break;
  26279. case T.AutoPanClamped:
  26280. if (r.autoPanPosition.x !== n.x || r.autoPanPosition.z !== n.z) {
  26281. if (Math.abs(this.player.position.x - r.autoPanPosition.x) < .01 && Math.abs(this.player.position.z - r.autoPanPosition.z) < .01)
  26282. return void t({
  26283. success: !1,
  26284. error: "Already at edge of current model bounds."
  26285. });
  26286. var i = "The view point is outside the bounds for the current model. ";
  26287. i += "The view point was clamped to " + o(r.target.x, r.target.z),
  26288. console.warn(i)
  26289. }
  26290. case T.AutoPanComplete:
  26291. t({
  26292. success: !0,
  26293. message: "Panned camera to position " + o(r.autoPanPosition.x, r.autoPanPosition.z)
  26294. })
  26295. }
  26296. }
  26297. if (this.player.mode !== E.DOLLHOUSE && this.player.mode !== E.FLOORPLAN)
  26298. return t({
  26299. success: !1,
  26300. error: "Camera panning is not available in the current mode: " + this.player.mode
  26301. });
  26302. var n = e.position
  26303. , r = this.player.control;
  26304. r.setAutoPanPosition(n.x, n.z),
  26305. r.autoPan = !0;
  26306. var o = function(e, t) {
  26307. return "(" + e.toFixed(2) + ", " + t.toFixed(2) + ")"
  26308. };
  26309. r.on(T.AutoPanComplete, i.bind(this, T.AutoPanComplete)),
  26310. r.on(T.AutoPanInterrupt, i.bind(this, T.AutoPanInterrupt)),
  26311. r.on(T.AutoPanClamped, i.bind(this, T.AutoPanClamped))
  26312. },
  26313. click: function(e, t) {
  26314. var i = e.x
  26315. , n = e.y
  26316. , r = e.percentage;
  26317. r === !0 && (i = i / 100 * $("#player").width(),
  26318. n = n / 100 * $("#player").height()),
  26319. this.player.handleInputStart(i, n),
  26320. this.player.updateIntersect(),
  26321. this.player.handleInputEnd(i, n)
  26322. },
  26323. mouseOver: function(e, t) {
  26324. var i = e.x
  26325. , n = e.y
  26326. , r = e.percentage;
  26327. r === !0 && (i = i / 100 * $("#player").width(),
  26328. n = n / 100 * $("#player").height()),
  26329. this.player.handleInputMove(i, n),
  26330. this.player.updateIntersect()
  26331. },
  26332. moveToMode: function(e, t) {
  26333. function i(e) {
  26334. t(e ? {
  26335. success: !1,
  26336. error: "Failed to load new mode: " + e
  26337. } : {
  26338. success: !0,
  26339. message: "Moved to new mode: " + n
  26340. })
  26341. }
  26342. var n = e.mode;
  26343. n === E.PANORAMA || n === E.DOLLHOUSE || n === E.FLOORPLAN ? this.director.changeMode(n).then(function() {
  26344. i()
  26345. }, function(e) {
  26346. i(e)
  26347. }) : t({
  26348. success: !1,
  26349. error: "Invalid mode selection"
  26350. })
  26351. }
  26352. }
  26353. }
  26354. ).call(this, "/js/sdk/automation.js")
  26355. }
  26356. , {
  26357. "../constants": 8,
  26358. "../enum/AlignmentType": 17,
  26359. "../enum/ControlEvents": 21,
  26360. "../enum/Direction": 22,
  26361. "../enum/GLCubeFaces": 25,
  26362. "../enum/Keys": 30,
  26363. "../enum/ModelManagerEvents": 33,
  26364. "../enum/PlayerEvents": 40,
  26365. "../enum/RenderLayers": 41,
  26366. "../enum/Vectors": 50,
  26367. "../enum/Viewmode": 51,
  26368. "../enum/WarpStyle": 52,
  26369. "../lib/jpeg_encoder": 94,
  26370. "../sdk/SdkEvents": 161,
  26371. "../settings": 166,
  26372. "../util/common": 185,
  26373. "../util/logger": 189,
  26374. "../util/math": 190,
  26375. "../util/panorama": 191,
  26376. "./ApiHost": 159,
  26377. "./PostMessageType": 160,
  26378. "./TransitionStyles": 162,
  26379. three: 217
  26380. }],
  26381. 165: [function(e, t, i) {
  26382. "use strict";
  26383. function n(e) {
  26384. this.sourceWindow = e,
  26385. this.targetWindow = null,
  26386. this.targetOrigin = null,
  26387. this.id = Math.floor(1e5 * Math.random()),
  26388. this.bindEvents()
  26389. }
  26390. var r = e("./PostMessageType")
  26391. , o = e("events").EventEmitter;
  26392. n.prototype = Object.create(o.prototype),
  26393. n.prototype.bindEvents = function() {
  26394. this.sourceWindow.addEventListener("message", this.onPostmessageReceived.bind(this))
  26395. }
  26396. ,
  26397. n.prototype.setTarget = function(e, t) {
  26398. this.targetWindow = e,
  26399. this.targetOrigin = t
  26400. }
  26401. ,
  26402. n.prototype.onPostmessageReceived = function(e) {
  26403. var t = e.origin || e.originalEvent.origin
  26404. , i = e.source;
  26405. switch (e.data.type) {
  26406. case r.CONNECT:
  26407. break;
  26408. case r.RESPONSE:
  26409. if (this.id !== e.data.toId)
  26410. return;
  26411. default:
  26412. if (!this.validateMessageOrigin(t))
  26413. return
  26414. }
  26415. var n = e.data;
  26416. n.source = i,
  26417. n.origin = t,
  26418. n.timestamp = Date.now(),
  26419. this.emit(e.data.type, n)
  26420. }
  26421. ,
  26422. n.prototype.validateMessageOrigin = function(e) {
  26423. return "*" === this.targetOrigin || e === this.targetOrigin
  26424. }
  26425. ,
  26426. n.prototype.send = function(e) {
  26427. this.targetWindow && this.targetOrigin && (e.fromId = this.id,
  26428. this.targetWindow.postMessage(e, this.targetOrigin))
  26429. }
  26430. ,
  26431. t.exports = n
  26432. }
  26433. , {
  26434. "./PostMessageType": 160,
  26435. events: 202
  26436. }],
  26437. 166: [function(e, t, i) {
  26438. "use strict";
  26439. var n = e("three")
  26440. , r = e("./util/browser")
  26441. , o = e("./enum/Viewmode")
  26442. , a = e("./enum/VROption")
  26443. , s = e("./enum/Colors")
  26444. , l = e("./enum/WarpStyle")
  26445. , c = e("./util/easing")
  26446. , h = e("./util/common")
  26447. , u = e("./util/showcase")
  26448. , d = e("./constants")
  26449. , p = {
  26450. debug: !1,
  26451. version: "2.25.6-0-gd87e5b1",
  26452. languageTag: r.valueFromHash("lang", null),
  26453. pageTitle: "四维虚拟漫游",
  26454. authorizationHeader: u.getAuthorizationHeader(),
  26455. autoplay: r.valueFromHash("play", !1) || !r.inIframe(),
  26456. logLevel: r.valueFromHash("log", 2),
  26457. skyboxRadius: 2500,
  26458. modelBoundsPadding: 5,
  26459. showNeighbors: !1,
  26460. brand: r.valueFromHash("brand", !0),
  26461. showHighlights: r.valueFromHash("hhl", !0) && r.valueFromHash("hr", 1),
  26462. startHighlights: r.valueFromHash("hl", -1),
  26463. specialEdition: r.valueFromHash("bn", 0),
  26464. useWheel: r.valueFromHash("wh", !0),
  26465. crossOrigin: "anonymous",
  26466. fancierTransition: !1,
  26467. wireframe: !1,
  26468. skyboxWireframe: !1,
  26469. modelAlpha: 1,
  26470. highlightPanoSelection: !1,
  26471. showSweeps: !0,
  26472. showSkyboxes: !1,
  26473. showMesh: !0,
  26474. showFloors: !1,
  26475. showFloorDuration: 300,
  26476. showFloorDelay: 300,
  26477. hideFloorDuration: 300,
  26478. hideFloorDelay: 0,
  26479. reticuleOpacityTransitionTime: 250,
  26480. reticuleColor: window.DATA.mouseMarkerColor || s.newBlue, // 方奕卓 配置鼠标标志颜色
  26481. markerOpacityTransitionTime: 500,
  26482. guiAnimationSpeed: 250,
  26483. highlightAnimationDuration: 500,
  26484. modelComponentLoadSpinnerDelay: 150,
  26485. captureErrors: !1,
  26486. maxMobileTextures: 6,
  26487. minimalMemoryMode: r.valueFromHash("m3", r.isMobile()),
  26488. startupFlyinDelay: 3e3,
  26489. dollhouseDefault: {
  26490. minDistance: 15,
  26491. maxDistance: 50,
  26492. minPolarAngle: n.Math.degToRad(10),
  26493. maxPolarAngle: n.Math.degToRad(90)
  26494. },
  26495. hideReticuleTimeout: 1e3,
  26496. analytics: {
  26497. inactivityThreshold: 30,
  26498. sessionTrackingRate: .15,
  26499. maxTrackedErrors: 20,
  26500. sessionDurationPingFrequency: 10,
  26501. sessionDurationTimeout: 15
  26502. },
  26503. flydown: {
  26504. movementEasing: "easeInOutQuad",
  26505. movementDelay: .001,
  26506. rotationEasing: "easeInOutQuad",
  26507. rotationDelay: .5,
  26508. modelTextureDelay: .75,
  26509. skyboxDelay: .75
  26510. },
  26511. transition: {
  26512. flySpeed: .001,
  26513. flyTime: 750,
  26514. flytimeMaxDistanceThreshold: 5,
  26515. flytimeDistanceMultiplier: 150,
  26516. aimTime: 1500,
  26517. aimSlowFactor: 1.5,
  26518. blur: 0.8,
  26519. movementEasing: "easeInOutQuad",
  26520. blendEasing: "easeInOutQuad",
  26521. fastForwardFactor: 4,//r.valueFromHash("mfis", 3) //快速停止导览的速度,原先是3
  26522. },
  26523. show360Views: {
  26524. enabled: !0,
  26525. transitionTime: 1e3
  26526. },
  26527. quickstart: {
  26528. enabled: 1 === r.valueFromHash("qust", 0) || 1 === r.valueFromHash("qs", 0),
  26529. animation: 1400,
  26530. showTextDelay: 500,
  26531. fadeOutDelay: 3e3,
  26532. fovChange: 10
  26533. },
  26534. appConfig: {
  26535. webvr_version: null,
  26536. segment_key: null,
  26537. embedly_key: null,
  26538. branch_key: null,
  26539. keen_write_key: null,
  26540. keen_project_id: null
  26541. },
  26542. vr: {
  26543. enabled: !0,
  26544. allowWebVR: !1,
  26545. option: r.valueFromHash("vr", a.CONTEXTUAL)
  26546. },
  26547. share: {
  26548. enabled: !r.valueFromHash("mls", 0) && r.valueFromHash("brand", !0)
  26549. },
  26550. input: {
  26551. longTapThreshold: 200,
  26552. moveToleranceNDC: 0.01,//.08,
  26553. touchMoveThreshold: 25
  26554. },
  26555. help: {
  26556. modalStayDuration: 600
  26557. },
  26558. immersive: {
  26559. timeToShowAgain: 1250,
  26560. uiStayDuration: 600
  26561. },
  26562. tourInteraction: {
  26563. disabled: "0" === r.valueFromHash("tourcta", null),
  26564. showPauseButton: 1e3,
  26565. showModal: 1500,
  26566. allowNextClick: 200,
  26567. largeModal: "1" === r.valueFromHash("tourcta", null),
  26568. smallModal: "2" === r.valueFromHash("tourcta", null)
  26569. },
  26570. labels: {
  26571. enabled: !1,
  26572. hideUntilStart: !0,
  26573. fadeInDuration: 250,
  26574. fadeInDelay: 250,
  26575. fadeOutDuration: 250,
  26576. fadeOutDelay: 0,
  26577. zoomHideThreshhold: {
  26578. mobile: r.isSmallScreen() ? .45 : .6,
  26579. desktop: 2
  26580. },
  26581. zoomTruncateThreshhold: {
  26582. mobile: r.isSmallScreen() ? .35 : .45,
  26583. desktop: .85
  26584. },
  26585. minLengthForTruncate: 16,
  26586. truncateLength: 12,
  26587. truncateSuffix: "..."
  26588. },
  26589. tags: {
  26590. enabled: r.valueFromHash("mt", 1),
  26591. startup: {
  26592. hideUntilStart: !0,
  26593. fadeInDuration: 500,
  26594. fadeInDelay: 100
  26595. },
  26596. visibility: {
  26597. anyDistance: !0,
  26598. visibleDistance: 8,
  26599. cameraClearance: .1,
  26600. alphaTestLevel: .05,
  26601. hideViaFloor: !0,
  26602. hideOffScreenDisc: !1,
  26603. hideOffScreenObject: !1
  26604. },
  26605. disc: {
  26606. opacity: 1,
  26607. disabledOpacity: .5,
  26608. scale: {
  26609. nearBound: 1.5,
  26610. farBound: 4.8,
  26611. linkFarBound: !1,
  26612. linkPercent: 40,
  26613. maxSize: 80,
  26614. minSize: 40,
  26615. baseViewportSize: 800,
  26616. responsiveness: 100
  26617. }
  26618. },
  26619. pole: {
  26620. enabled: !0,
  26621. height: .5,
  26622. width: 2,
  26623. opacity: .5,
  26624. color: "white"
  26625. },
  26626. navigate: {
  26627. nearestPano: !0,
  26628. lineOfSight: !0,
  26629. reactivate: !0,
  26630. aimAt: "disc",
  26631. tiltTolerance: 25,
  26632. rotateSpeedFactor: .6
  26633. }
  26634. },
  26635. path: {
  26636. color: window.DATA.floorMarkerColor || s.newBlue, // 方奕卓 配置导览标志颜色
  26637. colorUp: s._desat(s.newBlue, .5),
  26638. colorDown: s._darken(s.newBlue, .35),
  26639. opacity: .5,
  26640. style: "ribbon",
  26641. height: .025,
  26642. ribbonWidth: .24,
  26643. outsideHeight: .5,
  26644. waypointRadius: .5,
  26645. waypointIndoorRadius: .24,
  26646. waypointPulse: 1e3,
  26647. typ: l.BLACK,
  26648. meshFree: r.valueFromHash("mf", 1),
  26649. mapGuides: r.valueFromHash("guides", !0),
  26650. fadeInTime: 400,
  26651. fadeOutTime: 300
  26652. },
  26653. warp: {
  26654. nearPanoDist: .1,
  26655. matchCam: !1,
  26656. blur: .33,
  26657. fastTime: 1500,
  26658. teleportTime: 1500,//瞬间过渡的时间
  26659. flytimeDistanceMultiplier:150,//add
  26660. flyTime:750,//add
  26661. outsideTime: 2e3,
  26662. lookAheadMax: .3,
  26663. lookAheadDist: 2.5,
  26664. softPushDist: .37,
  26665. softPushEnd: .3,
  26666. softBendAngle: 8,
  26667. softBendTilt: 4,
  26668. softBendEnd: .3,
  26669. doBurns: true, //r.valueFromHash("kb", !0),
  26670. burnsAngle: 8, //导览在每个点停留时的旋转角度
  26671. minBurnsAngle: 35,
  26672. minDownAngle: -35,
  26673. maxTurnPerSec: 280,
  26674. maxAimPerSec: 35,
  26675. minRotation: 12,
  26676. maxAimRotation: 33.2,
  26677. turnFriction: .2,
  26678. flySpeed: .01,
  26679. minWarpTime: 1200,
  26680. warpInterruptionRedirectTime: 500,
  26681. tourStepDelay: r.valueFromHash("st", 0),
  26682. walkDelay: 0,
  26683. walkMaxDist: 50,
  26684. walkMinDist: .8,
  26685. walkSlideShowThreshhold: 3000,
  26686. walkExtraPanosDistance: .4,
  26687. timePerMeter: 1200,
  26688. motionLeadTime: 5000,
  26689. movementEasing: "easeInOutQuad",
  26690. blendEasing: "easeInOutQuad",
  26691. showBunny: !1,
  26692. loop: r.valueFromHash("lp", !1),
  26693. auto: r.valueFromHash("ts", -1),
  26694. eOrder: 'YXZ', //"YXZ",
  26695. stepFactor: .25,
  26696. brakeStrength: 2,
  26697. minBrakeAngle: .1,
  26698. maxBrakeAngle: 1.8,
  26699. climbEffort: 4
  26700. },
  26701. rotationFriction: .05,
  26702. rotationAccelerationInside: 4.5,
  26703. rotationAccelerationOutside: .15,
  26704. rotationAfterMoveMultiplier: 40,
  26705. rotationAfterMoveHistoryCount: 5,
  26706. panFriction: .09,
  26707. panAccelerationOutside: 60,
  26708. onload: r.valueFromHash("onload", o.PANORAMA),
  26709. zoomNearLimit: .1,
  26710. zoomFarLimit: 50,
  26711. navigation: {
  26712. panoScores: !1,
  26713. mouseDirection: !0,
  26714. filterStrictness: .75,
  26715. angleFactor: -30,
  26716. directionFactor: 10,
  26717. distanceFactor: -1,
  26718. optionalityFactor: 3
  26719. },
  26720. sdkInit: !1,
  26721. secretPanelWord: [38, 38, 40, 40, 37, 39, 37, 39, 66, 65],
  26722. console: r.valueFromHash("console", !1),
  26723. noMeshFloorPositionOffset: new n.Vector3(0,-1.2,0),
  26724. panoramaNeighbourMaxDistance: 5,
  26725. panoFloorClickRadius: .35,
  26726. showScreenshotLocations: !1,
  26727. showAxis: !1,
  26728. showNeighbourRaycasts: !1,
  26729. colorMarkerOnLoad: !1,
  26730. colorMarkerByFloor: !1,
  26731. tiling: {
  26732. panoPreRenderRepeatDelay: 2500,
  26733. panoPreRenderDelay: 500,
  26734. preRenderTourPanos: r.valueFromHash("tileprerender", 0),
  26735. tilingFlagNames: ["usetiles", "tiles"],
  26736. maxNavPanoQuality: r.valueFromHash("maxtileq", null),
  26737. maxZoomPanoQuality: r.valueFromHash("maxztileq", null),
  26738. overlayStyle: r.valueFromHash("tileoverlay", 0),
  26739. uploadIntervalDelay: r.valueFromHash("tileupdelay", 10),
  26740. initialIntervalDelay: r.valueFromHash("itiledelay", 0),
  26741. maxNonBaseUploadsPerFrame: r.valueFromHash("maxnbtpf", 1/* 2 */),
  26742. maxBaseUploadsPerFrame: r.valueFromHash("maxbtpf", 6),
  26743. customCompression: r.valueFromHash("tilecustcomp", 0),
  26744. // mobileHighQualityOverride: !1,
  26745. mobileHighQualityOverride: 1,
  26746. allowUltraHighResolution: true
  26747. },
  26748. zoom: {
  26749. enabled: true,
  26750. forceOff: r.valueFromHash("nozoom", 0),
  26751. overridemax: r.valueFromHash("maxzoom", null),
  26752. overridemin: r.valueFromHash("minzoom", null),
  26753. max: d.highQualityMaxZoom,
  26754. min: 1,
  26755. transitionStyle: r.valueFromHash("zoomtrans", 1),
  26756. activationThreshold: 1.1,
  26757. restoreTime: 500
  26758. },
  26759. profiling: {
  26760. enabled: r.valueFromHash("mem", !1)
  26761. }
  26762. };
  26763. p = h.deepExtend(p, d, {
  26764. insideFOV: r.valueFromHash("fov", d.insideFOV),
  26765. insideFOVMax: r.valueFromHash("fovmax", d.insideFOVMax),
  26766. panorama: {
  26767. transitionTime: 1e3,
  26768. modelAlpha: 0,
  26769. modelAlphaDelay: p.flydown.modelTextureDelay,
  26770. modelAlphaLength: 1,
  26771. skyboxOpacity: 1,
  26772. skyboxOpacityDelay: p.flydown.skyboxDelay,
  26773. skyboxOpacityLength: .9,
  26774. fovLength: 1,
  26775. fovDelay: 0,
  26776. cameraMatrixDuration: .8,
  26777. cameraMatrixDelay: 0,
  26778. cameraMatrixEase: c.easeInCubic,
  26779. reticuleOpacity: 1,
  26780. markerOpacity: .3,
  26781. markerOpacityOnHover: 1
  26782. },
  26783. dollhouse: {
  26784. transitionTime: 1e3,
  26785. modelAlpha: 1,
  26786. modelAlphaDelay: 0,
  26787. modelAlphaLength: 1 - p.flydown.modelTextureDelay,
  26788. skyboxOpacity: 0,
  26789. skyboxOpacityDelay: 0,
  26790. skyboxOpacityLength: 1 - p.flydown.skyboxDelay,
  26791. fovLength: 1,
  26792. fovDelay: 0,
  26793. cameraMatrixDuration: .8,
  26794. cameraMatrixDelay: .3,
  26795. cameraMatrixEase: c.easeInCubic,
  26796. reticuleOpacity: 1,
  26797. markerOpacity: 0,
  26798. markerOpacityOnHover: 0
  26799. },
  26800. floorplan: {
  26801. transitionTime: 1e3,
  26802. modelAlpha: 1,
  26803. modelAlphaDelay: 0,
  26804. modelAlphaLength: 1 - p.flydown.modelTextureDelay,
  26805. skyboxOpacity: 0,
  26806. skyboxOpacityDelay: 0,
  26807. skyboxOpacityLength: 1 - p.flydown.skyboxDelay,
  26808. fovLength: 1,
  26809. fovDelay: 0,
  26810. cameraMatrixDuration: .5,
  26811. cameraMatrixDelay: 0,
  26812. cameraMatrixEase: c.easeOutCubic,
  26813. reticuleOpacity: 1,
  26814. markerOpacity: 0,
  26815. markerOpacityOnHover: 0,
  26816. cameraHeight: 50
  26817. },
  26818. transitioning: {
  26819. reticuleOpacity: 0,
  26820. markerOpacity: .3,
  26821. markerOpacityOnHover: 1
  26822. },
  26823. "floorplan-dollhouse": {
  26824. rotationDelay: 0,
  26825. rotationDuration: 1
  26826. },
  26827. "floorplan-panorama": {
  26828. rotationDelay: .5,
  26829. rotationDuration: 1
  26830. },
  26831. "dollhouse-panorama": {
  26832. rotationDelay: .5,
  26833. rotationDuration: 1
  26834. },
  26835. "dollhouse-floorplan": {
  26836. rotationDelay: 0,
  26837. rotationDuration: 1,
  26838. cameraMatrixDuration: 1.05,
  26839. cameraMatrixDelay: .5
  26840. },
  26841. "panorama-dollhouse": {
  26842. rotationDelay: 0,
  26843. rotationDuration: .5
  26844. },
  26845. "panorama-floorplan": {
  26846. transitionTime: 1500,
  26847. rotationDelay: 0,
  26848. rotationDuration: .5
  26849. }
  26850. }),
  26851. p.path.meshFree && (p.path.typ = l.WALK),
  26852. p.zoom.max = p.zoom.overridemax || p.zoom.max,
  26853. p.zoom.min = p.zoom.overridemin || p.zoom.min,
  26854. window._settings = t.exports = p
  26855. }
  26856. , {
  26857. "./constants": 8,
  26858. "./enum/Colors": 19,
  26859. "./enum/VROption": 47,
  26860. "./enum/Viewmode": 51,
  26861. "./enum/WarpStyle": 52,
  26862. "./util/browser": 182,
  26863. "./util/common": 185,
  26864. "./util/easing": 186,
  26865. "./util/showcase": 193,
  26866. three: 217
  26867. }],
  26868. 167: [function(e, t, i) {
  26869. "use strict";
  26870. var n = e("three")
  26871. , r = e("./settings")
  26872. , 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"
  26873. , a = "precision highp float;\nprecision highp int;\n\nuniform mat4 viewMatrix;\nuniform vec3 cameraPosition;\n";
  26874. t.exports = {
  26875. basicTextured: {
  26876. uniforms: {
  26877. tDiffuse: {
  26878. type: "t",
  26879. value: null
  26880. },
  26881. alpha: {
  26882. type: "f",
  26883. value: 1
  26884. }
  26885. },
  26886. vertexShader: "varying vec2 vUv;\nvoid main() {\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n}",
  26887. 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}"
  26888. },
  26889. copyCubeMap: {
  26890. uniforms: {
  26891. tDiffuse: {
  26892. type: "t",
  26893. value: null
  26894. },
  26895. alpha: {
  26896. type: "f",
  26897. value: 1
  26898. }
  26899. },
  26900. 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}",
  26901. 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}"
  26902. },
  26903. cube: {
  26904. uniforms: {
  26905. map: {
  26906. type: "t",
  26907. value: null
  26908. },
  26909. opacity: {
  26910. type: "f",
  26911. value: 1
  26912. }
  26913. },
  26914. vertexShader: o + "varying vec3 vWorldPosition;\n\nvoid main() {\n vWorldPosition = position;\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}\n",
  26915. 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"
  26916. },
  26917. model: {
  26918. uniforms: {
  26919. map: {
  26920. type: "t",
  26921. value: null
  26922. },
  26923. modelAlpha: {
  26924. type: "f",
  26925. value: r.modelAlpha
  26926. },
  26927. opacity: {
  26928. type: "f",
  26929. value: 1
  26930. },
  26931. progress: {
  26932. type: "f",
  26933. value: 0
  26934. },
  26935. blackout: {
  26936. type: "i",
  26937. value: 0
  26938. },
  26939. pano0Map: {
  26940. type: "t",
  26941. value: null
  26942. },
  26943. pano0Position: {
  26944. type: "v3",
  26945. value: new n.Vector3
  26946. },
  26947. pano0Matrix: {
  26948. type: "m4",
  26949. value: new n.Matrix4
  26950. },
  26951. pano1Map: {
  26952. type: "t",
  26953. value: null
  26954. },
  26955. pano1Position: {
  26956. type: "v3",
  26957. value: new n.Vector3
  26958. },
  26959. pano1Matrix: {
  26960. type: "m4",
  26961. value: new n.Matrix4
  26962. }
  26963. },
  26964. vertexShader: o + `uniform vec3 pano0Position;
  26965. uniform mat4 pano0Matrix;\n\nuniform vec3 pano1Position;\n
  26966. uniform mat4 pano1Matrix;\n\nvarying vec2 vUv;\n
  26967. varying vec3 vWorldPosition0;
  26968. varying vec3 vWorldPosition1;
  26969. uniform int blackout;
  26970. void main() {
  26971. vUv = uv;
  26972. vec4 worldPosition = modelMatrix * vec4(position, 1.0);
  26973. vec3 positionLocalToPanoCenter0 = worldPosition.xyz - pano0Position;
  26974. vWorldPosition0 = (vec4(positionLocalToPanoCenter0, 1.0) * pano0Matrix).xyz;
  26975. vWorldPosition0.x *= -1.0;
  26976. vec3 positionLocalToPanoCenter1 = worldPosition.xyz - pano1Position;
  26977. vWorldPosition1 = (vec4(positionLocalToPanoCenter1, 1.0) * pano1Matrix).xyz;
  26978. vWorldPosition1.x *= -1.0;
  26979. gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );
  26980. }`,
  26981. fragmentShader: a + `uniform sampler2D map;\nuniform float modelAlpha;\nuniform float opacity;\n
  26982. 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
  26983. void main() {
  26984. const vec4 BLACK = vec4(0.0, 0.0, 0.0, 1.0);
  26985. const vec4 GREY = vec4(0.5, 0.5, 0.5, 1.0);
  26986. vec4 colorFromPanos;
  26987. if (blackout == 5){//add for TransitionPass
  26988. colorFromPanos = textureCube( pano1Map, vWorldPosition1.xyz) ;
  26989. }else{
  26990. vec4 colorFromPano0 = textureCube( pano0Map, vWorldPosition0.xyz);
  26991. vec4 colorFromPano1 = textureCube( pano1Map, vWorldPosition1.xyz);
  26992. if (blackout == 0) {colorFromPanos = mix(colorFromPano0, colorFromPano1, progress);}
  26993. else if (blackout == 1) {
  26994. colorFromPanos = mix(colorFromPano0, BLACK, min(1.0, progress*2.0));
  26995. colorFromPanos = mix(colorFromPanos, colorFromPano1, max(0.0, progress * 2.0 - 1.0));
  26996. }
  26997. else if (blackout == 2) {colorFromPanos = mix(colorFromPano0, BLACK, progress);}
  26998. else if (blackout == 3) {colorFromPanos = mix(BLACK, colorFromPano1, max(0.0, progress * 2.0 - 1.0));}
  26999. }
  27000. //#ifdef useModelMap //起不了作用为啥
  27001. if(modelAlpha>0.0){
  27002. vec4 colorFromTexture = texture2D( map, vUv );
  27003. colorFromPanos = mix(colorFromPanos, colorFromTexture, modelAlpha);
  27004. }
  27005. //#endif
  27006. float whiteness = 1.0 - smoothstep(0.1, 0.2, opacity);
  27007. colorFromPanos = mix(colorFromPanos, GREY, whiteness);
  27008. gl_FragColor = vec4(colorFromPanos.rgb, opacity);
  27009. }`
  27010. },
  27011. hot:{
  27012. uniforms:{
  27013. color:{
  27014. type: "c",
  27015. value: new n.Color( 0xff2200 )
  27016. },
  27017. opac:{
  27018. type: "f",
  27019. value: 0
  27020. },
  27021. texture1:{
  27022. type: "t",
  27023. value: null
  27024. },
  27025. texture2:{
  27026. type: "t",
  27027. value: null
  27028. }
  27029. },
  27030. vertexShader:"varying vec2 vUv;\n\nvoid main() {\n\n vUv = uv ;\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\n}\n",
  27031. 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"
  27032. },
  27033. modelOutside: {
  27034. uniforms: {
  27035. map: {
  27036. type: "t",
  27037. value: null
  27038. },
  27039. opacity: {
  27040. type: "f",
  27041. value: 1
  27042. }
  27043. },
  27044. vertexShader: o + "varying vec2 vUv;\n\nvoid main() {\n\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\n}\n",
  27045. 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"
  27046. },
  27047. ribbon: {
  27048. uniforms: {
  27049. map: {
  27050. type: "t",
  27051. value: null
  27052. },
  27053. opacity: {
  27054. type: "f",
  27055. value: 1
  27056. },
  27057. color: {
  27058. type: "c",
  27059. value: new n.Color(r.path.color)
  27060. }
  27061. },
  27062. 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",
  27063. 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"
  27064. },
  27065. waypoint: {
  27066. uniforms: {
  27067. map: {
  27068. type: "t",
  27069. value: null
  27070. },
  27071. opacity: {
  27072. type: "f",
  27073. value: 1
  27074. },
  27075. pulse: {
  27076. type: "f",
  27077. value: 1
  27078. },
  27079. nearFade: {
  27080. type: "v2",
  27081. value: new n.Vector2(2 * r.insideNear,2 * r.path.waypointIndoorRadius)
  27082. },
  27083. color: {
  27084. type: "c",
  27085. value: new n.Color(r.reticuleColor)
  27086. }
  27087. },
  27088. 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",
  27089. 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"
  27090. },
  27091. modelDebug: {
  27092. uniforms: {
  27093. map: {
  27094. type: "t",
  27095. value: null
  27096. },
  27097. modelAlpha: {
  27098. type: "f",
  27099. value: r.modelAlpha
  27100. },
  27101. depthmapRatio: {
  27102. type: "f",
  27103. value: 0
  27104. },
  27105. opacity: {
  27106. type: "f",
  27107. value: 1
  27108. },
  27109. progress: {
  27110. type: "f",
  27111. value: 0
  27112. },
  27113. considerOcclusion: {
  27114. type: "i",
  27115. value: r.fancierTransition
  27116. },
  27117. highlightPanoSelection: {
  27118. type: "i",
  27119. value: 0
  27120. },
  27121. useThirdPano: {
  27122. type: "i",
  27123. value: r.useThirdPano
  27124. },
  27125. pano0Map: {
  27126. type: "t",
  27127. value: null
  27128. },
  27129. pano0Depth: {
  27130. type: "t",
  27131. value: null
  27132. },
  27133. pano0Position: {
  27134. type: "v3",
  27135. value: new n.Vector3
  27136. },
  27137. pano0Matrix: {
  27138. type: "m4",
  27139. value: new n.Matrix4
  27140. },
  27141. pano0Weight: {
  27142. type: "f",
  27143. value: r.transition.pano0Weight
  27144. },
  27145. pano1Map: {
  27146. type: "t",
  27147. value: null
  27148. },
  27149. pano1Depth: {
  27150. type: "t",
  27151. value: null
  27152. },
  27153. pano1Position: {
  27154. type: "v3",
  27155. value: new n.Vector3
  27156. },
  27157. pano1Matrix: {
  27158. type: "m4",
  27159. value: new n.Matrix4
  27160. },
  27161. pano1Weight: {
  27162. type: "f",
  27163. value: r.transition.pano1Weight
  27164. },
  27165. pano2Map: {
  27166. type: "t",
  27167. value: null
  27168. },
  27169. pano2Depth: {
  27170. type: "t",
  27171. value: null
  27172. },
  27173. pano2Position: {
  27174. type: "v3",
  27175. value: new n.Vector3
  27176. },
  27177. pano2Matrix: {
  27178. type: "m4",
  27179. value: new n.Matrix4
  27180. },
  27181. pano2Weight: {
  27182. type: "f",
  27183. value: r.transition.pano2Weight
  27184. }
  27185. },
  27186. 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",
  27187. 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"
  27188. },
  27189. customDepth: {
  27190. uniforms: {
  27191. panoPosition: {
  27192. type: "v3",
  27193. value: new n.Vector3
  27194. }
  27195. },
  27196. 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",
  27197. 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"
  27198. },
  27199. skysphere: {
  27200. uniforms: {
  27201. radius: {
  27202. type: "f",
  27203. value: 0
  27204. }
  27205. },
  27206. 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",
  27207. 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"
  27208. },
  27209. tagDisc: {
  27210. uniforms: {
  27211. opacity: {
  27212. type: "f",
  27213. value: 0
  27214. },
  27215. color: {
  27216. type: "c",
  27217. value: new n.Color
  27218. },
  27219. bg: {
  27220. type: "t",
  27221. value: null
  27222. },
  27223. mask: {
  27224. type: "t",
  27225. value: null
  27226. }
  27227. },
  27228. vertexShader: o + "varying vec2 vUv;\nvoid main() {\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n}",
  27229. 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"
  27230. }
  27231. }
  27232. }
  27233. , {
  27234. "./settings": 166,
  27235. three: 217
  27236. }],
  27237. 168: [function(e, t, i) {
  27238. (function(i) {
  27239. "use strict";
  27240. var n = e("three")
  27241. , r = (e("url"),
  27242. e("./util/ajax"))
  27243. , o = e("./settings")
  27244. , a = e("./util/logger")
  27245. , s = e("./util/math")
  27246. , l = e("./util/showcase")
  27247. , c = e("./objects/Panorama")
  27248. , h = new a(i)
  27249. , u = e("./model/Model")
  27250. , d = e("./shaders")
  27251. , p = e("./util/transitions")
  27252. , f = e("./objects/Chunk")
  27253. , g = e("./objects/Reticule")
  27254. , m = e("./objects/Skybox")
  27255. , v = e("./objects/Floor")
  27256. , A = e("./cameras/DollhouseCamera")
  27257. , y = e("./cameras/FloorplanCamera")
  27258. , C = e("./cameras/PanoramaCamera")
  27259. , I = e("./controls/DollhouseControls")
  27260. , E = e("./controls/FloorplanControls")
  27261. , b = e("./controls/PanoramaControls");
  27262. n.ImageUtils.crossOrigin = o.crossOrigin,
  27263. t.exports = {
  27264. shaders: d,
  27265. transitions: p,
  27266. Model: u,
  27267. Chunk: f,
  27268. Floor: v,
  27269. Skybox: m,
  27270. Reticule: g,
  27271. Panorama: c,
  27272. DollhouseCamera: A,
  27273. FloorplanCamera: y,
  27274. PanoramaCamera: C,
  27275. DollhouseControls: I,
  27276. FloorplanControls: E,
  27277. PanoramaControls: b,
  27278. getModel: function(e) {
  27279. if (!e.url)
  27280. throw 'getModel(): missing parameter "url"';
  27281. e.autoload = void 0 === e.autoload || e.autoload;
  27282. var t = l.parseSidUrl(e.url);
  27283. e.urlBase = t.urlBase,
  27284. e.urlModel = t.urlModel,
  27285. e.urlFiles = t.urlFiles;
  27286. var i = this._getPlatformError();
  27287. return i ? $.Deferred().reject(i).promise() : (this.options = e,
  27288. this._loadModel().then(this._buildModel.bind(this)))
  27289. },
  27290. _getPlatformError: function() {
  27291. 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"
  27292. },
  27293. _loadModel: function() {
  27294. return r.get(this.options.urlModel, {
  27295. responseType: "json",
  27296. prefetchFrom: "model",
  27297. auth: l.getAuthorizationHeader()
  27298. }).then(null, function() {
  27299. return h.warn("Model loading failed at initial metadata load"),
  27300. "loading-failed"
  27301. })
  27302. },
  27303. _buildModel: function(e) {
  27304. e = l.normalizeModeldata(e, s);
  27305. var t = new u(this.options,e);
  27306. return this.options.autoload ? t.load(!0) : $.when(t)
  27307. }
  27308. }
  27309. }
  27310. ).call(this, "/js/showcase.js")
  27311. }
  27312. , {
  27313. "./cameras/DollhouseCamera": 5,
  27314. "./cameras/FloorplanCamera": 6,
  27315. "./cameras/PanoramaCamera": 7,
  27316. "./controls/DollhouseControls": 10,
  27317. "./controls/FloorplanControls": 11,
  27318. "./controls/PanoramaControls": 13,
  27319. "./model/Model": 139,
  27320. "./objects/Chunk": 144,
  27321. "./objects/Floor": 146,
  27322. "./objects/Panorama": 148,
  27323. "./objects/Reticule": 149,
  27324. "./objects/Skybox": 152,
  27325. "./settings": 166,
  27326. "./shaders": 167,
  27327. "./util/ajax": 181,
  27328. "./util/logger": 189,
  27329. "./util/math": 190,
  27330. "./util/showcase": 193,
  27331. "./util/transitions": 195,
  27332. three: 217,
  27333. url: 208
  27334. }],
  27335. 169: [function(e, t, i) {
  27336. "use strict";
  27337. function n() {
  27338. var e = {
  27339. renderTarget: null,
  27340. inUse: !1,
  27341. size: -1,
  27342. pano: null
  27343. };
  27344. return e
  27345. }
  27346. function r(e) {
  27347. M.push(e)
  27348. }
  27349. function o(e) {
  27350. var t = n();
  27351. return t.inUse = !0,
  27352. t.size = e,
  27353. r(t),
  27354. t
  27355. }
  27356. function a(e) {
  27357. for (var t = 0; t < M.length; t++) {
  27358. var i = M[t];
  27359. if (!i.inUse && i.size === e)
  27360. return i.inUse = !0,
  27361. i
  27362. }
  27363. return null
  27364. }
  27365. function s(e) {
  27366. for (var t = 0; t < M.length; t++) {
  27367. var i = M[t];
  27368. if (i.renderTarget === e)
  27369. return i.inUse = !1,
  27370. !0
  27371. }
  27372. return !1
  27373. }
  27374. function l() {
  27375. this.tileDirectory = {},
  27376. this.activeRenderTargetDescriptors = {},
  27377. this.activePanos = [],
  27378. this.panoLODDescriptors = {},
  27379. this.panoDescriptors = {},
  27380. this.tileTrees = {},
  27381. this.sceneRenderer = null,
  27382. this.tileDownloader = null,
  27383. this.forceQueue = [],
  27384. this.uploadQueues = {},
  27385. this.uploadInterval = null,
  27386. this.uploadIntervalCancelled = !1,
  27387. this.usingTileOverlay = !1,
  27388. this.overlayTilesLoaded = !1,
  27389. this.overlayTileBase = null,
  27390. this.overlayTilesBasic = {},
  27391. this.overlayTilesEnhanced = {},
  27392. this.zoomRenderTarget = null,
  27393. this.zoomPano = null,
  27394. this.zoomingActive = !1,
  27395. this.zoomPanoId = null,
  27396. this.zoomPanoRenderingDisabled = !1,
  27397. this.direction = new h.Vector3,
  27398. this.initTime = -1,
  27399. this.maxBaseUploadsPerFrame = x,
  27400. this.maxNonBaseUploadsPerFrame = T
  27401. }
  27402. function c() {
  27403. this.uploadIntervalCancelled || (this.overlayTilesLoaded || !this.usingTileOverlay ? (b = !0,
  27404. this.updateUploadQueue(this.maxNonBaseUploadsPerFrame, this.maxBaseUploadsPerFrame),
  27405. this.peekNextFromUploadQueue() ? this.refreshUploadInterval(w) : this.uploadInterval = null) : this.refreshUploadInterval(this.uploadIntervalDelay))
  27406. }
  27407. /* function c() {
  27408. this.uploadIntervalCancelled || (this.overlayTilesLoaded || !this.usingTileOverlay ? (b = !0,
  27409. this.updateUploadQueue(1, 2),
  27410. w = 18,
  27411. this.peekNextFromUploadQueue() ? this.refreshUploadInterval(w) : this.uploadInterval = null) : this.refreshUploadInterval(this.uploadIntervalDelay))
  27412. } */
  27413. var h = e("three")
  27414. , u = e("../exception/BasicException")
  27415. , d = e("../settings")
  27416. , p = e("../enum/PanoSizeClass")
  27417. , f = (e("../objects/Panorama"),
  27418. e("../enum/PanoRendererEvents"))
  27419. , g = e("../enum/SceneRendererEvents")
  27420. , m = e("../enum/TileDownloaderEvents")
  27421. , v = e("../enum/Vectors")
  27422. , A = (e("../enum/GLCubeFaces"),
  27423. e("../objects/Panorama"),
  27424. e("./TileTree"))
  27425. , y = (e("./TileDownloader"),
  27426. e("./TilePrioritizer"))
  27427. , C = e("./TileUtils")
  27428. , p = e("../enum/PanoSizeClass")
  27429. , I = (e("../util/browser"),
  27430. e("../util/panorama"))
  27431. , E = e("events").EventEmitter
  27432. , b = !1
  27433. , w = d.tiling.uploadIntervalDelay
  27434. , _ = d.tiling.initialIntervalDelay
  27435. , T = d.tiling.maxNonBaseUploadsPerFrame
  27436. , x = d.tiling.maxBaseUploadsPerFrame
  27437. , S = {
  27438. Base: 0,
  27439. Remaining: 1
  27440. }
  27441. ,M = [];
  27442. window.targetList = M
  27443. l.prototype = Object.create(E.prototype),
  27444. l.prototype.init = function(e, t, i) {
  27445. this.sceneRenderer = e,
  27446. this.tileDownloader = t,
  27447. this.qualityManager = i,
  27448. this.bindEvents(),
  27449. this.sceneRenderer.on(g.ContextCreated, this.loadOverlayTiles.bind(this)),
  27450. this.initTime = performance.now()
  27451. }
  27452. ,
  27453. l.prototype.getActivePanoTextures = function(e) {
  27454. e = e || [];
  27455. for (var t = 0; t < M.length; t++) {
  27456. var i = M[t];
  27457. i.renderTarget && i.renderTarget.texture && e.push(i.renderTarget.texture)
  27458. }
  27459. }
  27460. ,
  27461. l.prototype.hasQueuedTiles = function() {
  27462. var e = this.peekNextFromUploadQueue();
  27463. return null !== e && void 0 !== e
  27464. }
  27465. ,
  27466. l.prototype.getActiveRenderTargetDescriptor = function(e) {
  27467. return this.activeRenderTargetDescriptors[e]
  27468. }
  27469. ,
  27470. l.prototype.setActiveRenderTargetDescriptor = function(e, t) {
  27471. this.activeRenderTargetDescriptors[e] = t
  27472. }
  27473. ,
  27474. l.prototype.loadOverlayTiles = function() {
  27475. if (0 !== d.tiling.overlayStyle) {
  27476. var e = 0
  27477. , t = function(t, n, r) {
  27478. t = n ? t[n] = this.sceneRenderer.initSizedTexture2D(C.TILE_SIZE, h.ClampToEdgeWrapping) : this.overlayTileBase = this.sceneRenderer.initSizedTexture2D(C.TILE_SIZE, h.ClampToEdgeWrapping),
  27479. this.sceneRenderer.uploadTexture2D(r, t, 0, 0, C.TILE_SIZE, C.TILE_SIZE),
  27480. e++,
  27481. e === i.length && (this.overlayTilesLoaded = !0)
  27482. }
  27483. .bind(this)
  27484. , i = [["images/outlineBase.png", t.bind(this, this.overlayTileBase, null)], ["images/outlineBasic512.png", t.bind(this, this.overlayTilesBasic, 256)], ["images/outlineBasic512.png", t.bind(this, this.overlayTilesBasic, 512)], ["images/outlineBasic1024.png", t.bind(this, this.overlayTilesBasic, 1024)], ["images/outlineBasic2048.png", t.bind(this, this.overlayTilesBasic, 2048)], ["images/outlineBasic4096.png", t.bind(this, this.overlayTilesBasic, 4096)], ["images/outlineEnhanced512.png", t.bind(this, this.overlayTilesEnhanced, 256)], ["images/outlineEnhanced512.png", t.bind(this, this.overlayTilesEnhanced, 512)], ["images/outlineEnhanced1024.png", t.bind(this, this.overlayTilesEnhanced, 1024)], ["images/outlineEnhanced2048.png", t.bind(this, this.overlayTilesEnhanced, 2048)], ["images/outlineEnhanced4096.png", t.bind(this, this.overlayTilesEnhanced, 4096)]];
  27485. i.forEach(function(e) {
  27486. this.tileDownloader.loadImage(e[0], 0, e[1])
  27487. }
  27488. .bind(this)),
  27489. this.usingTileOverlay = !0
  27490. } else
  27491. this.usingTileOverlay = !1
  27492. }
  27493. ,
  27494. l.prototype.bindEvents = function() {
  27495. this.tileDownloader.on(m.TileDownloadSuccess, this.onTileDownloaded.bind(this))
  27496. }
  27497. ,
  27498. l.prototype.setupZoomRenderTarget = function() {
  27499. var targets = {};
  27500. return function(){
  27501. if(this.qualityManager.maxRenderTargetSize == '2k' && this.qualityManager.getMaxNavPanoSize()=='2k')return; //不使用zoomTarget 直接用pano的tiledPanoRenderTarget,防崩溃
  27502. if (this.qualityManager.getMaxZoomPanoSize() >= this.qualityManager.getMaxNavPanoSize()) {
  27503. if (this.zoomRenderTarget && this.zoomRenderTarget.width === this.qualityManager.getMaxZoomPanoSize())
  27504. return;
  27505. var e = this.zoomRenderTarget;
  27506. var size = this.qualityManager.getMaxZoomPanoSize()
  27507. if(size > this.qualityManager.maxRenderTargetSize){
  27508. return
  27509. }
  27510. if(targets[size]){
  27511. this.zoomRenderTarget = targets[size]
  27512. }else{
  27513. this.zoomRenderTarget = this.initTiledPano(size, true )//放大后不使用抗锯齿,否则消耗更多内存
  27514. targets[size] = this.zoomRenderTarget
  27515. }
  27516. if(e) {//将旧的zoomRenderTarget渲染到新zoomRenderTarget上
  27517. var t = e.width
  27518. , i = this.zoomRenderTarget.width;
  27519. this.sceneRenderer.copyCubeMap(e.texture, this.zoomRenderTarget, t, t, i, i),
  27520. e.texture.dispose(),
  27521. e.texture.loaded = !1,
  27522. e.texture.version = 0,
  27523. this.sceneRenderer.deallocateCubeTexture(e.texture),
  27524. e.texture = null
  27525. }
  27526. this.zoomPanoRenderingDisabled = !1
  27527. } else
  27528. this.zoomPanoRenderingDisabled = !0
  27529. }
  27530. }()
  27531. ,
  27532. l.prototype.enableHighQuality = function(e) {
  27533. //xzw add 如果最多只要2k图的话enableUltraHighQualityMode替换成这个
  27534. if (!this.qualityManager.highQualityModeStarted) {
  27535. this.setupZoomRenderTarget()
  27536. e()
  27537. this.qualityManager.highQualityModeStarted = true
  27538. }
  27539. }
  27540. ,
  27541. l.prototype.enableUltraHighQualityMode = function(e) {
  27542. if (!this.qualityManager.ultraHighQualityModeEnabled()) {
  27543. var t = this.qualityManager.getPanoSize(p.ULTRAHIGH);
  27544. this.tileDownloader.testDownload(t, C.TILE_SIZE, function(t) {
  27545. t && (this.qualityManager.enableUltraHighQualityMode(),
  27546. this.setupZoomRenderTarget(),
  27547. e())
  27548. }
  27549. .bind(this))
  27550. }
  27551. }
  27552. ,
  27553. l.prototype.activateTiledPano = function(e, t, i) {
  27554. i && this.clearAllQueuedUploads();
  27555. for (var n = 0; n < C.FACES_PER_PANO; n++)
  27556. this.initTileTree(e.id, n, this.qualityManager.getMaxPossiblePanoSize());
  27557. this.linkAllTilesAndNodes(e);
  27558. var r = this.getActiveRenderTargetDescriptor(e.id)
  27559. , l = t;
  27560. if (l > this.qualityManager.getMaxNavPanoSize() && (l = this.qualityManager.getMaxNavPanoSize()),
  27561. !r || l !== r.size) {
  27562. if (r && s(r.renderTarget),
  27563. r = a(l),
  27564. !r) {
  27565. var c = this.initTiledPano(l, !browser.isMobile()/* !1 */);
  27566. r = o(c.width),
  27567. r.renderTarget = c
  27568. }
  27569. r.pano = e,
  27570. this.resetPanoDescriptor(e.id),
  27571. this.resetPanoLODDescriptors(e.id),
  27572. this.resetRenderStatus(e.id, !0, !0)
  27573. }
  27574. this.setActiveRenderTargetDescriptor(e.id, r);
  27575. var h = i ? 0 : 1;
  27576. return this.updateActivePanos(e, h),
  27577. r.renderTarget
  27578. }
  27579. ,
  27580. l.prototype.deactivateTiledPano = function(e) {
  27581. var t = this.getActiveRenderTargetDescriptor(e.id);
  27582. this.isRenderTargetDescriptorValid(t) && s(t.renderTarget),
  27583. this.setActiveRenderTargetDescriptor(e.id, null);
  27584. var i = this.getUploadQueueForPano(e.id);
  27585. this.clearUploadQueue(i),
  27586. this.updateActivePanos()
  27587. }
  27588. ,
  27589. l.prototype.updateActivePanos = function() {
  27590. var e = [];
  27591. return function(t, i) {
  27592. e.length = 0;
  27593. for (var n = 0; n < this.activePanos.length; n++) {
  27594. t && e.length === i && e.push(t);
  27595. var r = this.activePanos[n]
  27596. , o = this.getActiveRenderTargetDescriptor(r.id);
  27597. t && r.id === t.id || !this.isRenderTargetDescriptorValid(o) || e.push(r)
  27598. }
  27599. t && i >= e.length && e.push(t),
  27600. this.activePanos.length = 0,
  27601. this.activePanos.push.apply(this.activePanos, e)
  27602. }
  27603. }(),
  27604. l.prototype.getActivePanoCount = function() {
  27605. return this.activePanos.length
  27606. }
  27607. ,
  27608. l.prototype.resetRenderStatus = function(e, t, i, n) {
  27609. var r = null;
  27610. n && (r = A.getLevelCountForSize(C.TILE_SIZE, n) + 1);
  27611. for (var o = function(e, n, r, o) {
  27612. i && (n.tile.zoomUploaded = !1),
  27613. t && (n.tile.uploaded = !1)
  27614. }, a = 0; a < C.FACES_PER_PANO; a++) {
  27615. var s = this.getTileTree(e, a);
  27616. s.breadthFirst({
  27617. callback: o.bind(this, a),
  27618. minLevel: r
  27619. })
  27620. }
  27621. }
  27622. ,
  27623. l.prototype.copyBaseRenderStatusToZoomed = function(e) {
  27624. for (var t = A.getLevelCountForSize(C.TILE_SIZE, this.qualityManager.getMaxNavPanoSize()), i = function(e, t, i, n) {
  27625. t.tile.zoomUploaded = t.tile.uploaded,
  27626. t.zoomCovered = t.covered
  27627. }, n = 0; n < C.FACES_PER_PANO; n++) {
  27628. var r = this.getTileTree(e, n);
  27629. r.breadthFirst({
  27630. callback: i.bind(this, n),
  27631. maxLevel: t
  27632. })
  27633. }
  27634. }
  27635. ,
  27636. l.prototype.renderPanoTiles = function() {
  27637. var e = [];
  27638. return function(t, i, n, r) {
  27639. this.zoomRenderTarget && this.zoomRenderTarget.width === this.qualityManager.getMaxZoomPanoSize() || this.zoomPanoRenderingDisabled || this.setupZoomRenderTarget(),
  27640. i = i || this.direction || v.FORWARD;
  27641. var o = this.getActiveRenderTargetDescriptor(t);
  27642. if (!this.isRenderTargetDescriptorValid(o))
  27643. throw new u("PanoRenderer.renderPanoTiles() -> Cannot render to a pano that is not activated.");
  27644. for (var a = 0; a < C.FACES_PER_PANO; a++) {
  27645. var s = this.getTileTree(t, a);
  27646. e.length = 0,
  27647. s.breadthFirst({
  27648. saveVisited: e
  27649. });
  27650. for (var l = 0; l < e.length; l++) {
  27651. var c = e[l];
  27652. this.queueTileUpload(c.tile, !1, r || 0 === l && n)
  27653. }
  27654. }
  27655. this.updateDirection(i)
  27656. }
  27657. }(),
  27658. l.prototype.isRenderTargetDescriptorValid = function(e) {
  27659. return e && e.renderTarget
  27660. }
  27661. ,
  27662. l.prototype.isPanoActive = function(e) {
  27663. var t = this.getActiveRenderTargetDescriptor(e);
  27664. return this.isRenderTargetDescriptorValid(t)
  27665. }
  27666. ,
  27667. l.prototype.isPanoZoomed = function(e) {
  27668. return this.zoomingActive && this.zoomPanoId === e
  27669. }
  27670. ,
  27671. l.prototype.initTileTree = function(e, t, i) {
  27672. var n = this.tileTrees[e];
  27673. n || (n = [],
  27674. this.tileTrees[e] = n);
  27675. var r = n[t];
  27676. if (!r) {
  27677. var o = A.getLevelCountForSize(C.TILE_SIZE, i);
  27678. r = new A(C.TILE_SIZE,o),
  27679. n[t] = r
  27680. }
  27681. }
  27682. ,
  27683. l.prototype.getTileTree = function(e, t) {
  27684. var i = this.tileTrees[e];
  27685. if (!i)
  27686. throw new u("PanoRenderer.getTileTree() -> Tree array not yet initialized!");
  27687. var n = i[t];
  27688. if (!n)
  27689. throw new u("PanoRenderer.getTileTree() -> Tree not yet initialized!");
  27690. return n
  27691. }
  27692. ,
  27693. l.prototype.initTiledPano = function(e, antialias) {
  27694. var i = this.sceneRenderer.renderer
  27695. , n = (i.context,
  27696. new h.WebGLRenderTargetCube(e,e,{
  27697. stencilBuffer: !1
  27698. }))
  27699. , r = new h.CubeTexture([]);
  27700. n.texture = r,
  27701. r.image = [null, null, null, null, null, null],
  27702. r.flipY = !0,
  27703. //antialias: 如果抗锯齿的话,采用mipmap,会增加一倍的存储消耗。原版本都是不抗锯齿的。但是抗锯齿效果更柔和
  27704. antialias ? (r.generateMipmaps = !0,
  27705. r.magFilter = h.LinearFilter,
  27706. r.minFilter = h.LinearMipMapLinearFilter) : (r.generateMipmaps = !1,
  27707. r.magFilter = h.LinearFilter,
  27708. r.minFilter = h.LinearFilter),
  27709. r.format = h.RGBAFormat,
  27710. i.setRenderTarget(n),
  27711. i.setRenderTarget(null);
  27712. var o = i.properties.get(r);
  27713. return o.__image__webglTextureCube = o.__webglTexture,
  27714. n
  27715. }
  27716. ,
  27717. l.prototype.getUploadQueueForPano = function(e) {
  27718. var t = this.uploadQueues[e];
  27719. return t || (t = [],
  27720. this.uploadQueues[e] = t),
  27721. t
  27722. }
  27723. ,
  27724. l.prototype.isTileUploaded = function(e) {
  27725. return this.isPanoZoomed(e.panoId) ? e.zoomUploaded : e.uploaded
  27726. }
  27727. ,
  27728. l.prototype.setUploaded = function(e, t) {
  27729. this.isPanoZoomed(e.panoId) ? e.zoomUploaded = t : e.uploaded = t
  27730. }
  27731. ,
  27732. l.prototype.queueTileUpload = function(e, t, i) {
  27733. var n = this.getActiveRenderTargetDescriptor(e.panoId);
  27734. if (this.isRenderTargetDescriptorValid(n) && e.downloaded && !this.isTileUploaded(e) && (!e.uploadQueued || i) && (!(e.panoSize > this.qualityManager.getMaxNavPanoSize()) || this.zoomingActive)) {
  27735. var r = this.getUploadQueueForPano(e.panoId);
  27736. 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),
  27737. e.uploadQueued = !0,
  27738. this.uploadInterval || this.uploadIntervalCancelled || this.refreshUploadInterval(0))
  27739. }
  27740. }
  27741. ,
  27742. l.prototype.shoulPushToFrontOfQueue = function(e) {
  27743. return 0 === A.getLevelCountForSize(C.TILE_SIZE, e.panoSize)
  27744. }
  27745. ,
  27746. l.prototype.getTopUploadQueue = function() {
  27747. for (var e = null, t = null, i = S.Base; i <= S.Remaining; i++)
  27748. for (var n = 0; n < this.activePanos.length; n++)
  27749. if (e = this.activePanos[n],
  27750. t = this.getUploadQueueForPano(e.id),
  27751. t.length > 0)
  27752. switch (i) {
  27753. case S.Base:
  27754. if (0 === t[0].level)
  27755. return t;
  27756. break;
  27757. case S.Remaining:
  27758. return t
  27759. }
  27760. return null
  27761. }
  27762. ,
  27763. l.prototype.getNextFromUploadQueue = function() {
  27764. var e = function(e) {
  27765. var t = e.shift();
  27766. return t.uploadQueued = !1,
  27767. t
  27768. };
  27769. return function() {
  27770. if (this.forceQueue.length > 0)
  27771. return e(this.forceQueue);
  27772. var t = this.getTopUploadQueue();
  27773. return t && t.length > 0 ? e(t) : null
  27774. }
  27775. }(),
  27776. l.prototype.peekNextFromUploadQueue = function() {
  27777. if (this.forceQueue.length > 0)
  27778. return this.forceQueue[0];
  27779. var e = this.getTopUploadQueue();
  27780. return e && e.length > 0 ? e[0] : null
  27781. }
  27782. ,
  27783. l.prototype.clearAllQueuedUploads = function() {
  27784. this.clearAllUploadQueues(null, 0)
  27785. }
  27786. ,
  27787. l.prototype.clearAllQueuedUploadsForPano = function(e) {
  27788. this.clearAllUploadQueues(e, 0)
  27789. }
  27790. ,
  27791. l.prototype.clearAllUploadQueues = function(e, t) {
  27792. if (e)
  27793. this.clearUploadQueue(this.getUploadQueueForPano(e), t),
  27794. this.clearUploadQueue(this.forceQueue, t, e);
  27795. else {
  27796. for (var i = 0; i < this.activePanos.length; i++) {
  27797. var n = this.activePanos[i];
  27798. this.clearUploadQueue(this.getUploadQueueForPano(n.id), t)
  27799. }
  27800. this.clearUploadQueue(this.forceQueue, t)
  27801. }
  27802. }
  27803. ,
  27804. l.prototype.clearUploadQueue = function(e, t, i) {
  27805. void 0 !== t && null !== t || (t = 0);
  27806. for (var n = 0; n < e.length; ) {
  27807. var r = e[n];
  27808. (!i || i && i === r.tile.panoId) && r.level >= t ? (r.uploadQueued = !1,
  27809. e.splice(n, 1)) : n++
  27810. }
  27811. }
  27812. ,
  27813. l.prototype.refreshUploadInterval = function() {
  27814. var e = null;
  27815. return function(t) {
  27816. this.uploadIntervalCancelled || (e || (e = c.bind(this)),
  27817. null !== t && void 0 !== t || (t = w),
  27818. b || (t = _),
  27819. this.uploadInterval = window.setTimeout(e, t),
  27820. this.uploadIntervalDelay = t)
  27821. }
  27822. }(),
  27823. l.prototype.update = function() {
  27824. var e = performance.now()
  27825. , t = 0;
  27826. return function() {
  27827. this.uploadIntervalCancelled = !0,
  27828. window.clearTimeout(this.uploadInterval),
  27829. this.uploadInterval = null;
  27830. var i = performance.now() - e;
  27831. !(i > w || 0 === t) || !this.overlayTilesLoaded && this.usingTileOverlay || (this.updateUploadQueue(this.maxNonBaseUploadsPerFrame, this.maxBaseUploadsPerFrame),
  27832. e = performance.now()),
  27833. t++
  27834. }
  27835. }(),
  27836. l.prototype.updateUploadQueue = function(e, t) {
  27837. e || (e = 1);
  27838. for (var i = 0, n = 0; ; ) {
  27839. if (n >= t || i >= e)
  27840. break;
  27841. var r = this.getNextFromUploadQueue();
  27842. if (!r)
  27843. break;
  27844. if (0 !== r.level ? i++ : n++,
  27845. !(r.panoSize > this.qualityManager.getMaxNavPanoSize()) || this.zoomingActive) {
  27846. var o = this.getActiveRenderTargetDescriptor(r.panoId);
  27847. this.isRenderTargetDescriptorValid(o) && this.uploadTile(r, r.forceUpload)
  27848. }
  27849. }
  27850. }
  27851. ,
  27852. l.prototype.updateDirection = function(e) {
  27853. if (e = e || this.direction) {
  27854. this.direction = e;
  27855. for (var t = 0; t < this.activePanos.length; t++) {
  27856. var i = this.activePanos[t]
  27857. , n = this.getUploadQueueForPano(i.id);
  27858. y.sortPanoTiles(n, i, this.direction)
  27859. }
  27860. }
  27861. }
  27862. ,
  27863. l.prototype.uploadTile = function() {
  27864. var e = {}
  27865. , t = (new h.Vector4,
  27866. d.tiling.overlayStyle);
  27867. //var failHistory = {};
  27868. return function(i, n) {
  27869. var r = i.panoId
  27870. , o = i.image
  27871. , a = i.tileSize
  27872. , s = i.panoSize
  27873. , l = i.tileIndex
  27874. , c = (i.faceTileIndex,
  27875. i.totalTiles)
  27876. , u = (i.face,
  27877. i.tileX)
  27878. , d = i.tileY
  27879. , p = !0
  27880. , g = !1
  27881. , m = (this.getPanoDescriptor(r),
  27882. this.getPanoLODDescriptor(r, s))
  27883. , v = this.getActiveRenderTargetDescriptor(r)
  27884. , A = v.renderTarget
  27885. , y = v.size;
  27886. if (this.isPanoZoomed(r) && (A = this.zoomRenderTarget,
  27887. y = A.width), //this.qualityManager.getMaxZoomPanoSize()),
  27888. this.isRenderTargetDescriptorValid(v) || (p = !1,
  27889. g = !1),
  27890. n || (this.anyUploaded(i.node) && (p = !1,
  27891. g = !0),
  27892. this.isTileUploaded(i) && (p = !1,
  27893. g = !1)),
  27894. p) {
  27895. /* if(failHistory[''+r+s+l]){
  27896. console.log('uploadTile retry', r, s, l)
  27897. }
  27898. console.log('uploadTile 成功', r, s, l)
  27899. */
  27900. var C = u * a
  27901. , I = d * a
  27902. , E = a / s * y
  27903. , b = C / s * y
  27904. , w = I / s * y;
  27905. if (s > this.qualityManager.maxRenderTargetSize) {
  27906. player.model.getHighImage(o, i.cubeFace, u, d)
  27907. }else{
  27908. e[a] || (e[a] = this.sceneRenderer.initSizedTexture2D(a, h.ClampToEdgeWrapping));
  27909. var _ = e[a]
  27910. this.sceneRenderer.uploadTexture2D(o, _, 0, 0, a, a)
  27911. if ( 1 === t || 2 === t) {
  27912. var T = 1 === t ? this.overlayTilesBasic : this.overlayTilesEnhanced;
  27913. this.sceneRenderer.renderToCubeMap(_, A, a, a, 0, 0, a, a, b, w, E, E, i.cubeFace),
  27914. this.sceneRenderer.renderToCubeMap(T[s], A, a, a, 0, 0, a, a, b, w, E, E, i.cubeFace, h.NormalBlending, !0, .5)
  27915. } else
  27916. this.sceneRenderer.renderToCubeMap(_, A, a, a, 0, 0, a, a, b, w, E, E, i.cubeFace);
  27917. }
  27918. m.uploadCount++,
  27919. this.emit(f.TileRenderSuccess, r, s, l, c),
  27920. m.uploadCount === c && this.emit(f.PanoRenderComplete, r, s, c),
  27921. this.setUploaded(i, !0),
  27922. this.addCoverageForNode(i.node)
  27923. } else{
  27924. this.setUploaded(i, !1);
  27925. //console.log('uploadTile 失败', r, s, l)
  27926. //failHistory[''+r+s+l] = true;
  27927. }
  27928. return i.uploadAttempted || (m.uploadAttempts++,
  27929. this.emit(f.TileUploadAttempted, r, s, l, c)),
  27930. i.uploadAttempted = !0,
  27931. m.uploadAttempts === c && this.emit(f.UploadAttemptedForAllTiles, r, s, c),
  27932. g
  27933. }
  27934. }(),
  27935. l.prototype.linkTileAndNode = function(e, t) {
  27936. t.tile = e,
  27937. e.node = t
  27938. }
  27939. ,
  27940. l.prototype.linkAllTilesAndNodes = function(e) {
  27941. for (var t = function(t, i, n, r, o) {
  27942. var a = this.getTileDirectoryEntry(e.id, i, r, o);
  27943. this.linkTileAndNode(a, n)
  27944. }, i = 0; i < C.FACES_PER_PANO; i++) {
  27945. var n = this.getTileTree(e.id, i);
  27946. n.breadthFirst({
  27947. callback: t.bind(this, n, i)
  27948. })
  27949. }
  27950. }
  27951. ,
  27952. l.prototype.anyUploaded = function(e) {
  27953. if (!e)
  27954. return !1;
  27955. if (e.tile && this.isTileUploaded(e.tile))
  27956. return !0;
  27957. if (e.children)
  27958. for (var t = 0; t < e.children.length; t++) {
  27959. var i = e.children[t];
  27960. if (this.anyUploaded(i))
  27961. return !0
  27962. }
  27963. return !1
  27964. }
  27965. ,
  27966. l.prototype.setNodeCovered = function(e, t) {
  27967. this.isPanoZoomed(e.tile.panoId) ? e.zoomCovered = t : e.covered = t
  27968. }
  27969. ,
  27970. l.prototype.isNodeCovered = function(e) {
  27971. return !!e && (this.isPanoZoomed(e.tile.panoId) ? e.zoomCovered : e.covered)
  27972. }
  27973. ,
  27974. l.prototype.addCoverageForNode = function(e) {
  27975. if (this.setNodeCovered(e, !0),
  27976. e.parent && e.covered) {
  27977. var t = e.parent;
  27978. this.nodeSubcovered(t) && this.addCoverageForNode(t, !0)
  27979. }
  27980. }
  27981. ,
  27982. l.prototype.calcFullCoverage = function(e) {
  27983. var t = !1;
  27984. if (e.children)
  27985. for (var i = 0; i < e.children.length; i++) {
  27986. var n = e.children[i];
  27987. t = t || this.calcFullCoverage(n)
  27988. }
  27989. e.covered = e.tile.uploaded || t
  27990. }
  27991. ,
  27992. l.prototype.nodeSubcovered = function(e) {
  27993. if (!e.children)
  27994. return !1;
  27995. for (var t = 0; t < e.children.length; t++)
  27996. if (!e.children[t] || !this.isNodeCovered(e.children[t]))
  27997. return !1;
  27998. return !0
  27999. }
  28000. ,
  28001. l.prototype.resetPanoDescriptor = function(e) {
  28002. this.getPanoDescriptor(e)
  28003. }
  28004. ,
  28005. l.prototype.getPanoDescriptor = function(e) {
  28006. var t = this.panoDescriptors[e];
  28007. return t || (t = {},
  28008. this.panoDescriptors[e] = t),
  28009. t
  28010. }
  28011. ,
  28012. l.prototype.resetPanoLODDescriptors = function(e) {
  28013. var t = this.getPanoLODDescriptors(e);
  28014. for (var i in t)
  28015. if (t.hasOwnProperty(i)) {
  28016. var n = t[i];
  28017. n.uploadCount = 0,
  28018. n.uploadAttempts = 0
  28019. }
  28020. }
  28021. ,
  28022. l.prototype.getPanoLODDescriptor = function(e, t) {
  28023. var i = this.getPanoLODDescriptors(e)
  28024. , n = i[t];
  28025. return n || (n = {
  28026. uploadCount: 0,
  28027. uploadAttempts: 0
  28028. },
  28029. i[t] = n),
  28030. n
  28031. }
  28032. ,
  28033. l.prototype.getPanoLODDescriptors = function(e) {
  28034. var t = this.panoLODDescriptors[e];
  28035. return t || (t = {},
  28036. this.panoLODDescriptors[e] = t),
  28037. t
  28038. }
  28039. ,
  28040. l.prototype.onTileDownloaded = function(e) {
  28041. var t = A.getLevelCountForSize(C.TILE_SIZE, e.panoSize)
  28042. , i = this.getTileDirectoryEntry(e.panoId, e.face, t, e.faceTileIndex);
  28043. if (i.downloaded = !0,
  28044. i.image = e.image,
  28045. i.panoSize = e.panoSize,
  28046. i.tileX = e.tileX,
  28047. i.tileY = e.tileY,
  28048. i.totalTiles = e.totalTiles,
  28049. i.tileIndex = e.tileIndex,
  28050. i.faceTileIndex = e.faceTileIndex,
  28051. i.face = e.face,
  28052. i.cubeFace = I.mapFaceToCubemapFace(e.face),
  28053. i.panoId = e.panoId,
  28054. i.tileSize = e.tileSize,
  28055. i.direction = (new h.Vector3).copy(e.direction),
  28056. i.node = null,
  28057. i.level = A.getLevelCountForSize(C.TILE_SIZE, i.panoSize),
  28058. this.isPanoActive(i.panoId)) {
  28059. var n = this.getTileTree(i.panoId, i.face)
  28060. , r = n.getSubNode(i.panoSize, i.tileX, i.tileY);
  28061. this.linkTileAndNode(i, r),
  28062. this.queueTileUpload(i, !0)
  28063. }
  28064. }
  28065. ,
  28066. l.prototype.getTileDirectoryEntry = function(e, t, i, n) {
  28067. var r = this.tileDirectory[e];
  28068. r || (r = {},
  28069. this.tileDirectory[e] = r);
  28070. var o = 16384 * t + 1024 * i + n
  28071. , a = r[o];
  28072. return a || (a = {
  28073. downloaded: !1,
  28074. uploaded: !1,
  28075. zoomUploaded: !1
  28076. },
  28077. r[o] = a),
  28078. a._key = e + ":" + t + ":" + i + ":" + n,
  28079. a._tileKey = o,
  28080. a
  28081. }
  28082. ,
  28083. l.prototype.setZoomingActive = function(e, t, i) {
  28084. this.zoomPanoRenderingDisabled || e === this.zoomingActive && this.zoomPanoId === t.id || (this.zoomingActive = e,
  28085. this.zoomPanoId = t.id,
  28086. this.zoomingActive && (this.zoomPanoId !== t.id || i) && this.updateZoomedPanoFromBase(t))
  28087. }
  28088. ,
  28089. l.prototype.updateZoomedPanoFromBase = function(e) {
  28090. if (!this.zoomPanoRenderingDisabled) {
  28091. var t = this.getActiveRenderTargetDescriptor(e.id);
  28092. if (t && t.renderTarget) {
  28093. var i = Math.min(this.qualityManager.maxRenderTargetSize, this.qualityManager.getMaxZoomPanoSize()), //this.qualityManager.getMaxZoomPanoSize()
  28094. n = t.renderTarget
  28095. , r = t.size;
  28096. this.sceneRenderer.copyCubeMap(n.texture, this.zoomRenderTarget, r, r, i, i),
  28097. this.copyBaseRenderStatusToZoomed(e.id)
  28098. }
  28099. }
  28100. }
  28101. ,
  28102. t.exports = l
  28103. }
  28104. , {
  28105. "../enum/GLCubeFaces": 25,
  28106. "../enum/PanoRendererEvents": 35,
  28107. "../enum/PanoSizeClass": 36,
  28108. "../enum/SceneRendererEvents": 43,
  28109. "../enum/TileDownloaderEvents": 45,
  28110. "../enum/Vectors": 50,
  28111. "../exception/BasicException": 55,
  28112. "../objects/Panorama": 148,
  28113. "../settings": 166,
  28114. "../util/browser": 182,
  28115. "../util/panorama": 191,
  28116. "./TileDownloader": 171,
  28117. "./TilePrioritizer": 172,
  28118. "./TileTree": 173,
  28119. "./TileUtils": 174,
  28120. events: 202,
  28121. three: 217
  28122. }],
  28123. 170: [function(e, t, i) {
  28124. "use strict";
  28125. function n(e, t, i) {
  28126. this.maxNavPanoSize = -1,
  28127. this.maxZoomPanoSize = -1,
  28128. this.devicePixelDensity = e,
  28129. this.deviceScreenSize = t,
  28130. this.clientBandwidth = i,
  28131. this.panoSizeClassMap = {},
  28132. this.useHighResolutionPanos = !0,
  28133. this.useUltraHighResolutionPanos = !1,
  28134. this.modelHasUltraHighPanos = !1
  28135. this.maxRenderTargetSize = a.isMobile() ? 2048 : 4096 //add
  28136. this.maxRenderTargetSize = Math.min( common.getMaxCubemapSize(), this.maxRenderTargetSize)//add
  28137. }
  28138. var r = e("../enum/PanoSizeClass")
  28139. , o = e("../settings")
  28140. , a = e("../util/browser")
  28141. , s = e("../constants")
  28142. , l = e("../util/showcase")
  28143. , c = e("../enum/ModelManagerEvents");
  28144. n.prototype.init = function(e) {
  28145. this.buildPanoSizeClassMap(this.devicePixelDensity, this.deviceScreenSize, this.clientBandwidth),
  28146. this.ultraHighSize = this.getPanoSize(r.ULTRAHIGH),
  28147. this.highSize = this.getPanoSize(r.HIGH),
  28148. this.standardSize = this.getPanoSize(r.STANDARD),
  28149. this.baseSize = this.getPanoSize(r.BASE),
  28150. o.tiling.maxZoomPanoQuality && this.ultraHighSize <= o.tiling.maxZoomPanoQuality && (o.tiling.allowUltraHighResolution = !0),
  28151. this.highQualityThreshold = a.valueFromHash("threshold2k", s.windowHeightHighQualityThreshold),
  28152. this.updateMaximums(),
  28153. e.on(c.ActiveModelChanged, this.onModelChanged.bind(this))
  28154. }
  28155. ,
  28156. n.prototype.updateFromModel = function(e) {
  28157. this.updateHighResolutionSettings(e),
  28158. this.updateUltraHighResolutionSettings(e)
  28159. }
  28160. ,
  28161. n.prototype.updateHighResolutionSettings = function(e) {
  28162. //---------------------许钟文---------原始的会判断modeldata里version,以致useHighResolutionPanos为false,所以我直接变为true啦----------------------------------
  28163. l.modelDataPromisesTiles(e.data) ? this.useHighResolutionPanos = !0 : this.useHighResolutionPanos = !1,
  28164. //this.useHighResolutionPanos = !0;
  28165. //----------------------e n d -----------------------------------------------------------------
  28166. this.updateMaximums()
  28167. }
  28168. ,
  28169. n.prototype.updateUltraHighResolutionSettings = function(e) {
  28170. o.tiling.allowUltraHighResolution && this.modelHasUltraHighPanos ? this.useUltraHighResolutionPanos = !0 : this.useUltraHighResolutionPanos = !1,
  28171. this.updateMaximums()
  28172. }
  28173. ,
  28174. n.prototype.enableUltraHighQualityMode = function() {
  28175. this.modelHasUltraHighPanos = !0,
  28176. this.updateUltraHighResolutionSettings(null)
  28177. }
  28178. ,
  28179. n.prototype.ultraHighQualityModeEnabled = function() {
  28180. return this.modelHasUltraHighPanos
  28181. }
  28182. ,
  28183. n.prototype.onModelChanged = function(e) {
  28184. this.updateFromModel(e.model),
  28185. this.updateMaximums()
  28186. }
  28187. ,
  28188. n.prototype.updateMaximums = function() {
  28189. this.maxNavPanoSize = o.tiling.maxNavPanoQuality || this.detectMaxNavPanoSize(),
  28190. this.maxZoomPanoSize = o.tiling.maxZoomPanoQuality || this.detectMaxZoomPanoSize(),
  28191. this.maxZoomPanoSize < this.maxNavPanoSize && (this.maxNavPanoSize = this.maxZoomPanoSize)
  28192. }
  28193. ,
  28194. n.prototype.buildPanoSizeClassMap = function() {
  28195. this.panoSizeClassMap[r.BASE] = 512,
  28196. this.panoSizeClassMap[r.STANDARD] = 1024,
  28197. this.panoSizeClassMap[r.HIGH] = 2048,
  28198. this.panoSizeClassMap[r.ULTRAHIGH] = 4096
  28199. }
  28200. ,
  28201. n.prototype.getPanoSize = function(e) {
  28202. return this.panoSizeClassMap[e]
  28203. }
  28204. ,
  28205. n.prototype.getMaxPossiblePanoSize = function() {
  28206. return this.getPanoSize(r.ULTRAHIGH)
  28207. }
  28208. ,
  28209. n.prototype.getMaxPanoSize = function() {
  28210. return this.maxZoomPanoSize
  28211. }
  28212. ,
  28213. n.prototype.getMaxNavPanoSize = function() {
  28214. return this.maxNavPanoSize
  28215. }
  28216. ,
  28217. n.prototype.getMaxZoomPanoSize = function() {
  28218. return this.maxZoomPanoSize
  28219. }
  28220. ,
  28221. /* n.prototype.detectMaxNavPanoSizeClass = function() {
  28222. if(settings.mobileNavHigh)return r.HIGH //改
  28223. else return this.useHighResolutionPanos ? a.isMobile() ? r.STANDARD : $("#player").height() < this.highQualityThreshold ? r.STANDARD : r.HIGH : r.STANDARD
  28224. } */
  28225. n.prototype.detectDevice = function(){//add
  28226. if(a.isMobile()){
  28227. let area = $("#player").width() * $("#player").height()
  28228. if(area < 768 * 1024){//ipad mini full screen 大场景拍的质量很好默认不需要很高清
  28229. return 'mobile'
  28230. }else{
  28231. return 'bigMobile'
  28232. }
  28233. }else{
  28234. return 'pc'
  28235. }
  28236. }
  28237. n.prototype.detectMaxNavPanoSizeClass = function() { //xzw 改
  28238. switch(this.getNavZoomClass()){
  28239. case '1k':
  28240. return r.STANDARD;
  28241. break;
  28242. case '2k':
  28243. default:
  28244. return r.HIGH;
  28245. case '4k':
  28246. return r.ULTRAHIGH;
  28247. }
  28248. }
  28249. ,
  28250. n.prototype.detectMaxNavPanoSize = function() {
  28251. var e = this.detectMaxNavPanoSizeClass();
  28252. return this.getPanoSize(e)
  28253. }
  28254. ,
  28255. n.prototype.getMaxZoomClass = function(){//add
  28256. let type = this.detectDevice()
  28257. let setting = settings.tileClass[type] //见manage.js的settings
  28258. return setting.max
  28259. }
  28260. n.prototype.getNavZoomClass = function(){//add
  28261. let type = this.detectDevice()
  28262. let setting = settings.tileClass[type]
  28263. return setting.nav
  28264. }
  28265. ,
  28266. n.prototype.detectMaxZoomPanoSize = function() {//获取当前zoomRenderTarget应下载的最高级别
  28267. //若是有三个级别,每次只需要加载到当前的zoomLevel;而两级时因为有zoomed来判断是使用基本贴图还是zoomRenderTarget,所以只需要返回最大的即可
  28268. if (this.zoomLevelResolution) {//有三个级别
  28269. if (this.zoomLevelResolution == '4k' && this.useUltraHighResolutionPanos) {
  28270. return this.getPanoSize(r.ULTRAHIGH)
  28271. } else if (this.zoomLevelResolution == '1k' || !this.useHighResolutionPanos) {
  28272. return this.getPanoSize(r.STANDARD)
  28273. } else {
  28274. return this.getPanoSize(r.HIGH)
  28275. }
  28276. } else {
  28277. let tileClass = this.getMaxZoomClass()
  28278. if(tileClass == '1k')return this.getPanoSize(r.STANDARD);
  28279. if(tileClass == '4k' && this.useUltraHighResolutionPanos ){
  28280. return this.getPanoSize(r.ULTRAHIGH);
  28281. }else{//'2k'
  28282. return this.getPanoSize(r.HIGH);
  28283. }
  28284. }
  28285. }
  28286. /* n.prototype.detectMaxZoomPanoSize = function() {
  28287. 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)
  28288. } */
  28289. ,
  28290. t.exports = n
  28291. }
  28292. , {
  28293. "../constants": 8,
  28294. "../enum/ModelManagerEvents": 33,
  28295. "../enum/PanoSizeClass": 36,
  28296. "../settings": 166,
  28297. "../util/browser": 182,
  28298. "../util/showcase": 193
  28299. }],
  28300. 171: [function(e, t, i) {
  28301. (function(i) {
  28302. "use strict";
  28303. function n(e) {
  28304. this.panos = null,
  28305. this.retryMinimumTime = 1e4,
  28306. this.urls = null,
  28307. this.panoLoadCallbacks = {},
  28308. this.downloadDescriptors = {},
  28309. this.priorityQueue = [],
  28310. this.forceQueue = [],
  28311. this.activeDownloads = [],
  28312. this.qualityManager = null,
  28313. this.tilePrioritizer = null,
  28314. this.refreshInterval = null,
  28315. this.processPriorityQueue = !1,
  28316. this.concurrentDownloads = e.concurrentDownloads || 1,
  28317. this.downloadTestResults = {}
  28318. }
  28319. var r = e("three")
  28320. , o = (e("../enum/Viewmode"),
  28321. e("../settings"))
  28322. , a = (e("../objects/Panorama"),
  28323. e("../util/logger"))
  28324. , s = (e("../enum/Vectors"),
  28325. e("../enum/PanoSizeClass"),
  28326. e("../enum/TileDownloaderEvents"))
  28327. , l = e("./TilePrioritizer")
  28328. , c = e("./TileUtils")
  28329. , h = (e("../enum/GLCubeFaces"),
  28330. e("../enum/DownloadStatus"))
  28331. , u = e("../util/panorama")
  28332. , d = e("../util/ajax")
  28333. , p = e("../ab")
  28334. , f = e("events").EventEmitter
  28335. , g = (new a(i),
  28336. Object.freeze({
  28337. Testing: 1,
  28338. Success: 2,
  28339. Fail: 3
  28340. }));
  28341. n.prototype = Object.create(f.prototype),
  28342. n.IDLE_REFRESH_DELAY = 500,
  28343. n.ACTIVE_REFRESH_DELAY = 16,
  28344. n.DOWNLOAD_RETRIES = 4,
  28345. n.prototype.init = function(e) {
  28346. this.qualityManager = e
  28347. }
  28348. ,
  28349. n.prototype.setUrls = function(e) {
  28350. this.urls = e
  28351. }
  28352. ,
  28353. n.prototype.setPanoData = function(e, t, i) {
  28354. this.panos = e,
  28355. this.imagePanos = t,
  28356. this.panoGroupId = i
  28357. }
  28358. ,
  28359. n.prototype.start = function() {
  28360. this.refreshUpdateInterval(0)
  28361. }
  28362. ,
  28363. n.prototype.stop = function() {
  28364. window.cancel(this.refreshInterval)
  28365. }
  28366. ,
  28367. n.prototype.refreshUpdateInterval = function(e) {
  28368. e || (e = 0),
  28369. this.refreshInterval = window.setTimeout(function() {
  28370. var e = this.update();
  28371. e ? this.refreshUpdateInterval(n.ACTIVE_REFRESH_DELAY) : this.refreshUpdateInterval(n.IDLE_REFRESH_DELAY)
  28372. }
  28373. .bind(this), e)
  28374. }
  28375. ,
  28376. n.prototype.update = function() {
  28377. var e = this.forceQueue.length > 0;
  28378. return this.processQueueForDownloading(this.forceQueue),
  28379. this.processPriorityQueue && (this.queuePrioritizedTilesForPanos(this.panos),
  28380. this.priorityQueue.length > 0 && (e = !0),
  28381. this.processQueueForDownloading(this.priorityQueue)),
  28382. e
  28383. }
  28384. ,
  28385. n.prototype.forceQueueTilesForPano = function() {
  28386. var e = []
  28387. , t = [];
  28388. return function(i, n, r, o, a, s) {
  28389. e.length = 0;
  28390. for (var u = this.getTileDownloadDescriptors(i, n), d = 0; d < u.length; d++) {
  28391. var p = u[d];
  28392. p.status !== h.None && p.status !== h.Queued || e.push(p)
  28393. }
  28394. if (r && e.length > 0) {
  28395. l.sortPanoTiles(e, i, r),
  28396. t.length = 0,
  28397. c.matchingTilesInDirection(i, n, r, o, a, t);
  28398. for (var f = 0, g = function(e) {
  28399. return e.face === m.face && e.faceTileIndex === m.faceTileIndex
  28400. }; f < e.length; ) {
  28401. var m = e[f]
  28402. , v = t.findIndex(g);
  28403. v < 0 ? e.splice(f, 1) : f++
  28404. }
  28405. }
  28406. for (var A = 0; A < e.length; A++)
  28407. this.forceQueue.push(e[A]);
  28408. this.setStatusForAllDescriptors(this.forceQueue, h.ForceQueued),
  28409. this.clearFromQueue(this.priorityQueue, h.ForceQueued, !1),
  28410. s && this.processQueueForDownloading(this.forceQueue, !0)
  28411. }
  28412. }(),
  28413. n.prototype.clearForceQueue = function() {
  28414. this.clearQueue(this.forceQueue)
  28415. }
  28416. ,
  28417. n.prototype.queuePrioritizedTilesForPanos = function(e) {
  28418. this.tilePrioritizer && (this.clearQueue(this.priorityQueue),
  28419. this.tilePrioritizer.filterAndPrioritize(this.priorityQueue, e, this),
  28420. this.clearFromQueue(this.priorityQueue, h.None, !0),
  28421. this.setStatusOrRemoveForAllDescriptors(this.priorityQueue, h.Queued))
  28422. }
  28423. ,
  28424. n.prototype.clearQueue = function(e) {
  28425. this.setStatusForAllDescriptors(e, h.None),
  28426. e.length = 0
  28427. }
  28428. ,
  28429. n.prototype.clearFromQueue = function(e, t, i) {
  28430. for (var n = 0; n < e.length; n++) {
  28431. var r = e[n];
  28432. r && (t === r.status && !i || t !== r.status && i) && (e[n] = null)
  28433. }
  28434. }
  28435. ,
  28436. n.prototype.setStatusForAllDescriptors = function(e, t) {
  28437. for (var i = 0; i < e.length; i++) {
  28438. var n = e[i];
  28439. n && (n.status = t)
  28440. }
  28441. }
  28442. ,
  28443. n.prototype.setStatusOrRemoveForAllDescriptors = function(e, t) {
  28444. for (var i = 0; i < e.length; i++) {
  28445. var n = e[i];
  28446. n && (n.status !== t ? n.status = t : e[i] = null)
  28447. }
  28448. }
  28449. ,
  28450. n.prototype.getTileDownloadDescriptors = function(e, t) {
  28451. var i = this.getAllTileDownloadDescriptorsForPano(e)
  28452. , n = i[t];
  28453. return n || (n = this.buildDownloadDescriptorArray(t),
  28454. i[t] = n,
  28455. this.initTileDownloadDescriptors(n, e, t)),
  28456. n
  28457. }
  28458. ,
  28459. n.prototype.getAllTileDownloadDescriptorsForPano = function(e) {
  28460. var t = this.downloadDescriptors[e.id];
  28461. return t || (t = {},
  28462. this.downloadDescriptors[e.id] = t),
  28463. t
  28464. }
  28465. ,
  28466. n.prototype.processQueueForDownloading = function(e, t) {
  28467. if (this.cleanupActiveDownloads(),
  28468. this.activeDownloads.length < this.concurrentDownloads || t)
  28469. for (var i = t ? e.length : this.concurrentDownloads - this.activeDownloads.length, n = 0, r = 0; n < i && e.length > 0; r++) {
  28470. var o = e.shift();
  28471. o && (this.startDownload(o),
  28472. n++)
  28473. }
  28474. }
  28475. ,
  28476. n.prototype.testDownload = function(e, t, i) {
  28477. var n = this.downloadTestResults[e];
  28478. if (n)
  28479. return void (n === g.Success ? i(!0) : n === g.Fail && i(!1));
  28480. this.downloadTestResults[e] = g.Testing;
  28481. var r = this.panos.list[0]
  28482. , o = this.getTileUrl(r.id, e, t, 0)
  28483. , a = function(t) {
  28484. this.downloadTestResults[e] = g.Success,
  28485. i(!0)
  28486. }
  28487. .bind(this)
  28488. , s = function() {
  28489. this.downloadTestResults[e] = g.Fail,
  28490. i(!1)
  28491. }
  28492. .bind(this);
  28493. this.loadImage(o, 0, a, s)
  28494. }
  28495. ,
  28496. n.prototype.startDownload = function(e) {
  28497. e.status = h.Downloading;
  28498. var t = this.getTileUrl(e.pano.id, e.panoSize, e.tileSize, e.tileIndex);
  28499. this.activeDownloads.push(e),
  28500. this.loadImage(t, n.DOWNLOAD_RETRIES, this.downloadComplete.bind(this, e), this.downloadFailed.bind(this, e))
  28501. }
  28502. ,
  28503. n.prototype.downloadFailed = function(e, t) {}
  28504. ,
  28505. n.prototype.downloadComplete = function(e, t) {
  28506. if (e.panoGroupId === this.panoGroupId) {
  28507. var i = this.getPanoLoadCallbacks(e.pano, e.panoSize);
  28508. e.status = h.Downloaded,
  28509. i && i.onProgress && i.onProgress(e.pano, e.panoSize);
  28510. var n = {
  28511. panoId: e.pano.id,
  28512. image: t,
  28513. tileSize: e.tileSize,
  28514. panoSize: e.panoSize,
  28515. tileIndex: e.tileIndex,
  28516. faceTileIndex: e.faceTileIndex,
  28517. totalTiles: e.totalTiles,
  28518. face: e.face,
  28519. tileX: e.tileX,
  28520. tileY: e.tileY,
  28521. direction: e.direction
  28522. };
  28523. e.image = t,
  28524. this.emit(s.TileDownloadSuccess, n),
  28525. this.isPanoDownloaded(e.pano, e.panoSize) && (n = {
  28526. panoId: e.pano.id,
  28527. tileSize: e.tileSize,
  28528. panoSize: e.panoSize
  28529. },
  28530. this.emit(s.PanoDownloadComplete, n),
  28531. i && i.onLoad && i.onLoad(e.pano, e.panoSize))
  28532. }
  28533. }
  28534. ,
  28535. n.prototype.cleanupActiveDownloads = function() {
  28536. var e = [];
  28537. return function() {
  28538. e.length = 0;
  28539. for (var t = 0; t < this.activeDownloads.length; t++) {
  28540. var i = this.activeDownloads[t];
  28541. i.status !== h.Downloaded && i.status !== h.Failed && e.push(i)
  28542. }
  28543. this.activeDownloads.length = 0,
  28544. this.activeDownloads.push.apply(this.activeDownloads, e)
  28545. }
  28546. }(),
  28547. n.prototype.isPanoDownloaded = function(e, t) {
  28548. var i = this.getTileDownloadDescriptors(e, t);
  28549. if (i.length <= 0)
  28550. return !1;
  28551. for (var n = 0; n < i.length; n++) {
  28552. var r = i[n];
  28553. if (r.status !== h.Downloaded)
  28554. return !1
  28555. }
  28556. return !0
  28557. }
  28558. ,
  28559. n.prototype.setPanoLoadCallbacks = function(e, t, i, n, r) {
  28560. var o = e.id + ":" + this.qualityManager.getPanoSize(t);
  28561. this.panoLoadCallbacks[o] = {
  28562. onLoad: i,
  28563. onFail: n,
  28564. onProgress: r
  28565. }
  28566. }
  28567. ,
  28568. n.prototype.getPanoLoadCallbacks = function(e, t) {
  28569. var i = e.id + ":" + t;
  28570. return this.panoLoadCallbacks[i]
  28571. }
  28572. ,
  28573. n.prototype.buildDownloadDescriptorArray = function(e) {
  28574. for (var t = c.getTileCountForSize(e), i = [], n = 0; n < t; n++) {
  28575. var r = this.buildDownloadDescriptor();
  28576. i.push(r)
  28577. }
  28578. return i
  28579. }
  28580. ,
  28581. n.prototype.buildDownloadDescriptor = function() {
  28582. var e = {
  28583. panoGroupId: null,
  28584. pano: null,
  28585. panoSize: -1,
  28586. tileSize: -1,
  28587. tileIndex: -1,
  28588. totalTiles: -1,
  28589. faceTileIndex: -1,
  28590. status: h.None,
  28591. url: null,
  28592. image: null,
  28593. direction: new r.Vector3,
  28594. face: -1,
  28595. cubeFace: -1,
  28596. tileX: -1,
  28597. tileY: -1
  28598. };
  28599. return e
  28600. }
  28601. ,
  28602. n.prototype.initTileDownloadDescriptors = function(e, t, i) {
  28603. for (var n = 0; n < e.length; n++) {
  28604. var r = e[n];
  28605. this.initTileDownloadDescriptor(r, t, i, n)
  28606. }
  28607. }
  28608. ,
  28609. n.prototype.initTileDownloadDescriptor = function(e, t, i, n) {
  28610. var r = i >= c.TILE_SIZE ? c.TILE_SIZE : i;
  28611. e.face = c.getFaceForTile(i, n),
  28612. e.cubeFace = u.mapFaceToCubemapFace(e.face),
  28613. e.panoGroupId = this.panoGroupId,
  28614. e.pano = t,
  28615. e.panoSize = i,
  28616. e.tileSize = r,
  28617. e.tileIndex = n,
  28618. e.totalTiles = c.getTileCountForSize(i),
  28619. e.status = h.None,
  28620. e.image = null,
  28621. c.getTileLocation(e.panoSize, e.tileIndex, e),
  28622. c.getTileVector(e.panoSize, e.tileSize, e.cubeFace, e.tileX, e.tileY, c.LocationOnTile.Center, 0, e.direction)
  28623. }
  28624. ,
  28625. n.prototype.getTileUrl = function() {
  28626. var e = {
  28627. 256: "256",
  28628. 512: "512",
  28629. 1024: "1k",
  28630. 2048: "2k",
  28631. 4096: "4k"
  28632. }
  28633. , t = {
  28634. face: -1,
  28635. faceTileIndex: -1,
  28636. tileX: -1,
  28637. tileY: -1
  28638. };
  28639. return function(i, n, r, a) {
  28640. c.getTileLocation(n, a, t);
  28641. var s = Math.floor(n / r)
  28642. , l = s * s
  28643. , h = Math.floor(a / l)
  28644. , u = "";
  28645. 1 === o.tiling.customCompression && (u = "_" + o.tiling["q" + e[n]]);
  28646. var d = this.urls.get("tiles/" + i + "/" + e[n] + u + "_face" + h + "_" + t.tileX + "_" + t.tileY + ".jpg");
  28647. return d = p.changeIfTileGenerating(d)
  28648. }
  28649. }(),
  28650. n.prototype.loadImage = function(e, t, i, n) {
  28651. d.getImage(e, t).then(function(e) {
  28652. i(e)
  28653. }).fail(n)
  28654. }
  28655. ,
  28656. t.exports = n
  28657. }
  28658. ).call(this, "/js/tile/TileDownloader.js")
  28659. }
  28660. , {
  28661. "../ab": 3,
  28662. "../enum/DownloadStatus": 24,
  28663. "../enum/GLCubeFaces": 25,
  28664. "../enum/PanoSizeClass": 36,
  28665. "../enum/TileDownloaderEvents": 45,
  28666. "../enum/Vectors": 50,
  28667. "../enum/Viewmode": 51,
  28668. "../objects/Panorama": 148,
  28669. "../settings": 166,
  28670. "../util/ajax": 181,
  28671. "../util/logger": 189,
  28672. "../util/panorama": 191,
  28673. "./TilePrioritizer": 172,
  28674. "./TileUtils": 174,
  28675. events: 202,
  28676. three: 217
  28677. }],
  28678. 172: [function(e, t, i) {
  28679. (function(i) {
  28680. "use strict";
  28681. function n(e, t, i, o, a) {
  28682. this.qualityManager = e,
  28683. this.maxNavQuality = this.qualityManager.getMaxNavPanoSize(),
  28684. this.maxZoomQuality = this.qualityManager.getMaxZoomPanoSize(),
  28685. this.baseSize = t,
  28686. this.standardSize = i,
  28687. this.highSize = o,
  28688. this.ultraHighSize = a,
  28689. this.priorityCriteria = new n.PriorityCriteria(null,new r.Vector3(0,0,0),new r.Vector3(0,0,-1),new r.Vector3(0,0,-1))
  28690. }
  28691. var r = e("three")
  28692. , o = (e("../enum/Viewmode"),
  28693. e("../settings"),
  28694. e("../settings"),
  28695. e("../objects/Panorama"))
  28696. , a = e("../util/logger")
  28697. , s = (e("../enum/Vectors"),
  28698. e("../enum/PanoSizeClass"),
  28699. e("../enum/ModelManagerEvents"),
  28700. e("../enum/GLCubeFaces"),
  28701. e("../enum/DownloadStatus"))
  28702. , l = (e("../util/browser"),
  28703. e("./TileUtils"))
  28704. , c = e("../util/math")
  28705. , h = (e("events").EventEmitter,
  28706. new a(i),
  28707. Object.freeze({
  28708. None: 0,
  28709. DirectionalFOV: 1
  28710. }));
  28711. n.PriorityCriteria = function(e, t, i, n, o) {
  28712. this.pano = e,
  28713. this.cameraPosition = (new r.Vector3).copy(t),
  28714. this.cameraDir = (new r.Vector3).copy(i),
  28715. this.panoSpaceDir = (new r.Vector3).copy(n),
  28716. this.upcomingPanos = o,
  28717. this.copy = function(e) {
  28718. this.pano = e.pano,
  28719. this.cameraPosition.copy(e.cameraPosition),
  28720. this.cameraDir.copy(e.cameraDir),
  28721. this.panoSpaceDir.copy(e.panoSpaceDir),
  28722. this.upcomingPanos = o
  28723. }
  28724. ,
  28725. this.zoomingActive = !1
  28726. }
  28727. ,
  28728. n.DIRECTIONAL_FOV = 180,
  28729. n.DIRECTIONAL_FOV_NARROW = 120,
  28730. n.MAX_SCORED_PANOS_TOCONSIDER = 6,
  28731. n.MAX_SCORED_PANOS_TOADD = 2,
  28732. n.MAX_UPCOMING_PANOS_TOADD = 3,
  28733. n.DIRECTION_SCORE_STRICTNESS = .75,
  28734. n.appendQueue = function(e, t) {
  28735. if (e && t)
  28736. for (var i = 0; i < t.length; i++)
  28737. e.push(t[i])
  28738. }
  28739. ,
  28740. n.prototype.updateCriteria = function(e, t, i, n) {
  28741. this.priorityCriteria.pano = e,
  28742. this.priorityCriteria.cameraPosition.copy(t),
  28743. this.priorityCriteria.cameraDir.copy(i),
  28744. this.priorityCriteria.upcomingPanos = n,
  28745. this.maxNavQuality = this.qualityManager.getMaxNavPanoSize()
  28746. this.maxZoomQuality = this.qualityManager.getMaxZoomPanoSize()
  28747. if(!player.panoRenderer.isPanoZoomed(e.id)){ //xzw add,直到到达该点后才能下载4k,否则不会渲染到zoomRenderTarget上
  28748. this.maxNavQuality = Math.min(2048, this.maxNavQuality)
  28749. this.maxZoomQuality = Math.min(2048, this.maxZoomQuality)
  28750. }
  28751. }
  28752. ,
  28753. n.prototype.filterAndPrioritize = function() {
  28754. var e = []
  28755. , t = []
  28756. , i = [];
  28757. return function(r, o, a) {
  28758. this.populateNeighborPanos(this.priorityCriteria.pano, o, e),
  28759. this.populateScoredPanos(this.priorityCriteria.pano, o, t, this.priorityCriteria.cameraDir, n.MAX_SCORED_PANOS_TOCONSIDER);
  28760. var s = this.baseSize
  28761. , l = this.standardSize
  28762. , c = this.highSize
  28763. , h = this.ultraHighSize;
  28764. this.queueTilesForPano(r, a, this.priorityCriteria.pano, s),
  28765. this.priorityCriteria.upcomingPanos && this.queueTilesForPanos(r, this.priorityCriteria.upcomingPanos, a, s, n.MAX_UPCOMING_PANOS_TOADD),
  28766. this.priorityCriteria.upcomingPanos && this.queueTilesForPanos(r, this.priorityCriteria.upcomingPanos, a, 1024 , n.MAX_UPCOMING_PANOS_TOADD),//更清晰些
  28767. i.length = 0,
  28768. this.canDownloadSize(l) && this.queueTilesInDirectionForPano(i, a, this.priorityCriteria.pano, l, this.priorityCriteria.cameraPosition, this.priorityCriteria.cameraDir, n.DIRECTIONAL_FOV_NARROW),
  28769. n.sortPanoTiles(i, this.priorityCriteria.pano, this.priorityCriteria.cameraDir),
  28770. n.appendQueue(r, i),
  28771. this.queueTilesForPanos(r, t, a, s, n.MAX_SCORED_PANOS_TOADD),
  28772. i.length = 0,
  28773. this.canDownloadSize(c) && this.queueTilesInDirectionForPano(i, a, this.priorityCriteria.pano, c, this.priorityCriteria.cameraPosition, this.priorityCriteria.cameraDir, n.DIRECTIONAL_FOV_NARROW),
  28774. this.canDownloadSize(h) && this.queueTilesInDirectionForPano(i, a, this.priorityCriteria.pano, h, this.priorityCriteria.cameraPosition, this.priorityCriteria.cameraDir, n.DIRECTIONAL_FOV_NARROW),
  28775. n.sortPanoTiles(i, this.priorityCriteria.pano, this.priorityCriteria.cameraDir),
  28776. n.appendQueue(r, i),
  28777. i.length = 0,
  28778. this.canDownloadSize(l) && this.queueTilesInDirectionForPano(i, a, this.priorityCriteria.pano, l, this.priorityCriteria.cameraPosition, this.priorityCriteria.cameraDir, n.DIRECTIONAL_FOV),
  28779. this.canDownloadSize(c) && this.queueTilesInDirectionForPano(i, a, this.priorityCriteria.pano, c, this.priorityCriteria.cameraPosition, this.priorityCriteria.cameraDir, n.DIRECTIONAL_FOV),
  28780. this.canDownloadSize(h) && this.queueTilesInDirectionForPano(i, a, this.priorityCriteria.pano, h, this.priorityCriteria.cameraPosition, this.priorityCriteria.cameraDir, n.DIRECTIONAL_FOV),
  28781. n.sortPanoTiles(i, this.priorityCriteria.pano, this.priorityCriteria.cameraDir),
  28782. n.appendQueue(r, i),
  28783. this.queueTilesForPanos(r, e, a, s)
  28784. }
  28785. }(),
  28786. n.prototype.canDownloadSize = function(e) {
  28787. return this.maxNavQuality >= e || this.maxZoomQuality >= e && this.zoomingActive
  28788. }
  28789. ,
  28790. n.prototype.populateNeighborPanos = function(e, t, i) {
  28791. i = i || [],
  28792. i.length = 0;
  28793. var n = t.getNeighbours(e);
  28794. for (var r in n)
  28795. if (n.hasOwnProperty(r)) {
  28796. var o = t.get(r);
  28797. i.push(o)
  28798. }
  28799. return i
  28800. }
  28801. ,
  28802. n.prototype.populateScoredPanos = function(e, t, i, r, a) {
  28803. i = i || [],
  28804. i.length = 0;
  28805. var s = [o.filters.inPanoDirection(e.position, r, n.DIRECTION_SCORE_STRICTNESS), o.filters.not(e)]
  28806. , l = [o.scoreFunctions.distanceSquared(e), o.scoreFunctions.direction(e.position, r)]
  28807. , c = t.sortByScore(s, l);
  28808. if (c)
  28809. for (var h = 0; h < c.length && h < a; h++) {
  28810. var u = c[h].item;
  28811. i.push(u)
  28812. }
  28813. return i
  28814. }
  28815. ,
  28816. n.prototype.queueTilesForPanos = function(e, t, i, n, r) {
  28817. for (var o = 0, a = 0; a < t.length; a++) {
  28818. var s = t[a]
  28819. , l = this.queueTilesForPano(e, i, s, n);
  28820. if (o += l > 0 ? 1 : 0,
  28821. r && o >= r)
  28822. break
  28823. }
  28824. return o
  28825. }
  28826. ,
  28827. n.prototype.queueTilesForPano = function() {
  28828. var e = {
  28829. filter: h.None
  28830. };
  28831. return function(t, i, n, r) {
  28832. return this.filterAndQueueTileDownloadDescriptors(t, i, n, r, e)
  28833. }
  28834. }(),
  28835. n.prototype.queueTilesForPanosInDirection = function() {
  28836. var e = new r.Vector3;
  28837. return function(t, i, n, r, o, a, s, l) {
  28838. for (var h = 0, u = 0; u < n.length; u++) {
  28839. var d = n[u];
  28840. e.copy(d.position),
  28841. e.sub(o),
  28842. e.normalize();
  28843. var p = Math.max(Math.min(a.dot(e), 1), -1)
  28844. , f = c.getFOVDotThreshold(s);
  28845. if (p >= f) {
  28846. var g = this.queueTilesInDirectionForPano(t, i, d, r, o, a, s);
  28847. if (h += g > 0 ? 1 : 0,
  28848. l && h >= l)
  28849. break
  28850. }
  28851. }
  28852. return h
  28853. }
  28854. }(),
  28855. n.prototype.queueTilesInDirectionForPanos = function(e, t, i, n, r, o, a, s) {
  28856. for (var l = 0, c = 0; c < i.length; c++) {
  28857. var h = i[c]
  28858. , u = this.queueTilesInDirectionForPano(e, t, h, n, o, a);
  28859. if (l += u > 0 ? 1 : 0,
  28860. s && l >= s)
  28861. break
  28862. }
  28863. return l
  28864. }
  28865. ,
  28866. n.prototype.queueTilesInDirectionForPano = function() {
  28867. var e = {
  28868. filter: h.DirectionalFOV,
  28869. direction: new r.Vector3,
  28870. fov: 60
  28871. }
  28872. , t = new r.Vector3;
  28873. return function(i, n, r, o, a, s, c) {
  28874. return t.copy(s),
  28875. l.getRelativeDirection(r.quaternion, t),
  28876. e.direction.copy(t),
  28877. e.fov = c,
  28878. this.filterAndQueueTileDownloadDescriptors(i, n, r, o, e)
  28879. }
  28880. }(),
  28881. n.prototype.filterAndQueueTileDownloadDescriptors = function() {
  28882. var e = [];
  28883. return function(t, i, n, r, o) {
  28884. var a = i.getTileDownloadDescriptors(n, r);
  28885. e.length = 0,
  28886. this.filterTileDownloadDescriptors(n, a, e, o);
  28887. for (var s = 0, l = 0; l < e.length; l++) {
  28888. var c = e[l];
  28889. c && (t.push(c),
  28890. s++)
  28891. }
  28892. return s
  28893. }
  28894. }(),
  28895. n.prototype.filterTileDownloadDescriptors = function() {
  28896. new r.Vector3;
  28897. return function(e, t, i, n) {
  28898. var r, o;
  28899. switch (n.filter) {
  28900. case h.DirectionalFOV:
  28901. for (r = 0; r < t.length; r++)
  28902. o = t[r],
  28903. l.isTileWithinFOV(o.panoSize, o.tileSize, o.face, o.tileX, o.tileY, n.direction, n.fov) && i.push(o);
  28904. break;
  28905. default:
  28906. for (r = 0; r < t.length; r++)
  28907. o = t[r],
  28908. i.push(o)
  28909. }
  28910. for (r = 0; r < i.length; r++)
  28911. o = i[r],
  28912. this.canIncludeDescriptor(o) || (i[r] = null)
  28913. }
  28914. }(),
  28915. n.prototype.canIncludeDescriptor = function(e) {
  28916. return e.status !== s.Downloading && e.status !== s.Downloaded
  28917. }
  28918. ,
  28919. n.prototype.canIncludePano = function(e, t) {
  28920. return !e.isLoaded(t)
  28921. }
  28922. ,
  28923. n.getFOVDotThreshold = function(e) {
  28924. return Math.cos(r.Math.degToRad(e / 2))
  28925. }
  28926. ;
  28927. var u = function() {
  28928. var e = function e(t, i) {
  28929. var n = e._panoSpaceDir
  28930. , r = e._fovThreshold
  28931. , o = e._fovThresholdNarrow
  28932. , a = Math.max(Math.min(n.dot(t.direction), 1), -1)
  28933. , s = Math.max(Math.min(n.dot(i.direction), 1), -1);
  28934. return t._dot = a,
  28935. i._dot = s,
  28936. 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)
  28937. };
  28938. return e._panoSpaceDir = new r.Vector3,
  28939. e._fovThreshold = -1,
  28940. e._fovThresholdNarrow = -1,
  28941. e
  28942. }();
  28943. n.sortPanoTiles = function(e, t, i) {
  28944. u._panoSpaceDir.copy(i),
  28945. l.getRelativeDirection(t.quaternion, u._panoSpaceDir),
  28946. u._fovThresholdNarrow = c.getFOVDotThreshold(n.DIRECTIONAL_FOV_NARROW),
  28947. u._fovThreshold = c.getFOVDotThreshold(n.DIRECTIONAL_FOV),
  28948. e.sort(u)
  28949. }
  28950. ,
  28951. n.insertSortedPanoTile = function(e, t, i, r) {
  28952. u._panoSpaceDir.copy(r),
  28953. l.getRelativeDirection(i.quaternion, u._panoSpaceDir),
  28954. u._fovThresholdNarrow = c.getFOVDotThreshold(n.DIRECTIONAL_FOV_NARROW),
  28955. u._fovThreshold = c.getFOVDotThreshold(n.DIRECTIONAL_FOV);
  28956. for (var o = -1, a = 0; a < e.length; a++) {
  28957. var s = u(t, e[a]);
  28958. if (s <= 0) {
  28959. o = a;
  28960. break
  28961. }
  28962. }
  28963. if (o === -1)
  28964. e[e.length] = t;
  28965. else {
  28966. for (var h = e.length; h > o; h--)
  28967. e[h] = e[h - 1];
  28968. e[o] = t
  28969. }
  28970. }
  28971. ,
  28972. n.prototype.setZoomingActive = function(e) {
  28973. e !== this.zoomingActive && (this.zoomingActive = e)
  28974. }
  28975. ,
  28976. t.exports = n
  28977. }
  28978. ).call(this, "/js/tile/TilePrioritizer.js")
  28979. }
  28980. , {
  28981. "../enum/DownloadStatus": 24,
  28982. "../enum/GLCubeFaces": 25,
  28983. "../enum/ModelManagerEvents": 33,
  28984. "../enum/PanoSizeClass": 36,
  28985. "../enum/Vectors": 50,
  28986. "../enum/Viewmode": 51,
  28987. "../objects/Panorama": 148,
  28988. "../settings": 166,
  28989. "../util/browser": 182,
  28990. "../util/logger": 189,
  28991. "../util/math": 190,
  28992. "./TileUtils": 174,
  28993. events: 202,
  28994. three: 217
  28995. }],
  28996. 173: [function(e, t, i) {
  28997. "use strict";
  28998. function n(e, t) {
  28999. this.levels = t,
  29000. this.tileSize = e,
  29001. this.root = null,
  29002. this.allNodes = [],
  29003. a(this)
  29004. }
  29005. function r(e, t) {
  29006. this.tree = e,
  29007. this.parent = t,
  29008. this.children = [],
  29009. this.id = ++u
  29010. }
  29011. function o(e, t, i, r, a, s, l, h) {
  29012. if (e) {
  29013. l = l || n.TraversalType.PreOrder;
  29014. var u = r * c + i;
  29015. if (l === n.TraversalType.PreOrder && (a && a(e, t, u, i, r),
  29016. s && s.push(e)),
  29017. e.children && 0 !== e.children.length) {
  29018. for (var d = r * c, p = i * c, f = 0; f < c; f++)
  29019. for (var g = 0; g < c; g++)
  29020. o(e.children[g * c + f], t + 1, p + f, d + g, a, s, l, h);
  29021. l === n.TraversalType.PostOrder && (a && a(e, t, u, i, r),
  29022. s && s.push(e))
  29023. }
  29024. }
  29025. }
  29026. function a(e) {
  29027. e.root = s(e, null, 0)
  29028. }
  29029. function s(e, t, i) {
  29030. if (i > e.levels)
  29031. return null;
  29032. var n = new r(e,t);
  29033. e.allNodes.push(n);
  29034. for (var o = 0; o < h; o++)
  29035. n.children[o] = s(e, n, i + 1);
  29036. return n
  29037. }
  29038. function l(e, t, i, n, r) {
  29039. if (!e)
  29040. return null;
  29041. if (0 === i)
  29042. return e;
  29043. if (!e.children || 0 === e.children.length)
  29044. return null;
  29045. var o = Math.pow(c, i)
  29046. , a = o / c
  29047. , s = n % a
  29048. , h = r % a
  29049. , u = Math.floor(r / a)
  29050. , d = Math.floor(n / a)
  29051. , p = u * c + d
  29052. , f = e.children[p];
  29053. return l(f, t + 1, i - 1, s, h)
  29054. }
  29055. var c = (e("three"),
  29056. e("./TileUtils"),
  29057. e("../objects/Panorama"),
  29058. e("../util/panorama"),
  29059. e("events").EventEmitter,
  29060. 2)
  29061. , h = c * c;
  29062. n.TraversalType = Object.freeze({
  29063. PreOrder: 0,
  29064. PostOrder: 1
  29065. });
  29066. var u = 0;
  29067. n.getLevelCountForSize = function(e, t) {
  29068. var i = 0;
  29069. for (t < e && (t = e); ; ) {
  29070. if (t /= c,
  29071. t < e)
  29072. break;
  29073. i++
  29074. }
  29075. return i
  29076. }
  29077. ,
  29078. n.getSizeForLevel = function(e, t) {
  29079. return Math.pow(c, t) * e
  29080. }
  29081. ,
  29082. n.prototype.getSubNode = function(e, t, i) {
  29083. (!t || e < this.tileSize) && (t = 0),
  29084. (!i || e < this.tileSize) && (i = 0),
  29085. e < this.tileSize && (e = this.tileSize);
  29086. var r = n.getLevelCountForSize(this.tileSize, e)
  29087. , o = l(this.root, 0, r, t, i);
  29088. return o
  29089. }
  29090. ,
  29091. n.prototype.breadthFirst = function(e) {
  29092. e = e || {};
  29093. var t = !!e.nullLevelEnd
  29094. , i = e.maxLevel
  29095. , n = e.minLevel
  29096. , r = e.callback
  29097. , o = e.saveVisited
  29098. , a = []
  29099. , s = {}
  29100. , l = 0
  29101. , c = 0;
  29102. for (a.push(this.root),
  29103. a.push(s); a.length > 0 && !(i && l > i); ) {
  29104. var h = a.shift();
  29105. if (h === s)
  29106. (!n || l >= n) && (r && t && r(null),
  29107. o && t && o.push(null)),
  29108. a.length > 0 && a.push(s),
  29109. l++,
  29110. c = 0;
  29111. else {
  29112. if (h.children)
  29113. for (var u = 0; u < h.children.length; u++) {
  29114. var d = h.children[u];
  29115. d && a.push(h.children[u])
  29116. }
  29117. var p = this.getFaceIndexFromNode(h);
  29118. (!n || l >= n) && (r && r(h, l, p),
  29119. o && o.push(h)),
  29120. c++
  29121. }
  29122. }
  29123. }
  29124. ,
  29125. n.prototype.getFaceIndexFromNode = function(e) {
  29126. if (!e)
  29127. return -1;
  29128. for (var t = 1, i = e, n = 0, r = 0; ; ) {
  29129. var o = i.parent;
  29130. if (!o)
  29131. break;
  29132. for (var a = -1, s = 0; s < o.children.length; s++)
  29133. o.children[s] === i && (a = s);
  29134. var l = a % c
  29135. , h = Math.floor(a / c);
  29136. n = l * t + n,
  29137. r = h * t + r,
  29138. t *= c,
  29139. i = o
  29140. }
  29141. return r * t + n
  29142. }
  29143. ,
  29144. n.prototype.depthFirst = function(e, t, i) {
  29145. o(this.root, 0, 0, 0, e, t, i, this.tileSize)
  29146. }
  29147. ,
  29148. t.exports = n
  29149. }
  29150. , {
  29151. "../objects/Panorama": 148,
  29152. "../util/panorama": 191,
  29153. "./TileUtils": 174,
  29154. events: 202,
  29155. three: 217
  29156. }],
  29157. 174: [function(e, t, i) {
  29158. "use strict";
  29159. var n = e("../enum/GLCubeFaces")
  29160. , r = e("../util/MathLight")
  29161. , o = {};
  29162. o.TILE_SIZE = 512,
  29163. o.FACES_PER_PANO = 6,
  29164. o.LocationOnTile = {
  29165. Center: 0,
  29166. UpperLeft: 1,
  29167. UpperRight: 2,
  29168. LowerRight: 3,
  29169. LowerLeft: 4
  29170. },
  29171. o.getTileVector = function() {
  29172. return function(e, t, i, a, s, l, c, h) {
  29173. l = l || o.LocationOnTile.Center;
  29174. var u = e / t
  29175. , d = a / u;
  29176. s = -s + (u - 1);
  29177. var p = s / u
  29178. , f = t / e
  29179. , g = 2 * f
  29180. , m = g / 2
  29181. , v = 2 * d - 1 + m
  29182. , A = 2 * p - 1 + m;
  29183. switch (l) {
  29184. case o.LocationOnTile.UpperLeft:
  29185. v -= m,
  29186. A += m,
  29187. v += c * g;
  29188. break;
  29189. case o.LocationOnTile.UpperRight:
  29190. v += m,
  29191. A += m,
  29192. A -= c * g;
  29193. break;
  29194. case o.LocationOnTile.LowerRight:
  29195. v += m,
  29196. A -= m,
  29197. v -= c * g;
  29198. break;
  29199. case o.LocationOnTile.LowerLeft:
  29200. v -= m,
  29201. A -= m,
  29202. A += c * g;
  29203. break;
  29204. case o.LocationOnTile.Center:
  29205. }
  29206. switch (i) {
  29207. case n.GL_TEXTURE_CUBE_MAP_POSITIVE_X:
  29208. r.setVector(h, -1, A, -v);
  29209. break;
  29210. case n.GL_TEXTURE_CUBE_MAP_NEGATIVE_X:
  29211. r.setVector(h, 1, A, v);
  29212. break;
  29213. case n.GL_TEXTURE_CUBE_MAP_POSITIVE_Y:
  29214. r.setVector(h, -v, 1, -A);
  29215. break;
  29216. case n.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y:
  29217. r.setVector(h, -v, -1, A);
  29218. break;
  29219. case n.GL_TEXTURE_CUBE_MAP_POSITIVE_Z:
  29220. r.setVector(h, -v, A, 1);
  29221. break;
  29222. case n.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z:
  29223. r.setVector(h, v, A, -1)
  29224. }
  29225. r.normalize(h)
  29226. }
  29227. }(),
  29228. o.getFaceForTile = function(e, t) {
  29229. var i = o.TILE_SIZE;
  29230. e < o.TILE_SIZE && (i = e);
  29231. var n = Math.floor(e / i)
  29232. , r = n * n;
  29233. return Math.floor(t / r)
  29234. }
  29235. ,
  29236. o.getTileLocation = function(e, t, i) {
  29237. var n = o.TILE_SIZE;
  29238. e < o.TILE_SIZE && (n = e);
  29239. var r = o.getFaceForTile(e, t)
  29240. , a = Math.floor(e / n)
  29241. , s = a * a
  29242. , l = t - r * s;
  29243. i.tileX = l % a,
  29244. i.tileY = Math.floor(l / a),
  29245. i.face = r,
  29246. i.faceTileIndex = l
  29247. }
  29248. ,
  29249. o.getTileCountForSize = function(e) {
  29250. if (e <= o.TILE_SIZE)
  29251. return o.FACES_PER_PANO;
  29252. var t = Math.floor(e / o.TILE_SIZE)
  29253. , i = t * t
  29254. , n = i * o.FACES_PER_PANO;
  29255. return n
  29256. }
  29257. ,
  29258. o.getRelativeDirection = function() {
  29259. var e = new r.Matrix4
  29260. , t = new r.Quaternion;
  29261. return function(i, n) {
  29262. t.copy(i),
  29263. t.inverse(),
  29264. e.makeRotationFromQuaternion(t),
  29265. e.applyToVector3(n),
  29266. r.normalize(n)
  29267. }
  29268. }(),
  29269. o.matchingTilesInDirection = function() {
  29270. var e = new r.Vector3
  29271. , t = new r.Vector3(0,0,-1)
  29272. , i = new r.Quaternion
  29273. , n = function(e, t) {
  29274. e.push({
  29275. face: t.face,
  29276. faceTileIndex: t.faceTileIndex,
  29277. tileX: t.tileX,
  29278. tileY: t.tileY
  29279. })
  29280. }
  29281. , a = function() {
  29282. var e = {
  29283. face: -1,
  29284. faceTileIndex: -1,
  29285. tileX: -1,
  29286. tileY: -1
  29287. };
  29288. return function(t, i, r) {
  29289. for (var a = o.getTileCountForSize(t), s = 0, l = 0; l < a; l++)
  29290. o.getTileLocation(t, l, e),
  29291. i && !i(e) || (s++,
  29292. r && n(r, e));
  29293. return s
  29294. }
  29295. }();
  29296. return function(n, s, l, c, h, u) {
  29297. var d = s < o.TILE_SIZE ? s : o.TILE_SIZE;
  29298. o.getTileCountForSize(s);
  29299. if (!c && !h)
  29300. return a(s, null, u);
  29301. var p = !!h;
  29302. if (h = h || c,
  29303. h = Math.max(0, Math.min(h, 360)),
  29304. c = Math.max(0, Math.min(c, 360)),
  29305. r.copyVector(l, e),
  29306. o.getRelativeDirection(n.quaternion, e),
  29307. p) {
  29308. i.setFromUnitVectors(e, t);
  29309. var f = function(e) {
  29310. return o.isTileWithinFrustum(s, d, e.face, e.tileX, e.tileY, i, c, h)
  29311. };
  29312. return a(s, f, u)
  29313. }
  29314. var g = function(t) {
  29315. return o.isTileWithinFOV(s, d, t.face, t.tileX, t.tileY, e, c)
  29316. };
  29317. return a(s, g, u)
  29318. }
  29319. }(),
  29320. o.isTileWithinFrustum = function() {
  29321. var e = new r.Vector3
  29322. , t = 1e-5;
  29323. return function(i, n, a, s, l, c, h, u) {
  29324. 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++)
  29325. if (o.getTileVector(i, n, m, s, l, b, 0, e),
  29326. r.applyQuaternionToVector(c, e),
  29327. e.z >= -t)
  29328. I++;
  29329. else {
  29330. var w = -1 / e.z
  29331. , _ = e.x * w
  29332. , T = e.y * w;
  29333. T > d ? v++ : T < p && A++,
  29334. _ > f ? y++ : _ < g && C++,
  29335. E++
  29336. }
  29337. return A !== E && v !== E && y !== E && C !== E
  29338. }
  29339. }(),
  29340. o.isTileWithinFOV = function() {
  29341. var e = new r.Vector3
  29342. , t = new r.Vector3(0,1,0)
  29343. , i = new r.Vector3(1,0,0);
  29344. return function(n, a, s, l, c, h, u) {
  29345. var d = o.mapFaceToCubemapFace(s);
  29346. if (r.cross(h, t, i),
  29347. o.getTileVector(n, a, d, l, c, o.LocationOnTile.Center, 0, e),
  29348. o.isWithinFOV(e, h, u, null))
  29349. return !0;
  29350. for (var p = u / 360, f = Math.floor(1 / p), g = 0, m = 0; m < f; m++) {
  29351. for (var v = o.LocationOnTile.UpperLeft; v <= o.LocationOnTile.LowerLeft; v++)
  29352. if (o.getTileVector(n, a, d, l, c, v, g, e),
  29353. o.isWithinFOV(e, h, u, null))
  29354. return !0;
  29355. g += p
  29356. }
  29357. return !1
  29358. }
  29359. }(),
  29360. o.isWithinFOV = function() {
  29361. var e = new r.Vector3
  29362. , t = new r.Vector3;
  29363. return function(i, n, o, a) {
  29364. if (r.copyVector(i, t),
  29365. a) {
  29366. r.copyVector(a, e),
  29367. r.normalize(e);
  29368. var s = r.dot(e, i);
  29369. e.x *= s,
  29370. e.y *= s,
  29371. e.z *= s,
  29372. r.subVector(t, e)
  29373. }
  29374. var l = o / 2 * r.RADIANS_PER_DEGREE
  29375. , c = Math.cos(l)
  29376. , h = r.dot(t, n);
  29377. return h >= c
  29378. }
  29379. }(),
  29380. o.mapFaceToCubemapFace = function() {
  29381. var e = {
  29382. 0: n.GL_TEXTURE_CUBE_MAP_POSITIVE_Y,
  29383. 1: n.GL_TEXTURE_CUBE_MAP_POSITIVE_Z,
  29384. 2: n.GL_TEXTURE_CUBE_MAP_POSITIVE_X,
  29385. 3: n.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z,
  29386. 4: n.GL_TEXTURE_CUBE_MAP_NEGATIVE_X,
  29387. 5: n.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y
  29388. };
  29389. return function(t) {
  29390. return e[t]
  29391. }
  29392. }(),
  29393. t.exports = o
  29394. }
  29395. , {
  29396. "../enum/GLCubeFaces": 25,
  29397. "../util/MathLight": 176
  29398. }],
  29399. 175: [function(e, t, i) {
  29400. (function(i) {
  29401. "use strict";
  29402. function n() {
  29403. this.list = [],
  29404. this.index = {},
  29405. Object.defineProperty(this, "length", {
  29406. get: function() {
  29407. return this.list.length
  29408. }
  29409. })
  29410. }
  29411. var r = (e("./common"),
  29412. e("./logger"));
  29413. new r(i);
  29414. n.prototype.forEach = function(e) {
  29415. this.list.forEach(e)
  29416. }
  29417. ,
  29418. n.prototype.add = function(e) {
  29419. this.list.push(e),
  29420. this.index[this.getIndex(e)] = e
  29421. }
  29422. ,
  29423. n.prototype.getIndex = function(e) {
  29424. throw new Error("IndexedCollection.getIndex not implemented in subclass.")
  29425. }
  29426. ,
  29427. n.prototype.extend = function(e) {
  29428. for (var t = 0; t < e.length; t++)
  29429. this.add(e[t])
  29430. }
  29431. ,
  29432. n.prototype.get = function(e) {
  29433. return this.index[e]
  29434. }
  29435. ,
  29436. n.prototype.first = function() {
  29437. return this.list[0]
  29438. }
  29439. ,
  29440. n.prototype.last = function() {
  29441. return this.list[this.list.length - 1]
  29442. }
  29443. ,
  29444. n.prototype.reIndex = function() {
  29445. this.index = {};
  29446. var e = this;
  29447. this.forEach(function(t) {
  29448. e.index[e.getIndex(t)] = t
  29449. })
  29450. }
  29451. ,
  29452. n.prototype.filter = function(e) {
  29453. var t = this.list.filter(e);
  29454. return this.reIndex(),
  29455. t
  29456. }
  29457. ,
  29458. n.prototype.reduce = function(e, t) {
  29459. return this.list.reduce(e, t)
  29460. }
  29461. ,
  29462. n.prototype.sort = function(e) {
  29463. return this.list.sort(e)
  29464. }
  29465. ,
  29466. n.prototype.indexOf = function(e) {
  29467. for (var t = 0; t < this.list.length; ++t)
  29468. if (this.list[t] === e)
  29469. return t;
  29470. return -1
  29471. }
  29472. ,
  29473. t.exports = n
  29474. }
  29475. ).call(this, "/js/util/IndexedCollection.js")
  29476. }
  29477. , {
  29478. "./common": 185,
  29479. "./logger": 189
  29480. }],
  29481. 176: [function(e, t, i) {
  29482. "use strict";
  29483. var n = e("../constants")
  29484. , r = {};
  29485. r.RADIANS_PER_DEGREE = Math.PI / 180,
  29486. r.DEGREES_PER_RADIAN = 180 / Math.PI,
  29487. r.Vector3 = function(e, t, i) {
  29488. this.x = e || 0,
  29489. this.y = t || 0,
  29490. this.z = i || 0
  29491. }
  29492. ,
  29493. r.Matrix4 = function() {
  29494. this.elements = new Float32Array([1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1]),
  29495. arguments.length > 0 && console.error("MathLight.Matrix4: the constructor no longer reads arguments. use .set() instead.")
  29496. }
  29497. ,
  29498. r.Matrix4.prototype = {
  29499. identity: function() {
  29500. return this.set(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1),
  29501. this
  29502. },
  29503. copy: function(e) {
  29504. return this.elements.set(e.elements),
  29505. this
  29506. },
  29507. applyToVector3: function(e) {
  29508. var t = e.x
  29509. , i = e.y
  29510. , n = e.z
  29511. , r = this.elements;
  29512. return e.x = r[0] * t + r[4] * i + r[8] * n + r[12],
  29513. e.y = r[1] * t + r[5] * i + r[9] * n + r[13],
  29514. e.z = r[2] * t + r[6] * i + r[10] * n + r[14],
  29515. this
  29516. },
  29517. getInverse: function(e, t) {
  29518. var i = this.elements
  29519. , n = e.elements
  29520. , r = n[0]
  29521. , o = n[1]
  29522. , a = n[2]
  29523. , s = n[3]
  29524. , l = n[4]
  29525. , c = n[5]
  29526. , h = n[6]
  29527. , u = n[7]
  29528. , d = n[8]
  29529. , p = n[9]
  29530. , f = n[10]
  29531. , g = n[11]
  29532. , m = n[12]
  29533. , v = n[13]
  29534. , A = n[14]
  29535. , y = n[15]
  29536. , C = p * A * u - v * f * u + v * h * g - c * A * g - p * h * y + c * f * y
  29537. , I = m * f * u - d * A * u - m * h * g + l * A * g + d * h * y - l * f * y
  29538. , E = d * v * u - m * p * u + m * c * g - l * v * g - d * c * y + l * p * y
  29539. , b = m * p * h - d * v * h - m * c * f + l * v * f + d * c * A - l * p * A
  29540. , w = r * C + o * I + a * E + s * b;
  29541. if (0 === w) {
  29542. var _ = "MathLight.Matrix4.getInverse(): can't invert matrix, determinant is 0";
  29543. if (t)
  29544. throw new Error(_);
  29545. return console.warn(_),
  29546. this.identity()
  29547. }
  29548. var T = 1 / w;
  29549. return i[0] = C * T,
  29550. i[1] = (v * f * s - p * A * s - v * a * g + o * A * g + p * a * y - o * f * y) * T,
  29551. i[2] = (c * A * s - v * h * s + v * a * u - o * A * u - c * a * y + o * h * y) * T,
  29552. i[3] = (p * h * s - c * f * s - p * a * u + o * f * u + c * a * g - o * h * g) * T,
  29553. i[4] = I * T,
  29554. i[5] = (d * A * s - m * f * s + m * a * g - r * A * g - d * a * y + r * f * y) * T,
  29555. i[6] = (m * h * s - l * A * s - m * a * u + r * A * u + l * a * y - r * h * y) * T,
  29556. i[7] = (l * f * s - d * h * s + d * a * u - r * f * u - l * a * g + r * h * g) * T,
  29557. i[8] = E * T,
  29558. i[9] = (m * p * s - d * v * s - m * o * g + r * v * g + d * o * y - r * p * y) * T,
  29559. i[10] = (l * v * s - m * c * s + m * o * u - r * v * u - l * o * y + r * c * y) * T,
  29560. i[11] = (d * c * s - l * p * s - d * o * u + r * p * u + l * o * g - r * c * g) * T,
  29561. i[12] = b * T,
  29562. i[13] = (d * v * a - m * p * a + m * o * f - r * v * f - d * o * A + r * p * A) * T,
  29563. i[14] = (m * c * a - l * v * a - m * o * h + r * v * h + l * o * A - r * c * A) * T,
  29564. i[15] = (l * p * a - d * c * a + d * o * h - r * p * h - l * o * f + r * c * f) * T,
  29565. this
  29566. },
  29567. makeRotationFromQuaternion: function(e) {
  29568. var t = this.elements
  29569. , i = e.x
  29570. , n = e.y
  29571. , r = e.z
  29572. , o = e.w
  29573. , a = i + i
  29574. , s = n + n
  29575. , l = r + r
  29576. , c = i * a
  29577. , h = i * s
  29578. , u = i * l
  29579. , d = n * s
  29580. , p = n * l
  29581. , f = r * l
  29582. , g = o * a
  29583. , m = o * s
  29584. , v = o * l;
  29585. return t[0] = 1 - (d + f),
  29586. t[4] = h - v,
  29587. t[8] = u + m,
  29588. t[1] = h + v,
  29589. t[5] = 1 - (c + f),
  29590. t[9] = p - g,
  29591. t[2] = u - m,
  29592. t[6] = p + g,
  29593. t[10] = 1 - (c + d),
  29594. t[3] = 0,
  29595. t[7] = 0,
  29596. t[11] = 0,
  29597. t[12] = 0,
  29598. t[13] = 0,
  29599. t[14] = 0,
  29600. t[15] = 1,
  29601. this
  29602. }
  29603. },
  29604. r.Quaternion = function(e, t, i, n) {
  29605. this._x = e || 0,
  29606. this._y = t || 0,
  29607. this._z = i || 0,
  29608. this._w = void 0 !== n ? n : 1
  29609. }
  29610. ,
  29611. r.Quaternion.prototype = {
  29612. get x() {
  29613. return this._x
  29614. },
  29615. set x(e) {
  29616. this._x = e
  29617. },
  29618. get y() {
  29619. return this._y
  29620. },
  29621. set y(e) {
  29622. this._y = e
  29623. },
  29624. get z() {
  29625. return this._z
  29626. },
  29627. set z(e) {
  29628. this._z = e
  29629. },
  29630. get w() {
  29631. return this._w
  29632. },
  29633. set w(e) {
  29634. this._w = e
  29635. },
  29636. copy: function(e) {
  29637. this._x = e.x,
  29638. this._y = e.y,
  29639. this._z = e.z,
  29640. this._w = e.w
  29641. },
  29642. inverse: function() {
  29643. return this.conjugate().normalize()
  29644. },
  29645. conjugate: function() {
  29646. return this._x *= -1,
  29647. this._y *= -1,
  29648. this._z *= -1,
  29649. this
  29650. },
  29651. length: function() {
  29652. return Math.sqrt(this._x * this._x + this._y * this._y + this._z * this._z + this._w * this._w)
  29653. },
  29654. normalize: function() {
  29655. var e = this.length();
  29656. return 0 === e ? (this._x = 0,
  29657. this._y = 0,
  29658. this._z = 0,
  29659. this._w = 1) : (e = 1 / e,
  29660. this._x = this._x * e,
  29661. this._y = this._y * e,
  29662. this._z = this._z * e,
  29663. this._w = this._w * e),
  29664. this
  29665. },
  29666. setFromAxisAngle: function(e, t) {
  29667. var i = t / 2
  29668. , n = Math.sin(i);
  29669. return this._x = e.x * n,
  29670. this._y = e.y * n,
  29671. this._z = e.z * n,
  29672. this._w = Math.cos(i),
  29673. this
  29674. },
  29675. setFromUnitVectors: function() {
  29676. var e, t, i = 1e-6;
  29677. return function(n, o) {
  29678. return void 0 === e && (e = new r.Vector3),
  29679. t = r.dot(n, o) + 1,
  29680. t < i ? (t = 0,
  29681. 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),
  29682. this._x = e.x,
  29683. this._y = e.y,
  29684. this._z = e.z,
  29685. this._w = t,
  29686. this.normalize()
  29687. }
  29688. }(),
  29689. multiply: function(e) {
  29690. return this.multiplyQuaternions(this, e)
  29691. },
  29692. premultiply: function(e) {
  29693. return this.multiplyQuaternions(e, this)
  29694. },
  29695. multiplyQuaternions: function(e, t) {
  29696. var i = e._x
  29697. , n = e._y
  29698. , r = e._z
  29699. , o = e._w
  29700. , a = t._x
  29701. , s = t._y
  29702. , l = t._z
  29703. , c = t._w;
  29704. return this._x = i * c + o * a + n * l - r * s,
  29705. this._y = n * c + o * s + r * a - i * l,
  29706. this._z = r * c + o * l + i * s - n * a,
  29707. this._w = o * c - i * a - n * s - r * l,
  29708. this
  29709. }
  29710. },
  29711. r.convertWorkshopVector = function(e) {
  29712. return new r.Vector3(-e.x,e.y,e.z)
  29713. }
  29714. ,
  29715. r.convertWorkshopQuaternion = function(e) {
  29716. 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))
  29717. }
  29718. ;
  29719. r.convertWorkshopOrthoZoom = function(e) {//xzw
  29720. //return e === -1 ? -1 : e / 16 * ($("#player").width() / $("#player").height()) / n.workshopApsect
  29721. return e === -1 ? -1 : e * ($("#player").width() / $("#player").height()) / g_snapShotWidth * g_snapShotHeight;
  29722. }
  29723. ,
  29724. r.convertWorkshopPanoramaQuaternion = function(e) {
  29725. 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))
  29726. }
  29727. ,
  29728. r.normalize = function(e) {
  29729. var t = e.x * e.x + e.y * e.y + e.z * e.z
  29730. , i = Math.sqrt(t);
  29731. e.x /= i,
  29732. e.y /= i,
  29733. e.z /= i
  29734. }
  29735. ,
  29736. r.dot = function(e, t) {
  29737. return e.x * t.x + e.y * t.y + e.z * t.z
  29738. }
  29739. ,
  29740. r.cross = function(e, t, i) {
  29741. var n = e.x
  29742. , r = e.y
  29743. , o = e.z;
  29744. i.x = r * t.z - o * t.y,
  29745. i.y = o * t.x - n * t.z,
  29746. i.z = n * t.y - r * t.x
  29747. }
  29748. ,
  29749. r.setVector = function(e, t, i, n) {
  29750. e.x = t,
  29751. e.y = i,
  29752. e.z = n
  29753. }
  29754. ,
  29755. r.copyVector = function(e, t) {
  29756. t.x = e.x,
  29757. t.y = e.y,
  29758. t.z = e.z
  29759. }
  29760. ,
  29761. r.addVector = function(e, t) {
  29762. e.x += t.x,
  29763. e.y += t.y,
  29764. e.z += t.z
  29765. }
  29766. ,
  29767. r.subVector = function(e, t) {
  29768. e.x -= t.x,
  29769. e.y -= t.y,
  29770. e.z -= t.z
  29771. }
  29772. ,
  29773. r.applyQuaternionToVector = function(e, t) {
  29774. var i = t.x
  29775. , n = t.y
  29776. , r = t.z
  29777. , o = e.x
  29778. , a = e.y
  29779. , s = e.z
  29780. , l = e.w
  29781. , c = l * i + a * r - s * n
  29782. , h = l * n + s * i - o * r
  29783. , u = l * r + o * n - a * i
  29784. , d = -o * i - a * n - s * r;
  29785. t.x = c * l + d * -o + h * -s - u * -a,
  29786. t.y = h * l + d * -a + u * -o - c * -s,
  29787. t.z = u * l + d * -s + c * -a - h * -o
  29788. }
  29789. ,
  29790. r.angleBetweenVectors = function(e, t) {
  29791. return Math.acos(r.dot(e, t))
  29792. }
  29793. ,
  29794. t.exports = r
  29795. }
  29796. , {
  29797. "../constants": 8
  29798. }],
  29799. 177: [function(e, t, i) {
  29800. (function(i) {
  29801. "use strict";
  29802. function n(e) {
  29803. this.cache = null,
  29804. this.expires = 0
  29805. }
  29806. function r() {
  29807. this.baseUrl = null,
  29808. this.cache = null,
  29809. this.expires = 0
  29810. }
  29811. function o() {
  29812. this.baseUrl = null,
  29813. this.expires = 0
  29814. }
  29815. function a(e) {
  29816. this.initialLoadingPromise = null,
  29817. this.endpoint = e + "?type=3",
  29818. this.urlContainer = null,
  29819. this.authorizationHeader = h.getAuthorizationHeader(),
  29820. this.containerClasses = [o, r, n]
  29821. }
  29822. var s = e("./ajax")
  29823. , l = e("./logger")
  29824. , c = e("../constants")
  29825. , h = e("./showcase")
  29826. , u = (e("../ab"),
  29827. new l(i));
  29828. n.prototype = {
  29829. version: 1,
  29830. validate: function(e) {
  29831. return "catalog.json"in e && Object.keys(e).length > 0
  29832. },
  29833. update: function(e) {
  29834. return this.cache = e,
  29835. this.expires = Date.now() + c.signedUrlDefaultExpireTime,
  29836. $.when()
  29837. },
  29838. get: function(e) {
  29839. return this.cache[e]
  29840. }
  29841. },
  29842. r.prototype = {
  29843. version: 2,
  29844. validate: function(e) {
  29845. return "catalog.json"in e && "base.url"in e && Object.keys(e).length > 1
  29846. },
  29847. update: function(e) {
  29848. return this.baseUrl = e["base.url"],
  29849. this.cache = e,
  29850. this.expires = Date.now() + c.signedUrlDefaultExpireTime,
  29851. $.when()
  29852. },
  29853. get: function(e) {
  29854. var t = this.cache[e];
  29855. return t ? this.baseUrl.replace("{{filename}}", e) + t : null
  29856. }
  29857. },
  29858. o.prototype = {
  29859. version: 3,
  29860. validate: function(e) {
  29861. return e.templates && e.catalog_file && (!e.expires || 1e3 * e.expires > Date.now())
  29862. },
  29863. update: function(e) {
  29864. return this.baseUrl = e.templates[0],
  29865. e.expires ? this.expires = 1e3 * e.expires : this.expires = Date.now() + c.signedUrlDefaultExpireTime,
  29866. $.when()
  29867. },
  29868. get: function(e) {
  29869. return this.baseUrl.replace("{{filename}}", e)
  29870. }
  29871. },
  29872. a.prototype = {
  29873. init: function() {
  29874. return this.initialLoadingPromise ? this.initialLoadingPromise : (setInterval(function() {
  29875. var e = this.urlContainer ? this.urlContainer.expires : Date.now();
  29876. Date.now() + c.signedUrlRefreshBuffer > e && (u.debug("Refreshing urls..."),
  29877. this.refresh().done(function() {
  29878. u.debug("Refreshed")
  29879. }).fail(function() {
  29880. u.error("Failed url refresh, urls might go stale soon")
  29881. }))
  29882. }
  29883. .bind(this), c.signedUrlCheckInterval),
  29884. this.initialLoadingPromise = this.refresh(),
  29885. this.initialLoadingPromise)
  29886. },
  29887. refresh: function(e) { //已经在someData.js里加载过了 不用再加载file了吧
  29888. e = e || {};
  29889. /*var t = void 0 === e.cache || e.cache;
  29890. return s.get( this.endpoint , { //file
  29891. responseType: "json",
  29892. prefetchFrom: t ? "files" : null,
  29893. cache: t,
  29894. auth: this.authorizationHeader
  29895. }).then(function(e) {
  29896. if (this.urlContainer && this.urlContainer.validate(e))
  29897. return this.urlContainer.update(e);
  29898. for (var i = 0; i < this.containerClasses.length; i++) {
  29899. var n = this.containerClasses[i]
  29900. , r = new n;
  29901. if (r.validate(e))
  29902. return u.info("Using urls version " + r.version),
  29903. this.urlContainer = r,
  29904. this.urlContainer.update(e)
  29905. }
  29906. return t ? this.refresh({
  29907. cache: !1
  29908. }) : $.Deferred().reject("missing-urls")
  29909. }
  29910. .bind(this), function(e) {
  29911. return "loading-failed"
  29912. }) */
  29913. return $.Deferred().resolve();
  29914. },
  29915. get: function(e) {
  29916. //return this.urlContainer.get(e)
  29917. return window.DATA.files.templates[0].replace("{{filename}}", e)
  29918. }
  29919. },
  29920. t.exports = a
  29921. }
  29922. ).call(this, "/js/util/ModelUrls.js")
  29923. }
  29924. , {
  29925. "../ab": 3,
  29926. "../constants": 8,
  29927. "./ajax": 181,
  29928. "./logger": 189,
  29929. "./showcase": 193
  29930. }],
  29931. 178: [function(e, t, i) {
  29932. (function(i) {
  29933. "use strict";
  29934. function n() {
  29935. u.call(this),
  29936. this.neighbourMap = {},
  29937. this.map = null
  29938. }
  29939. var r = e("three")
  29940. , o = e("./common")
  29941. , a = e("../settings")
  29942. , s = e("../objects/Panorama")
  29943. , a = e("../settings")
  29944. , l = e("./aStar")
  29945. , c = e("./logger")
  29946. , h = new c(i)
  29947. , u = e("./IndexedCollection")
  29948. , d = e("./transitions");
  29949. o.inherit(n, u),
  29950. n.prototype.getIndex = function(e) {
  29951. return e.id
  29952. }
  29953. ,
  29954. n.prototype.find = function(e, t) {
  29955. var i = o.filterAll(this.list, e);
  29956. return 0 === i.length ? null : (t && t.forEach(function(e) {
  29957. i = o.stableSort(i, e)
  29958. }),
  29959. i[0])
  29960. }
  29961. /* n.prototype.sortByScore = function(e, t) {
  29962. var i = o.filterAll(this.list, e);
  29963. return 0 === i.length ? null : i = i.map(function(e) {
  29964. return {
  29965. pano: e,
  29966. score: t.reduce(function(t, i) {
  29967. return t + i(e)
  29968. }, 0)
  29969. }
  29970. }).sort(function(e, t) {
  29971. return t.score - e.score;
  29972. })
  29973. } */
  29974. ,
  29975. n.prototype.sortByScore = function( request, rank){
  29976. return common.sortByScore(this.list, request, rank)
  29977. }
  29978. ,
  29979. n.prototype.lowestByScore = function(e, t, i) {
  29980. return this.findRankedByScore(0, e, t, i)
  29981. }
  29982. ,
  29983. n.prototype.findRankedByScore = function(e, t, i, n) {
  29984. n && (n.candidates = null,
  29985. n.pano = null),
  29986. e || (e = 0);
  29987. var r = this.sortByScore(t, i);
  29988. return !r || 0 === r.length || e >= r.length ? null : (n && (n.candidates = r,
  29989. n.pano = r[e].item),
  29990. r[e].item)
  29991. }
  29992. ,
  29993. n.prototype.showPanoScores = function(e) {
  29994. this.list.forEach(function(e) {
  29995. e.removeTextSprite()
  29996. });
  29997. var t = 6344768;
  29998. e.forEach(function(e) {
  29999. e.pano.addTextSprite(e.score.toFixed(2), t),
  30000. t = 16428055
  30001. })
  30002. }
  30003. ,
  30004. n.prototype.isNeighbour = function(e, t) {
  30005. return this.neighbourMap[e.id][t.id]
  30006. }
  30007. ,
  30008. n.prototype.getNeighbours = function(e) {
  30009. return this.neighbourMap[e.id]
  30010. }
  30011. ,
  30012. n.prototype.setNeighbour = function(e, t, i) {
  30013. return this.neighbourMap[e.id] || (this.neighbourMap[e.id] = {}),
  30014. this.neighbourMap[t.id] || (this.neighbourMap[t.id] = {}),
  30015. this.neighbourMap[e.id][e.id] = !0,
  30016. this.neighbourMap[t.id][t.id] = !0,
  30017. this.neighbourMap[e.id][t.id] = i,
  30018. this.neighbourMap[t.id][e.id] = i,
  30019. this.neighbourMap[e.id]
  30020. }
  30021. ,
  30022. n.prototype.findClosest = function(e, t) {
  30023. var i = [s.filters.isPanoAligned()];
  30024. return t && i.push(s.filters.inDirection(e, t, .75)),
  30025. this.find(i, [s.sortFunctions.distanceToPoint(e)])
  30026. }
  30027. ,
  30028. n.prototype.dualNeighbors = function(e, t) {
  30029. var i, n = [];
  30030. for (i in this.neighbourMap[e.id])
  30031. this.neighbourMap[t.id][i] && n.push(i);
  30032. return n
  30033. }
  30034. ,
  30035. n.prototype.populate_path_graph = function() {
  30036. 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;
  30037. for (e = 0; e < this.list.length; e += 1) {
  30038. o = this.list[e],
  30039. s = {},
  30040. l = !1,
  30041. i = o.neighbourPanos || o.findNeighourPanos();
  30042. for (t in i)
  30043. if (i[t]) {
  30044. a = this.index[t],
  30045. p.copy(o.floorPosition),
  30046. p.sub(a.floorPosition);
  30047. var m = Math.sqrt(p.x * p.x + p.z * p.z)
  30048. , v = (Math.abs(p.y) / Math.max(m, .01),
  30049. Math.max(0, Math.abs(p.y) - .2));
  30050. v > 0 ? (f += 1,
  30051. v = Math.pow(4 * v, 2),
  30052. m = Math.pow(m, 2),
  30053. n = Math.sqrt(v * v + m * m)) : (g += 1,
  30054. n = p.length()),
  30055. s[a.id] = n,
  30056. l = !0
  30057. }
  30058. l ? u[o.id] = s : d += 1
  30059. }
  30060. this.map = u,
  30061. h.info("graph ready in " + (Date.now() - c) + "ms, " + d + " had no neighbors")
  30062. }
  30063. ,
  30064. n.prototype.aStarSearch = function(e, t) {
  30065. var i = Date.now()
  30066. , n = new l({
  30067. start: e,
  30068. isEnd: function(e) {
  30069. return e === t
  30070. },
  30071. neighbor: function(e) {
  30072. var t = e.neighbourPanos || e.findNeighourPanos()
  30073. , i = [];
  30074. for (var n in t)
  30075. t[n] && i.push(this.index[n]); //add: t[n] &&
  30076. return i
  30077. }
  30078. .bind(this),
  30079. distance: function(e, t) {
  30080. var i = this.map[e.id]
  30081. , n = i[t.id];
  30082. return n
  30083. }
  30084. .bind(this),
  30085. heuristic: function(e, t) {
  30086. return 1
  30087. }
  30088. .bind(this),
  30089. hash: function(e) {
  30090. return e.id
  30091. },
  30092. timeout: 5e3
  30093. });
  30094. if (h.debug("A* search in " + (Date.now() - i) + "ms"),
  30095. "success" !== n.status)
  30096. return h.debug("Did not find A* path from " + e + " to " + t),
  30097. null;
  30098. h.debug("Total cost " + n.cost.toPrecision(3) + ", " + n.path.length + " steps");
  30099. var r = [];
  30100. return n.path.forEach(function(e) {
  30101. r.push(e.id)
  30102. }),
  30103. r
  30104. }
  30105. ,
  30106. n.prototype.includeNodesNearPath = function() {
  30107. var e = new r.Vector3
  30108. , t = new r.Vector3
  30109. , i = new r.Vector3
  30110. , n = new r.Vector3
  30111. , o = new r.Vector3
  30112. , a = new r.Vector3
  30113. , s = new r.Vector3
  30114. , l = new r.Vector3
  30115. , c = []
  30116. , h = new r.Vector3
  30117. , u = new r.Vector3;
  30118. return function(r, d) {
  30119. if (r)
  30120. for (var p = function(e, t, i) {
  30121. return o.copy(t).sub(e),
  30122. o.dot(i)
  30123. }, f = function(e, t) {
  30124. return p(h, e.position, i) - p(h, t.position, i)
  30125. }, g = 0; g < r.length - 1; ) {
  30126. var m = r[g]
  30127. , v = r[g + 1]
  30128. , A = this.index[m]
  30129. , y = this.index[v];
  30130. h.copy(A.position),
  30131. u.copy(y.position),
  30132. c.length = 0,
  30133. e.copy(u).sub(h),
  30134. i.copy(e).normalize();
  30135. for (var C = 0; C < this.list.length; C++) {
  30136. var I = this.list[C];
  30137. o.copy(I.position).sub(h);
  30138. var E = o.dot(i);
  30139. if (E > 0) {
  30140. s.copy(i),
  30141. s.multiplyScalar(E),
  30142. a.copy(o),
  30143. a.sub(s);
  30144. var b = a.length();
  30145. if (b < d) {
  30146. t.copy(e).negate(),
  30147. n.copy(t).normalize(),
  30148. l.copy(I.position).sub(u);
  30149. var w = l.dot(n);
  30150. w > 0 && c.push(I)
  30151. }
  30152. }
  30153. }
  30154. if (c.length > 0) {
  30155. c.sort(f);
  30156. for (var _ = r.length + c.length - 1; _ >= g + c.length; _--)
  30157. r[_] = r[_ - c.length];
  30158. for (var T = 0; T < c.length; T++)
  30159. r[T + g + 1] = c[T].id
  30160. }
  30161. g += c.length + 1
  30162. }
  30163. }
  30164. }(),
  30165. /* n.prototype. = function(e, t) {
  30166. var i = void 0 === e ? a.panorama.markerOpacity : e
  30167. , n = this.list.findIndex(function(e) {
  30168. return e.marker
  30169. });
  30170. if (!(n < 0)) {
  30171. var r = this.list[n].marker.material.opacity;
  30172. if (r !== e) {
  30173. var o = i - r;
  30174. d.trigger({
  30175. func: function(e, t) {
  30176. var i = r + e * o;
  30177. this.forEach(function(e) {
  30178. e.marker && (e.marker.material.opacity = i)
  30179. })
  30180. }
  30181. .bind(this),
  30182. duration: void 0 === t ? a.markerOpacityTransitionTime : t,
  30183. name: "_fpm"
  30184. })
  30185. }
  30186. }
  30187. } */
  30188. n.prototype.fadeMarkerOpacity = function(e, t, gr) {
  30189. d.cancelById('fadeMarkerOpacity')
  30190. var n = this.list.findIndex(function (e) {
  30191. //why? 难道没有marker的pano吗 findeIndex:获取数组中函数返回值不为fasle的第一个元素索引位置
  30192. return e.marker
  30193. })
  30194. if (n < 0) {
  30195. //logger.info('marker findIndex<0')
  30196. return
  30197. }
  30198. var group
  30199. var tran = function (list, index) {
  30200. list.member = list.member.filter(function (m) {
  30201. return m.marker && m.marker.material.opacity != list.toOp
  30202. })
  30203. transitions.trigger({
  30204. func: function (e, t) {
  30205. //e:0-1
  30206. list.member.forEach(function (m) {
  30207. var o = m.marker.oldOpacity
  30208. var i = o + e * (list.toOp - o)
  30209. m.marker && (m.marker.material.opacity = i)
  30210. })
  30211. }.bind(this),
  30212. duration: void 0 == t ? a.markerOpacityTransitionTime : t,
  30213. name: '_fpm_' + index,
  30214. id: 'fadeMarkerOpacity',
  30215. })
  30216. }
  30217. this.forEach(function (e) {
  30218. //先记录旧的opacity
  30219. e.marker && (e.marker.oldOpacity = e.marker.material.opacity)
  30220. })
  30221. group = gr
  30222. /* if (e > 0 && gr) {
  30223. group = gr
  30224. } else {
  30225. group = [
  30226. {
  30227. member: this.list,
  30228. toOp: 0,
  30229. },
  30230. ]
  30231. } */
  30232. for (var i = 0; i < group.length; i++) {
  30233. tran(group[i], i)
  30234. }
  30235. }
  30236. ,
  30237. t.exports = n
  30238. }
  30239. ).call(this, "/js/util/PanoramaCollection.js")
  30240. }
  30241. , {
  30242. "../objects/Panorama": 148,
  30243. "../settings": 166,
  30244. "./IndexedCollection": 175,
  30245. "./aStar": 180,
  30246. "./common": 185,
  30247. "./logger": 189,
  30248. "./transitions": 195,
  30249. three: 217
  30250. }],
  30251. 179: [function(e, t, i) {
  30252. "use strict";
  30253. function n() {
  30254. this.actionSequence = [],
  30255. this.actionSequenceInProgress = !1
  30256. }
  30257. function r(e, t, i, n) {
  30258. s.trackAlways("zoom_" + e, {
  30259. from: t,
  30260. to: i,
  30261. pano: n
  30262. })
  30263. }
  30264. function o(e, t) {
  30265. r("initial", 1, e, t)
  30266. }
  30267. function a(e, t, i) {
  30268. r("followup", e, t, i)
  30269. }
  30270. var s = e("../analytics");
  30271. n.prototype.reset = function(e) {
  30272. this.actionSequenceInProgress = !1,
  30273. this.actionSequence.length = 0
  30274. }
  30275. ,
  30276. n.prototype.addZoomAction = function() {
  30277. var e = null
  30278. , t = null
  30279. , i = !1
  30280. , n = function() {
  30281. if (e = null,
  30282. this.actionSequence.length > 0) {
  30283. var i = this.actionSequence[0].start
  30284. , n = this.actionSequence[this.actionSequence.length - 1].end;
  30285. 1 === i ? o(n, t) : a(i, n, t)
  30286. }
  30287. this.reset()
  30288. };
  30289. return function(r, o, a) {
  30290. if (r !== o) {
  30291. i || (n = n.bind(this),
  30292. i = !0),
  30293. e && (window.clearTimeout(e),
  30294. e = null),
  30295. a === t && this.actionSequenceInProgress || (this.reset(),
  30296. t = a),
  30297. this.actionSequenceInProgress = !0;
  30298. var s = {
  30299. start: r,
  30300. end: o
  30301. };
  30302. this.actionSequence.push(s),
  30303. e = window.setTimeout(n, 150)
  30304. }
  30305. }
  30306. }(),
  30307. t.exports = n
  30308. }
  30309. , {
  30310. "../analytics": 4
  30311. }],
  30312. 180: [function(e, t, i) {
  30313. "use strict";
  30314. function n(e) {
  30315. void 0 === e.timeout && (e.timeout = 1 / 0);
  30316. var t = e.hash || o
  30317. , i = {
  30318. data: e.start,
  30319. g: 0,
  30320. h: e.heuristic(e.start)
  30321. }
  30322. , n = i;
  30323. i.f = i.h;
  30324. var h = new s
  30325. , u = new l(a)
  30326. , d = c();
  30327. u.push(i),
  30328. d.set(t(i.data), i);
  30329. for (var p = new Date; u.size(); ) {
  30330. if (new Date - p > e.timeout)
  30331. return {
  30332. status: "timeout",
  30333. cost: n.g,
  30334. path: r(n)
  30335. };
  30336. var f = u.pop();
  30337. if (d.delete(t(f.data)),
  30338. e.isEnd(f.data))
  30339. return {
  30340. status: "success",
  30341. cost: f.g,
  30342. path: r(f)
  30343. };
  30344. h.add(t(f.data));
  30345. for (var g = e.neighbor(f.data), m = 0; m < g.length; m++) {
  30346. var v = g[m];
  30347. if (!h.contains(t(v))) {
  30348. var A = f.g + e.distance(f.data, v)
  30349. , y = d.get(t(v))
  30350. , C = !1;
  30351. if (void 0 === y)
  30352. y = {
  30353. data: v
  30354. },
  30355. d.set(t(v), y);
  30356. else {
  30357. if (y.g < A)
  30358. continue;
  30359. C = !0
  30360. }
  30361. y.parent = f,
  30362. y.g = A,
  30363. y.h = e.heuristic(v),
  30364. y.f = A + y.h,
  30365. y.h < n.h && (n = y),
  30366. C ? u.heapify() : u.push(y)
  30367. }
  30368. }
  30369. }
  30370. return {
  30371. status: "noPath",
  30372. cost: n.g,
  30373. path: r(n)
  30374. }
  30375. }
  30376. function r(e) {
  30377. if (void 0 !== e.parent) {
  30378. var t = r(e.parent);
  30379. return t.push(e.data),
  30380. t
  30381. }
  30382. return [e.data]
  30383. }
  30384. function o(e) {
  30385. return e.toString()
  30386. }
  30387. function a(e, t) {
  30388. return e.f - t.f
  30389. }
  30390. var s = e("Set")
  30391. , l = e("heap")
  30392. , c = e("dict");
  30393. t.exports = n
  30394. }
  30395. , {
  30396. Set: 196,
  30397. dict: 210,
  30398. heap: 211
  30399. }],
  30400. 181: [function(e, t, i) {
  30401. (function(i) {
  30402. "use strict";
  30403. function n(e, t, i) {
  30404. var n = new XMLHttpRequest;
  30405. if (i && "withCredentials"in n)
  30406. n.open(e, t, i);
  30407. else if ("undefined" != typeof XDomainRequest)
  30408. n = new XDomainRequest,
  30409. n.open(e, t);
  30410. else {
  30411. if (i)
  30412. throw "Browser does not support CORS!";
  30413. n.open(e, t)
  30414. }
  30415. return n
  30416. }
  30417. function r(e, t, i) {
  30418. function o() {
  30419. u.warn("Retrying ", t),
  30420. r(e, t, i).done(c.resolve.bind(c)).progress(c.notify.bind(c)).fail(c.reject.bind(c))
  30421. }
  30422. function a(e, t) {
  30423. var i = e.response;
  30424. if ("json" === t && "object" != typeof i)
  30425. try {
  30426. i = JSON.parse(e.responseText)
  30427. } catch (e) {
  30428. return void c.reject({
  30429. error: "Failed parsing JSON"
  30430. })
  30431. }
  30432. else if ("image/jpeg" === t) {
  30433. var n = new Uint8Array(e.response)
  30434. , r = new Blob([n],{
  30435. type: "image/jpeg"
  30436. })
  30437. , o = URL.createObjectURL(r);
  30438. i = new Image,
  30439. i.src = o,
  30440. i.crossOrigin = "Anonymous",
  30441. i.onload = function() {
  30442. URL.revokeObjectURL(o)
  30443. }
  30444. }
  30445. return i
  30446. }
  30447. var s = n(e, t, !1);
  30448. if (i = i || {},
  30449. i.retries = void 0 !== i.retries ? i.retries : 0,
  30450. i.retry = void 0 !== i.retry ? i.retry : "get" === e.toLowerCase(),
  30451. i.responseType)
  30452. if (["arraybuffer", "text", "json"].indexOf(i.responseType) > -1)
  30453. s.responseType = i.responseType;
  30454. else {
  30455. if ("image/jpeg" !== i.responseType)
  30456. throw new Error('reponseType can only be one of "arraybuffer", "text" or "json", "image/jpeg"');
  30457. s.responseType = "arraybuffer"
  30458. }
  30459. if ("json" === i.responseType && s.setRequestHeader("Accept", "application/json"),
  30460. i.auth && s.setRequestHeader("Authorization", i.auth),
  30461. "object" == typeof i.data && (i.data = JSON.stringify(i.data),
  30462. s.setRequestHeader("Content-Type", "application/json")),
  30463. "object" == typeof i.headers)
  30464. for (var l in i.headers)
  30465. s.setRequestHeader(l, i.headers[l]);
  30466. var c = $.Deferred();
  30467. return s.onreadystatechange = function(e) {
  30468. if (4 === this.readyState)
  30469. if (this.status >= 500 && this.status <= 600 && i.retry && i.retries < 3)
  30470. i.retries++,
  30471. setTimeout(o, 1e3);
  30472. else if (200 === this.status) {
  30473. var t = a(this, i.responseType);
  30474. c.resolve(t)
  30475. } else
  30476. c.reject(this)
  30477. }
  30478. ,
  30479. s.onprogress = function(e) {
  30480. c.notify(e)
  30481. }
  30482. ,
  30483. s.send(i.data),
  30484. c.promise()
  30485. }
  30486. function o(e) {
  30487. return Object.keys(e).sort().map(function(t) {
  30488. return {
  30489. key: t,
  30490. value: e[t]
  30491. }
  30492. })
  30493. }
  30494. function a(e, t) {
  30495. var i = t.responseType || null
  30496. , n = t.auth || null
  30497. , r = t.prefetchFrom || null
  30498. , a = e + "__" + i + "__" + n + "__" + r;
  30499. return t.headers && o(t.headers).forEach(function(e) {
  30500. a += "__" + e.key + ":" + e.value
  30501. }),
  30502. a
  30503. }
  30504. function s(e, t) {
  30505. return window.MP_REQUEST_CACHE ? window.MP_REQUEST_CACHE[a(e, t)] : null
  30506. }
  30507. function l(e, t, i) {
  30508. window.MP_REQUEST_CACHE && (window.MP_REQUEST_CACHE[a(e, t)] = i)
  30509. }
  30510. var c = e("./logger")
  30511. , h = e("../ab")
  30512. , u = new c(i);
  30513. window.URL = window.URL || window.webkitURL,
  30514. window.MP_REQUEST_CACHE = window.MP_REQUEST_CACHE || {},
  30515. window.DATA = window.DATA || {}
  30516. /* setTimeout(function() {//MP-- xzw delete
  30517. window.MP_REQUEST_CACHE = null,
  30518. window.DATA = {}
  30519. }, 6e4),
  30520. window.onpageshow = function(e) {
  30521. e.persisted && (window.MP_REQUEST_CACHE = null,
  30522. window.DATA = {})
  30523. } */
  30524. ,
  30525. t.exports = {
  30526. get: function(e, t) {
  30527. t = t || {};
  30528. var i = void 0 === t.cache || t.cache;
  30529. if (i) {
  30530. var n = s(e, t);
  30531. if (n)
  30532. return n
  30533. }
  30534. var o;
  30535. return o = t.prefetchFrom && window.DATA[t.prefetchFrom] ? $.when(window.DATA[t.prefetchFrom]) : r("GET", e, t),
  30536. i && l(e, t, o),
  30537. o
  30538. },
  30539. post: function(e, t) {
  30540. return r("POST", e, t)
  30541. },
  30542. patch: function(e, t) {
  30543. return r("PATCH", e, t)
  30544. },
  30545. getImage: function(e, t) { //xzw改 遇到部分图片在ios16以上显示不出,ios18更严重。查阅解决方法为使用decode
  30546. function i() {
  30547. u.warn("Retrying ", e),
  30548. o.getImage(e, t - 1).done(n.resolve.bind(n)).progress(n.notify.bind(n)).fail(n.reject.bind(n))
  30549. }
  30550. var n = $.Deferred()
  30551. , r = new Image
  30552. , o = this;
  30553. e = h.changeIfImageOptimzing(e)
  30554. r.crossOrigin = "anonymous",
  30555. r.src = e
  30556. /* if(browser.texNeedDecode){//
  30557. r.decode().then((e) => {
  30558. let delay = Math.round(r.width * r.height / 30000)
  30559. browser.isMobile() && (delay *= 3)
  30560. //console.log('delay111111111111',delay)
  30561. setTimeout(()=>{n.resolve(r)}, delay ) //需延迟,否则报错 WebGL: INVALID_VALUE: texImage2D: bad image data,但延迟时间不定。 试过定时1秒后更新tex没用。 直接改图为rgb模式了
  30562. }).catch((error) => {
  30563. console.error('Image decoding failed:?!!!!', error);
  30564. });
  30565. }else{//原本的代码: */
  30566. null !== t && void 0 !== t || (t = 3)
  30567. r.onerror = function() {
  30568. t > 0 ? setTimeout(i, 1e3) : n.reject()
  30569. }
  30570. ,
  30571. r.onload = function() {
  30572. n.resolve(r)
  30573. }
  30574. //}
  30575. return n
  30576. /*
  30577. Safari 浏览器在 iOS 上有一个特殊的图像解码策略,称为“懒加载”或“延迟解码”。这意味着图像不会立即解码,而是在需要显示时才解码。这可能会导致某些情况下图像无法及时显示。
  30578. 使用 decode() 方法:如果你使用的是现代浏览器(如 Safari 14+),可以尝试使用 ImageBitmapRenderingContext 的 createImageBitmap() 和 decode() 方法来提前解码图像。
  30579. const image = new Image();
  30580. image.src = 'image.png';
  30581. image.decode().then(() => {
  30582. const texture = new THREE.Texture(image);
  30583. texture.needsUpdate = true;
  30584. }).catch((error) => {
  30585. console.error('Image decoding failed:', error);
  30586. });
  30587. */
  30588. }
  30589. }
  30590. }
  30591. ).call(this, "/js/util/ajax.js")
  30592. }
  30593. , {
  30594. "../ab": 3,
  30595. "./logger": 189
  30596. }],
  30597. 182: [function(e, t, i) {
  30598. "use strict";
  30599. function n(e, t) {
  30600. var i = window.navigator.userAgent
  30601. , n = i.match(e);
  30602. return n = n ? n[1].split(t) : [],
  30603. {
  30604. major: parseInt(n[0]) || 0,
  30605. minor: parseInt(n[1]) || 0,
  30606. patch: parseInt(n[2]) || 0
  30607. }
  30608. }
  30609. var r = e("../exception/DeviceMismatchException");
  30610. t.exports = {
  30611. supportsFullscreen: function() {
  30612. return document.fullscreenEnabled || document.mozFullscreenEnabled || document.mozFullScreenEnabled || document.webkitFullscreenEnabled || document.msFullscreenEnabled
  30613. },
  30614. isPointerLocked: function() {
  30615. return document.pointerLockElement || document.mozPointerLockElement || document.webkitPointerLockElement
  30616. },
  30617. requestFullscreen: function(e, t) {
  30618. e.requestFullscreen ? e.requestFullscreen() : e.mozRequestFullScreen ? e.mozRequestFullScreen() : e.webkitRequestFullscreen ? e.webkitRequestFullscreen(Element.ALLOW_KEYBOARD_INPUT) : e.msRequestFullscreen && e.msRequestFullscreen(),
  30619. t && $(document).on("fullscreenchange webkitfullscreenchange mozfullscreenchange MSFullscreenChange", browser.requestPointerLock)
  30620. },
  30621. requestPointerLock: function() {
  30622. var e;
  30623. if (document.fullscreenElement)
  30624. e = document.fullscreenElement();
  30625. else if (document.mozFullscreenElement)
  30626. e = document.mozFullscreenElement();
  30627. else if (document.mozFullScreenElement)
  30628. e = document.mozFullScreenElement();
  30629. else {
  30630. if (!document.webkitFullscreenElement)
  30631. return;
  30632. e = document.webkitFullscreenElement()
  30633. }
  30634. e.requestPointerLock = e.requestPointerLock || e.mozRequestPointerLock || e.webkitRequestPointerLock,
  30635. e.requestPointerLock(),
  30636. $(document).off("fullscreenchange webkitfullscreenchange mozfullscreenchange MSFullscreenChange", this)
  30637. },
  30638. exitPointerLock: function() {
  30639. document.exitPointerLock = document.exitPointerLock || document.mozExitPointerLock || document.webkitExitPointerLock,
  30640. document.exitPointerLock()
  30641. },
  30642. exitFullscreen: function() {
  30643. document.exitFullscreen ? document.exitFullscreen() : document.msExitFullscreen ? document.msExitFullscreen() : document.mozCancelFullScreen ? document.mozCancelFullScreen() : document.webkitExitFullscreen && document.webkitExitFullscreen()
  30644. },
  30645. details: function() {
  30646. var e = navigator.userAgent.match("(Firefox|Chrome|Safari)/([\\d]+)");
  30647. return e ? {
  30648. name: e[1],
  30649. version: parseInt(e[2]),
  30650. platform: navigator.platform
  30651. } : {}
  30652. },
  30653. is: function(e) {
  30654. return this.details() && this.details().name === e
  30655. },
  30656. inIframe: function() {
  30657. return window.parent !== window
  30658. },
  30659. aspectRatio: function() {
  30660. var e = $("#player").width() / $("#player").height();
  30661. return isFinite(e) ? e : 0
  30662. },
  30663. userAgent: function() {
  30664. return window.navigator.userAgent
  30665. },
  30666. isLandscape: function() {
  30667. return this.isMobile && this.aspectRatio() > 1
  30668. },
  30669. isSmallScreen: function() {
  30670. var e = screen.width / window.devicePixelRatio;
  30671. return e < 240
  30672. },
  30673. detectIE: function() {
  30674. var e = window.navigator.userAgent
  30675. , t = e.indexOf("MSIE ");
  30676. return t !== -1 || !!navigator.userAgent.match(/Trident.*rv\:11\./)
  30677. },
  30678. detectSafari: function() {
  30679. var e = window.navigator.userAgent
  30680. , t = e.indexOf("Safari");
  30681. return t !== -1 && !this.detectChrome()//因为 Chrome 的用户代理字符串中也包含 "Safari"。
  30682. },
  30683. SafariVersion: function() {//add
  30684. if(!this.detectSafari())return;
  30685. const match = window.navigator.userAgent.match(/Version\/(\d+)\.(\d+)/);
  30686. if (match) {
  30687. return {
  30688. major: parseInt(match[1], 10),
  30689. minor: parseInt(match[2], 10)
  30690. };
  30691. }
  30692. },
  30693. detectFirefox: function() {
  30694. var e = window.navigator.userAgent;
  30695. return e.indexOf("Firefox") !== -1
  30696. },
  30697. detectChrome: function() {
  30698. var e = window.navigator.userAgent;
  30699. return e.indexOf("Chrome") !== -1 && !this.detectOpera()
  30700. },
  30701. detectOpera: function() {
  30702. var e = window.navigator.userAgent;
  30703. return e.indexOf("OPR") !== -1
  30704. },
  30705. detectIOS: function() {
  30706. return this.detectIPhone() || this.detectIPad() || this.detectIPod()
  30707. },
  30708. detectIPad: function() {
  30709. var e = window.navigator.userAgent
  30710. , t = /iPad/;
  30711. return t.test(e)
  30712. },
  30713. detectIPod: function() {
  30714. var e = window.navigator.userAgent
  30715. , t = /iPod/;
  30716. return t.test(e)
  30717. },
  30718. detectIPhone: function() {
  30719. var e = window.navigator.userAgent
  30720. , t = /iPhone/;
  30721. return t.test(e)
  30722. },
  30723. detectAndroid: function() {
  30724. var e = window.navigator.userAgent;
  30725. return e.indexOf("Android") !== -1
  30726. },
  30727. detectAndroidMobile: function() {
  30728. var e = window.navigator.userAgent;
  30729. return this.detectAndroid() && e.indexOf("Mobile") !== -1
  30730. },
  30731. detectSamsungNative: function() {
  30732. var e = window.navigator.userAgent;
  30733. return e.indexOf("SM-G900H") !== -1 || e.indexOf("GT-I9500") !== -1 || e.indexOf("SM-N900") !== -1
  30734. },
  30735. detectSamsungS6: function() {
  30736. var e = window.navigator.userAgent;
  30737. return e.indexOf("SM-G92") !== -1
  30738. },
  30739. /************************************************************fyz改from徐世廷*************************************************************/
  30740. detectHUAWEI5X: function() {
  30741. return -1 !== window.navigator.userAgent.indexOf("KIW-TL00H")
  30742. },
  30743. /*******************************************************************************************************************************/
  30744. detectWebVR: function() {
  30745. return !(!window.navigator.getVRDisplays || !window.VRDisplay)
  30746. },
  30747. getVRDisplay: function() {
  30748. var e = $.Deferred();
  30749. return this.detectWebVR() ? (navigator.getVRDisplays().then(function(t) {
  30750. t.length >= 1 && e.resolve(t[0]),
  30751. e.reject(null)
  30752. }),
  30753. e) : e.reject(null)
  30754. },
  30755. iosVersion: function() {
  30756. if (!this.detectIOS())
  30757. throw new r("Did not detect an iDevice");
  30758. var e = /((?:\d+\_?){1,3}) like Mac OS/
  30759. , t = "_";
  30760. return n(e, t)
  30761. },
  30762. androidVersion: function() {
  30763. if (!this.detectAndroid())
  30764. throw new r("Did not detect an Android based device");
  30765. var e = /Android ((?:\d+\.?){1,3})/
  30766. , t = ".";
  30767. return n(e, t)
  30768. },
  30769. valueFromCookie: function(e, t) {
  30770. var i = new RegExp(e + "=([0-9a-f]+)(; ?|$)").exec(document.cookie);
  30771. if (!i)
  30772. return t;
  30773. var n = i[1];
  30774. return "boolean" == typeof t ? "true" === n || "1" === n : "number" == typeof t ? parseFloat(n) : n
  30775. }
  30776. }
  30777. Object.assign(window.browser, t.exports)
  30778. t.exports = window.browser
  30779. //window.browser.texNeedDecode = true//browser.SafariVersion()?.major > 14
  30780. changeLog()
  30781. }
  30782. , {
  30783. "../exception/DeviceMismatchException": 56
  30784. }],
  30785. 183: [function(e, t, i) {
  30786. (function(i) {
  30787. "use strict";
  30788. function n(e, t) {
  30789. var i = r(t);
  30790. var replaceAll = function (str, f, e) {
  30791. //f全部替换成e
  30792. var reg = new RegExp(f, "g"); //创建正则RegExp对象
  30793. return str.replace(reg, e);
  30794. };
  30795. //获取方法:postFix = `&firstView=pano:${player.currentPano.id},qua:${math.toPrecision(player.quaternion.toArray(),4)}&qs=1`
  30796. var urlFirstView = c.valueFromHash('firstView');
  30797. if(urlFirstView){ //&firstView=pano:e98808cfdb894f33851c3b3d7d0a2679,qua:-0.01515,0.325382,0.0052157,0.9454&qs=1
  30798. try{
  30799. urlFirstView = replaceAll(urlFirstView, "pano:", '"pano":"')
  30800. if(urlFirstView.includes('qua')){
  30801. urlFirstView = replaceAll(urlFirstView, ",qua:", '","qua":[')
  30802. urlFirstView += ']'
  30803. }else{
  30804. urlFirstView+='"'
  30805. }
  30806. urlFirstView = "{"+urlFirstView+"}"
  30807. let info = JSON.parse(urlFirstView);
  30808. i.pano = t.index[info.pano] //panos.get(info.pano)
  30809. if(!i.pano){
  30810. urlFirstView = false
  30811. console.error('检测到firstView但是 找不到该pano')
  30812. }else{
  30813. if(info.qua){
  30814. i.quaternion = new THREE.Quaternion().fromArray(info.qua)
  30815. }else{
  30816. i.quaternion = new THREE.Quaternion()
  30817. }
  30818. i.zoom = -1;
  30819. i.mode = "panorama"
  30820. i.setByUrl = true
  30821. }
  30822. }catch(e){
  30823. urlFirstView = false
  30824. console.error('检测到firstView但是解析出错'+e)
  30825. }
  30826. }
  30827. if (Object.keys(i).length > 0)
  30828. return i;
  30829. if (e.heroImage)
  30830. i = o(e, t);
  30831. else if (window.DATA.camera_start) {
  30832. var n = window.DATA.camera_start;
  30833. try {
  30834. Object.keys(n).length > 0 && !l.isEmptyQuaternion(n.camera.quaternion) && (i.mode = h.convertWorkshopModeInt(n.mode),
  30835. i.position = n.camera.position,
  30836. //i.quaternion = n.camera.quaternion,
  30837. i.quaternion = new th.Quaternion().fromArray(n.camera.quaternion),//xzw
  30838. i.zoom = l.convertWorkshopOrthoZoom(n.camera.zoom),
  30839. n.pano && (i.pano = t.get(n.pano.uuid) || t.findClosest(i.position),
  30840. d.debug("Using camera_start"),
  30841. d.debug("Modeldata pano: ", i.pano.quaternion),
  30842. d.debug("Camera start pano: ", n.pano.quaternion)),
  30843. i.mode !== h.PANORAMA && (i.floorVisibility = e.heroImage.metadata.floor_visibility))
  30844. } catch (e) {
  30845. d.warn(e.message)
  30846. if(i.mode == "panorama" && !i.pano)i.pano = t.list[0]
  30847. }
  30848. }
  30849. if (e.outsideAllowed() || i.mode === h.PANORAMA || (i = {}),
  30850. i.mode === h.MESH && i.position && (i.mode = h.PANORAMA,
  30851. i.pano = t.findClosest(i.position),
  30852. i.quaternion = i.pano.quaternion),
  30853. 0 === Object.keys(i).length) {
  30854. var a = t.list[0];
  30855. a && (i.mode = h.PANORAMA,
  30856. i.pano = a,
  30857. i.position = a.position,
  30858. i.quaternion = a.quaternion,
  30859. d.info("Starting at 1st pano " + a.id))
  30860. }
  30861. return i.mode = i.mode || h.DOLLHOUSE,
  30862. i
  30863. }
  30864. function r(e) {
  30865. var t = c.valueFromHash("start", "")
  30866. , i = {};
  30867. if ("" !== t) {
  30868. d.debug("Start override found in parameters, trying to parse..."),
  30869. i = a(t) || {};
  30870. var n = c.valueFromHash("tag", null);
  30871. n && (i.tag = n),
  30872. i.panoId && (i.pano = e.get(i.panoId))
  30873. }
  30874. return i
  30875. }
  30876. function o(e, t) {
  30877. if (!e.heroImage || !e.heroImage.metadata.camera_position)
  30878. return {};
  30879. var i = {}
  30880. , n = e.heroImage.metadata;
  30881. d.debug("Using start position from thumbnail image"),
  30882. i.position = n.camera_position,
  30883. i.quaternion = n.camera_quaternion;
  30884. try {
  30885. i.mode = h.convertWorkshopModeInt(n.camera_mode),
  30886. i.mode === h.PANORAMA ? i.pano = t.get(n.scan_id) : i.floorVisibility = n.floor_visibility
  30887. } catch (e) {
  30888. d.debug(e.message)
  30889. }
  30890. return i
  30891. }
  30892. function a(e) {
  30893. return s.deserialize(e)
  30894. }
  30895. var s = e("../controls/serializer")
  30896. , l = e("../util/math")
  30897. , c = e("./browser")
  30898. , h = e("../enum/Viewmode")
  30899. , u = e("../util/logger")
  30900. , th = e("three")//xzw
  30901. , d = new u(i);
  30902. t.exports = {
  30903. getStartCameraOptions: n
  30904. }
  30905. }
  30906. ).call(this, "/js/util/camera.js")
  30907. }
  30908. , {
  30909. "../controls/serializer": 14,
  30910. "../enum/Viewmode": 51,
  30911. "../util/logger": 189,
  30912. "../util/math": 190,
  30913. "./browser": 182,
  30914. "three": 217
  30915. }],
  30916. 184: [function(e, t, i) {
  30917. "use strict";
  30918. function n(e, t, i) {
  30919. return o(e.fov, t, i)
  30920. }
  30921. var r = e("./MathLight")
  30922. , o = function(e, t, i) {
  30923. var n = t
  30924. , o = i
  30925. , a = 2 * Math.atan(Math.tan(e * r.RADIANS_PER_DEGREE / 2) * (n / o)) * r.DEGREES_PER_RADIAN;
  30926. return a
  30927. }
  30928. , a = function(e, t, i) {
  30929. var n = t
  30930. , o = i
  30931. , a = 2 * Math.atan(Math.tan(e * r.RADIANS_PER_DEGREE / 2) * (o / n)) * r.DEGREES_PER_RADIAN;
  30932. return a
  30933. }
  30934. , s = function(e, t, i, n) {
  30935. var r = o(e, i, n);
  30936. return r > t ? a(t, i, n) : e
  30937. };
  30938. t.exports = {
  30939. clampVFOV: s,
  30940. getHFOVForCamera: n,
  30941. getHFOVFromVFOV: o,
  30942. getVFOVFromHFOV: a
  30943. }
  30944. window.MathLight = t.exports
  30945. MathLight.closeTo = function(e1,e2, precision){//xzw add 判断e1,e2是否接近
  30946. var prec = Math.pow(10, - (precision || 4));
  30947. var s1 = Math.abs(e1.x - e2.x) < prec && Math.abs(e1.y - e2.y) < prec && Math.abs(e1.z - e2.z) < prec
  30948. if(e1.w){
  30949. return s1 && Math.abs(e1.w - e2.w) < prec
  30950. }else return s1
  30951. }
  30952. }
  30953. , {
  30954. "./MathLight": 176
  30955. }],
  30956. 185: [function(e, t, i) {
  30957. "use strict";
  30958. var n = e("three");
  30959. t.exports = {
  30960. delayOneFrame: function(e) {
  30961. window.setTimeout(e, 1)
  30962. },
  30963. normalizeUrl: function(e) {
  30964. return e.replace("https://", "http://")
  30965. },
  30966. domainFromUrl: function(e) {
  30967. var t = /^([^:]*:\/\/)?(www\.)?([^\/]+)/.exec(e);
  30968. return t ? t[3] : e
  30969. },
  30970. average: function(e, t) {
  30971. if (0 === e.length)
  30972. return null;
  30973. for (var i = 0, n = 0, r = 0; r < e.length; r++) {
  30974. var o = t ? e[r][t] : e[r];
  30975. i += o,
  30976. n++
  30977. }
  30978. return i / n
  30979. },
  30980. countUnique: function(e) {
  30981. for (var t = {}, i = 0; i < e.length; i++)
  30982. t[e[i]] = 1 + (t[e[i]] || 0);
  30983. return Object.keys(t).length
  30984. },
  30985. averageVectors: function(e, t) {
  30986. var i = new n.Vector3;
  30987. if (0 === e.length)
  30988. return i;
  30989. for (var r = 0, o = 0; o < e.length; o++) {
  30990. var a = t ? e[o][t] : e[o];
  30991. i.add(a),
  30992. r++
  30993. }
  30994. return i.divideScalar(r)
  30995. },
  30996. equalLists: function(e, t) {
  30997. if (e.length !== t.length)
  30998. return !1;
  30999. for (var i = 0; i < e.length; i++)
  31000. if (e[i] !== t[i])
  31001. return !1;
  31002. return !0
  31003. },
  31004. lowerMedian: function(e, t) {
  31005. if (0 === e.length)
  31006. return null;
  31007. t = t || 2,
  31008. e.sort(function(e, t) {
  31009. return e - t
  31010. });
  31011. var i = Math.floor(e.length / t);
  31012. return e[i]
  31013. },
  31014. stableSort: function(e, t) {
  31015. return e.map(function(e, t) {
  31016. return {
  31017. value: e,
  31018. index: t
  31019. }
  31020. }).sort(function(e, i) {
  31021. var n = t(e.value, i.value);
  31022. return 0 !== n ? n : e.index - i.index
  31023. }).map(function(e) {
  31024. return e.value
  31025. })
  31026. },
  31027. filterAll: function(e, t) {
  31028. return e.filter(function(e) {
  31029. return t.every(function(t) {
  31030. return t(e)
  31031. })
  31032. })
  31033. },
  31034. formatDate: function(e) {
  31035. return [e.getFullYear(), e.getMonth() + 1, e.getDate()].join("-")
  31036. },
  31037. formatDatetime: function(e) {
  31038. return [e.getFullYear(), e.getMonth() + 1, e.getDate(), e.getHours(), e.getMinutes()].join("-")
  31039. },
  31040. randomString: function(e) {
  31041. for (var t = "", i = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789", n = 0; n < e; n++)
  31042. t += i.charAt(Math.floor(Math.random() * i.length));
  31043. return t
  31044. },
  31045. uint8ToBase64: function(e, t) {
  31046. t && "number" == typeof t || (t = 8192);
  31047. for (var i = [], n = 0; n < e.length; n += t)
  31048. i.push(String.fromCharCode.apply(null, e.subarray(n, n + t)));
  31049. return btoa(i.join(""))
  31050. },
  31051. uuid4: function e(t) {
  31052. return t ? (t ^ 16 * Math.random() >> t / 4).toString(16) : ([1e7] + -1e3 + -4e3 + -8e3 + -1e11).replace(/[018]/g, e)
  31053. },
  31054. nth: function(e) {
  31055. return e %= 10,
  31056. 1 === e ? e + "st" : 2 === e ? e + "nd" : 3 === e ? e + "rd" : e + "th"
  31057. },
  31058. extendObject: function(e, t) {
  31059. return Object.keys(t).forEach(function(i) {
  31060. e[i] = t[i]
  31061. }),
  31062. e
  31063. },
  31064. deepExtend: function e(t) {
  31065. t = t || {};
  31066. for (var i = 1; i < arguments.length; i++) {
  31067. var n = arguments[i];
  31068. if (n)
  31069. for (var r in n)
  31070. n.hasOwnProperty(r) && ("object" == typeof n[r] ? t[r] = e(t[r], n[r]) : t[r] = n[r])
  31071. }
  31072. return t
  31073. },
  31074. inherit: function(e, t) {
  31075. e.prototype = Object.create(t.prototype),
  31076. e.prototype.constructor = e
  31077. },
  31078. extend: function(e, t) {
  31079. for (var i in t.prototype)
  31080. e.prototype[i] = t.prototype[i]
  31081. }
  31082. ,
  31083. getFileNameFromUrl:function(url){
  31084. return url.split('/').pop();
  31085. },
  31086. },
  31087. Math.sign = function(e) {
  31088. return e < 0 ? -1 : 1
  31089. }
  31090. window.common = t.exports
  31091. expandCommon(common)
  31092. }
  31093. , {
  31094. three: 217
  31095. }],
  31096. 186: [function(e, t, i) {
  31097. "use strict";
  31098. var n = {};
  31099. n.linearTween = function(e, t, i, n) {
  31100. return i * e / n + t
  31101. }
  31102. ,
  31103. n.easeInQuad = function(e, t, i, n) {
  31104. return e /= n,
  31105. i * e * e + t
  31106. }
  31107. ,
  31108. n.easeOutQuad = function(e, t, i, n) {
  31109. return e /= n,
  31110. -i * e * (e - 2) + t
  31111. }
  31112. ,
  31113. n.easeInOutQuad = function(e, t, i, n) {
  31114. return e /= n / 2,
  31115. e < 1 ? i / 2 * e * e + t : (e--,
  31116. -i / 2 * (e * (e - 2) - 1) + t)
  31117. }
  31118. ,
  31119. n.easeInCubic = function(e, t, i, n) {
  31120. return e /= n,
  31121. i * e * e * e + t
  31122. }
  31123. ,
  31124. n.easeOutCubic = function(e, t, i, n) {
  31125. return e /= n,
  31126. e--,
  31127. i * (e * e * e + 1) + t
  31128. }
  31129. ,
  31130. n.easeInOutCubic = function(e, t, i, n) {
  31131. return e /= n / 2,
  31132. e < 1 ? i / 2 * e * e * e + t : (e -= 2,
  31133. i / 2 * (e * e * e + 2) + t)
  31134. }
  31135. ,
  31136. n.easeInQuart = function(e, t, i, n) {
  31137. return e /= n,
  31138. i * e * e * e * e + t
  31139. }
  31140. ,
  31141. n.easeOutQuart = function(e, t, i, n) {
  31142. return e /= n,
  31143. e--,
  31144. -i * (e * e * e * e - 1) + t
  31145. }
  31146. ,
  31147. n.easeInOutQuart = function(e, t, i, n) {
  31148. return e /= n / 2,
  31149. e < 1 ? i / 2 * e * e * e * e + t : (e -= 2,
  31150. -i / 2 * (e * e * e * e - 2) + t)
  31151. }
  31152. ,
  31153. n.easeInQuint = function(e, t, i, n) {
  31154. return e /= n,
  31155. i * e * e * e * e * e + t
  31156. }
  31157. ,
  31158. n.easeOutQuint = function(e, t, i, n) {
  31159. return e /= n,
  31160. e--,
  31161. i * (e * e * e * e * e + 1) + t
  31162. }
  31163. ,
  31164. n.easeInOutQuint = function(e, t, i, n) {
  31165. return e /= n / 2,
  31166. e < 1 ? i / 2 * e * e * e * e * e + t : (e -= 2,
  31167. i / 2 * (e * e * e * e * e + 2) + t)
  31168. }
  31169. ,
  31170. n.easeInSine = function(e, t, i, n) {
  31171. return -i * Math.cos(e / n * (Math.PI / 2)) + i + t
  31172. }
  31173. ,
  31174. n.easeOutSine = function(e, t, i, n) {
  31175. return i * Math.sin(e / n * (Math.PI / 2)) + t
  31176. }
  31177. ,
  31178. n.easeInOutSine = function(e, t, i, n) {
  31179. return -i / 2 * (Math.cos(Math.PI * e / n) - 1) + t
  31180. }
  31181. ,
  31182. n.easeInExpo = function(e, t, i, n) {
  31183. return i * Math.pow(2, 10 * (e / n - 1)) + t
  31184. }
  31185. ,
  31186. n.easeOutExpo = function(e, t, i, n) {
  31187. return i * (-Math.pow(2, -10 * e / n) + 1) + t
  31188. }
  31189. ,
  31190. n.easeInOutExpo = function(e, t, i, n) {
  31191. return e /= n / 2,
  31192. e < 1 ? i / 2 * Math.pow(2, 10 * (e - 1)) + t : (e--,
  31193. i / 2 * (-Math.pow(2, -10 * e) + 2) + t)
  31194. }
  31195. ,
  31196. n.easeInCirc = function(e, t, i, n) {
  31197. return e /= n,
  31198. -i * (Math.sqrt(1 - e * e) - 1) + t
  31199. }
  31200. ,
  31201. n.easeOutCirc = function(e, t, i, n) {
  31202. return e /= n,
  31203. e--,
  31204. i * Math.sqrt(1 - e * e) + t
  31205. }
  31206. ,
  31207. n.easeInOutCirc = function(e, t, i, n) {
  31208. return e /= n / 2,
  31209. e < 1 ? -i / 2 * (Math.sqrt(1 - e * e) - 1) + t : (e -= 2,
  31210. i / 2 * (Math.sqrt(1 - e * e) + 1) + t)
  31211. }
  31212. ,
  31213. n.easeInElastic = function(e, t, i, n) {
  31214. var r = 1.70158
  31215. , o = 0
  31216. , a = i;
  31217. return 0 === e ? t : 1 === (e /= n) ? t + i : (o || (o = .3 * n),
  31218. a < Math.abs(i) ? (a = i,
  31219. r = o / 4) : r = o / (2 * Math.PI) * Math.asin(i / a),
  31220. -(a * Math.pow(2, 10 * (e -= 1)) * Math.sin((e * n - r) * (2 * Math.PI) / o)) + t)
  31221. }
  31222. ,
  31223. n.easeOutElastic = function(e, t, i, n) {
  31224. var r = 1.70158
  31225. , o = 0
  31226. , a = i;
  31227. return 0 === e ? t : 1 === (e /= n) ? t + i : (o || (o = .3 * n),
  31228. a < Math.abs(i) ? (a = i,
  31229. r = o / 4) : r = o / (2 * Math.PI) * Math.asin(i / a),
  31230. a * Math.pow(2, -10 * e) * Math.sin((e * n - r) * (2 * Math.PI) / o) + i + t)
  31231. }
  31232. ,
  31233. n.easeInOutElastic = function(e, t, i, n) {
  31234. var r = 1.70158
  31235. , o = 0
  31236. , a = i;
  31237. return 0 === e ? t : 2 === (e /= n / 2) ? t + i : (o || (o = n * (.3 * 1.5)),
  31238. a < Math.abs(i) ? (a = i,
  31239. r = o / 4) : r = o / (2 * Math.PI) * Math.asin(i / a),
  31240. 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)
  31241. }
  31242. ,
  31243. n.easeInBack = function(e, t, i, n, r) {
  31244. return void 0 === r && (r = 1.70158),
  31245. i * (e /= n) * e * ((r + 1) * e - r) + t
  31246. }
  31247. ,
  31248. n.easeOutBack = function(e, t, i, n, r) {
  31249. return void 0 === r && (r = 1.70158),
  31250. i * ((e = e / n - 1) * e * ((r + 1) * e + r) + 1) + t
  31251. }
  31252. ,
  31253. n.easeInOutBack = function(e, t, i, n, r) {
  31254. return void 0 === r && (r = 1.70158),
  31255. (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
  31256. }
  31257. ,
  31258. n.easeOutBounce = function(e, t, i, n) {
  31259. 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
  31260. }
  31261. ,
  31262. n.easeInBounce = function(e, t, i, r) {
  31263. return i - n.easeOutBounce(r - e, 0, i, r) + t
  31264. }
  31265. ,
  31266. n.easeInOutBounce = function(e, t, i, r) {
  31267. 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
  31268. }
  31269. ,
  31270. t.exports = n
  31271. window.easing = n
  31272. }
  31273. , {}],
  31274. 187: [function(e, t, i) {
  31275. "use strict";
  31276. function n() {
  31277. this.events = [],
  31278. this.valid = !1
  31279. }
  31280. var r = e("../enum/Joystick");
  31281. n.prototype.push = function(e, t) {
  31282. this.events.push({
  31283. direction: e,
  31284. pano: t
  31285. }),
  31286. this.valid = !0
  31287. }
  31288. ,
  31289. n.prototype.pop = function(e) {
  31290. var t = this.events.pop();
  31291. return this.events.length < 1 && (this.valid = !1),
  31292. t
  31293. }
  31294. ,
  31295. n.prototype.peek = function() {
  31296. return this.events.length ? this.events[this.events.length - 1] : {
  31297. direction: null,
  31298. pano: null
  31299. }
  31300. }
  31301. ,
  31302. n.prototype.invalidate = function() {
  31303. this.events = [],
  31304. this.valid = !1
  31305. }
  31306. ,
  31307. n.prototype.reversePano = function(e) {
  31308. if (!this.valid)
  31309. return null;
  31310. var t = this.peek();
  31311. return r.opposite(e) === t.direction ? (this.pop(),
  31312. t.pano) : null
  31313. }
  31314. ,
  31315. t.exports = n
  31316. }
  31317. , {
  31318. "../enum/Joystick": 29
  31319. }],
  31320. 188: [function(e, t, i) {
  31321. "use strict";
  31322. window.lerp = t.exports = {
  31323. vector: function(e, t) {
  31324. var i = e.clone();
  31325. return t = t.clone(),
  31326. function(n) {
  31327. e.set(i.x * (1 - n) + t.x * n, i.y * (1 - n) + t.y * n, i.z * (1 - n) + t.z * n)
  31328. }
  31329. },
  31330. quaternion: function(e, t) {
  31331. var i = e.clone();
  31332. return function(n) {
  31333. e.copy(i).slerp(t, n)
  31334. }
  31335. },
  31336. property: function(e, t, i, n) {
  31337. var r = e[t];
  31338. return function(o) {
  31339. e[t] = r * (1 - o) + i * o,
  31340. n && n(e[t])
  31341. }
  31342. },
  31343. uniform: function(e, t, i) {
  31344. var n = e.material.uniforms[t].value;
  31345. return function(r) {
  31346. e.material.uniforms[t] && (e.material.uniforms[t].value = n * (1 - r) + i * r)
  31347. }
  31348. },
  31349. matrix4: function(e, t) {
  31350. var i = e.clone();
  31351. return function(n) {
  31352. for (var r = e.elements, o = i.elements, a = t.elements, s = 0; s < 16; s++)
  31353. r[s] = o[s] * (1 - n) + a[s] * n
  31354. }
  31355. },
  31356. allUniforms: function(e, t, i) {
  31357. var n = e.map(function(e) {
  31358. return this.uniform(e, t, i)
  31359. }
  31360. .bind(this));
  31361. return function(e) {
  31362. n.forEach(function(t) {
  31363. t(e)
  31364. })
  31365. }
  31366. }
  31367. }
  31368. }
  31369. , {}],
  31370. 189: [function(e, t, i) {
  31371. "use strict";
  31372. function n(e) {
  31373. var t, i, o, a, s = e.split("/"), l = "[" + s[s.length - 1].replace(".js", "") + "]", c = {};
  31374. if (n.consoleEnabled) {
  31375. var h = function(e) {
  31376. $("#debug-console").append("<p>" + e + "</p>"),
  31377. $("#debug-console")[0].scrollTop = $("#debug-console")[0].scrollHeight
  31378. };
  31379. t = function(e) {
  31380. h(Array.prototype.slice.call(arguments).join(" "))
  31381. }
  31382. ,
  31383. i = function(e) {
  31384. h(Array.prototype.slice.call(arguments).join(" "))
  31385. }
  31386. ,
  31387. o = function(e) {
  31388. h("WARN: " + Array.prototype.slice.call(arguments).join(" "))
  31389. }
  31390. ,
  31391. a = function(e) {
  31392. h("ERROR: " + Array.prototype.slice.call(arguments).join(" "))
  31393. }
  31394. } else
  31395. console.log ? (t = console.log,
  31396. i = console.info ? console.info : console.log,
  31397. o = console.warn ? console.warn : console.log,
  31398. a = console.error ? console.error : console.log) : t = i = o = a = function() {}
  31399. ;
  31400. var u = function(e) {
  31401. return [l, n.timestamp()].concat(Array.prototype.slice.call(e))
  31402. }
  31403. , d = function(t, i) {
  31404. if (r) {
  31405. var o = Array.prototype.slice.call(t).join(" ");
  31406. r.captureMessage(o, {
  31407. level: i,
  31408. path: e,
  31409. timestamp: n.timestamp()
  31410. })
  31411. }
  31412. }
  31413. , p = function(t, i) {
  31414. if (r) {
  31415. var o = Array.prototype.slice.call(t).join(" ");
  31416. r.captureException(new Error(o), {
  31417. level: i,
  31418. path: e,
  31419. timestamp: n.timestamp()
  31420. })
  31421. }
  31422. };
  31423. return {
  31424. debug: function() {
  31425. n.level >= n.levels.debug && t.apply(console, u(arguments))
  31426. },
  31427. info: function() {
  31428. n.level >= n.levels.info && i.apply(console, u(arguments))
  31429. },
  31430. warn: function() {
  31431. d(arguments, "warn"),
  31432. n.level >= n.levels.warn && o.apply(console, u(arguments))
  31433. },
  31434. error: function() {
  31435. p(arguments, "error"),
  31436. n.level >= n.levels.error && a.apply(console, u(arguments))
  31437. },
  31438. v3str: function(e, t) {
  31439. var i = void 0 === t ? 2 : t;
  31440. return "(" + e.x.toPrecision(i) + ", " + e.y.toPrecision(i) + ", " + e.z.toPrecision(i) + ")"
  31441. },
  31442. eulstr: function(e, t) {
  31443. var i = void 0 === t ? 2 : t;
  31444. return "(" + THREE.Math.radToDeg(e.x).toPrecision(i) + ", " + THREE.Math.radToDeg(e.y).toPrecision(i) + ", " + THREE.Math.radToDeg(e.z).toPrecision(i) + ' "' + e.order + '")'
  31445. },
  31446. time: function(e) {
  31447. n.level >= n.levels.debug && (c[e] = Date.now())
  31448. },
  31449. timeEnd: function(e) {
  31450. if (n.level >= n.levels.debug) {
  31451. var t = c[e];
  31452. if (!t)
  31453. return;
  31454. var i = (Date.now() - t) / 1e3;
  31455. this.debug(e, i + "s")
  31456. }
  31457. }
  31458. }
  31459. }
  31460. var r = window.Raven;
  31461. n.timestamp = function() {
  31462. return (Date.now() - window.navigationStart) / 1e3 + "s"
  31463. }
  31464. ,
  31465. n.levels = {
  31466. debug: 3,
  31467. info: 2,
  31468. warn: 1,
  31469. error: 0
  31470. },
  31471. n.level = n.levels.info,
  31472. t.exports = n
  31473. }
  31474. , {}],
  31475. 190: [function(e, t, i) {
  31476. "use strict";
  31477. var n = e("three")
  31478. , r = e("../enum/GLCubeFaces")
  31479. , o = e("../constants");
  31480. t.exports = {
  31481. convertVisionVector: function(e) {
  31482. return new n.Vector3(e.x,e.z,-e.y)
  31483. },
  31484. convertVisionQuaternion: function(e) {
  31485. 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)))
  31486. },
  31487. convertWorkshopVector: function(e) {
  31488. return new n.Vector3(-e.x,e.y,e.z)
  31489. },
  31490. convertWorkshopQuaternion: function(e) {
  31491. 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))
  31492. },
  31493. convertWorkshopPanoramaQuaternion: function(e) {
  31494. 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)))
  31495. },
  31496. convertWorkshopOrthoZoom: function(e) {// xzw
  31497. //return e === -1 ? -1 : e / 16 * ($("#player").width() / $("#player").height()) / o.workshopApsect
  31498. //return e;
  31499. return e === -1 ? -1 : e * ($("#player").width() / $("#player").height()) / g_snapShotWidth * g_snapShotHeight;
  31500. },
  31501. toPrecision: function(e, t) {//xzw change
  31502. var f = function(e, t){
  31503. var i = Math.pow(10, t);
  31504. return Math.round(e * i) / i
  31505. }
  31506. if(e instanceof Array){
  31507. for(var s=0; s<e.length; s++){
  31508. e[s] = f(e[s],t);
  31509. }
  31510. return e;
  31511. }
  31512. else return f(e,t)
  31513. },
  31514. isEmptyQuaternion: function(e) {
  31515. return 0 === Math.abs(e.x) && 0 === Math.abs(e.y) && 0 === Math.abs(e.z) && 0 === Math.abs(e.w)
  31516. },
  31517. projectPositionToCanvas: function(e, t, i) {
  31518. i = i || new n.Vector3,
  31519. i.copy(e);
  31520. var r = .5 * $("#player").width()
  31521. , o = .5 * $("#player").height();
  31522. return i.project(t),
  31523. i.x = i.x * r + r,
  31524. i.y = -(i.y * o) + o,
  31525. i
  31526. },
  31527. convertScreenPositionToNDC: function(e, t, i) {
  31528. return i = i || new n.Vector2,
  31529. i.x = e / $("#player").width() * 2 - 1,
  31530. i.y = 2 * -(t / $("#player").height()) + 1,
  31531. i
  31532. },
  31533. constrainedTurn: function(e) {
  31534. var t = e % (2 * Math.PI);
  31535. return t = t > Math.PI ? t -= 2 * Math.PI : t < -Math.PI ? t += 2 * Math.PI : t
  31536. },
  31537. getFOVDotThreshold: function(e) {
  31538. return Math.cos(n.Math.degToRad(e / 2))
  31539. },
  31540. transform2DForwardVectorByCubeFace: function(e, t, i, n) {
  31541. switch (e) {
  31542. case r.GL_TEXTURE_CUBE_MAP_POSITIVE_X:
  31543. i.set(1, t.y, t.x);
  31544. break;
  31545. case r.GL_TEXTURE_CUBE_MAP_NEGATIVE_X:
  31546. i.set(-1, t.y, -t.x);
  31547. break;
  31548. case r.GL_TEXTURE_CUBE_MAP_POSITIVE_Y:
  31549. i.set(-t.x, 1, -t.y);
  31550. break;
  31551. case r.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y:
  31552. i.set(-t.x, -1, t.y);
  31553. break;
  31554. case r.GL_TEXTURE_CUBE_MAP_POSITIVE_Z:
  31555. i.set(-t.x, t.y, 1);
  31556. break;
  31557. case r.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z:
  31558. i.set(t.x, t.y, -1)
  31559. }
  31560. n && i.normalize()
  31561. },
  31562. //add:
  31563. getPos2d : function(point, camera, dom){
  31564. var camera = camera ;
  31565. var dom = dom;
  31566. 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);
  31567. var x,y;
  31568. x = (pos.x + 1) / 2 * dom.clientWidth;
  31569. y = (1 - (pos.y + 1) / 2) * dom.clientHeight;
  31570. var inSight = x <= dom.clientWidth && x >= 0
  31571. && y <= dom.clientHeight && y >= 0
  31572. return {
  31573. pos: new THREE.Vector2(x,y),
  31574. vector: pos,
  31575. trueSide : pos.z<1, //trueSide为false时,即使在屏幕范围内可见,也是反方向的另一个不可以被渲染的点 参见Tag.update
  31576. inSight : inSight //在屏幕范围内可见
  31577. };
  31578. },
  31579. getDirByLonLat: function(lon, lat) {
  31580. var dir = new THREE.Vector3();
  31581. var phi = THREE.Math.degToRad(90 - lat);
  31582. var theta = THREE.Math.degToRad(lon);
  31583. dir.x = Math.sin(phi) * Math.cos(theta);
  31584. dir.y = Math.cos(phi);
  31585. dir.z = Math.sin(phi) * Math.sin(theta);
  31586. return dir.negate();
  31587. }
  31588. }
  31589. window.math = t.exports
  31590. expandMath(math)
  31591. }
  31592. , {
  31593. "../constants": 8,
  31594. "../enum/GLCubeFaces": 25,
  31595. three: 217
  31596. }],
  31597. 191: [function(e, t, i) {
  31598. "use strict";
  31599. function n(e, t, i) {
  31600. return a.map(function(n, o) {
  31601. return e.get("pan/" + i + "/" + t + "_skybox" + r(n) + ".jpg")
  31602. }
  31603. .bind(this))
  31604. }
  31605. function r(e) {
  31606. return s[e]
  31607. }
  31608. var o = e("../enum/GLCubeFaces")
  31609. , a = [0, 1, 2, 3, 4, 5]
  31610. , s = {
  31611. 0: o.GL_TEXTURE_CUBE_MAP_POSITIVE_Y,
  31612. 1: o.GL_TEXTURE_CUBE_MAP_POSITIVE_Z,
  31613. 2: o.GL_TEXTURE_CUBE_MAP_POSITIVE_X,
  31614. 3: o.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z,
  31615. 4: o.GL_TEXTURE_CUBE_MAP_NEGATIVE_X,
  31616. 5: o.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y
  31617. };
  31618. t.exports = {
  31619. mapFaceToCubemapFace: r,
  31620. getCubemapUrls: n
  31621. }
  31622. }
  31623. , {
  31624. "../enum/GLCubeFaces": 25
  31625. }],
  31626. 192: [function(e, t, i) {
  31627. "use strict";
  31628. t.exports = {
  31629. captureErrors: function(e, t, i) {
  31630. if ("Raven"in window) {
  31631. Raven.config(e, t).install(),
  31632. i && Raven.setTagsContext(i);
  31633. var n = console.warn
  31634. , r = console.error;
  31635. console.warn = function() {
  31636. var e = Array.prototype.slice.call(arguments);
  31637. Raven.captureMessage(e.join(" "), {
  31638. level: "warning"
  31639. }),
  31640. n.apply(console, e)
  31641. }
  31642. ,
  31643. console.error = function() {
  31644. var e = Array.prototype.slice.call(arguments);
  31645. Raven.captureException(new Error(e.join(" ")), {
  31646. level: "error"
  31647. }),
  31648. r.apply(console, e)
  31649. }
  31650. } else
  31651. console.error("Raven not found, not capturing errors.")
  31652. }
  31653. }
  31654. }
  31655. , {}],
  31656. 193: [function(e, t, i) {
  31657. (function(i) {
  31658. "use strict";
  31659. var n = e("./browser")
  31660. , r = e("../constants")
  31661. , o = e("url")
  31662. , a = e("./logger")
  31663. , ss = e('three')
  31664. , s = new a(i)
  31665. , l = {
  31666. getAuthorizationHeader: function() {
  31667. var e = n.valueFromHash("auth");
  31668. if (e)
  31669. return e.replace(",", " ");
  31670. var t = n.valueFromCookie("token");
  31671. return t ? "Token " + t : null
  31672. },
  31673. parseSidUrl: function(e) {
  31674. var t, i;
  31675. t=g_Prefix;
  31676. if (e = e || "",
  31677. e.match(/^https?/)) {
  31678. var n = o.parse(e);
  31679. t = g_Prefix,
  31680. i = e
  31681. } else{
  31682. //xzw 原先的不能用
  31683. //t = window.location.protocol + "//" + window.location.host, //MP
  31684. t = g_Prefix
  31685. //i = t + "/api/player/models/" + e; //MP
  31686. i = t + "data/" + e;
  31687. }
  31688. return {
  31689. urlBase: t,
  31690. urlModel: i,
  31691. urlFiles: i + (i.match(/\/$/) ? "files" : "/files"),
  31692. urlThumb: i + (i.match(/\/$/) ? "thumb" : "/thumb")
  31693. }
  31694. },
  31695. getModelIDFromQueryString: function() {
  31696. return n.valueFromHash("model") || n.valueFromHash("m")
  31697. },
  31698. /* normalizeModeldata: function(e, t) {//xzw 修改导览images数据
  31699. e = JSON.parse(JSON.stringify(e));
  31700. var i = null;
  31701. if (e.images.forEach(function(n) {
  31702. if(!n.metadata) return;
  31703. if ("string" == typeof n.metadata)
  31704. try {
  31705. n.metadata = JSON.parse(n.metadata)
  31706. } catch (e) {
  31707. s.warn("Unable to parse image metadata"),
  31708. n.metadata = null
  31709. }
  31710. else{
  31711. "object" == typeof n.metadata && s.debug("image.metadata already a JSON object");
  31712. }
  31713. if(n.metadata.camera_position instanceof Array){//xzw 改的格式
  31714. n.metadata.camera_position = new ss.Vector3().fromArray(n.metadata.camera_position);
  31715. n.metadata.camera_quaternion = new ss.Quaternion().fromArray(n.metadata.camera_quaternion);
  31716. }else{
  31717. n.metadata.camera_quaternion && (n.metadata.camera_quaternion = t.convertWorkshopQuaternion(n.metadata.camera_quaternion)),
  31718. n.metadata.camera_position && (n.metadata.camera_position = t.convertWorkshopVector(n.metadata.camera_position))
  31719. n.metadata.zoom = n.metadata.zoom || 1;
  31720. }
  31721. !i && e.icon && e.icon === n.sid && (i = n.metadata)
  31722. }),
  31723. //icon初始视角的:
  31724. i && i.camera_quaternion && i.camera_position && i.scan_position && i.scan_quaternion) {
  31725. var n = {};
  31726. n.pano = {
  31727. quaternion: t.convertWorkshopPanoramaQuaternion(i.scan_quaternion),
  31728. position: t.convertWorkshopVector(i.scan_position),
  31729. uuid: i.scan_id
  31730. },
  31731. n.camera = {
  31732. quaternion: i.camera_quaternion,
  31733. position: i.camera_position
  31734. },
  31735. e.startPano = n
  31736. }
  31737. return e
  31738. },
  31739. */
  31740. normalizeModeldata: function(e, t) {//xzw 修改导览images数据
  31741. e = JSON.parse(JSON.stringify(e));
  31742. var i = null;
  31743. var deal = function(n) {
  31744. if(!n.metadata) return;
  31745. if ("string" == typeof n.metadata)
  31746. try {
  31747. n.metadata = JSON.parse(n.metadata)
  31748. } catch (e) {
  31749. s.warn("Unable to parse image metadata"),
  31750. n.metadata = null
  31751. }
  31752. else{
  31753. "object" == typeof n.metadata && s.debug("image.metadata already a JSON object");
  31754. }
  31755. if(n.metadata.camera_position instanceof Array){//xzw 改的格式
  31756. n.metadata.camera_position = new ss.Vector3().fromArray(n.metadata.camera_position);
  31757. n.metadata.camera_quaternion = new ss.Quaternion().fromArray(n.metadata.camera_quaternion);
  31758. }else{
  31759. n.metadata.camera_position = new ss.Vector3().copy(n.metadata.camera_position)
  31760. n.metadata.camera_quaternion = new ss.Quaternion().copy(n.metadata.camera_quaternion)
  31761. /* n.metadata.camera_quaternion && (n.metadata.camera_quaternion = i.convertWorkshopQuaternion(n.metadata.camera_quaternion)),
  31762. n.metadata.camera_position && (n.metadata.camera_position = i.convertWorkshopVector(n.metadata.camera_position)) */
  31763. }
  31764. !i && e.icon && e.icon === n.sid && (i = n.metadata)
  31765. }
  31766. //改
  31767. e.images.forEach(info=>{
  31768. if(info.locations){
  31769. info.locations.forEach(a=>deal(a))
  31770. }else{
  31771. deal(info)
  31772. }
  31773. })
  31774. //icon初始视角的:
  31775. if(i && i.camera_quaternion && i.camera_position && i.scan_position && i.scan_quaternion) {
  31776. var n = {};
  31777. n.pano = {
  31778. quaternion: t.convertWorkshopPanoramaQuaternion(i.scan_quaternion),
  31779. position: t.convertWorkshopVector(i.scan_position),
  31780. uuid: i.scan_id
  31781. },
  31782. n.camera = {
  31783. quaternion: i.camera_quaternion,
  31784. position: i.camera_position
  31785. },
  31786. e.startPano = n
  31787. }
  31788. return e
  31789. },
  31790. visionVersionToInt: function() {
  31791. var e = new RegExp(["(?:[0-9.]+\\.){1,4}", "([0-9]+)", "[^\\.]*$"].join(""));
  31792. return function(t) {
  31793. if (!t)
  31794. throw new Error("Vision version is required");
  31795. var i = e.exec(t);
  31796. if (null === i)
  31797. throw new Error("String is not a vision version: " + t);
  31798. return parseInt(i[1])
  31799. }
  31800. }(),
  31801. modelDataPromisesTiles: function(e) {
  31802. var vision_version = e.vision_version || window.DATA.vision_version
  31803. if (vision_version)
  31804. try {
  31805. return l.visionVersionToInt(vision_version) >= l.visionVersionToInt(r.visionTilingStartVersion)
  31806. } catch (t) {
  31807. s.warn("Invalid vision version: " + vision_version)
  31808. }
  31809. // var t = e.created ? new Date(e.created) : null;
  31810. // return t && t >= r.visionTilingStartDate
  31811. return false
  31812. }
  31813. };
  31814. t.exports = l
  31815. }
  31816. ).call(this, "/js/util/showcase.js")
  31817. }
  31818. , {
  31819. "../constants": 8,
  31820. "./browser": 182,
  31821. "./logger": 189,
  31822. three:217,
  31823. url: 208
  31824. }],
  31825. 194: [function(e, t, i) {
  31826. "use strict";
  31827. var n = e("../util/ajax")
  31828. , r = e("three")
  31829. , o = e("../settings")
  31830. , a = {};
  31831. t.exports = {
  31832. load: function(e, t, i) {
  31833. var s = a[e];
  31834. return s ? (t && setTimeout(function() {
  31835. t(s)
  31836. }, 1),
  31837. s) : (s = new r.Texture,
  31838. o.minimalMemoryMode && (s.minFilter = r.LinearFilter,
  31839. s.magFilter = r.LinearFilter,
  31840. s.generateMipmaps = !1),
  31841. s.sourceFile = e,
  31842. a[e] = s,
  31843. n.getImage(e).then(function(e) {
  31844. s.image = e,
  31845. s.needsUpdate = !0,
  31846. t && t(s)
  31847. }).fail(i),
  31848. s)
  31849. },
  31850. loadBase64: function(e, t) {
  31851. t = t || "png";
  31852. var i = new r.Texture;
  31853. return i.image = document.createElement("img"),
  31854. i.image.setAttribute("src", "data:image/" + t + ";base64," + e),
  31855. o.minimalMemoryMode && (i.minFilter = r.LinearFilter,
  31856. i.magFilter = r.LinearFilter,
  31857. i.generateMipmaps = !1),
  31858. i.needsUpdate = !0,
  31859. i
  31860. },
  31861. isLoaded: function(e) {
  31862. return !!a[e]
  31863. }
  31864. }
  31865. window.Texture = t.exports
  31866. }
  31867. , {
  31868. "../settings": 166,
  31869. "../util/ajax": 181,
  31870. three: 217
  31871. }],
  31872. 195: [function(e, t, i) {
  31873. "use strict";
  31874. var n = e("./easing");
  31875. window.transitions = t.exports = {
  31876. globalDone: null,
  31877. funcs: [],
  31878. counter: 0,
  31879. uniqueID: 0,
  31880. start: function(e, t, i, r, o, a, s) {
  31881. return r = r || 0,
  31882. this.funcs.push({
  31883. func: e,
  31884. current: -r * Math.abs(t),
  31885. duration: (1 - Math.max(r, 0)) * Math.abs(t),
  31886. done: i,
  31887. easing: o || n.linearTween,
  31888. cycling: t < 0,
  31889. running: !0,
  31890. debug: r < 0,
  31891. name: a || "T" + this.counter,
  31892. id: void 0 === s ? this.counter : s,
  31893. paused: !1
  31894. }),
  31895. e(0, 16),
  31896. this.counter += 1,
  31897. e
  31898. },
  31899. trigger: function(e) {
  31900. var t = void 0 === e.delayRatio ? 0 : e.delayRatio
  31901. , i = e.func || function() {}
  31902. , r = void 0 === e.duration ? 0 : e.duration;
  31903. void 0 !== e.cycling && e.cycling && (r = -Math.abs(r));
  31904. var o = e.done || null
  31905. , a = e.easing || n.linearTween
  31906. , s = e.name || "R" + this.counter
  31907. , l = void 0 === e.id ? this.counter : e.id;
  31908. return this.start(i, r, o, t, a, s, l)
  31909. },
  31910. setTimeout: function(e, t, i) {
  31911. var n = void 0 === i ? this.counter : i;
  31912. return this.trigger({
  31913. done: e,
  31914. duration: void 0 === t ? 0 : t,
  31915. name: "O" + this.counter,
  31916. id: n
  31917. })
  31918. },
  31919. pause: function() {
  31920. this.paused = !0
  31921. },
  31922. resume: function() {
  31923. this.paused = !1
  31924. },
  31925. update: function(e) {
  31926. this.funcs.forEach(function(t) {
  31927. if (!(t.paused || (t.current += 1e3 * e,
  31928. t.current < 0)))
  31929. if (t.current >= t.duration && !t.cycling) {
  31930. var i = t.easing(1, 0, 1, 1);
  31931. t.func(i, 1e3 * e),
  31932. t.done && t.done(),
  31933. t.running = !1
  31934. } else {
  31935. var n = t.easing(t.current % t.duration / t.duration, 0, 1, 1)
  31936. , r = t.func(n, 1e3 * e) || !1;
  31937. r && (t.done && t.done(),
  31938. t.running = !1)
  31939. }
  31940. });
  31941. var t = this.funcs.length;
  31942. this.funcs = this.funcs.filter(function(e) {
  31943. return e.running
  31944. });
  31945. var i = this.funcs.length;
  31946. if (t > 0 && 0 === i && this.globalDone) {
  31947. var n = this.globalDone;
  31948. this.globalDone = null,
  31949. n()
  31950. }
  31951. },
  31952. adjustSpeed: function(e, t) {
  31953. for (var i = this.getById(e), n = 0; n < i.length; n++) {
  31954. var r = i[n];
  31955. r.duration /= t,
  31956. r.current /= t
  31957. }
  31958. },
  31959. getById: function(e) {
  31960. return this.funcs.filter(function(t) {
  31961. return e === t.id
  31962. })
  31963. },
  31964. get: function(e) {
  31965. for (var t = 0; t < this.funcs.length; t += 1)
  31966. if (this.funcs[t].func === e)
  31967. return this.funcs[t];
  31968. return null
  31969. },
  31970. isRunning: function(e) {
  31971. var t = this.get(e);
  31972. return null !== t && t.running
  31973. },
  31974. countActive: function() {
  31975. for (var e = 0, t = 0; t < this.funcs.length; t += 1)
  31976. e += this.funcs[t].running;
  31977. return e
  31978. },
  31979. listActive: function() {
  31980. for (var e = [], t = 0; t < this.funcs.length; t += 1)
  31981. this.funcs[t].running && e.push(this.funcs[t].name);
  31982. return e
  31983. },
  31984. done: function(e) {
  31985. this.globalDone = e
  31986. },
  31987. cancelById: function(e) {
  31988. var t = void 0 === e ? 0 : e;
  31989. this.funcs = this.funcs.filter(function(e) {
  31990. return e.id !== t
  31991. })
  31992. },
  31993. cancel: function(e) {
  31994. this.funcs = this.funcs.filter(function(t) {
  31995. return t.func !== e
  31996. })
  31997. },
  31998. getUniqueId: function() {
  31999. return this.uniqueID -= 1,
  32000. this.uniqueID
  32001. }
  32002. }
  32003. }
  32004. , {
  32005. "./easing": 186
  32006. }],
  32007. 196: [function(e, t, i) {
  32008. function n(e) {
  32009. if (this.set = {},
  32010. this.infContains = function() {
  32011. return !0
  32012. }
  32013. ,
  32014. "object" == typeof e)
  32015. if (e instanceof Array)
  32016. for (var t = 0; t < e.length; t++)
  32017. this.set[e[t]] = !0;
  32018. else
  32019. this.set = e;
  32020. else if ("function" == typeof e)
  32021. this.infContains = e;
  32022. else if ("undefined" != typeof e)
  32023. throw new Error("set must be either an array or an object.")
  32024. }
  32025. t.exports = n,
  32026. n.prototype.contains = function(e) {
  32027. return !!this.set[e]
  32028. }
  32029. ,
  32030. n.prototype.has = n.prototype.contains,
  32031. n.prototype.add = function(e) {
  32032. if (1 == arguments.length)
  32033. this.set[e] = !0;
  32034. else
  32035. for (var t = 0; t < arguments.length; t++)
  32036. this.set[arguments[t]] = !0
  32037. }
  32038. ,
  32039. n.prototype.addAll = function(e) {
  32040. if ("object" != typeof e && !(e instanceof Array))
  32041. throw new Error("arr must be an array.");
  32042. for (var t = 0; t < e.length; t++)
  32043. this.add(e[t])
  32044. }
  32045. ,
  32046. n.prototype.remove = function(e) {
  32047. if (1 == arguments.length)
  32048. delete this.set[e];
  32049. else
  32050. for (var t = 0; t < arguments.length; t++)
  32051. delete this.set[arguments[t]]
  32052. }
  32053. ,
  32054. n.prototype.delete = n.prototype.remove,
  32055. n.prototype.clear = function() {
  32056. this.set = {}
  32057. }
  32058. ,
  32059. n.prototype.size = function() {
  32060. return Object.keys(this.set).length
  32061. }
  32062. ,
  32063. n.prototype.toString = function() {
  32064. return "{" + Object.keys(this.set).toString() + "}"
  32065. }
  32066. ,
  32067. n.prototype.toArray = function() {
  32068. return "undefined" == typeof this.set ? [] : Object.keys(this.set)
  32069. }
  32070. ,
  32071. n.prototype["*values"] = n.prototype.toArray
  32072. }
  32073. , {}],
  32074. 197: [function(e, t, i) {}
  32075. , {}],
  32076. 198: [function(e, t, i) {
  32077. (function(t) {
  32078. "use strict";
  32079. function n() {
  32080. try {
  32081. var e = new Uint8Array(1);
  32082. return e.__proto__ = {
  32083. __proto__: Uint8Array.prototype,
  32084. foo: function() {
  32085. return 42
  32086. }
  32087. },
  32088. 42 === e.foo() && "function" == typeof e.subarray && 0 === e.subarray(1, 1).byteLength
  32089. } catch (e) {
  32090. return !1
  32091. }
  32092. }
  32093. function r() {
  32094. return a.TYPED_ARRAY_SUPPORT ? 2147483647 : 1073741823
  32095. }
  32096. function o(e, t) {
  32097. if (r() < t)
  32098. throw new RangeError("Invalid typed array length");
  32099. return a.TYPED_ARRAY_SUPPORT ? (e = new Uint8Array(t),
  32100. e.__proto__ = a.prototype) : (null === e && (e = new a(t)),
  32101. e.length = t),
  32102. e
  32103. }
  32104. function a(e, t, i) {
  32105. if (!(a.TYPED_ARRAY_SUPPORT || this instanceof a))
  32106. return new a(e,t,i);
  32107. if ("number" == typeof e) {
  32108. if ("string" == typeof t)
  32109. throw new Error("If encoding is specified then the first argument must be a string");
  32110. return h(this, e)
  32111. }
  32112. return s(this, e, t, i)
  32113. }
  32114. function s(e, t, i, n) {
  32115. if ("number" == typeof t)
  32116. throw new TypeError('"value" argument must not be a number');
  32117. return "undefined" != typeof ArrayBuffer && t instanceof ArrayBuffer ? p(e, t, i, n) : "string" == typeof t ? u(e, t, i) : f(e, t)
  32118. }
  32119. function l(e) {
  32120. if ("number" != typeof e)
  32121. throw new TypeError('"size" argument must be a number');
  32122. if (e < 0)
  32123. throw new RangeError('"size" argument must not be negative')
  32124. }
  32125. function c(e, t, i, n) {
  32126. return l(t),
  32127. 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)
  32128. }
  32129. function h(e, t) {
  32130. if (l(t),
  32131. e = o(e, t < 0 ? 0 : 0 | g(t)),
  32132. !a.TYPED_ARRAY_SUPPORT)
  32133. for (var i = 0; i < t; ++i)
  32134. e[i] = 0;
  32135. return e
  32136. }
  32137. function u(e, t, i) {
  32138. if ("string" == typeof i && "" !== i || (i = "utf8"),
  32139. !a.isEncoding(i))
  32140. throw new TypeError('"encoding" must be a valid string encoding');
  32141. var n = 0 | v(t, i);
  32142. e = o(e, n);
  32143. var r = e.write(t, i);
  32144. return r !== n && (e = e.slice(0, r)),
  32145. e
  32146. }
  32147. function d(e, t) {
  32148. var i = t.length < 0 ? 0 : 0 | g(t.length);
  32149. e = o(e, i);
  32150. for (var n = 0; n < i; n += 1)
  32151. e[n] = 255 & t[n];
  32152. return e
  32153. }
  32154. function p(e, t, i, n) {
  32155. if (t.byteLength,
  32156. i < 0 || t.byteLength < i)
  32157. throw new RangeError("'offset' is out of bounds");
  32158. if (t.byteLength < i + (n || 0))
  32159. throw new RangeError("'length' is out of bounds");
  32160. return t = void 0 === i && void 0 === n ? new Uint8Array(t) : void 0 === n ? new Uint8Array(t,i) : new Uint8Array(t,i,n),
  32161. a.TYPED_ARRAY_SUPPORT ? (e = t,
  32162. e.__proto__ = a.prototype) : e = d(e, t),
  32163. e
  32164. }
  32165. function f(e, t) {
  32166. if (a.isBuffer(t)) {
  32167. var i = 0 | g(t.length);
  32168. return e = o(e, i),
  32169. 0 === e.length ? e : (t.copy(e, 0, 0, i),
  32170. e)
  32171. }
  32172. if (t) {
  32173. if ("undefined" != typeof ArrayBuffer && t.buffer instanceof ArrayBuffer || "length"in t)
  32174. return "number" != typeof t.length || K(t.length) ? o(e, 0) : d(e, t);
  32175. if ("Buffer" === t.type && $(t.data))
  32176. return d(e, t.data)
  32177. }
  32178. throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")
  32179. }
  32180. function g(e) {
  32181. if (e >= r())
  32182. throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x" + r().toString(16) + " bytes");
  32183. return 0 | e
  32184. }
  32185. function m(e) {
  32186. return +e != e && (e = 0),
  32187. a.alloc(+e)
  32188. }
  32189. function v(e, t) {
  32190. if (a.isBuffer(e))
  32191. return e.length;
  32192. if ("undefined" != typeof ArrayBuffer && "function" == typeof ArrayBuffer.isView && (ArrayBuffer.isView(e) || e instanceof ArrayBuffer))
  32193. return e.byteLength;
  32194. "string" != typeof e && (e = "" + e);
  32195. var i = e.length;
  32196. if (0 === i)
  32197. return 0;
  32198. for (var n = !1; ; )
  32199. switch (t) {
  32200. case "ascii":
  32201. case "latin1":
  32202. case "binary":
  32203. return i;
  32204. case "utf8":
  32205. case "utf-8":
  32206. case void 0:
  32207. return j(e).length;
  32208. case "ucs2":
  32209. case "ucs-2":
  32210. case "utf16le":
  32211. case "utf-16le":
  32212. return 2 * i;
  32213. case "hex":
  32214. return i >>> 1;
  32215. case "base64":
  32216. return Z(e).length;
  32217. default:
  32218. if (n)
  32219. return j(e).length;
  32220. t = ("" + t).toLowerCase(),
  32221. n = !0
  32222. }
  32223. }
  32224. function A(e, t, i) {
  32225. var n = !1;
  32226. if ((void 0 === t || t < 0) && (t = 0),
  32227. t > this.length)
  32228. return "";
  32229. if ((void 0 === i || i > this.length) && (i = this.length),
  32230. i <= 0)
  32231. return "";
  32232. if (i >>>= 0,
  32233. t >>>= 0,
  32234. i <= t)
  32235. return "";
  32236. for (e || (e = "utf8"); ; )
  32237. switch (e) {
  32238. case "hex":
  32239. return L(this, t, i);
  32240. case "utf8":
  32241. case "utf-8":
  32242. return M(this, t, i);
  32243. case "ascii":
  32244. return P(this, t, i);
  32245. case "latin1":
  32246. case "binary":
  32247. return O(this, t, i);
  32248. case "base64":
  32249. return S(this, t, i);
  32250. case "ucs2":
  32251. case "ucs-2":
  32252. case "utf16le":
  32253. case "utf-16le":
  32254. return D(this, t, i);
  32255. default:
  32256. if (n)
  32257. throw new TypeError("Unknown encoding: " + e);
  32258. e = (e + "").toLowerCase(),
  32259. n = !0
  32260. }
  32261. }
  32262. function y(e, t, i) {
  32263. var n = e[t];
  32264. e[t] = e[i],
  32265. e[i] = n
  32266. }
  32267. function C(e, t, i, n, r) {
  32268. if (0 === e.length)
  32269. return -1;
  32270. if ("string" == typeof i ? (n = i,
  32271. i = 0) : i > 2147483647 ? i = 2147483647 : i < -2147483648 && (i = -2147483648),
  32272. i = +i,
  32273. isNaN(i) && (i = r ? 0 : e.length - 1),
  32274. i < 0 && (i = e.length + i),
  32275. i >= e.length) {
  32276. if (r)
  32277. return -1;
  32278. i = e.length - 1
  32279. } else if (i < 0) {
  32280. if (!r)
  32281. return -1;
  32282. i = 0
  32283. }
  32284. if ("string" == typeof t && (t = a.from(t, n)),
  32285. a.isBuffer(t))
  32286. return 0 === t.length ? -1 : I(e, t, i, n, r);
  32287. if ("number" == typeof t)
  32288. return t &= 255,
  32289. 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);
  32290. throw new TypeError("val must be string, number or Buffer")
  32291. }
  32292. function I(e, t, i, n, r) {
  32293. function o(e, t) {
  32294. return 1 === a ? e[t] : e.readUInt16BE(t * a)
  32295. }
  32296. var a = 1
  32297. , s = e.length
  32298. , l = t.length;
  32299. if (void 0 !== n && (n = String(n).toLowerCase(),
  32300. "ucs2" === n || "ucs-2" === n || "utf16le" === n || "utf-16le" === n)) {
  32301. if (e.length < 2 || t.length < 2)
  32302. return -1;
  32303. a = 2,
  32304. s /= 2,
  32305. l /= 2,
  32306. i /= 2
  32307. }
  32308. var c;
  32309. if (r) {
  32310. var h = -1;
  32311. for (c = i; c < s; c++)
  32312. if (o(e, c) === o(t, h === -1 ? 0 : c - h)) {
  32313. if (h === -1 && (h = c),
  32314. c - h + 1 === l)
  32315. return h * a
  32316. } else
  32317. h !== -1 && (c -= c - h),
  32318. h = -1
  32319. } else
  32320. for (i + l > s && (i = s - l),
  32321. c = i; c >= 0; c--) {
  32322. for (var u = !0, d = 0; d < l; d++)
  32323. if (o(e, c + d) !== o(t, d)) {
  32324. u = !1;
  32325. break
  32326. }
  32327. if (u)
  32328. return c
  32329. }
  32330. return -1
  32331. }
  32332. function E(e, t, i, n) {
  32333. i = Number(i) || 0;
  32334. var r = e.length - i;
  32335. n ? (n = Number(n),
  32336. n > r && (n = r)) : n = r;
  32337. var o = t.length;
  32338. if (o % 2 !== 0)
  32339. throw new TypeError("Invalid hex string");
  32340. n > o / 2 && (n = o / 2);
  32341. for (var a = 0; a < n; ++a) {
  32342. var s = parseInt(t.substr(2 * a, 2), 16);
  32343. if (isNaN(s))
  32344. return a;
  32345. e[i + a] = s
  32346. }
  32347. return a
  32348. }
  32349. function b(e, t, i, n) {
  32350. return q(j(t, e.length - i), e, i, n)
  32351. }
  32352. function w(e, t, i, n) {
  32353. return q(Y(t), e, i, n)
  32354. }
  32355. function _(e, t, i, n) {
  32356. return w(e, t, i, n)
  32357. }
  32358. function T(e, t, i, n) {
  32359. return q(Z(t), e, i, n)
  32360. }
  32361. function x(e, t, i, n) {
  32362. return q(X(t, e.length - i), e, i, n)
  32363. }
  32364. function S(e, t, i) {
  32365. return 0 === t && i === e.length ? Q.fromByteArray(e) : Q.fromByteArray(e.slice(t, i))
  32366. }
  32367. function M(e, t, i) {
  32368. i = Math.min(e.length, i);
  32369. for (var n = [], r = t; r < i; ) {
  32370. var o = e[r]
  32371. , a = null
  32372. , s = o > 239 ? 4 : o > 223 ? 3 : o > 191 ? 2 : 1;
  32373. if (r + s <= i) {
  32374. var l, c, h, u;
  32375. switch (s) {
  32376. case 1:
  32377. o < 128 && (a = o);
  32378. break;
  32379. case 2:
  32380. l = e[r + 1],
  32381. 128 === (192 & l) && (u = (31 & o) << 6 | 63 & l,
  32382. u > 127 && (a = u));
  32383. break;
  32384. case 3:
  32385. l = e[r + 1],
  32386. c = e[r + 2],
  32387. 128 === (192 & l) && 128 === (192 & c) && (u = (15 & o) << 12 | (63 & l) << 6 | 63 & c,
  32388. u > 2047 && (u < 55296 || u > 57343) && (a = u));
  32389. break;
  32390. case 4:
  32391. l = e[r + 1],
  32392. c = e[r + 2],
  32393. h = e[r + 3],
  32394. 128 === (192 & l) && 128 === (192 & c) && 128 === (192 & h) && (u = (15 & o) << 18 | (63 & l) << 12 | (63 & c) << 6 | 63 & h,
  32395. u > 65535 && u < 1114112 && (a = u))
  32396. }
  32397. }
  32398. null === a ? (a = 65533,
  32399. s = 1) : a > 65535 && (a -= 65536,
  32400. n.push(a >>> 10 & 1023 | 55296),
  32401. a = 56320 | 1023 & a),
  32402. n.push(a),
  32403. r += s
  32404. }
  32405. return R(n)
  32406. }
  32407. function R(e) {
  32408. var t = e.length;
  32409. if (t <= ee)
  32410. return String.fromCharCode.apply(String, e);
  32411. for (var i = "", n = 0; n < t; )
  32412. i += String.fromCharCode.apply(String, e.slice(n, n += ee));
  32413. return i
  32414. }
  32415. function P(e, t, i) {
  32416. var n = "";
  32417. i = Math.min(e.length, i);
  32418. for (var r = t; r < i; ++r)
  32419. n += String.fromCharCode(127 & e[r]);
  32420. return n
  32421. }
  32422. function O(e, t, i) {
  32423. var n = "";
  32424. i = Math.min(e.length, i);
  32425. for (var r = t; r < i; ++r)
  32426. n += String.fromCharCode(e[r]);
  32427. return n
  32428. }
  32429. function L(e, t, i) {
  32430. var n = e.length;
  32431. (!t || t < 0) && (t = 0),
  32432. (!i || i < 0 || i > n) && (i = n);
  32433. for (var r = "", o = t; o < i; ++o)
  32434. r += W(e[o]);
  32435. return r
  32436. }
  32437. function D(e, t, i) {
  32438. for (var n = e.slice(t, i), r = "", o = 0; o < n.length; o += 2)
  32439. r += String.fromCharCode(n[o] + 256 * n[o + 1]);
  32440. return r
  32441. }
  32442. function N(e, t, i) {
  32443. if (e % 1 !== 0 || e < 0)
  32444. throw new RangeError("offset is not uint");
  32445. if (e + t > i)
  32446. throw new RangeError("Trying to access beyond buffer length")
  32447. }
  32448. function B(e, t, i, n, r, o) {
  32449. if (!a.isBuffer(e))
  32450. throw new TypeError('"buffer" argument must be a Buffer instance');
  32451. if (t > r || t < o)
  32452. throw new RangeError('"value" argument is out of bounds');
  32453. if (i + n > e.length)
  32454. throw new RangeError("Index out of range")
  32455. }
  32456. function F(e, t, i, n) {
  32457. t < 0 && (t = 65535 + t + 1);
  32458. for (var r = 0, o = Math.min(e.length - i, 2); r < o; ++r)
  32459. e[i + r] = (t & 255 << 8 * (n ? r : 1 - r)) >>> 8 * (n ? r : 1 - r)
  32460. }
  32461. function V(e, t, i, n) {
  32462. t < 0 && (t = 4294967295 + t + 1);
  32463. for (var r = 0, o = Math.min(e.length - i, 4); r < o; ++r)
  32464. e[i + r] = t >>> 8 * (n ? r : 3 - r) & 255
  32465. }
  32466. function U(e, t, i, n, r, o) {
  32467. if (i + n > e.length)
  32468. throw new RangeError("Index out of range");
  32469. if (i < 0)
  32470. throw new RangeError("Index out of range")
  32471. }
  32472. function k(e, t, i, n, r) {
  32473. return r || U(e, t, i, 4, 3.4028234663852886e38, -3.4028234663852886e38),
  32474. J.write(e, t, i, n, 23, 4),
  32475. i + 4
  32476. }
  32477. function H(e, t, i, n, r) {
  32478. return r || U(e, t, i, 8, 1.7976931348623157e308, -1.7976931348623157e308),
  32479. J.write(e, t, i, n, 52, 8),
  32480. i + 8
  32481. }
  32482. function G(e) {
  32483. if (e = z(e).replace(te, ""),
  32484. e.length < 2)
  32485. return "";
  32486. for (; e.length % 4 !== 0; )
  32487. e += "=";
  32488. return e
  32489. }
  32490. function z(e) {
  32491. return e.trim ? e.trim() : e.replace(/^\s+|\s+$/g, "")
  32492. }
  32493. function W(e) {
  32494. return e < 16 ? "0" + e.toString(16) : e.toString(16)
  32495. }
  32496. function j(e, t) {
  32497. t = t || 1 / 0;
  32498. for (var i, n = e.length, r = null, o = [], a = 0; a < n; ++a) {
  32499. if (i = e.charCodeAt(a),
  32500. i > 55295 && i < 57344) {
  32501. if (!r) {
  32502. if (i > 56319) {
  32503. (t -= 3) > -1 && o.push(239, 191, 189);
  32504. continue
  32505. }
  32506. if (a + 1 === n) {
  32507. (t -= 3) > -1 && o.push(239, 191, 189);
  32508. continue
  32509. }
  32510. r = i;
  32511. continue
  32512. }
  32513. if (i < 56320) {
  32514. (t -= 3) > -1 && o.push(239, 191, 189),
  32515. r = i;
  32516. continue
  32517. }
  32518. i = (r - 55296 << 10 | i - 56320) + 65536
  32519. } else
  32520. r && (t -= 3) > -1 && o.push(239, 191, 189);
  32521. if (r = null,
  32522. i < 128) {
  32523. if ((t -= 1) < 0)
  32524. break;
  32525. o.push(i)
  32526. } else if (i < 2048) {
  32527. if ((t -= 2) < 0)
  32528. break;
  32529. o.push(i >> 6 | 192, 63 & i | 128)
  32530. } else if (i < 65536) {
  32531. if ((t -= 3) < 0)
  32532. break;
  32533. o.push(i >> 12 | 224, i >> 6 & 63 | 128, 63 & i | 128)
  32534. } else {
  32535. if (!(i < 1114112))
  32536. throw new Error("Invalid code point");
  32537. if ((t -= 4) < 0)
  32538. break;
  32539. o.push(i >> 18 | 240, i >> 12 & 63 | 128, i >> 6 & 63 | 128, 63 & i | 128)
  32540. }
  32541. }
  32542. return o
  32543. }
  32544. function Y(e) {
  32545. for (var t = [], i = 0; i < e.length; ++i)
  32546. t.push(255 & e.charCodeAt(i));
  32547. return t
  32548. }
  32549. function X(e, t) {
  32550. for (var i, n, r, o = [], a = 0; a < e.length && !((t -= 2) < 0); ++a)
  32551. i = e.charCodeAt(a),
  32552. n = i >> 8,
  32553. r = i % 256,
  32554. o.push(r),
  32555. o.push(n);
  32556. return o
  32557. }
  32558. function Z(e) {
  32559. return Q.toByteArray(G(e))
  32560. }
  32561. function q(e, t, i, n) {
  32562. for (var r = 0; r < n && !(r + i >= t.length || r >= e.length); ++r)
  32563. t[r + i] = e[r];
  32564. return r
  32565. }
  32566. function K(e) {
  32567. return e !== e
  32568. }
  32569. var Q = e("base64-js")
  32570. , J = e("ieee754")
  32571. , $ = e("isarray");
  32572. i.Buffer = a,
  32573. i.SlowBuffer = m,
  32574. i.INSPECT_MAX_BYTES = 50,
  32575. a.TYPED_ARRAY_SUPPORT = void 0 !== t.TYPED_ARRAY_SUPPORT ? t.TYPED_ARRAY_SUPPORT : n(),
  32576. i.kMaxLength = r(),
  32577. a.poolSize = 8192,
  32578. a._augment = function(e) {
  32579. return e.__proto__ = a.prototype,
  32580. e
  32581. }
  32582. ,
  32583. a.from = function(e, t, i) {
  32584. return s(null, e, t, i)
  32585. }
  32586. ,
  32587. a.TYPED_ARRAY_SUPPORT && (a.prototype.__proto__ = Uint8Array.prototype,
  32588. a.__proto__ = Uint8Array,
  32589. "undefined" != typeof Symbol && Symbol.species && a[Symbol.species] === a && Object.defineProperty(a, Symbol.species, {
  32590. value: null,
  32591. configurable: !0
  32592. })),
  32593. a.alloc = function(e, t, i) {
  32594. return c(null, e, t, i)
  32595. }
  32596. ,
  32597. a.allocUnsafe = function(e) {
  32598. return h(null, e)
  32599. }
  32600. ,
  32601. a.allocUnsafeSlow = function(e) {
  32602. return h(null, e)
  32603. }
  32604. ,
  32605. a.isBuffer = function(e) {
  32606. return !(null == e || !e._isBuffer)
  32607. }
  32608. ,
  32609. a.compare = function(e, t) {
  32610. if (!a.isBuffer(e) || !a.isBuffer(t))
  32611. throw new TypeError("Arguments must be Buffers");
  32612. if (e === t)
  32613. return 0;
  32614. for (var i = e.length, n = t.length, r = 0, o = Math.min(i, n); r < o; ++r)
  32615. if (e[r] !== t[r]) {
  32616. i = e[r],
  32617. n = t[r];
  32618. break
  32619. }
  32620. return i < n ? -1 : n < i ? 1 : 0
  32621. }
  32622. ,
  32623. a.isEncoding = function(e) {
  32624. switch (String(e).toLowerCase()) {
  32625. case "hex":
  32626. case "utf8":
  32627. case "utf-8":
  32628. case "ascii":
  32629. case "latin1":
  32630. case "binary":
  32631. case "base64":
  32632. case "ucs2":
  32633. case "ucs-2":
  32634. case "utf16le":
  32635. case "utf-16le":
  32636. return !0;
  32637. default:
  32638. return !1
  32639. }
  32640. }
  32641. ,
  32642. a.concat = function(e, t) {
  32643. if (!$(e))
  32644. throw new TypeError('"list" argument must be an Array of Buffers');
  32645. if (0 === e.length)
  32646. return a.alloc(0);
  32647. var i;
  32648. if (void 0 === t)
  32649. for (t = 0,
  32650. i = 0; i < e.length; ++i)
  32651. t += e[i].length;
  32652. var n = a.allocUnsafe(t)
  32653. , r = 0;
  32654. for (i = 0; i < e.length; ++i) {
  32655. var o = e[i];
  32656. if (!a.isBuffer(o))
  32657. throw new TypeError('"list" argument must be an Array of Buffers');
  32658. o.copy(n, r),
  32659. r += o.length
  32660. }
  32661. return n
  32662. }
  32663. ,
  32664. a.byteLength = v,
  32665. a.prototype._isBuffer = !0,
  32666. a.prototype.swap16 = function() {
  32667. var e = this.length;
  32668. if (e % 2 !== 0)
  32669. throw new RangeError("Buffer size must be a multiple of 16-bits");
  32670. for (var t = 0; t < e; t += 2)
  32671. y(this, t, t + 1);
  32672. return this
  32673. }
  32674. ,
  32675. a.prototype.swap32 = function() {
  32676. var e = this.length;
  32677. if (e % 4 !== 0)
  32678. throw new RangeError("Buffer size must be a multiple of 32-bits");
  32679. for (var t = 0; t < e; t += 4)
  32680. y(this, t, t + 3),
  32681. y(this, t + 1, t + 2);
  32682. return this
  32683. }
  32684. ,
  32685. a.prototype.swap64 = function() {
  32686. var e = this.length;
  32687. if (e % 8 !== 0)
  32688. throw new RangeError("Buffer size must be a multiple of 64-bits");
  32689. for (var t = 0; t < e; t += 8)
  32690. y(this, t, t + 7),
  32691. y(this, t + 1, t + 6),
  32692. y(this, t + 2, t + 5),
  32693. y(this, t + 3, t + 4);
  32694. return this
  32695. }
  32696. ,
  32697. a.prototype.toString = function() {
  32698. var e = 0 | this.length;
  32699. return 0 === e ? "" : 0 === arguments.length ? M(this, 0, e) : A.apply(this, arguments)
  32700. }
  32701. ,
  32702. a.prototype.equals = function(e) {
  32703. if (!a.isBuffer(e))
  32704. throw new TypeError("Argument must be a Buffer");
  32705. return this === e || 0 === a.compare(this, e)
  32706. }
  32707. ,
  32708. a.prototype.inspect = function() {
  32709. var e = ""
  32710. , t = i.INSPECT_MAX_BYTES;
  32711. return this.length > 0 && (e = this.toString("hex", 0, t).match(/.{2}/g).join(" "),
  32712. this.length > t && (e += " ... ")),
  32713. "<Buffer " + e + ">"
  32714. }
  32715. ,
  32716. a.prototype.compare = function(e, t, i, n, r) {
  32717. if (!a.isBuffer(e))
  32718. throw new TypeError("Argument must be a Buffer");
  32719. if (void 0 === t && (t = 0),
  32720. void 0 === i && (i = e ? e.length : 0),
  32721. void 0 === n && (n = 0),
  32722. void 0 === r && (r = this.length),
  32723. t < 0 || i > e.length || n < 0 || r > this.length)
  32724. throw new RangeError("out of range index");
  32725. if (n >= r && t >= i)
  32726. return 0;
  32727. if (n >= r)
  32728. return -1;
  32729. if (t >= i)
  32730. return 1;
  32731. if (t >>>= 0,
  32732. i >>>= 0,
  32733. n >>>= 0,
  32734. r >>>= 0,
  32735. this === e)
  32736. return 0;
  32737. 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)
  32738. if (c[u] !== h[u]) {
  32739. o = c[u],
  32740. s = h[u];
  32741. break
  32742. }
  32743. return o < s ? -1 : s < o ? 1 : 0
  32744. }
  32745. ,
  32746. a.prototype.includes = function(e, t, i) {
  32747. return this.indexOf(e, t, i) !== -1
  32748. }
  32749. ,
  32750. a.prototype.indexOf = function(e, t, i) {
  32751. return C(this, e, t, i, !0)
  32752. }
  32753. ,
  32754. a.prototype.lastIndexOf = function(e, t, i) {
  32755. return C(this, e, t, i, !1)
  32756. }
  32757. ,
  32758. a.prototype.write = function(e, t, i, n) {
  32759. if (void 0 === t)
  32760. n = "utf8",
  32761. i = this.length,
  32762. t = 0;
  32763. else if (void 0 === i && "string" == typeof t)
  32764. n = t,
  32765. i = this.length,
  32766. t = 0;
  32767. else {
  32768. if (!isFinite(t))
  32769. throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");
  32770. t |= 0,
  32771. isFinite(i) ? (i |= 0,
  32772. void 0 === n && (n = "utf8")) : (n = i,
  32773. i = void 0)
  32774. }
  32775. var r = this.length - t;
  32776. if ((void 0 === i || i > r) && (i = r),
  32777. e.length > 0 && (i < 0 || t < 0) || t > this.length)
  32778. throw new RangeError("Attempt to write outside buffer bounds");
  32779. n || (n = "utf8");
  32780. for (var o = !1; ; )
  32781. switch (n) {
  32782. case "hex":
  32783. return E(this, e, t, i);
  32784. case "utf8":
  32785. case "utf-8":
  32786. return b(this, e, t, i);
  32787. case "ascii":
  32788. return w(this, e, t, i);
  32789. case "latin1":
  32790. case "binary":
  32791. return _(this, e, t, i);
  32792. case "base64":
  32793. return T(this, e, t, i);
  32794. case "ucs2":
  32795. case "ucs-2":
  32796. case "utf16le":
  32797. case "utf-16le":
  32798. return x(this, e, t, i);
  32799. default:
  32800. if (o)
  32801. throw new TypeError("Unknown encoding: " + n);
  32802. n = ("" + n).toLowerCase(),
  32803. o = !0
  32804. }
  32805. }
  32806. ,
  32807. a.prototype.toJSON = function() {
  32808. return {
  32809. type: "Buffer",
  32810. data: Array.prototype.slice.call(this._arr || this, 0)
  32811. }
  32812. }
  32813. ;
  32814. var ee = 4096;
  32815. a.prototype.slice = function(e, t) {
  32816. var i = this.length;
  32817. e = ~~e,
  32818. t = void 0 === t ? i : ~~t,
  32819. e < 0 ? (e += i,
  32820. e < 0 && (e = 0)) : e > i && (e = i),
  32821. t < 0 ? (t += i,
  32822. t < 0 && (t = 0)) : t > i && (t = i),
  32823. t < e && (t = e);
  32824. var n;
  32825. if (a.TYPED_ARRAY_SUPPORT)
  32826. n = this.subarray(e, t),
  32827. n.__proto__ = a.prototype;
  32828. else {
  32829. var r = t - e;
  32830. n = new a(r,void 0);
  32831. for (var o = 0; o < r; ++o)
  32832. n[o] = this[o + e]
  32833. }
  32834. return n
  32835. }
  32836. ,
  32837. a.prototype.readUIntLE = function(e, t, i) {
  32838. e |= 0,
  32839. t |= 0,
  32840. i || N(e, t, this.length);
  32841. for (var n = this[e], r = 1, o = 0; ++o < t && (r *= 256); )
  32842. n += this[e + o] * r;
  32843. return n
  32844. }
  32845. ,
  32846. a.prototype.readUIntBE = function(e, t, i) {
  32847. e |= 0,
  32848. t |= 0,
  32849. i || N(e, t, this.length);
  32850. for (var n = this[e + --t], r = 1; t > 0 && (r *= 256); )
  32851. n += this[e + --t] * r;
  32852. return n
  32853. }
  32854. ,
  32855. a.prototype.readUInt8 = function(e, t) {
  32856. return t || N(e, 1, this.length),
  32857. this[e]
  32858. }
  32859. ,
  32860. a.prototype.readUInt16LE = function(e, t) {
  32861. return t || N(e, 2, this.length),
  32862. this[e] | this[e + 1] << 8
  32863. }
  32864. ,
  32865. a.prototype.readUInt16BE = function(e, t) {
  32866. return t || N(e, 2, this.length),
  32867. this[e] << 8 | this[e + 1]
  32868. }
  32869. ,
  32870. a.prototype.readUInt32LE = function(e, t) {
  32871. return t || N(e, 4, this.length),
  32872. (this[e] | this[e + 1] << 8 | this[e + 2] << 16) + 16777216 * this[e + 3]
  32873. }
  32874. ,
  32875. a.prototype.readUInt32BE = function(e, t) {
  32876. return t || N(e, 4, this.length),
  32877. 16777216 * this[e] + (this[e + 1] << 16 | this[e + 2] << 8 | this[e + 3])
  32878. }
  32879. ,
  32880. a.prototype.readIntLE = function(e, t, i) {
  32881. e |= 0,
  32882. t |= 0,
  32883. i || N(e, t, this.length);
  32884. for (var n = this[e], r = 1, o = 0; ++o < t && (r *= 256); )
  32885. n += this[e + o] * r;
  32886. return r *= 128,
  32887. n >= r && (n -= Math.pow(2, 8 * t)),
  32888. n
  32889. }
  32890. ,
  32891. a.prototype.readIntBE = function(e, t, i) {
  32892. e |= 0,
  32893. t |= 0,
  32894. i || N(e, t, this.length);
  32895. for (var n = t, r = 1, o = this[e + --n]; n > 0 && (r *= 256); )
  32896. o += this[e + --n] * r;
  32897. return r *= 128,
  32898. o >= r && (o -= Math.pow(2, 8 * t)),
  32899. o
  32900. }
  32901. ,
  32902. a.prototype.readInt8 = function(e, t) {
  32903. return t || N(e, 1, this.length),
  32904. 128 & this[e] ? (255 - this[e] + 1) * -1 : this[e]
  32905. }
  32906. ,
  32907. a.prototype.readInt16LE = function(e, t) {
  32908. t || N(e, 2, this.length);
  32909. var i = this[e] | this[e + 1] << 8;
  32910. return 32768 & i ? 4294901760 | i : i
  32911. }
  32912. ,
  32913. a.prototype.readInt16BE = function(e, t) {
  32914. t || N(e, 2, this.length);
  32915. var i = this[e + 1] | this[e] << 8;
  32916. return 32768 & i ? 4294901760 | i : i
  32917. }
  32918. ,
  32919. a.prototype.readInt32LE = function(e, t) {
  32920. return t || N(e, 4, this.length),
  32921. this[e] | this[e + 1] << 8 | this[e + 2] << 16 | this[e + 3] << 24
  32922. }
  32923. ,
  32924. a.prototype.readInt32BE = function(e, t) {
  32925. return t || N(e, 4, this.length),
  32926. this[e] << 24 | this[e + 1] << 16 | this[e + 2] << 8 | this[e + 3]
  32927. }
  32928. ,
  32929. a.prototype.readFloatLE = function(e, t) {
  32930. return t || N(e, 4, this.length),
  32931. J.read(this, e, !0, 23, 4)
  32932. }
  32933. ,
  32934. a.prototype.readFloatBE = function(e, t) {
  32935. return t || N(e, 4, this.length),
  32936. J.read(this, e, !1, 23, 4)
  32937. }
  32938. ,
  32939. a.prototype.readDoubleLE = function(e, t) {
  32940. return t || N(e, 8, this.length),
  32941. J.read(this, e, !0, 52, 8)
  32942. }
  32943. ,
  32944. a.prototype.readDoubleBE = function(e, t) {
  32945. return t || N(e, 8, this.length),
  32946. J.read(this, e, !1, 52, 8)
  32947. }
  32948. ,
  32949. a.prototype.writeUIntLE = function(e, t, i, n) {
  32950. if (e = +e,
  32951. t |= 0,
  32952. i |= 0,
  32953. !n) {
  32954. var r = Math.pow(2, 8 * i) - 1;
  32955. B(this, e, t, i, r, 0)
  32956. }
  32957. var o = 1
  32958. , a = 0;
  32959. for (this[t] = 255 & e; ++a < i && (o *= 256); )
  32960. this[t + a] = e / o & 255;
  32961. return t + i
  32962. }
  32963. ,
  32964. a.prototype.writeUIntBE = function(e, t, i, n) {
  32965. if (e = +e,
  32966. t |= 0,
  32967. i |= 0,
  32968. !n) {
  32969. var r = Math.pow(2, 8 * i) - 1;
  32970. B(this, e, t, i, r, 0)
  32971. }
  32972. var o = i - 1
  32973. , a = 1;
  32974. for (this[t + o] = 255 & e; --o >= 0 && (a *= 256); )
  32975. this[t + o] = e / a & 255;
  32976. return t + i
  32977. }
  32978. ,
  32979. a.prototype.writeUInt8 = function(e, t, i) {
  32980. return e = +e,
  32981. t |= 0,
  32982. i || B(this, e, t, 1, 255, 0),
  32983. a.TYPED_ARRAY_SUPPORT || (e = Math.floor(e)),
  32984. this[t] = 255 & e,
  32985. t + 1
  32986. }
  32987. ,
  32988. a.prototype.writeUInt16LE = function(e, t, i) {
  32989. return e = +e,
  32990. t |= 0,
  32991. i || B(this, e, t, 2, 65535, 0),
  32992. a.TYPED_ARRAY_SUPPORT ? (this[t] = 255 & e,
  32993. this[t + 1] = e >>> 8) : F(this, e, t, !0),
  32994. t + 2
  32995. }
  32996. ,
  32997. a.prototype.writeUInt16BE = function(e, t, i) {
  32998. return e = +e,
  32999. t |= 0,
  33000. i || B(this, e, t, 2, 65535, 0),
  33001. a.TYPED_ARRAY_SUPPORT ? (this[t] = e >>> 8,
  33002. this[t + 1] = 255 & e) : F(this, e, t, !1),
  33003. t + 2
  33004. }
  33005. ,
  33006. a.prototype.writeUInt32LE = function(e, t, i) {
  33007. return e = +e,
  33008. t |= 0,
  33009. i || B(this, e, t, 4, 4294967295, 0),
  33010. a.TYPED_ARRAY_SUPPORT ? (this[t + 3] = e >>> 24,
  33011. this[t + 2] = e >>> 16,
  33012. this[t + 1] = e >>> 8,
  33013. this[t] = 255 & e) : V(this, e, t, !0),
  33014. t + 4
  33015. }
  33016. ,
  33017. a.prototype.writeUInt32BE = function(e, t, i) {
  33018. return e = +e,
  33019. t |= 0,
  33020. i || B(this, e, t, 4, 4294967295, 0),
  33021. a.TYPED_ARRAY_SUPPORT ? (this[t] = e >>> 24,
  33022. this[t + 1] = e >>> 16,
  33023. this[t + 2] = e >>> 8,
  33024. this[t + 3] = 255 & e) : V(this, e, t, !1),
  33025. t + 4
  33026. }
  33027. ,
  33028. a.prototype.writeIntLE = function(e, t, i, n) {
  33029. if (e = +e,
  33030. t |= 0,
  33031. !n) {
  33032. var r = Math.pow(2, 8 * i - 1);
  33033. B(this, e, t, i, r - 1, -r)
  33034. }
  33035. var o = 0
  33036. , a = 1
  33037. , s = 0;
  33038. for (this[t] = 255 & e; ++o < i && (a *= 256); )
  33039. e < 0 && 0 === s && 0 !== this[t + o - 1] && (s = 1),
  33040. this[t + o] = (e / a >> 0) - s & 255;
  33041. return t + i
  33042. }
  33043. ,
  33044. a.prototype.writeIntBE = function(e, t, i, n) {
  33045. if (e = +e,
  33046. t |= 0,
  33047. !n) {
  33048. var r = Math.pow(2, 8 * i - 1);
  33049. B(this, e, t, i, r - 1, -r)
  33050. }
  33051. var o = i - 1
  33052. , a = 1
  33053. , s = 0;
  33054. for (this[t + o] = 255 & e; --o >= 0 && (a *= 256); )
  33055. e < 0 && 0 === s && 0 !== this[t + o + 1] && (s = 1),
  33056. this[t + o] = (e / a >> 0) - s & 255;
  33057. return t + i
  33058. }
  33059. ,
  33060. a.prototype.writeInt8 = function(e, t, i) {
  33061. return e = +e,
  33062. t |= 0,
  33063. i || B(this, e, t, 1, 127, -128),
  33064. a.TYPED_ARRAY_SUPPORT || (e = Math.floor(e)),
  33065. e < 0 && (e = 255 + e + 1),
  33066. this[t] = 255 & e,
  33067. t + 1
  33068. }
  33069. ,
  33070. a.prototype.writeInt16LE = function(e, t, i) {
  33071. return e = +e,
  33072. t |= 0,
  33073. i || B(this, e, t, 2, 32767, -32768),
  33074. a.TYPED_ARRAY_SUPPORT ? (this[t] = 255 & e,
  33075. this[t + 1] = e >>> 8) : F(this, e, t, !0),
  33076. t + 2
  33077. }
  33078. ,
  33079. a.prototype.writeInt16BE = function(e, t, i) {
  33080. return e = +e,
  33081. t |= 0,
  33082. i || B(this, e, t, 2, 32767, -32768),
  33083. a.TYPED_ARRAY_SUPPORT ? (this[t] = e >>> 8,
  33084. this[t + 1] = 255 & e) : F(this, e, t, !1),
  33085. t + 2
  33086. }
  33087. ,
  33088. a.prototype.writeInt32LE = function(e, t, i) {
  33089. return e = +e,
  33090. t |= 0,
  33091. i || B(this, e, t, 4, 2147483647, -2147483648),
  33092. a.TYPED_ARRAY_SUPPORT ? (this[t] = 255 & e,
  33093. this[t + 1] = e >>> 8,
  33094. this[t + 2] = e >>> 16,
  33095. this[t + 3] = e >>> 24) : V(this, e, t, !0),
  33096. t + 4
  33097. }
  33098. ,
  33099. a.prototype.writeInt32BE = function(e, t, i) {
  33100. return e = +e,
  33101. t |= 0,
  33102. i || B(this, e, t, 4, 2147483647, -2147483648),
  33103. e < 0 && (e = 4294967295 + e + 1),
  33104. a.TYPED_ARRAY_SUPPORT ? (this[t] = e >>> 24,
  33105. this[t + 1] = e >>> 16,
  33106. this[t + 2] = e >>> 8,
  33107. this[t + 3] = 255 & e) : V(this, e, t, !1),
  33108. t + 4
  33109. }
  33110. ,
  33111. a.prototype.writeFloatLE = function(e, t, i) {
  33112. return k(this, e, t, !0, i)
  33113. }
  33114. ,
  33115. a.prototype.writeFloatBE = function(e, t, i) {
  33116. return k(this, e, t, !1, i)
  33117. }
  33118. ,
  33119. a.prototype.writeDoubleLE = function(e, t, i) {
  33120. return H(this, e, t, !0, i)
  33121. }
  33122. ,
  33123. a.prototype.writeDoubleBE = function(e, t, i) {
  33124. return H(this, e, t, !1, i)
  33125. }
  33126. ,
  33127. a.prototype.copy = function(e, t, i, n) {
  33128. if (i || (i = 0),
  33129. n || 0 === n || (n = this.length),
  33130. t >= e.length && (t = e.length),
  33131. t || (t = 0),
  33132. n > 0 && n < i && (n = i),
  33133. n === i)
  33134. return 0;
  33135. if (0 === e.length || 0 === this.length)
  33136. return 0;
  33137. if (t < 0)
  33138. throw new RangeError("targetStart out of bounds");
  33139. if (i < 0 || i >= this.length)
  33140. throw new RangeError("sourceStart out of bounds");
  33141. if (n < 0)
  33142. throw new RangeError("sourceEnd out of bounds");
  33143. n > this.length && (n = this.length),
  33144. e.length - t < n - i && (n = e.length - t + i);
  33145. var r, o = n - i;
  33146. if (this === e && i < t && t < n)
  33147. for (r = o - 1; r >= 0; --r)
  33148. e[r + t] = this[r + i];
  33149. else if (o < 1e3 || !a.TYPED_ARRAY_SUPPORT)
  33150. for (r = 0; r < o; ++r)
  33151. e[r + t] = this[r + i];
  33152. else
  33153. Uint8Array.prototype.set.call(e, this.subarray(i, i + o), t);
  33154. return o
  33155. }
  33156. ,
  33157. a.prototype.fill = function(e, t, i, n) {
  33158. if ("string" == typeof e) {
  33159. if ("string" == typeof t ? (n = t,
  33160. t = 0,
  33161. i = this.length) : "string" == typeof i && (n = i,
  33162. i = this.length),
  33163. 1 === e.length) {
  33164. var r = e.charCodeAt(0);
  33165. r < 256 && (e = r)
  33166. }
  33167. if (void 0 !== n && "string" != typeof n)
  33168. throw new TypeError("encoding must be a string");
  33169. if ("string" == typeof n && !a.isEncoding(n))
  33170. throw new TypeError("Unknown encoding: " + n)
  33171. } else
  33172. "number" == typeof e && (e &= 255);
  33173. if (t < 0 || this.length < t || this.length < i)
  33174. throw new RangeError("Out of range index");
  33175. if (i <= t)
  33176. return this;
  33177. t >>>= 0,
  33178. i = void 0 === i ? this.length : i >>> 0,
  33179. e || (e = 0);
  33180. var o;
  33181. if ("number" == typeof e)
  33182. for (o = t; o < i; ++o)
  33183. this[o] = e;
  33184. else {
  33185. var s = a.isBuffer(e) ? e : j(new a(e,n).toString())
  33186. , l = s.length;
  33187. for (o = 0; o < i - t; ++o)
  33188. this[o + t] = s[o % l]
  33189. }
  33190. return this
  33191. }
  33192. ;
  33193. var te = /[^+\/0-9A-Za-z-_]/g
  33194. }
  33195. ).call(this, "undefined" != typeof global ? global : "undefined" != typeof self ? self : "undefined" != typeof window ? window : {})
  33196. }
  33197. , {
  33198. "base64-js": 199,
  33199. ieee754: 200,
  33200. isarray: 201
  33201. }],
  33202. 199: [function(e, t, i) {
  33203. "use strict";
  33204. function n(e) {
  33205. var t = e.length;
  33206. if (t % 4 > 0)
  33207. throw new Error("Invalid string. Length must be a multiple of 4");
  33208. return "=" === e[t - 2] ? 2 : "=" === e[t - 1] ? 1 : 0
  33209. }
  33210. function r(e) {
  33211. return 3 * e.length / 4 - n(e)
  33212. }
  33213. function o(e) {
  33214. var t, i, r, o, a, s, l = e.length;
  33215. a = n(e),
  33216. s = new u(3 * l / 4 - a),
  33217. r = a > 0 ? l - 4 : l;
  33218. var c = 0;
  33219. for (t = 0,
  33220. i = 0; t < r; t += 4,
  33221. i += 3)
  33222. o = h[e.charCodeAt(t)] << 18 | h[e.charCodeAt(t + 1)] << 12 | h[e.charCodeAt(t + 2)] << 6 | h[e.charCodeAt(t + 3)],
  33223. s[c++] = o >> 16 & 255,
  33224. s[c++] = o >> 8 & 255,
  33225. s[c++] = 255 & o;
  33226. return 2 === a ? (o = h[e.charCodeAt(t)] << 2 | h[e.charCodeAt(t + 1)] >> 4,
  33227. s[c++] = 255 & o) : 1 === a && (o = h[e.charCodeAt(t)] << 10 | h[e.charCodeAt(t + 1)] << 4 | h[e.charCodeAt(t + 2)] >> 2,
  33228. s[c++] = o >> 8 & 255,
  33229. s[c++] = 255 & o),
  33230. s
  33231. }
  33232. function a(e) {
  33233. return c[e >> 18 & 63] + c[e >> 12 & 63] + c[e >> 6 & 63] + c[63 & e]
  33234. }
  33235. function s(e, t, i) {
  33236. for (var n, r = [], o = t; o < i; o += 3)
  33237. n = (e[o] << 16) + (e[o + 1] << 8) + e[o + 2],
  33238. r.push(a(n));
  33239. return r.join("")
  33240. }
  33241. function l(e) {
  33242. for (var t, i = e.length, n = i % 3, r = "", o = [], a = 16383, l = 0, h = i - n; l < h; l += a)
  33243. o.push(s(e, l, l + a > h ? h : l + a));
  33244. return 1 === n ? (t = e[i - 1],
  33245. r += c[t >> 2],
  33246. r += c[t << 4 & 63],
  33247. r += "==") : 2 === n && (t = (e[i - 2] << 8) + e[i - 1],
  33248. r += c[t >> 10],
  33249. r += c[t >> 4 & 63],
  33250. r += c[t << 2 & 63],
  33251. r += "="),
  33252. o.push(r),
  33253. o.join("")
  33254. }
  33255. i.byteLength = r,
  33256. i.toByteArray = o,
  33257. i.fromByteArray = l;
  33258. for (var c = [], h = [], u = "undefined" != typeof Uint8Array ? Uint8Array : Array, d = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", p = 0, f = d.length; p < f; ++p)
  33259. c[p] = d[p],
  33260. h[d.charCodeAt(p)] = p;
  33261. h["-".charCodeAt(0)] = 62,
  33262. h["_".charCodeAt(0)] = 63
  33263. }
  33264. , {}],
  33265. 200: [function(e, t, i) {
  33266. i.read = function(e, t, i, n, r) {
  33267. 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];
  33268. for (u += d,
  33269. o = p & (1 << -h) - 1,
  33270. p >>= -h,
  33271. h += s; h > 0; o = 256 * o + e[t + u],
  33272. u += d,
  33273. h -= 8)
  33274. ;
  33275. for (a = o & (1 << -h) - 1,
  33276. o >>= -h,
  33277. h += n; h > 0; a = 256 * a + e[t + u],
  33278. u += d,
  33279. h -= 8)
  33280. ;
  33281. if (0 === o)
  33282. o = 1 - c;
  33283. else {
  33284. if (o === l)
  33285. return a ? NaN : (p ? -1 : 1) * (1 / 0);
  33286. a += Math.pow(2, n),
  33287. o -= c
  33288. }
  33289. return (p ? -1 : 1) * a * Math.pow(2, o - n)
  33290. }
  33291. ,
  33292. i.write = function(e, t, i, n, r, o) {
  33293. 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;
  33294. for (t = Math.abs(t),
  33295. isNaN(t) || t === 1 / 0 ? (s = isNaN(t) ? 1 : 0,
  33296. a = h) : (a = Math.floor(Math.log(t) / Math.LN2),
  33297. t * (l = Math.pow(2, -a)) < 1 && (a--,
  33298. l *= 2),
  33299. t += a + u >= 1 ? d / l : d * Math.pow(2, 1 - u),
  33300. t * l >= 2 && (a++,
  33301. l /= 2),
  33302. a + u >= h ? (s = 0,
  33303. a = h) : a + u >= 1 ? (s = (t * l - 1) * Math.pow(2, r),
  33304. a += u) : (s = t * Math.pow(2, u - 1) * Math.pow(2, r),
  33305. a = 0)); r >= 8; e[i + p] = 255 & s,
  33306. p += f,
  33307. s /= 256,
  33308. r -= 8)
  33309. ;
  33310. for (a = a << r | s,
  33311. c += r; c > 0; e[i + p] = 255 & a,
  33312. p += f,
  33313. a /= 256,
  33314. c -= 8)
  33315. ;
  33316. e[i + p - f] |= 128 * g
  33317. }
  33318. }
  33319. , {}],
  33320. 201: [function(e, t, i) {
  33321. var n = {}.toString;
  33322. t.exports = Array.isArray || function(e) {
  33323. return "[object Array]" == n.call(e)
  33324. }
  33325. }
  33326. , {}],
  33327. 202: [function(e, t, i) {
  33328. function n() {
  33329. this._events = this._events || {},
  33330. this._maxListeners = this._maxListeners || void 0
  33331. }
  33332. function r(e) {
  33333. return "function" == typeof e
  33334. }
  33335. function o(e) {
  33336. return "number" == typeof e
  33337. }
  33338. function a(e) {
  33339. return "object" == typeof e && null !== e
  33340. }
  33341. function s(e) {
  33342. return void 0 === e
  33343. }
  33344. t.exports = n,
  33345. n.EventEmitter = n,
  33346. n.prototype._events = void 0,
  33347. n.prototype._maxListeners = void 0,
  33348. n.defaultMaxListeners = 10,
  33349. n.prototype.setMaxListeners = function(e) {
  33350. if (!o(e) || e < 0 || isNaN(e))
  33351. throw TypeError("n must be a positive number");
  33352. return this._maxListeners = e,
  33353. this
  33354. }
  33355. ,
  33356. n.prototype.emit = function(e) {
  33357. var t, i, n, o, l, c;
  33358. if (this._events || (this._events = {}),
  33359. "error" === e && (!this._events.error || a(this._events.error) && !this._events.error.length)) {
  33360. if (t = arguments[1],
  33361. t instanceof Error)
  33362. throw t;
  33363. var h = new Error('Uncaught, unspecified "error" event. (' + t + ")");
  33364. throw h.context = t,
  33365. h
  33366. }
  33367. if (i = this._events[e],
  33368. s(i))
  33369. return !1;
  33370. if (r(i))
  33371. switch (arguments.length) {
  33372. case 1:
  33373. i.call(this);
  33374. break;
  33375. case 2:
  33376. i.call(this, arguments[1]);
  33377. break;
  33378. case 3:
  33379. i.call(this, arguments[1], arguments[2]);
  33380. break;
  33381. default:
  33382. o = Array.prototype.slice.call(arguments, 1),
  33383. i.apply(this, o)
  33384. }
  33385. else if (a(i))
  33386. for (o = Array.prototype.slice.call(arguments, 1),
  33387. c = i.slice(),
  33388. n = c.length,
  33389. l = 0; l < n; l++)
  33390. c[l].apply(this, o);
  33391. return !0
  33392. }
  33393. ,
  33394. n.prototype.addListener = function(e, t) {
  33395. var i;
  33396. if (!r(t))
  33397. throw TypeError("listener must be a function");
  33398. return this._events || (this._events = {}),
  33399. this._events.newListener && this.emit("newListener", e, r(t.listener) ? t.listener : t),
  33400. this._events[e] ? a(this._events[e]) ? this._events[e].push(t) : this._events[e] = [this._events[e], t] : this._events[e] = t,
  33401. a(this._events[e]) && !this._events[e].warned && (i = s(this._maxListeners) ? n.defaultMaxListeners : this._maxListeners,
  33402. i && i > 0 && this._events[e].length > i && (this._events[e].warned = !0,
  33403. console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.", this._events[e].length),
  33404. "function" == typeof console.trace && console.trace())),
  33405. this
  33406. }
  33407. ,
  33408. n.prototype.on = n.prototype.addListener,
  33409. n.prototype.once = function(e, t) {
  33410. function i() {
  33411. this.removeListener(e, i),
  33412. n || (n = !0,
  33413. t.apply(this, arguments))
  33414. }
  33415. if (!r(t))
  33416. throw TypeError("listener must be a function");
  33417. var n = !1;
  33418. return i.listener = t,
  33419. this.on(e, i),
  33420. this
  33421. }
  33422. ,
  33423. n.prototype.removeListener = function(e, t) {
  33424. var i, n, o, s;
  33425. if (!r(t))
  33426. throw TypeError("listener must be a function");
  33427. if (!this._events || !this._events[e])
  33428. return this;
  33429. if (i = this._events[e],
  33430. o = i.length,
  33431. n = -1,
  33432. i === t || r(i.listener) && i.listener === t)
  33433. delete this._events[e],
  33434. this._events.removeListener && this.emit("removeListener", e, t);
  33435. else if (a(i)) {
  33436. for (s = o; s-- > 0; )
  33437. if (i[s] === t || i[s].listener && i[s].listener === t) {
  33438. n = s;
  33439. break
  33440. }
  33441. if (n < 0)
  33442. return this;
  33443. 1 === i.length ? (i.length = 0,
  33444. delete this._events[e]) : i.splice(n, 1),
  33445. this._events.removeListener && this.emit("removeListener", e, t)
  33446. }
  33447. return this
  33448. }
  33449. ,
  33450. n.prototype.removeAllListeners = function(e) {
  33451. var t, i;
  33452. if (!this._events)
  33453. return this;
  33454. if (!this._events.removeListener)
  33455. return 0 === arguments.length ? this._events = {} : this._events[e] && delete this._events[e],
  33456. this;
  33457. if (0 === arguments.length) {
  33458. for (t in this._events)
  33459. "removeListener" !== t && this.removeAllListeners(t);
  33460. return this.removeAllListeners("removeListener"),
  33461. this._events = {},
  33462. this
  33463. }
  33464. if (i = this._events[e],
  33465. r(i))
  33466. this.removeListener(e, i);
  33467. else if (i)
  33468. for (; i.length; )
  33469. this.removeListener(e, i[i.length - 1]);
  33470. return delete this._events[e],
  33471. this
  33472. }
  33473. ,
  33474. n.prototype.listeners = function(e) {
  33475. var t;
  33476. return t = this._events && this._events[e] ? r(this._events[e]) ? [this._events[e]] : this._events[e].slice() : []
  33477. }
  33478. ,
  33479. n.prototype.listenerCount = function(e) {
  33480. if (this._events) {
  33481. var t = this._events[e];
  33482. if (r(t))
  33483. return 1;
  33484. if (t)
  33485. return t.length
  33486. }
  33487. return 0
  33488. }
  33489. ,
  33490. n.listenerCount = function(e, t) {
  33491. return e.listenerCount(t)
  33492. }
  33493. }
  33494. , {}],
  33495. 203: [function(e, t, i) {
  33496. function n() {
  33497. throw new Error("setTimeout has not been defined")
  33498. }
  33499. function r() {
  33500. throw new Error("clearTimeout has not been defined")
  33501. }
  33502. function o(e) {
  33503. if (u === setTimeout)
  33504. return setTimeout(e, 0);
  33505. if ((u === n || !u) && setTimeout)
  33506. return u = setTimeout,
  33507. setTimeout(e, 0);
  33508. try {
  33509. return u(e, 0)
  33510. } catch (t) {
  33511. try {
  33512. return u.call(null, e, 0)
  33513. } catch (t) {
  33514. return u.call(this, e, 0)
  33515. }
  33516. }
  33517. }
  33518. function a(e) {
  33519. if (d === clearTimeout)
  33520. return clearTimeout(e);
  33521. if ((d === r || !d) && clearTimeout)
  33522. return d = clearTimeout,
  33523. clearTimeout(e);
  33524. try {
  33525. return d(e)
  33526. } catch (t) {
  33527. try {
  33528. return d.call(null, e)
  33529. } catch (t) {
  33530. return d.call(this, e)
  33531. }
  33532. }
  33533. }
  33534. function s() {
  33535. m && f && (m = !1,
  33536. f.length ? g = f.concat(g) : v = -1,
  33537. g.length && l())
  33538. }
  33539. function l() {
  33540. if (!m) {
  33541. var e = o(s);
  33542. m = !0;
  33543. for (var t = g.length; t; ) {
  33544. for (f = g,
  33545. g = []; ++v < t; )
  33546. f && f[v].run();
  33547. v = -1,
  33548. t = g.length
  33549. }
  33550. f = null,
  33551. m = !1,
  33552. a(e)
  33553. }
  33554. }
  33555. function c(e, t) {
  33556. this.fun = e,
  33557. this.array = t
  33558. }
  33559. function h() {}
  33560. var u, d, p = t.exports = {};
  33561. !function() {
  33562. try {
  33563. u = "function" == typeof setTimeout ? setTimeout : n
  33564. } catch (e) {
  33565. u = n
  33566. }
  33567. try {
  33568. d = "function" == typeof clearTimeout ? clearTimeout : r
  33569. } catch (e) {
  33570. d = r
  33571. }
  33572. }();
  33573. var f, g = [], m = !1, v = -1;
  33574. p.nextTick = function(e) {
  33575. var t = new Array(arguments.length - 1);
  33576. if (arguments.length > 1)
  33577. for (var i = 1; i < arguments.length; i++)
  33578. t[i - 1] = arguments[i];
  33579. g.push(new c(e,t)),
  33580. 1 !== g.length || m || o(l)
  33581. }
  33582. ,
  33583. c.prototype.run = function() {
  33584. this.fun.apply(null, this.array)
  33585. }
  33586. ,
  33587. p.title = "browser",
  33588. p.browser = !0,
  33589. p.env = {},
  33590. p.argv = [],
  33591. p.version = "",
  33592. p.versions = {},
  33593. p.on = h,
  33594. p.addListener = h,
  33595. p.once = h,
  33596. p.off = h,
  33597. p.removeListener = h,
  33598. p.removeAllListeners = h,
  33599. p.emit = h,
  33600. p.binding = function(e) {
  33601. throw new Error("process.binding is not supported")
  33602. }
  33603. ,
  33604. p.cwd = function() {
  33605. return "/"
  33606. }
  33607. ,
  33608. p.chdir = function(e) {
  33609. throw new Error("process.chdir is not supported")
  33610. }
  33611. ,
  33612. p.umask = function() {
  33613. return 0
  33614. }
  33615. }
  33616. , {}],
  33617. 204: [function(e, t, i) {
  33618. (function(e) {
  33619. !function(n) {
  33620. function r(e) {
  33621. throw new RangeError(L[e])
  33622. }
  33623. function o(e, t) {
  33624. for (var i = e.length, n = []; i--; )
  33625. n[i] = t(e[i]);
  33626. return n
  33627. }
  33628. function a(e, t) {
  33629. var i = e.split("@")
  33630. , n = "";
  33631. i.length > 1 && (n = i[0] + "@",
  33632. e = i[1]),
  33633. e = e.replace(O, ".");
  33634. var r = e.split(".")
  33635. , a = o(r, t).join(".");
  33636. return n + a
  33637. }
  33638. function s(e) {
  33639. for (var t, i, n = [], r = 0, o = e.length; r < o; )
  33640. t = e.charCodeAt(r++),
  33641. t >= 55296 && t <= 56319 && r < o ? (i = e.charCodeAt(r++),
  33642. 56320 == (64512 & i) ? n.push(((1023 & t) << 10) + (1023 & i) + 65536) : (n.push(t),
  33643. r--)) : n.push(t);
  33644. return n
  33645. }
  33646. function l(e) {
  33647. return o(e, function(e) {
  33648. var t = "";
  33649. return e > 65535 && (e -= 65536,
  33650. t += B(e >>> 10 & 1023 | 55296),
  33651. e = 56320 | 1023 & e),
  33652. t += B(e)
  33653. }).join("")
  33654. }
  33655. function c(e) {
  33656. return e - 48 < 10 ? e - 22 : e - 65 < 26 ? e - 65 : e - 97 < 26 ? e - 97 : E
  33657. }
  33658. function h(e, t) {
  33659. return e + 22 + 75 * (e < 26) - ((0 != t) << 5)
  33660. }
  33661. function u(e, t, i) {
  33662. var n = 0;
  33663. for (e = i ? N(e / T) : e >> 1,
  33664. e += N(e / t); e > D * w >> 1; n += E)
  33665. e = N(e / D);
  33666. return N(n + (D + 1) * e / (e + _))
  33667. }
  33668. function d(e) {
  33669. var t, i, n, o, a, s, h, d, p, f, g = [], m = e.length, v = 0, A = S, y = x;
  33670. for (i = e.lastIndexOf(M),
  33671. i < 0 && (i = 0),
  33672. n = 0; n < i; ++n)
  33673. e.charCodeAt(n) >= 128 && r("not-basic"),
  33674. g.push(e.charCodeAt(n));
  33675. for (o = i > 0 ? i + 1 : 0; o < m; ) {
  33676. for (a = v,
  33677. s = 1,
  33678. h = E; o >= m && r("invalid-input"),
  33679. d = c(e.charCodeAt(o++)),
  33680. (d >= E || d > N((I - v) / s)) && r("overflow"),
  33681. v += d * s,
  33682. p = h <= y ? b : h >= y + w ? w : h - y,
  33683. !(d < p); h += E)
  33684. f = E - p,
  33685. s > N(I / f) && r("overflow"),
  33686. s *= f;
  33687. t = g.length + 1,
  33688. y = u(v - a, t, 0 == a),
  33689. N(v / t) > I - A && r("overflow"),
  33690. A += N(v / t),
  33691. v %= t,
  33692. g.splice(v++, 0, A)
  33693. }
  33694. return l(g)
  33695. }
  33696. function p(e) {
  33697. var t, i, n, o, a, l, c, d, p, f, g, m, v, A, y, C = [];
  33698. for (e = s(e),
  33699. m = e.length,
  33700. t = S,
  33701. i = 0,
  33702. a = x,
  33703. l = 0; l < m; ++l)
  33704. g = e[l],
  33705. g < 128 && C.push(B(g));
  33706. for (n = o = C.length,
  33707. o && C.push(M); n < m; ) {
  33708. for (c = I,
  33709. l = 0; l < m; ++l)
  33710. g = e[l],
  33711. g >= t && g < c && (c = g);
  33712. for (v = n + 1,
  33713. c - t > N((I - i) / v) && r("overflow"),
  33714. i += (c - t) * v,
  33715. t = c,
  33716. l = 0; l < m; ++l)
  33717. if (g = e[l],
  33718. g < t && ++i > I && r("overflow"),
  33719. g == t) {
  33720. for (d = i,
  33721. p = E; f = p <= a ? b : p >= a + w ? w : p - a,
  33722. !(d < f); p += E)
  33723. y = d - f,
  33724. A = E - f,
  33725. C.push(B(h(f + y % A, 0))),
  33726. d = N(y / A);
  33727. C.push(B(h(d, 0))),
  33728. a = u(i, v, n == o),
  33729. i = 0,
  33730. ++n
  33731. }
  33732. ++i,
  33733. ++t
  33734. }
  33735. return C.join("")
  33736. }
  33737. function f(e) {
  33738. return a(e, function(e) {
  33739. return R.test(e) ? d(e.slice(4).toLowerCase()) : e
  33740. })
  33741. }
  33742. function g(e) {
  33743. return a(e, function(e) {
  33744. return P.test(e) ? "xn--" + p(e) : e
  33745. })
  33746. }
  33747. var m = "object" == typeof i && i && !i.nodeType && i
  33748. , v = "object" == typeof t && t && !t.nodeType && t
  33749. , A = "object" == typeof e && e;
  33750. A.global !== A && A.window !== A && A.self !== A || (n = A);
  33751. 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 = {
  33752. overflow: "Overflow: input needs wider integers to process",
  33753. "not-basic": "Illegal input >= 0x80 (not a basic code point)",
  33754. "invalid-input": "Invalid input"
  33755. }, D = E - b, N = Math.floor, B = String.fromCharCode;
  33756. if (y = {
  33757. version: "1.4.1",
  33758. ucs2: {
  33759. decode: s,
  33760. encode: l
  33761. },
  33762. decode: d,
  33763. encode: p,
  33764. toASCII: g,
  33765. toUnicode: f
  33766. },
  33767. "function" == typeof define && "object" == typeof define.amd && define.amd)
  33768. define("punycode", function() {
  33769. return y
  33770. });
  33771. else if (m && v)
  33772. if (t.exports == m)
  33773. v.exports = y;
  33774. else
  33775. for (C in y)
  33776. y.hasOwnProperty(C) && (m[C] = y[C]);
  33777. else
  33778. n.punycode = y
  33779. }(this)
  33780. }
  33781. ).call(this, "undefined" != typeof global ? global : "undefined" != typeof self ? self : "undefined" != typeof window ? window : {})
  33782. }
  33783. , {}],
  33784. 205: [function(e, t, i) {
  33785. "use strict";
  33786. function n(e, t) {
  33787. return Object.prototype.hasOwnProperty.call(e, t)
  33788. }
  33789. t.exports = function(e, t, i, o) {
  33790. t = t || "&",
  33791. i = i || "=";
  33792. var a = {};
  33793. if ("string" != typeof e || 0 === e.length)
  33794. return a;
  33795. var s = /\+/g;
  33796. e = e.split(t);
  33797. var l = 1e3;
  33798. o && "number" == typeof o.maxKeys && (l = o.maxKeys);
  33799. var c = e.length;
  33800. l > 0 && c > l && (c = l);
  33801. for (var h = 0; h < c; ++h) {
  33802. var u, d, p, f, g = e[h].replace(s, "%20"), m = g.indexOf(i);
  33803. m >= 0 ? (u = g.substr(0, m),
  33804. d = g.substr(m + 1)) : (u = g,
  33805. d = ""),
  33806. p = decodeURIComponent(u),
  33807. f = decodeURIComponent(d),
  33808. n(a, p) ? r(a[p]) ? a[p].push(f) : a[p] = [a[p], f] : a[p] = f
  33809. }
  33810. return a
  33811. }
  33812. ;
  33813. var r = Array.isArray || function(e) {
  33814. return "[object Array]" === Object.prototype.toString.call(e)
  33815. }
  33816. }
  33817. , {}],
  33818. 206: [function(e, t, i) {
  33819. "use strict";
  33820. function n(e, t) {
  33821. if (e.map)
  33822. return e.map(t);
  33823. for (var i = [], n = 0; n < e.length; n++)
  33824. i.push(t(e[n], n));
  33825. return i
  33826. }
  33827. var r = function(e) {
  33828. switch (typeof e) {
  33829. case "string":
  33830. return e;
  33831. case "boolean":
  33832. return e ? "true" : "false";
  33833. case "number":
  33834. return isFinite(e) ? e : "";
  33835. default:
  33836. return ""
  33837. }
  33838. };
  33839. t.exports = function(e, t, i, s) {
  33840. return t = t || "&",
  33841. i = i || "=",
  33842. null === e && (e = void 0),
  33843. "object" == typeof e ? n(a(e), function(a) {
  33844. var s = encodeURIComponent(r(a)) + i;
  33845. return o(e[a]) ? n(e[a], function(e) {
  33846. return s + encodeURIComponent(r(e))
  33847. }).join(t) : s + encodeURIComponent(r(e[a]))
  33848. }).join(t) : s ? encodeURIComponent(r(s)) + i + encodeURIComponent(r(e)) : ""
  33849. }
  33850. ;
  33851. var o = Array.isArray || function(e) {
  33852. return "[object Array]" === Object.prototype.toString.call(e)
  33853. }
  33854. , a = Object.keys || function(e) {
  33855. var t = [];
  33856. for (var i in e)
  33857. Object.prototype.hasOwnProperty.call(e, i) && t.push(i);
  33858. return t
  33859. }
  33860. }
  33861. , {}],
  33862. 207: [function(e, t, i) {
  33863. "use strict";
  33864. i.decode = i.parse = e("./decode"),
  33865. i.encode = i.stringify = e("./encode")
  33866. }
  33867. , {
  33868. "./decode": 205,
  33869. "./encode": 206
  33870. }],
  33871. 208: [function(e, t, i) {
  33872. "use strict";
  33873. function n() {
  33874. this.protocol = null,
  33875. this.slashes = null,
  33876. this.auth = null,
  33877. this.host = null,
  33878. this.port = null,
  33879. this.hostname = null,
  33880. this.hash = null,
  33881. this.search = null,
  33882. this.query = null,
  33883. this.pathname = null,
  33884. this.path = null,
  33885. this.href = null
  33886. }
  33887. function r(e, t, i) {
  33888. if (e && c.isObject(e) && e instanceof n)
  33889. return e;
  33890. var r = new n;
  33891. return r.parse(e, t, i),
  33892. r
  33893. }
  33894. function o(e) {
  33895. return c.isString(e) && (e = r(e)),
  33896. e instanceof n ? e.format() : n.prototype.format.call(e)
  33897. }
  33898. function a(e, t) {
  33899. return r(e, !1, !0).resolve(t)
  33900. }
  33901. function s(e, t) {
  33902. return e ? r(e, !1, !0).resolveObject(t) : t
  33903. }
  33904. var l = e("punycode")
  33905. , c = e("./util");
  33906. i.parse = r,
  33907. i.resolve = a,
  33908. i.resolveObject = s,
  33909. i.format = o,
  33910. i.Url = n;
  33911. var h = /^([a-z0-9.+-]+:)/i
  33912. , u = /:[0-9]*$/
  33913. , d = /^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/
  33914. , p = ["<", ">", '"', "`", " ", "\r", "\n", "\t"]
  33915. , f = ["{", "}", "|", "\\", "^", "`"].concat(p)
  33916. , g = ["'"].concat(f)
  33917. , m = ["%", "/", "?", ";", "#"].concat(g)
  33918. , v = ["/", "?", "#"]
  33919. , A = 255
  33920. , y = /^[+a-z0-9A-Z_-]{0,63}$/
  33921. , C = /^([+a-z0-9A-Z_-]{0,63})(.*)$/
  33922. , I = {
  33923. javascript: !0,
  33924. "javascript:": !0
  33925. }
  33926. , E = {
  33927. javascript: !0,
  33928. "javascript:": !0
  33929. }
  33930. , b = {
  33931. http: !0,
  33932. https: !0,
  33933. ftp: !0,
  33934. gopher: !0,
  33935. file: !0,
  33936. "http:": !0,
  33937. "https:": !0,
  33938. "ftp:": !0,
  33939. "gopher:": !0,
  33940. "file:": !0
  33941. }
  33942. , w = e("querystring");
  33943. n.prototype.parse = function(e, t, i) {
  33944. if (!c.isString(e))
  33945. throw new TypeError("Parameter 'url' must be a string, not " + typeof e);
  33946. var n = e.indexOf("?")
  33947. , r = n !== -1 && n < e.indexOf("#") ? "?" : "#"
  33948. , o = e.split(r)
  33949. , a = /\\/g;
  33950. o[0] = o[0].replace(a, "/"),
  33951. e = o.join(r);
  33952. var s = e;
  33953. if (s = s.trim(),
  33954. !i && 1 === e.split("#").length) {
  33955. var u = d.exec(s);
  33956. if (u)
  33957. return this.path = s,
  33958. this.href = s,
  33959. this.pathname = u[1],
  33960. u[2] ? (this.search = u[2],
  33961. t ? this.query = w.parse(this.search.substr(1)) : this.query = this.search.substr(1)) : t && (this.search = "",
  33962. this.query = {}),
  33963. this
  33964. }
  33965. var p = h.exec(s);
  33966. if (p) {
  33967. p = p[0];
  33968. var f = p.toLowerCase();
  33969. this.protocol = f,
  33970. s = s.substr(p.length)
  33971. }
  33972. if (i || p || s.match(/^\/\/[^@\/]+@[^@\/]+/)) {
  33973. var _ = "//" === s.substr(0, 2);
  33974. !_ || p && E[p] || (s = s.substr(2),
  33975. this.slashes = !0)
  33976. }
  33977. if (!E[p] && (_ || p && !b[p])) {
  33978. for (var T = -1, x = 0; x < v.length; x++) {
  33979. var S = s.indexOf(v[x]);
  33980. S !== -1 && (T === -1 || S < T) && (T = S)
  33981. }
  33982. var M, R;
  33983. R = T === -1 ? s.lastIndexOf("@") : s.lastIndexOf("@", T),
  33984. R !== -1 && (M = s.slice(0, R),
  33985. s = s.slice(R + 1),
  33986. this.auth = decodeURIComponent(M)),
  33987. T = -1;
  33988. for (var x = 0; x < m.length; x++) {
  33989. var S = s.indexOf(m[x]);
  33990. S !== -1 && (T === -1 || S < T) && (T = S)
  33991. }
  33992. T === -1 && (T = s.length),
  33993. this.host = s.slice(0, T),
  33994. s = s.slice(T),
  33995. this.parseHost(),
  33996. this.hostname = this.hostname || "";
  33997. var P = "[" === this.hostname[0] && "]" === this.hostname[this.hostname.length - 1];
  33998. if (!P)
  33999. for (var O = this.hostname.split(/\./), x = 0, L = O.length; x < L; x++) {
  34000. var D = O[x];
  34001. if (D && !D.match(y)) {
  34002. for (var N = "", B = 0, F = D.length; B < F; B++)
  34003. N += D.charCodeAt(B) > 127 ? "x" : D[B];
  34004. if (!N.match(y)) {
  34005. var V = O.slice(0, x)
  34006. , U = O.slice(x + 1)
  34007. , k = D.match(C);
  34008. k && (V.push(k[1]),
  34009. U.unshift(k[2])),
  34010. U.length && (s = "/" + U.join(".") + s),
  34011. this.hostname = V.join(".");
  34012. break
  34013. }
  34014. }
  34015. }
  34016. this.hostname.length > A ? this.hostname = "" : this.hostname = this.hostname.toLowerCase(),
  34017. P || (this.hostname = l.toASCII(this.hostname));
  34018. var H = this.port ? ":" + this.port : ""
  34019. , G = this.hostname || "";
  34020. this.host = G + H,
  34021. this.href += this.host,
  34022. P && (this.hostname = this.hostname.substr(1, this.hostname.length - 2),
  34023. "/" !== s[0] && (s = "/" + s))
  34024. }
  34025. if (!I[f])
  34026. for (var x = 0, L = g.length; x < L; x++) {
  34027. var z = g[x];
  34028. if (s.indexOf(z) !== -1) {
  34029. var W = encodeURIComponent(z);
  34030. W === z && (W = escape(z)),
  34031. s = s.split(z).join(W)
  34032. }
  34033. }
  34034. var j = s.indexOf("#");
  34035. j !== -1 && (this.hash = s.substr(j),
  34036. s = s.slice(0, j));
  34037. var Y = s.indexOf("?");
  34038. if (Y !== -1 ? (this.search = s.substr(Y),
  34039. this.query = s.substr(Y + 1),
  34040. t && (this.query = w.parse(this.query)),
  34041. s = s.slice(0, Y)) : t && (this.search = "",
  34042. this.query = {}),
  34043. s && (this.pathname = s),
  34044. b[f] && this.hostname && !this.pathname && (this.pathname = "/"),
  34045. this.pathname || this.search) {
  34046. var H = this.pathname || ""
  34047. , X = this.search || "";
  34048. this.path = H + X
  34049. }
  34050. return this.href = this.format(),
  34051. this
  34052. }
  34053. ,
  34054. n.prototype.format = function() {
  34055. var e = this.auth || "";
  34056. e && (e = encodeURIComponent(e),
  34057. e = e.replace(/%3A/i, ":"),
  34058. e += "@");
  34059. var t = this.protocol || ""
  34060. , i = this.pathname || ""
  34061. , n = this.hash || ""
  34062. , r = !1
  34063. , o = "";
  34064. this.host ? r = e + this.host : this.hostname && (r = e + (this.hostname.indexOf(":") === -1 ? this.hostname : "[" + this.hostname + "]"),
  34065. this.port && (r += ":" + this.port)),
  34066. this.query && c.isObject(this.query) && Object.keys(this.query).length && (o = w.stringify(this.query));
  34067. var a = this.search || o && "?" + o || "";
  34068. return t && ":" !== t.substr(-1) && (t += ":"),
  34069. this.slashes || (!t || b[t]) && r !== !1 ? (r = "//" + (r || ""),
  34070. i && "/" !== i.charAt(0) && (i = "/" + i)) : r || (r = ""),
  34071. n && "#" !== n.charAt(0) && (n = "#" + n),
  34072. a && "?" !== a.charAt(0) && (a = "?" + a),
  34073. i = i.replace(/[?#]/g, function(e) {
  34074. return encodeURIComponent(e)
  34075. }),
  34076. a = a.replace("#", "%23"),
  34077. t + r + i + a + n
  34078. }
  34079. ,
  34080. n.prototype.resolve = function(e) {
  34081. return this.resolveObject(r(e, !1, !0)).format()
  34082. }
  34083. ,
  34084. n.prototype.resolveObject = function(e) {
  34085. if (c.isString(e)) {
  34086. var t = new n;
  34087. t.parse(e, !1, !0),
  34088. e = t
  34089. }
  34090. for (var i = new n, r = Object.keys(this), o = 0; o < r.length; o++) {
  34091. var a = r[o];
  34092. i[a] = this[a]
  34093. }
  34094. if (i.hash = e.hash,
  34095. "" === e.href)
  34096. return i.href = i.format(),
  34097. i;
  34098. if (e.slashes && !e.protocol) {
  34099. for (var s = Object.keys(e), l = 0; l < s.length; l++) {
  34100. var h = s[l];
  34101. "protocol" !== h && (i[h] = e[h])
  34102. }
  34103. return b[i.protocol] && i.hostname && !i.pathname && (i.path = i.pathname = "/"),
  34104. i.href = i.format(),
  34105. i
  34106. }
  34107. if (e.protocol && e.protocol !== i.protocol) {
  34108. if (!b[e.protocol]) {
  34109. for (var u = Object.keys(e), d = 0; d < u.length; d++) {
  34110. var p = u[d];
  34111. i[p] = e[p]
  34112. }
  34113. return i.href = i.format(),
  34114. i
  34115. }
  34116. if (i.protocol = e.protocol,
  34117. e.host || E[e.protocol])
  34118. i.pathname = e.pathname;
  34119. else {
  34120. for (var f = (e.pathname || "").split("/"); f.length && !(e.host = f.shift()); )
  34121. ;
  34122. e.host || (e.host = ""),
  34123. e.hostname || (e.hostname = ""),
  34124. "" !== f[0] && f.unshift(""),
  34125. f.length < 2 && f.unshift(""),
  34126. i.pathname = f.join("/")
  34127. }
  34128. if (i.search = e.search,
  34129. i.query = e.query,
  34130. i.host = e.host || "",
  34131. i.auth = e.auth,
  34132. i.hostname = e.hostname || e.host,
  34133. i.port = e.port,
  34134. i.pathname || i.search) {
  34135. var g = i.pathname || ""
  34136. , m = i.search || "";
  34137. i.path = g + m
  34138. }
  34139. return i.slashes = i.slashes || e.slashes,
  34140. i.href = i.format(),
  34141. i
  34142. }
  34143. var v = i.pathname && "/" === i.pathname.charAt(0)
  34144. , A = e.host || e.pathname && "/" === e.pathname.charAt(0)
  34145. , y = A || v || i.host && e.pathname
  34146. , C = y
  34147. , I = i.pathname && i.pathname.split("/") || []
  34148. , f = e.pathname && e.pathname.split("/") || []
  34149. , w = i.protocol && !b[i.protocol];
  34150. if (w && (i.hostname = "",
  34151. i.port = null,
  34152. i.host && ("" === I[0] ? I[0] = i.host : I.unshift(i.host)),
  34153. i.host = "",
  34154. e.protocol && (e.hostname = null,
  34155. e.port = null,
  34156. e.host && ("" === f[0] ? f[0] = e.host : f.unshift(e.host)),
  34157. e.host = null),
  34158. y = y && ("" === f[0] || "" === I[0])),
  34159. A)
  34160. i.host = e.host || "" === e.host ? e.host : i.host,
  34161. i.hostname = e.hostname || "" === e.hostname ? e.hostname : i.hostname,
  34162. i.search = e.search,
  34163. i.query = e.query,
  34164. I = f;
  34165. else if (f.length)
  34166. I || (I = []),
  34167. I.pop(),
  34168. I = I.concat(f),
  34169. i.search = e.search,
  34170. i.query = e.query;
  34171. else if (!c.isNullOrUndefined(e.search)) {
  34172. if (w) {
  34173. i.hostname = i.host = I.shift();
  34174. var _ = !!(i.host && i.host.indexOf("@") > 0) && i.host.split("@");
  34175. _ && (i.auth = _.shift(),
  34176. i.host = i.hostname = _.shift())
  34177. }
  34178. return i.search = e.search,
  34179. i.query = e.query,
  34180. c.isNull(i.pathname) && c.isNull(i.search) || (i.path = (i.pathname ? i.pathname : "") + (i.search ? i.search : "")),
  34181. i.href = i.format(),
  34182. i
  34183. }
  34184. if (!I.length)
  34185. return i.pathname = null,
  34186. i.search ? i.path = "/" + i.search : i.path = null,
  34187. i.href = i.format(),
  34188. i;
  34189. 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--)
  34190. T = I[M],
  34191. "." === T ? I.splice(M, 1) : ".." === T ? (I.splice(M, 1),
  34192. S++) : S && (I.splice(M, 1),
  34193. S--);
  34194. if (!y && !C)
  34195. for (; S--; S)
  34196. I.unshift("..");
  34197. !y || "" === I[0] || I[0] && "/" === I[0].charAt(0) || I.unshift(""),
  34198. x && "/" !== I.join("/").substr(-1) && I.push("");
  34199. var R = "" === I[0] || I[0] && "/" === I[0].charAt(0);
  34200. if (w) {
  34201. i.hostname = i.host = R ? "" : I.length ? I.shift() : "";
  34202. var _ = !!(i.host && i.host.indexOf("@") > 0) && i.host.split("@");
  34203. _ && (i.auth = _.shift(),
  34204. i.host = i.hostname = _.shift())
  34205. }
  34206. return y = y || i.host && I.length,
  34207. y && !R && I.unshift(""),
  34208. I.length ? i.pathname = I.join("/") : (i.pathname = null,
  34209. i.path = null),
  34210. c.isNull(i.pathname) && c.isNull(i.search) || (i.path = (i.pathname ? i.pathname : "") + (i.search ? i.search : "")),
  34211. i.auth = e.auth || i.auth,
  34212. i.slashes = i.slashes || e.slashes,
  34213. i.href = i.format(),
  34214. i
  34215. }
  34216. ,
  34217. n.prototype.parseHost = function() {
  34218. var e = this.host
  34219. , t = u.exec(e);
  34220. t && (t = t[0],
  34221. ":" !== t && (this.port = t.substr(1)),
  34222. e = e.substr(0, e.length - t.length)),
  34223. e && (this.hostname = e)
  34224. }
  34225. }
  34226. , {
  34227. "./util": 209,
  34228. punycode: 204,
  34229. querystring: 207
  34230. }],
  34231. 209: [function(e, t, i) {
  34232. "use strict";
  34233. t.exports = {
  34234. isString: function(e) {
  34235. return "string" == typeof e
  34236. },
  34237. isObject: function(e) {
  34238. return "object" == typeof e && null !== e
  34239. },
  34240. isNull: function(e) {
  34241. return null === e
  34242. },
  34243. isNullOrUndefined: function(e) {
  34244. return null == e
  34245. }
  34246. }
  34247. }
  34248. , {}],
  34249. 210: [function(e, t, i) {
  34250. "use strict";
  34251. function n(e) {
  34252. return l + e
  34253. }
  34254. function r(e) {
  34255. return e.substring(l.length)
  34256. }
  34257. function o(e, t) {
  34258. for (var i in t)
  34259. Object.defineProperty(e, i, {
  34260. value: t[i],
  34261. configurable: !0,
  34262. writable: !0
  34263. })
  34264. }
  34265. function a(e) {
  34266. if ("string" != typeof e)
  34267. throw new TypeError("key must be a string.")
  34268. }
  34269. var s = Object.prototype.hasOwnProperty
  34270. , l = "~";
  34271. t.exports = function(e) {
  34272. var t = Object.create(null)
  34273. , i = 0
  34274. , l = {};
  34275. return o(l, {
  34276. get: function(e, i) {
  34277. a(e);
  34278. var r = n(e);
  34279. return r in t ? t[r] : i
  34280. },
  34281. set: function(e, r) {
  34282. a(e);
  34283. var o = n(e);
  34284. return o in t || ++i,
  34285. t[o] = r
  34286. },
  34287. has: function(e) {
  34288. return a(e),
  34289. n(e)in t
  34290. },
  34291. delete: function(e) {
  34292. a(e);
  34293. var r = n(e);
  34294. return r in t && (--i,
  34295. delete t[r],
  34296. !0)
  34297. },
  34298. clear: function() {
  34299. t = Object.create(null),
  34300. i = 0
  34301. },
  34302. forEach: function(e, i) {
  34303. if ("function" != typeof e)
  34304. throw new TypeError("`callback` must be a function");
  34305. for (var n in t)
  34306. if (s.call(t, n)) {
  34307. var o = r(n)
  34308. , a = t[n];
  34309. e.call(i, a, o, l)
  34310. }
  34311. }
  34312. }),
  34313. Object.defineProperty(l, "size", {
  34314. get: function() {
  34315. return i
  34316. },
  34317. configurable: !0
  34318. }),
  34319. "object" == typeof e && null !== e && Object.keys(e).forEach(function(t) {
  34320. l.set(t, e[t])
  34321. }),
  34322. l
  34323. }
  34324. }
  34325. , {}],
  34326. 211: [function(e, t, i) {
  34327. t.exports = e("./lib/heap")
  34328. }
  34329. , {
  34330. "./lib/heap": 212
  34331. }],
  34332. 212: [function(e, t, i) {
  34333. (function() {
  34334. var e, n, r, o, a, s, l, c, h, u, d, p, f, g, m;
  34335. r = Math.floor,
  34336. u = Math.min,
  34337. n = function(e, t) {
  34338. return e < t ? -1 : e > t ? 1 : 0
  34339. }
  34340. ,
  34341. h = function(e, t, i, o, a) {
  34342. var s;
  34343. if (null == i && (i = 0),
  34344. null == a && (a = n),
  34345. i < 0)
  34346. throw new Error("lo must be non-negative");
  34347. for (null == o && (o = e.length); i < o; )
  34348. s = r((i + o) / 2),
  34349. a(t, e[s]) < 0 ? o = s : i = s + 1;
  34350. return [].splice.apply(e, [i, i - i].concat(t)),
  34351. t
  34352. }
  34353. ,
  34354. s = function(e, t, i) {
  34355. return null == i && (i = n),
  34356. e.push(t),
  34357. g(e, 0, e.length - 1, i)
  34358. }
  34359. ,
  34360. a = function(e, t) {
  34361. var i, r;
  34362. return null == t && (t = n),
  34363. i = e.pop(),
  34364. e.length ? (r = e[0],
  34365. e[0] = i,
  34366. m(e, 0, t)) : r = i,
  34367. r
  34368. }
  34369. ,
  34370. c = function(e, t, i) {
  34371. var r;
  34372. return null == i && (i = n),
  34373. r = e[0],
  34374. e[0] = t,
  34375. m(e, 0, i),
  34376. r
  34377. }
  34378. ,
  34379. l = function(e, t, i) {
  34380. var r;
  34381. return null == i && (i = n),
  34382. e.length && i(e[0], t) < 0 && (r = [e[0], t],
  34383. t = r[0],
  34384. e[0] = r[1],
  34385. m(e, 0, i)),
  34386. t
  34387. }
  34388. ,
  34389. o = function(e, t) {
  34390. var i, o, a, s, l, c;
  34391. for (null == t && (t = n),
  34392. s = function() {
  34393. c = [];
  34394. for (var t = 0, i = r(e.length / 2); 0 <= i ? t < i : t > i; 0 <= i ? t++ : t--)
  34395. c.push(t);
  34396. return c
  34397. }
  34398. .apply(this).reverse(),
  34399. l = [],
  34400. o = 0,
  34401. a = s.length; o < a; o++)
  34402. i = s[o],
  34403. l.push(m(e, i, t));
  34404. return l
  34405. }
  34406. ,
  34407. f = function(e, t, i) {
  34408. var r;
  34409. if (null == i && (i = n),
  34410. r = e.indexOf(t),
  34411. r !== -1)
  34412. return g(e, 0, r, i),
  34413. m(e, r, i)
  34414. }
  34415. ,
  34416. d = function(e, t, i) {
  34417. var r, a, s, c, h;
  34418. if (null == i && (i = n),
  34419. a = e.slice(0, t),
  34420. !a.length)
  34421. return a;
  34422. for (o(a, i),
  34423. h = e.slice(t),
  34424. s = 0,
  34425. c = h.length; s < c; s++)
  34426. r = h[s],
  34427. l(a, r, i);
  34428. return a.sort(i).reverse()
  34429. }
  34430. ,
  34431. p = function(e, t, i) {
  34432. var r, s, l, c, d, p, f, g, m, v;
  34433. if (null == i && (i = n),
  34434. 10 * t <= e.length) {
  34435. if (c = e.slice(0, t).sort(i),
  34436. !c.length)
  34437. return c;
  34438. for (l = c[c.length - 1],
  34439. g = e.slice(t),
  34440. d = 0,
  34441. f = g.length; d < f; d++)
  34442. r = g[d],
  34443. i(r, l) < 0 && (h(c, r, 0, null, i),
  34444. c.pop(),
  34445. l = c[c.length - 1]);
  34446. return c
  34447. }
  34448. for (o(e, i),
  34449. v = [],
  34450. s = p = 0,
  34451. m = u(t, e.length); 0 <= m ? p < m : p > m; s = 0 <= m ? ++p : --p)
  34452. v.push(a(e, i));
  34453. return v
  34454. }
  34455. ,
  34456. g = function(e, t, i, r) {
  34457. var o, a, s;
  34458. for (null == r && (r = n),
  34459. o = e[i]; i > t && (s = i - 1 >> 1,
  34460. a = e[s],
  34461. r(o, a) < 0); )
  34462. e[i] = a,
  34463. i = s;
  34464. return e[i] = o
  34465. }
  34466. ,
  34467. m = function(e, t, i) {
  34468. var r, o, a, s, l;
  34469. for (null == i && (i = n),
  34470. o = e.length,
  34471. l = t,
  34472. a = e[t],
  34473. r = 2 * t + 1; r < o; )
  34474. s = r + 1,
  34475. s < o && !(i(e[r], e[s]) < 0) && (r = s),
  34476. e[t] = e[r],
  34477. t = r,
  34478. r = 2 * t + 1;
  34479. return e[t] = a,
  34480. g(e, l, t, i)
  34481. }
  34482. ,
  34483. e = function() {
  34484. function e(e) {
  34485. this.cmp = null != e ? e : n,
  34486. this.nodes = []
  34487. }
  34488. return e.push = s,
  34489. e.pop = a,
  34490. e.replace = c,
  34491. e.pushpop = l,
  34492. e.heapify = o,
  34493. e.updateItem = f,
  34494. e.nlargest = d,
  34495. e.nsmallest = p,
  34496. e.prototype.push = function(e) {
  34497. return s(this.nodes, e, this.cmp)
  34498. }
  34499. ,
  34500. e.prototype.pop = function() {
  34501. return a(this.nodes, this.cmp)
  34502. }
  34503. ,
  34504. e.prototype.peek = function() {
  34505. return this.nodes[0]
  34506. }
  34507. ,
  34508. e.prototype.contains = function(e) {
  34509. return this.nodes.indexOf(e) !== -1
  34510. }
  34511. ,
  34512. e.prototype.replace = function(e) {
  34513. return c(this.nodes, e, this.cmp)
  34514. }
  34515. ,
  34516. e.prototype.pushpop = function(e) {
  34517. return l(this.nodes, e, this.cmp)
  34518. }
  34519. ,
  34520. e.prototype.heapify = function() {
  34521. return o(this.nodes, this.cmp)
  34522. }
  34523. ,
  34524. e.prototype.updateItem = function(e) {
  34525. return f(this.nodes, e, this.cmp)
  34526. }
  34527. ,
  34528. e.prototype.clear = function() {
  34529. return this.nodes = []
  34530. }
  34531. ,
  34532. e.prototype.empty = function() {
  34533. return 0 === this.nodes.length
  34534. }
  34535. ,
  34536. e.prototype.size = function() {
  34537. return this.nodes.length
  34538. }
  34539. ,
  34540. e.prototype.clone = function() {
  34541. var t;
  34542. return t = new e,
  34543. t.nodes = this.nodes.slice(0),
  34544. t
  34545. }
  34546. ,
  34547. e.prototype.toArray = function() {
  34548. return this.nodes.slice(0)
  34549. }
  34550. ,
  34551. e.prototype.insert = e.prototype.push,
  34552. e.prototype.top = e.prototype.peek,
  34553. e.prototype.front = e.prototype.peek,
  34554. e.prototype.has = e.prototype.contains,
  34555. e.prototype.copy = e.prototype.clone,
  34556. e
  34557. }(),
  34558. function(e, n) {
  34559. return "function" == typeof define && define.amd ? define([], n) : "object" == typeof i ? t.exports = n() : e.Heap = n()
  34560. }(this, function() {
  34561. return e
  34562. })
  34563. }
  34564. ).call(this)
  34565. }
  34566. , {}],
  34567. 213: [function(e, t, i) {
  34568. !function(e) {
  34569. function i() {}
  34570. function n(e, t) {
  34571. return function() {
  34572. e.apply(t, arguments)
  34573. }
  34574. }
  34575. function r(e) {
  34576. if ("object" != typeof this)
  34577. throw new TypeError("Promises must be constructed via new");
  34578. if ("function" != typeof e)
  34579. throw new TypeError("not a function");
  34580. this._state = 0,
  34581. this._handled = !1,
  34582. this._value = void 0,
  34583. this._deferreds = [],
  34584. h(e, this)
  34585. }
  34586. function o(e, t) {
  34587. for (; 3 === e._state; )
  34588. e = e._value;
  34589. return 0 === e._state ? void e._deferreds.push(t) : (e._handled = !0,
  34590. void r._immediateFn(function() {
  34591. var i = 1 === e._state ? t.onFulfilled : t.onRejected;
  34592. if (null === i)
  34593. return void (1 === e._state ? a : s)(t.promise, e._value);
  34594. var n;
  34595. try {
  34596. n = i(e._value)
  34597. } catch (e) {
  34598. return void s(t.promise, e)
  34599. }
  34600. a(t.promise, n)
  34601. }))
  34602. }
  34603. function a(e, t) {
  34604. try {
  34605. if (t === e)
  34606. throw new TypeError("A promise cannot be resolved with itself.");
  34607. if (t && ("object" == typeof t || "function" == typeof t)) {
  34608. var i = t.then;
  34609. if (t instanceof r)
  34610. return e._state = 3,
  34611. e._value = t,
  34612. void l(e);
  34613. if ("function" == typeof i)
  34614. return void h(n(i, t), e)
  34615. }
  34616. e._state = 1,
  34617. e._value = t,
  34618. l(e)
  34619. } catch (t) {
  34620. s(e, t)
  34621. }
  34622. }
  34623. function s(e, t) {
  34624. e._state = 2,
  34625. e._value = t,
  34626. l(e)
  34627. }
  34628. function l(e) {
  34629. 2 === e._state && 0 === e._deferreds.length && r._immediateFn(function() {
  34630. e._handled || r._unhandledRejectionFn(e._value)
  34631. });
  34632. for (var t = 0, i = e._deferreds.length; t < i; t++)
  34633. o(e, e._deferreds[t]);
  34634. e._deferreds = null
  34635. }
  34636. function c(e, t, i) {
  34637. this.onFulfilled = "function" == typeof e ? e : null,
  34638. this.onRejected = "function" == typeof t ? t : null,
  34639. this.promise = i
  34640. }
  34641. function h(e, t) {
  34642. var i = !1;
  34643. try {
  34644. e(function(e) {
  34645. i || (i = !0,
  34646. a(t, e))
  34647. }, function(e) {
  34648. i || (i = !0,
  34649. s(t, e))
  34650. })
  34651. } catch (e) {
  34652. if (i)
  34653. return;
  34654. i = !0,
  34655. s(t, e)
  34656. }
  34657. }
  34658. var u = setTimeout;
  34659. r.prototype.catch = function(e) {
  34660. return this.then(null, e)
  34661. }
  34662. ,
  34663. r.prototype.then = function(e, t) {
  34664. var n = new this.constructor(i);
  34665. return o(this, new c(e,t,n)),
  34666. n
  34667. }
  34668. ,
  34669. r.all = function(e) {
  34670. var t = Array.prototype.slice.call(e);
  34671. return new r(function(e, i) {
  34672. function n(o, a) {
  34673. try {
  34674. if (a && ("object" == typeof a || "function" == typeof a)) {
  34675. var s = a.then;
  34676. if ("function" == typeof s)
  34677. return void s.call(a, function(e) {
  34678. n(o, e)
  34679. }, i)
  34680. }
  34681. t[o] = a,
  34682. 0 === --r && e(t)
  34683. } catch (e) {
  34684. i(e)
  34685. }
  34686. }
  34687. if (0 === t.length)
  34688. return e([]);
  34689. for (var r = t.length, o = 0; o < t.length; o++)
  34690. n(o, t[o])
  34691. }
  34692. )
  34693. }
  34694. ,
  34695. r.resolve = function(e) {
  34696. return e && "object" == typeof e && e.constructor === r ? e : new r(function(t) {
  34697. t(e)
  34698. }
  34699. )
  34700. }
  34701. ,
  34702. r.reject = function(e) {
  34703. return new r(function(t, i) {
  34704. i(e)
  34705. }
  34706. )
  34707. }
  34708. ,
  34709. r.race = function(e) {
  34710. return new r(function(t, i) {
  34711. for (var n = 0, r = e.length; n < r; n++)
  34712. e[n].then(t, i)
  34713. }
  34714. )
  34715. }
  34716. ,
  34717. r._immediateFn = "function" == typeof setImmediate && function(e) {
  34718. setImmediate(e)
  34719. }
  34720. || function(e) {
  34721. u(e, 0)
  34722. }
  34723. ,
  34724. r._unhandledRejectionFn = function(e) {
  34725. "undefined" != typeof console && console && console.warn("Possible Unhandled Promise Rejection:", e)
  34726. }
  34727. ,
  34728. r._setImmediateFn = function(e) {
  34729. r._immediateFn = e
  34730. }
  34731. ,
  34732. r._setUnhandledRejectionFn = function(e) {
  34733. r._unhandledRejectionFn = e
  34734. }
  34735. ,
  34736. "undefined" != typeof t && t.exports ? t.exports = r : e.Promise || (e.Promise = r)
  34737. }(this)
  34738. }
  34739. , {}],
  34740. 214: [function(e, t, i) {
  34741. (function(i) {
  34742. !function(i, n) {
  34743. "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)
  34744. }(this, function(t, n) {
  34745. "use strict";
  34746. var r = {};
  34747. return r.ByteBuffer = t,
  34748. r.Long = t.Long || null,
  34749. r.VERSION = "5.0.1",
  34750. r.WIRE_TYPES = {},
  34751. r.WIRE_TYPES.VARINT = 0,
  34752. r.WIRE_TYPES.BITS64 = 1,
  34753. r.WIRE_TYPES.LDELIM = 2,
  34754. r.WIRE_TYPES.STARTGROUP = 3,
  34755. r.WIRE_TYPES.ENDGROUP = 4,
  34756. r.WIRE_TYPES.BITS32 = 5,
  34757. r.PACKABLE_WIRE_TYPES = [r.WIRE_TYPES.VARINT, r.WIRE_TYPES.BITS64, r.WIRE_TYPES.BITS32],
  34758. r.TYPES = {
  34759. int32: {
  34760. name: "int32",
  34761. wireType: r.WIRE_TYPES.VARINT,
  34762. defaultValue: 0
  34763. },
  34764. uint32: {
  34765. name: "uint32",
  34766. wireType: r.WIRE_TYPES.VARINT,
  34767. defaultValue: 0
  34768. },
  34769. sint32: {
  34770. name: "sint32",
  34771. wireType: r.WIRE_TYPES.VARINT,
  34772. defaultValue: 0
  34773. },
  34774. int64: {
  34775. name: "int64",
  34776. wireType: r.WIRE_TYPES.VARINT,
  34777. defaultValue: r.Long ? r.Long.ZERO : void 0
  34778. },
  34779. uint64: {
  34780. name: "uint64",
  34781. wireType: r.WIRE_TYPES.VARINT,
  34782. defaultValue: r.Long ? r.Long.UZERO : void 0
  34783. },
  34784. sint64: {
  34785. name: "sint64",
  34786. wireType: r.WIRE_TYPES.VARINT,
  34787. defaultValue: r.Long ? r.Long.ZERO : void 0
  34788. },
  34789. bool: {
  34790. name: "bool",
  34791. wireType: r.WIRE_TYPES.VARINT,
  34792. defaultValue: !1
  34793. },
  34794. double: {
  34795. name: "double",
  34796. wireType: r.WIRE_TYPES.BITS64,
  34797. defaultValue: 0
  34798. },
  34799. string: {
  34800. name: "string",
  34801. wireType: r.WIRE_TYPES.LDELIM,
  34802. defaultValue: ""
  34803. },
  34804. bytes: {
  34805. name: "bytes",
  34806. wireType: r.WIRE_TYPES.LDELIM,
  34807. defaultValue: null
  34808. },
  34809. fixed32: {
  34810. name: "fixed32",
  34811. wireType: r.WIRE_TYPES.BITS32,
  34812. defaultValue: 0
  34813. },
  34814. sfixed32: {
  34815. name: "sfixed32",
  34816. wireType: r.WIRE_TYPES.BITS32,
  34817. defaultValue: 0
  34818. },
  34819. fixed64: {
  34820. name: "fixed64",
  34821. wireType: r.WIRE_TYPES.BITS64,
  34822. defaultValue: r.Long ? r.Long.UZERO : void 0
  34823. },
  34824. sfixed64: {
  34825. name: "sfixed64",
  34826. wireType: r.WIRE_TYPES.BITS64,
  34827. defaultValue: r.Long ? r.Long.ZERO : void 0
  34828. },
  34829. float: {
  34830. name: "float",
  34831. wireType: r.WIRE_TYPES.BITS32,
  34832. defaultValue: 0
  34833. },
  34834. enum: {
  34835. name: "enum",
  34836. wireType: r.WIRE_TYPES.VARINT,
  34837. defaultValue: 0
  34838. },
  34839. message: {
  34840. name: "message",
  34841. wireType: r.WIRE_TYPES.LDELIM,
  34842. defaultValue: null
  34843. },
  34844. group: {
  34845. name: "group",
  34846. wireType: r.WIRE_TYPES.STARTGROUP,
  34847. defaultValue: null
  34848. }
  34849. },
  34850. 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],
  34851. r.ID_MIN = 1,
  34852. r.ID_MAX = 536870911,
  34853. r.convertFieldsToCamelCase = !1,
  34854. r.populateAccessors = !0,
  34855. r.populateDefaults = !0,
  34856. r.Util = function() {
  34857. var t = {};
  34858. return t.IS_NODE = !("object" != typeof i || i + "" != "[object process]" || i.browser),
  34859. t.XHR = function() {
  34860. for (var e = [function() {
  34861. return new XMLHttpRequest
  34862. }
  34863. , function() {
  34864. return new ActiveXObject("Msxml2.XMLHTTP")
  34865. }
  34866. , function() {
  34867. return new ActiveXObject("Msxml3.XMLHTTP")
  34868. }
  34869. , function() {
  34870. return new ActiveXObject("Microsoft.XMLHTTP")
  34871. }
  34872. ], t = null, i = 0; i < e.length; i++) {
  34873. try {
  34874. t = e[i]()
  34875. } catch (e) {
  34876. continue
  34877. }
  34878. break
  34879. }
  34880. if (!t)
  34881. throw Error("XMLHttpRequest is not supported");
  34882. return t
  34883. }
  34884. ,
  34885. t.fetch = function(i, n) {
  34886. if (n && "function" != typeof n && (n = null),
  34887. t.IS_NODE) {
  34888. var r = e("fs");
  34889. if (n)
  34890. r.readFile(i, function(e, t) {
  34891. n(e ? null : "" + t)
  34892. });
  34893. else
  34894. try {
  34895. return r.readFileSync(i)
  34896. } catch (e) {
  34897. return null
  34898. }
  34899. } else {
  34900. var o = t.XHR();
  34901. if (o.open("GET", i, !!n),
  34902. o.setRequestHeader("Accept", "text/plain"),
  34903. "function" == typeof o.overrideMimeType && o.overrideMimeType("text/plain"),
  34904. !n)
  34905. return o.send(null),
  34906. 200 == o.status || 0 == o.status && "string" == typeof o.responseText ? o.responseText : null;
  34907. if (o.onreadystatechange = function() {
  34908. 4 == o.readyState && n(200 == o.status || 0 == o.status && "string" == typeof o.responseText ? o.responseText : null)
  34909. }
  34910. ,
  34911. 4 == o.readyState)
  34912. return;
  34913. o.send(null)
  34914. }
  34915. }
  34916. ,
  34917. t.toCamelCase = function(e) {
  34918. return e.replace(/_([a-zA-Z])/g, function(e, t) {
  34919. return t.toUpperCase()
  34920. })
  34921. }
  34922. ,
  34923. t
  34924. }(),
  34925. r.Lang = {
  34926. DELIM: /[\s\{\}=;:\[\],'"\(\)<>]/g,
  34927. RULE: /^(?:required|optional|repeated|map)$/,
  34928. TYPE: /^(?:double|float|int32|uint32|sint32|int64|uint64|sint64|fixed32|sfixed32|fixed64|sfixed64|bool|string|bytes)$/,
  34929. NAME: /^[a-zA-Z_][a-zA-Z_0-9]*$/,
  34930. TYPEDEF: /^[a-zA-Z][a-zA-Z_0-9]*$/,
  34931. TYPEREF: /^(?:\.?[a-zA-Z_][a-zA-Z_0-9]*)+$/,
  34932. FQTYPEREF: /^(?:\.[a-zA-Z][a-zA-Z_0-9]*)+$/,
  34933. NUMBER: /^-?(?:[1-9][0-9]*|0|0[xX][0-9a-fA-F]+|0[0-7]+|([0-9]*(\.[0-9]*)?([Ee][+-]?[0-9]+)?)|inf|nan)$/,
  34934. NUMBER_DEC: /^(?:[1-9][0-9]*|0)$/,
  34935. NUMBER_HEX: /^0[xX][0-9a-fA-F]+$/,
  34936. NUMBER_OCT: /^0[0-7]+$/,
  34937. NUMBER_FLT: /^([0-9]*(\.[0-9]*)?([Ee][+-]?[0-9]+)?|inf|nan)$/,
  34938. BOOL: /^(?:true|false)$/i,
  34939. ID: /^(?:[1-9][0-9]*|0|0[xX][0-9a-fA-F]+|0[0-7]+)$/,
  34940. NEGID: /^\-?(?:[1-9][0-9]*|0|0[xX][0-9a-fA-F]+|0[0-7]+)$/,
  34941. WHITESPACE: /\s/,
  34942. STRING: /(?:"([^"\\]*(?:\\.[^"\\]*)*)")|(?:'([^'\\]*(?:\\.[^'\\]*)*)')/g,
  34943. STRING_DQ: /(?:"([^"\\]*(?:\\.[^"\\]*)*)")/g,
  34944. STRING_SQ: /(?:'([^'\\]*(?:\\.[^'\\]*)*)')/g
  34945. },
  34946. r.DotProto = function(e, t) {
  34947. function i(e, i) {
  34948. var n = -1
  34949. , r = 1;
  34950. if ("-" == e.charAt(0) && (r = -1,
  34951. e = e.substring(1)),
  34952. t.NUMBER_DEC.test(e))
  34953. n = parseInt(e);
  34954. else if (t.NUMBER_HEX.test(e))
  34955. n = parseInt(e.substring(2), 16);
  34956. else {
  34957. if (!t.NUMBER_OCT.test(e))
  34958. throw Error("illegal id value: " + (r < 0 ? "-" : "") + e);
  34959. n = parseInt(e.substring(1), 8)
  34960. }
  34961. if (n = r * n | 0,
  34962. !i && n < 0)
  34963. throw Error("illegal id value: " + (r < 0 ? "-" : "") + e);
  34964. return n
  34965. }
  34966. function n(e) {
  34967. var i = 1;
  34968. if ("-" == e.charAt(0) && (i = -1,
  34969. e = e.substring(1)),
  34970. t.NUMBER_DEC.test(e))
  34971. return i * parseInt(e, 10);
  34972. if (t.NUMBER_HEX.test(e))
  34973. return i * parseInt(e.substring(2), 16);
  34974. if (t.NUMBER_OCT.test(e))
  34975. return i * parseInt(e.substring(1), 8);
  34976. if ("inf" === e)
  34977. return i * (1 / 0);
  34978. if ("nan" === e)
  34979. return NaN;
  34980. if (t.NUMBER_FLT.test(e))
  34981. return i * parseFloat(e);
  34982. throw Error("illegal number value: " + (i < 0 ? "-" : "") + e)
  34983. }
  34984. function r(e, t, i) {
  34985. "undefined" == typeof e[t] ? e[t] = i : (Array.isArray(e[t]) || (e[t] = [e[t]]),
  34986. e[t].push(i))
  34987. }
  34988. var o = {}
  34989. , a = function(e) {
  34990. this.source = e + "",
  34991. this.index = 0,
  34992. this.line = 1,
  34993. this.stack = [],
  34994. this._stringOpen = null
  34995. }
  34996. , s = a.prototype;
  34997. s._readString = function() {
  34998. var e = '"' === this._stringOpen ? t.STRING_DQ : t.STRING_SQ;
  34999. e.lastIndex = this.index - 1;
  35000. var i = e.exec(this.source);
  35001. if (!i)
  35002. throw Error("unterminated string");
  35003. return this.index = e.lastIndex,
  35004. this.stack.push(this._stringOpen),
  35005. this._stringOpen = null,
  35006. i[1]
  35007. }
  35008. ,
  35009. s.next = function() {
  35010. if (this.stack.length > 0)
  35011. return this.stack.shift();
  35012. if (this.index >= this.source.length)
  35013. return null;
  35014. if (null !== this._stringOpen)
  35015. return this._readString();
  35016. var e, i, n;
  35017. do {
  35018. for (e = !1; t.WHITESPACE.test(n = this.source.charAt(this.index)); )
  35019. if ("\n" === n && ++this.line,
  35020. ++this.index === this.source.length)
  35021. return null;
  35022. if ("/" === this.source.charAt(this.index))
  35023. if (++this.index,
  35024. "/" === this.source.charAt(this.index)) {
  35025. for (; "\n" !== this.source.charAt(++this.index); )
  35026. if (this.index == this.source.length)
  35027. return null;
  35028. ++this.index,
  35029. ++this.line,
  35030. e = !0
  35031. } else {
  35032. if ("*" !== (n = this.source.charAt(this.index)))
  35033. return "/";
  35034. do {
  35035. if ("\n" === n && ++this.line,
  35036. ++this.index === this.source.length)
  35037. return null;
  35038. i = n,
  35039. n = this.source.charAt(this.index)
  35040. } while ("*" !== i || "/" !== n);++this.index,
  35041. e = !0
  35042. }
  35043. } while (e);if (this.index === this.source.length)
  35044. return null;
  35045. var r = this.index;
  35046. t.DELIM.lastIndex = 0;
  35047. var o = t.DELIM.test(this.source.charAt(r++));
  35048. if (!o)
  35049. for (; r < this.source.length && !t.DELIM.test(this.source.charAt(r)); )
  35050. ++r;
  35051. var a = this.source.substring(this.index, this.index = r);
  35052. return '"' !== a && "'" !== a || (this._stringOpen = a),
  35053. a
  35054. }
  35055. ,
  35056. s.peek = function() {
  35057. if (0 === this.stack.length) {
  35058. var e = this.next();
  35059. if (null === e)
  35060. return null;
  35061. this.stack.push(e)
  35062. }
  35063. return this.stack[0]
  35064. }
  35065. ,
  35066. s.skip = function(e) {
  35067. var t = this.next();
  35068. if (t !== e)
  35069. throw Error("illegal '" + t + "', '" + e + "' expected")
  35070. }
  35071. ,
  35072. s.omit = function(e) {
  35073. return this.peek() === e && (this.next(),
  35074. !0)
  35075. }
  35076. ,
  35077. s.toString = function() {
  35078. return "Tokenizer (" + this.index + "/" + this.source.length + " at line " + this.line + ")"
  35079. }
  35080. ,
  35081. o.Tokenizer = a;
  35082. var l = function(e) {
  35083. this.tn = new a(e),
  35084. this.proto3 = !1
  35085. }
  35086. , c = l.prototype;
  35087. return c.parse = function() {
  35088. var e, i, n = {
  35089. name: "[ROOT]",
  35090. package: null,
  35091. messages: [],
  35092. enums: [],
  35093. imports: [],
  35094. options: {},
  35095. services: []
  35096. }, r = !0;
  35097. try {
  35098. for (; e = this.tn.next(); )
  35099. switch (e) {
  35100. case "package":
  35101. if (!r || null !== n.package)
  35102. throw Error("unexpected 'package'");
  35103. if (e = this.tn.next(),
  35104. !t.TYPEREF.test(e))
  35105. throw Error("illegal package name: " + e);
  35106. this.tn.skip(";"),
  35107. n.package = e;
  35108. break;
  35109. case "import":
  35110. if (!r)
  35111. throw Error("unexpected 'import'");
  35112. e = this.tn.peek(),
  35113. ("public" === e || (i = "weak" === e)) && this.tn.next(),
  35114. e = this._readString(),
  35115. this.tn.skip(";"),
  35116. i || n.imports.push(e);
  35117. break;
  35118. case "syntax":
  35119. if (!r)
  35120. throw Error("unexpected 'syntax'");
  35121. this.tn.skip("="),
  35122. "proto3" === (n.syntax = this._readString()) && (this.proto3 = !0),
  35123. this.tn.skip(";");
  35124. break;
  35125. case "message":
  35126. this._parseMessage(n, null),
  35127. r = !1;
  35128. break;
  35129. case "enum":
  35130. this._parseEnum(n),
  35131. r = !1;
  35132. break;
  35133. case "option":
  35134. this._parseOption(n);
  35135. break;
  35136. case "service":
  35137. this._parseService(n);
  35138. break;
  35139. case "extend":
  35140. this._parseExtend(n);
  35141. break;
  35142. default:
  35143. throw Error("unexpected '" + e + "'")
  35144. }
  35145. } catch (e) {
  35146. throw e.message = "Parse error at line " + this.tn.line + ": " + e.message,
  35147. e
  35148. }
  35149. return delete n.name,
  35150. n
  35151. }
  35152. ,
  35153. l.parse = function(e) {
  35154. return new l(e).parse()
  35155. }
  35156. ,
  35157. c._readString = function() {
  35158. var e, t, i = "";
  35159. do {
  35160. if (t = this.tn.next(),
  35161. "'" !== t && '"' !== t)
  35162. throw Error("illegal string delimiter: " + t);
  35163. i += this.tn.next(),
  35164. this.tn.skip(t),
  35165. e = this.tn.peek()
  35166. } while ('"' === e || '"' === e);return i
  35167. }
  35168. ,
  35169. c._readValue = function(e) {
  35170. var i = this.tn.peek();
  35171. if ('"' === i || "'" === i)
  35172. return this._readString();
  35173. if (this.tn.next(),
  35174. t.NUMBER.test(i))
  35175. return n(i);
  35176. if (t.BOOL.test(i))
  35177. return "true" === i.toLowerCase();
  35178. if (e && t.TYPEREF.test(i))
  35179. return i;
  35180. throw Error("illegal value: " + i)
  35181. }
  35182. ,
  35183. c._parseOption = function(e, i) {
  35184. var n = this.tn.next()
  35185. , r = !1;
  35186. if ("(" === n && (r = !0,
  35187. n = this.tn.next()),
  35188. !t.TYPEREF.test(n))
  35189. throw Error("illegal option name: " + n);
  35190. var o = n;
  35191. r && (this.tn.skip(")"),
  35192. o = "(" + o + ")",
  35193. n = this.tn.peek(),
  35194. t.FQTYPEREF.test(n) && (o += n,
  35195. this.tn.next())),
  35196. this.tn.skip("="),
  35197. this._parseOptionValue(e, o),
  35198. i || this.tn.skip(";")
  35199. }
  35200. ,
  35201. c._parseOptionValue = function(e, i) {
  35202. var n = this.tn.peek();
  35203. if ("{" !== n)
  35204. r(e.options, i, this._readValue(!0));
  35205. else
  35206. for (this.tn.skip("{"); "}" !== (n = this.tn.next()); ) {
  35207. if (!t.NAME.test(n))
  35208. throw Error("illegal option name: " + i + "." + n);
  35209. this.tn.omit(":") ? r(e.options, i + "." + n, this._readValue(!0)) : this._parseOptionValue(e, i + "." + n)
  35210. }
  35211. }
  35212. ,
  35213. c._parseService = function(e) {
  35214. var i = this.tn.next();
  35215. if (!t.NAME.test(i))
  35216. throw Error("illegal service name at line " + this.tn.line + ": " + i);
  35217. var n = i
  35218. , r = {
  35219. name: n,
  35220. rpc: {},
  35221. options: {}
  35222. };
  35223. for (this.tn.skip("{"); "}" !== (i = this.tn.next()); )
  35224. if ("option" === i)
  35225. this._parseOption(r);
  35226. else {
  35227. if ("rpc" !== i)
  35228. throw Error("illegal service token: " + i);
  35229. this._parseServiceRPC(r)
  35230. }
  35231. this.tn.omit(";"),
  35232. e.services.push(r)
  35233. }
  35234. ,
  35235. c._parseServiceRPC = function(e) {
  35236. var i = "rpc"
  35237. , n = this.tn.next();
  35238. if (!t.NAME.test(n))
  35239. throw Error("illegal rpc service method name: " + n);
  35240. var r = n
  35241. , o = {
  35242. request: null,
  35243. response: null,
  35244. request_stream: !1,
  35245. response_stream: !1,
  35246. options: {}
  35247. };
  35248. if (this.tn.skip("("),
  35249. n = this.tn.next(),
  35250. "stream" === n.toLowerCase() && (o.request_stream = !0,
  35251. n = this.tn.next()),
  35252. !t.TYPEREF.test(n))
  35253. throw Error("illegal rpc service request type: " + n);
  35254. if (o.request = n,
  35255. this.tn.skip(")"),
  35256. n = this.tn.next(),
  35257. "returns" !== n.toLowerCase())
  35258. throw Error("illegal rpc service request type delimiter: " + n);
  35259. if (this.tn.skip("("),
  35260. n = this.tn.next(),
  35261. "stream" === n.toLowerCase() && (o.response_stream = !0,
  35262. n = this.tn.next()),
  35263. o.response = n,
  35264. this.tn.skip(")"),
  35265. n = this.tn.peek(),
  35266. "{" === n) {
  35267. for (this.tn.next(); "}" !== (n = this.tn.next()); ) {
  35268. if ("option" !== n)
  35269. throw Error("illegal rpc service token: " + n);
  35270. this._parseOption(o)
  35271. }
  35272. this.tn.omit(";")
  35273. } else
  35274. this.tn.skip(";");
  35275. "undefined" == typeof e[i] && (e[i] = {}),
  35276. e[i][r] = o
  35277. }
  35278. ,
  35279. c._parseMessage = function(e, n) {
  35280. var r = !!n
  35281. , o = this.tn.next()
  35282. , a = {
  35283. name: "",
  35284. fields: [],
  35285. enums: [],
  35286. messages: [],
  35287. options: {},
  35288. services: [],
  35289. oneofs: {}
  35290. };
  35291. if (!t.NAME.test(o))
  35292. throw Error("illegal " + (r ? "group" : "message") + " name: " + o);
  35293. for (a.name = o,
  35294. r && (this.tn.skip("="),
  35295. n.id = i(this.tn.next()),
  35296. a.isGroup = !0),
  35297. o = this.tn.peek(),
  35298. "[" === o && n && this._parseFieldOptions(n),
  35299. this.tn.skip("{"); "}" !== (o = this.tn.next()); )
  35300. if (t.RULE.test(o))
  35301. this._parseMessageField(a, o);
  35302. else if ("oneof" === o)
  35303. this._parseMessageOneOf(a);
  35304. else if ("enum" === o)
  35305. this._parseEnum(a);
  35306. else if ("message" === o)
  35307. this._parseMessage(a);
  35308. else if ("option" === o)
  35309. this._parseOption(a);
  35310. else if ("service" === o)
  35311. this._parseService(a);
  35312. else if ("extensions" === o)
  35313. a.extensions = this._parseExtensionRanges();
  35314. else if ("reserved" === o)
  35315. this._parseIgnored();
  35316. else if ("extend" === o)
  35317. this._parseExtend(a);
  35318. else {
  35319. if (!t.TYPEREF.test(o))
  35320. throw Error("illegal message token: " + o);
  35321. if (!this.proto3)
  35322. throw Error("illegal field rule: " + o);
  35323. this._parseMessageField(a, "optional", o)
  35324. }
  35325. return this.tn.omit(";"),
  35326. e.messages.push(a),
  35327. a
  35328. }
  35329. ,
  35330. c._parseIgnored = function() {
  35331. for (; ";" !== this.tn.peek(); )
  35332. this.tn.next();
  35333. this.tn.skip(";")
  35334. }
  35335. ,
  35336. c._parseMessageField = function(e, n, r) {
  35337. if (!t.RULE.test(n))
  35338. throw Error("illegal message field rule: " + n);
  35339. var o, a = {
  35340. rule: n,
  35341. type: "",
  35342. name: "",
  35343. options: {},
  35344. id: 0
  35345. };
  35346. if ("map" === n) {
  35347. if (r)
  35348. throw Error("illegal type: " + r);
  35349. if (this.tn.skip("<"),
  35350. o = this.tn.next(),
  35351. !t.TYPE.test(o) && !t.TYPEREF.test(o))
  35352. throw Error("illegal message field type: " + o);
  35353. if (a.keytype = o,
  35354. this.tn.skip(","),
  35355. o = this.tn.next(),
  35356. !t.TYPE.test(o) && !t.TYPEREF.test(o))
  35357. throw Error("illegal message field: " + o);
  35358. if (a.type = o,
  35359. this.tn.skip(">"),
  35360. o = this.tn.next(),
  35361. !t.NAME.test(o))
  35362. throw Error("illegal message field name: " + o);
  35363. a.name = o,
  35364. this.tn.skip("="),
  35365. a.id = i(this.tn.next()),
  35366. o = this.tn.peek(),
  35367. "[" === o && this._parseFieldOptions(a),
  35368. this.tn.skip(";")
  35369. } else if (r = "undefined" != typeof r ? r : this.tn.next(),
  35370. "group" === r) {
  35371. var s = this._parseMessage(e, a);
  35372. if (!/^[A-Z]/.test(s.name))
  35373. throw Error("illegal group name: " + s.name);
  35374. a.type = s.name,
  35375. a.name = s.name.toLowerCase(),
  35376. this.tn.omit(";")
  35377. } else {
  35378. if (!t.TYPE.test(r) && !t.TYPEREF.test(r))
  35379. throw Error("illegal message field type: " + r);
  35380. if (a.type = r,
  35381. o = this.tn.next(),
  35382. !t.NAME.test(o))
  35383. throw Error("illegal message field name: " + o);
  35384. a.name = o,
  35385. this.tn.skip("="),
  35386. a.id = i(this.tn.next()),
  35387. o = this.tn.peek(),
  35388. "[" === o && this._parseFieldOptions(a),
  35389. this.tn.skip(";")
  35390. }
  35391. return e.fields.push(a),
  35392. a
  35393. }
  35394. ,
  35395. c._parseMessageOneOf = function(e) {
  35396. var i = this.tn.next();
  35397. if (!t.NAME.test(i))
  35398. throw Error("illegal oneof name: " + i);
  35399. var n, r = i, o = [];
  35400. for (this.tn.skip("{"); "}" !== (i = this.tn.next()); )
  35401. n = this._parseMessageField(e, "optional", i),
  35402. n.oneof = r,
  35403. o.push(n.id);
  35404. this.tn.omit(";"),
  35405. e.oneofs[r] = o
  35406. }
  35407. ,
  35408. c._parseFieldOptions = function(e) {
  35409. this.tn.skip("[");
  35410. for (var t, i = !0; "]" !== (t = this.tn.peek()); )
  35411. i || this.tn.skip(","),
  35412. this._parseOption(e, !0),
  35413. i = !1;
  35414. this.tn.next()
  35415. }
  35416. ,
  35417. c._parseEnum = function(e) {
  35418. var n = {
  35419. name: "",
  35420. values: [],
  35421. options: {}
  35422. }
  35423. , r = this.tn.next();
  35424. if (!t.NAME.test(r))
  35425. throw Error("illegal name: " + r);
  35426. for (n.name = r,
  35427. this.tn.skip("{"); "}" !== (r = this.tn.next()); )
  35428. if ("option" === r)
  35429. this._parseOption(n);
  35430. else {
  35431. if (!t.NAME.test(r))
  35432. throw Error("illegal name: " + r);
  35433. this.tn.skip("=");
  35434. var o = {
  35435. name: r,
  35436. id: i(this.tn.next(), !0)
  35437. };
  35438. r = this.tn.peek(),
  35439. "[" === r && this._parseFieldOptions({
  35440. options: {}
  35441. }),
  35442. this.tn.skip(";"),
  35443. n.values.push(o)
  35444. }
  35445. this.tn.omit(";"),
  35446. e.enums.push(n)
  35447. }
  35448. ,
  35449. c._parseExtensionRanges = function() {
  35450. var t, i, r, o = [];
  35451. do {
  35452. for (i = []; ; ) {
  35453. switch (t = this.tn.next()) {
  35454. case "min":
  35455. r = e.ID_MIN;
  35456. break;
  35457. case "max":
  35458. r = e.ID_MAX;
  35459. break;
  35460. default:
  35461. r = n(t)
  35462. }
  35463. if (i.push(r),
  35464. 2 === i.length)
  35465. break;
  35466. if ("to" !== this.tn.peek()) {
  35467. i.push(r);
  35468. break
  35469. }
  35470. this.tn.next()
  35471. }
  35472. o.push(i)
  35473. } while (this.tn.omit(","));return this.tn.skip(";"),
  35474. o
  35475. }
  35476. ,
  35477. c._parseExtend = function(e) {
  35478. var i = this.tn.next();
  35479. if (!t.TYPEREF.test(i))
  35480. throw Error("illegal extend reference: " + i);
  35481. var n = {
  35482. ref: i,
  35483. fields: []
  35484. };
  35485. for (this.tn.skip("{"); "}" !== (i = this.tn.next()); )
  35486. if (t.RULE.test(i))
  35487. this._parseMessageField(n, i);
  35488. else {
  35489. if (!t.TYPEREF.test(i))
  35490. throw Error("illegal extend token: " + i);
  35491. if (!this.proto3)
  35492. throw Error("illegal field rule: " + i);
  35493. this._parseMessageField(n, "optional", i)
  35494. }
  35495. return this.tn.omit(";"),
  35496. e.messages.push(n),
  35497. n
  35498. }
  35499. ,
  35500. c.toString = function() {
  35501. return "Parser at line " + this.tn.line
  35502. }
  35503. ,
  35504. o.Parser = l,
  35505. o
  35506. }(r, r.Lang),
  35507. r.Reflect = function(e) {
  35508. function i(i) {
  35509. if ("string" == typeof i && (i = e.TYPES[i]),
  35510. "undefined" == typeof i.defaultValue)
  35511. throw Error("default value for type " + i.name + " is not supported");
  35512. return i == e.TYPES.bytes ? new t(0) : i.defaultValue
  35513. }
  35514. function n(t, i) {
  35515. if (t && "number" == typeof t.low && "number" == typeof t.high && "boolean" == typeof t.unsigned && t.low === t.low && t.high === t.high)
  35516. return new e.Long(t.low,t.high,"undefined" == typeof i ? t.unsigned : i);
  35517. if ("string" == typeof t)
  35518. return e.Long.fromString(t, i || !1, 10);
  35519. if ("number" == typeof t)
  35520. return e.Long.fromNumber(t, i || !1);
  35521. throw Error("not convertible to Long")
  35522. }
  35523. function r(t, i) {
  35524. var n = i.readVarint32()
  35525. , o = 7 & n
  35526. , a = n >>> 3;
  35527. switch (o) {
  35528. case e.WIRE_TYPES.VARINT:
  35529. do
  35530. n = i.readUint8();
  35531. while (128 === (128 & n));break;
  35532. case e.WIRE_TYPES.BITS64:
  35533. i.offset += 8;
  35534. break;
  35535. case e.WIRE_TYPES.LDELIM:
  35536. n = i.readVarint32(),
  35537. i.offset += n;
  35538. break;
  35539. case e.WIRE_TYPES.STARTGROUP:
  35540. r(a, i);
  35541. break;
  35542. case e.WIRE_TYPES.ENDGROUP:
  35543. if (a === t)
  35544. return !1;
  35545. throw Error("Illegal GROUPEND after unknown group: " + a + " (" + t + " expected)");
  35546. case e.WIRE_TYPES.BITS32:
  35547. i.offset += 4;
  35548. break;
  35549. default:
  35550. throw Error("Illegal wire type in unknown group " + t + ": " + o)
  35551. }
  35552. return !0
  35553. }
  35554. var o = {}
  35555. , a = function(e, t, i) {
  35556. this.builder = e,
  35557. this.parent = t,
  35558. this.name = i,
  35559. this.className
  35560. }
  35561. , s = a.prototype;
  35562. s.fqn = function() {
  35563. for (var e = this.name, t = this; ; ) {
  35564. if (t = t.parent,
  35565. null == t)
  35566. break;
  35567. e = t.name + "." + e
  35568. }
  35569. return e
  35570. }
  35571. ,
  35572. s.toString = function(e) {
  35573. return (e ? this.className + " " : "") + this.fqn()
  35574. }
  35575. ,
  35576. s.build = function() {
  35577. throw Error(this.toString(!0) + " cannot be built directly")
  35578. }
  35579. ,
  35580. o.T = a;
  35581. var l = function(e, t, i, n, r) {
  35582. a.call(this, e, t, i),
  35583. this.className = "Namespace",
  35584. this.children = [],
  35585. this.options = n || {},
  35586. this.syntax = r || "proto2"
  35587. }
  35588. , c = l.prototype = Object.create(a.prototype);
  35589. c.getChildren = function(e) {
  35590. if (e = e || null,
  35591. null == e)
  35592. return this.children.slice();
  35593. for (var t = [], i = 0, n = this.children.length; i < n; ++i)
  35594. this.children[i]instanceof e && t.push(this.children[i]);
  35595. return t
  35596. }
  35597. ,
  35598. c.addChild = function(e) {
  35599. var t;
  35600. if (t = this.getChild(e.name))
  35601. if (t instanceof d.Field && t.name !== t.originalName && null === this.getChild(t.originalName))
  35602. t.name = t.originalName;
  35603. else {
  35604. if (!(e instanceof d.Field && e.name !== e.originalName && null === this.getChild(e.originalName)))
  35605. throw Error("Duplicate name in namespace " + this.toString(!0) + ": " + e.name);
  35606. e.name = e.originalName
  35607. }
  35608. this.children.push(e)
  35609. }
  35610. ,
  35611. c.getChild = function(e) {
  35612. for (var t = "number" == typeof e ? "id" : "name", i = 0, n = this.children.length; i < n; ++i)
  35613. if (this.children[i][t] === e)
  35614. return this.children[i];
  35615. return null
  35616. }
  35617. ,
  35618. c.resolve = function(e, t) {
  35619. var i = "string" == typeof e ? e.split(".") : e
  35620. , n = this
  35621. , r = 0;
  35622. if ("" === i[r]) {
  35623. for (; null !== n.parent; )
  35624. n = n.parent;
  35625. r++
  35626. }
  35627. var a;
  35628. do {
  35629. do {
  35630. if (!(n instanceof o.Namespace)) {
  35631. n = null;
  35632. break
  35633. }
  35634. if (a = n.getChild(i[r]),
  35635. !a || !(a instanceof o.T) || t && !(a instanceof o.Namespace)) {
  35636. n = null;
  35637. break
  35638. }
  35639. n = a,
  35640. r++
  35641. } while (r < i.length);if (null != n)
  35642. break;
  35643. if (null !== this.parent)
  35644. return this.parent.resolve(e, t)
  35645. } while (null != n);return n
  35646. }
  35647. ,
  35648. c.qn = function(e) {
  35649. var t = []
  35650. , i = e;
  35651. do
  35652. t.unshift(i.name),
  35653. i = i.parent;
  35654. while (null !== i);for (var n = 1; n <= t.length; n++) {
  35655. var r = t.slice(t.length - n);
  35656. if (e === this.resolve(r, e instanceof o.Namespace))
  35657. return r.join(".")
  35658. }
  35659. return e.fqn()
  35660. }
  35661. ,
  35662. c.build = function() {
  35663. for (var e, t = {}, i = this.children, n = 0, r = i.length; n < r; ++n)
  35664. e = i[n],
  35665. e instanceof l && (t[e.name] = e.build());
  35666. return Object.defineProperty && Object.defineProperty(t, "$options", {
  35667. value: this.buildOpt()
  35668. }),
  35669. t
  35670. }
  35671. ,
  35672. c.buildOpt = function() {
  35673. for (var e = {}, t = Object.keys(this.options), i = 0, n = t.length; i < n; ++i) {
  35674. var r = t[i]
  35675. , o = this.options[t[i]];
  35676. e[r] = o
  35677. }
  35678. return e
  35679. }
  35680. ,
  35681. c.getOption = function(e) {
  35682. return "undefined" == typeof e ? this.options : "undefined" != typeof this.options[e] ? this.options[e] : null
  35683. }
  35684. ,
  35685. o.Namespace = l;
  35686. var h = function(t, i, n, r) {
  35687. if (this.type = t,
  35688. this.resolvedType = i,
  35689. this.isMapKey = n,
  35690. this.syntax = r,
  35691. n && e.MAP_KEY_TYPES.indexOf(t) < 0)
  35692. throw Error("Invalid map key type: " + t.name)
  35693. }
  35694. , u = h.prototype;
  35695. h.defaultFieldValue = i,
  35696. u.verifyValue = function(i) {
  35697. function r(e, t) {
  35698. throw Error("Illegal value for " + o.toString(!0) + " of type " + o.type.name + ": " + e + " (" + t + ")")
  35699. }
  35700. var o = this;
  35701. switch (this.type) {
  35702. case e.TYPES.int32:
  35703. case e.TYPES.sint32:
  35704. case e.TYPES.sfixed32:
  35705. return ("number" != typeof i || i === i && i % 1 !== 0) && r(typeof i, "not an integer"),
  35706. i > 4294967295 ? 0 | i : i;
  35707. case e.TYPES.uint32:
  35708. case e.TYPES.fixed32:
  35709. return ("number" != typeof i || i === i && i % 1 !== 0) && r(typeof i, "not an integer"),
  35710. i < 0 ? i >>> 0 : i;
  35711. case e.TYPES.int64:
  35712. case e.TYPES.sint64:
  35713. case e.TYPES.sfixed64:
  35714. if (e.Long)
  35715. try {
  35716. return n(i, !1)
  35717. } catch (e) {
  35718. r(typeof i, e.message)
  35719. }
  35720. else
  35721. r(typeof i, "requires Long.js");
  35722. case e.TYPES.uint64:
  35723. case e.TYPES.fixed64:
  35724. if (e.Long)
  35725. try {
  35726. return n(i, !0)
  35727. } catch (e) {
  35728. r(typeof i, e.message)
  35729. }
  35730. else
  35731. r(typeof i, "requires Long.js");
  35732. case e.TYPES.bool:
  35733. return "boolean" != typeof i && r(typeof i, "not a boolean"),
  35734. i;
  35735. case e.TYPES.float:
  35736. case e.TYPES.double:
  35737. return "number" != typeof i && r(typeof i, "not a number"),
  35738. i;
  35739. case e.TYPES.string:
  35740. return "string" == typeof i || i && i instanceof String || r(typeof i, "not a string"),
  35741. "" + i;
  35742. case e.TYPES.bytes:
  35743. return t.isByteBuffer(i) ? i : t.wrap(i, "base64");
  35744. case e.TYPES.enum:
  35745. var a = this.resolvedType.getChildren(e.Reflect.Enum.Value);
  35746. for (l = 0; l < a.length; l++) {
  35747. if (a[l].name == i)
  35748. return a[l].id;
  35749. if (a[l].id == i)
  35750. return a[l].id
  35751. }
  35752. if ("proto3" === this.syntax)
  35753. return ("number" != typeof i || i === i && i % 1 !== 0) && r(typeof i, "not an integer"),
  35754. (i > 4294967295 || i < 0) && r(typeof i, "not in range for uint32"),
  35755. i;
  35756. r(i, "not a valid enum value");
  35757. case e.TYPES.group:
  35758. case e.TYPES.message:
  35759. if (i && "object" == typeof i || r(typeof i, "object expected"),
  35760. i instanceof this.resolvedType.clazz)
  35761. return i;
  35762. if (i instanceof e.Builder.Message) {
  35763. var s = {};
  35764. for (var l in i)
  35765. i.hasOwnProperty(l) && (s[l] = i[l]);
  35766. i = s
  35767. }
  35768. return new this.resolvedType.clazz(i)
  35769. }
  35770. throw Error("[INTERNAL] Illegal value for " + this.toString(!0) + ": " + i + " (undefined type " + this.type + ")")
  35771. }
  35772. ,
  35773. u.calculateLength = function(i, n) {
  35774. if (null === n)
  35775. return 0;
  35776. var r;
  35777. switch (this.type) {
  35778. case e.TYPES.int32:
  35779. return n < 0 ? t.calculateVarint64(n) : t.calculateVarint32(n);
  35780. case e.TYPES.uint32:
  35781. return t.calculateVarint32(n);
  35782. case e.TYPES.sint32:
  35783. return t.calculateVarint32(t.zigZagEncode32(n));
  35784. case e.TYPES.fixed32:
  35785. case e.TYPES.sfixed32:
  35786. case e.TYPES.float:
  35787. return 4;
  35788. case e.TYPES.int64:
  35789. case e.TYPES.uint64:
  35790. return t.calculateVarint64(n);
  35791. case e.TYPES.sint64:
  35792. return t.calculateVarint64(t.zigZagEncode64(n));
  35793. case e.TYPES.fixed64:
  35794. case e.TYPES.sfixed64:
  35795. return 8;
  35796. case e.TYPES.bool:
  35797. return 1;
  35798. case e.TYPES.enum:
  35799. return t.calculateVarint32(n);
  35800. case e.TYPES.double:
  35801. return 8;
  35802. case e.TYPES.string:
  35803. return r = t.calculateUTF8Bytes(n),
  35804. t.calculateVarint32(r) + r;
  35805. case e.TYPES.bytes:
  35806. if (n.remaining() < 0)
  35807. throw Error("Illegal value for " + this.toString(!0) + ": " + n.remaining() + " bytes remaining");
  35808. return t.calculateVarint32(n.remaining()) + n.remaining();
  35809. case e.TYPES.message:
  35810. return r = this.resolvedType.calculate(n),
  35811. t.calculateVarint32(r) + r;
  35812. case e.TYPES.group:
  35813. return r = this.resolvedType.calculate(n),
  35814. r + t.calculateVarint32(i << 3 | e.WIRE_TYPES.ENDGROUP)
  35815. }
  35816. throw Error("[INTERNAL] Illegal value to encode in " + this.toString(!0) + ": " + n + " (unknown type)")
  35817. }
  35818. ,
  35819. u.encodeValue = function(i, n, r) {
  35820. if (null === n)
  35821. return r;
  35822. switch (this.type) {
  35823. case e.TYPES.int32:
  35824. n < 0 ? r.writeVarint64(n) : r.writeVarint32(n);
  35825. break;
  35826. case e.TYPES.uint32:
  35827. r.writeVarint32(n);
  35828. break;
  35829. case e.TYPES.sint32:
  35830. r.writeVarint32ZigZag(n);
  35831. break;
  35832. case e.TYPES.fixed32:
  35833. r.writeUint32(n);
  35834. break;
  35835. case e.TYPES.sfixed32:
  35836. r.writeInt32(n);
  35837. break;
  35838. case e.TYPES.int64:
  35839. case e.TYPES.uint64:
  35840. r.writeVarint64(n);
  35841. break;
  35842. case e.TYPES.sint64:
  35843. r.writeVarint64ZigZag(n);
  35844. break;
  35845. case e.TYPES.fixed64:
  35846. r.writeUint64(n);
  35847. break;
  35848. case e.TYPES.sfixed64:
  35849. r.writeInt64(n);
  35850. break;
  35851. case e.TYPES.bool:
  35852. "string" == typeof n ? r.writeVarint32("false" === n.toLowerCase() ? 0 : !!n) : r.writeVarint32(n ? 1 : 0);
  35853. break;
  35854. case e.TYPES.enum:
  35855. r.writeVarint32(n);
  35856. break;
  35857. case e.TYPES.float:
  35858. r.writeFloat32(n);
  35859. break;
  35860. case e.TYPES.double:
  35861. r.writeFloat64(n);
  35862. break;
  35863. case e.TYPES.string:
  35864. r.writeVString(n);
  35865. break;
  35866. case e.TYPES.bytes:
  35867. if (n.remaining() < 0)
  35868. throw Error("Illegal value for " + this.toString(!0) + ": " + n.remaining() + " bytes remaining");
  35869. var o = n.offset;
  35870. r.writeVarint32(n.remaining()),
  35871. r.append(n),
  35872. n.offset = o;
  35873. break;
  35874. case e.TYPES.message:
  35875. var a = (new t).LE();
  35876. this.resolvedType.encode(n, a),
  35877. r.writeVarint32(a.offset),
  35878. r.append(a.flip());
  35879. break;
  35880. case e.TYPES.group:
  35881. this.resolvedType.encode(n, r),
  35882. r.writeVarint32(i << 3 | e.WIRE_TYPES.ENDGROUP);
  35883. break;
  35884. default:
  35885. throw Error("[INTERNAL] Illegal value to encode in " + this.toString(!0) + ": " + n + " (unknown type)")
  35886. }
  35887. return r
  35888. }
  35889. ,
  35890. u.decode = function(t, i, n) {
  35891. if (i != this.type.wireType)
  35892. throw Error("Unexpected wire type for element");
  35893. var r, o;
  35894. switch (this.type) {
  35895. case e.TYPES.int32:
  35896. return 0 | t.readVarint32();
  35897. case e.TYPES.uint32:
  35898. return t.readVarint32() >>> 0;
  35899. case e.TYPES.sint32:
  35900. return 0 | t.readVarint32ZigZag();
  35901. case e.TYPES.fixed32:
  35902. return t.readUint32() >>> 0;
  35903. case e.TYPES.sfixed32:
  35904. return 0 | t.readInt32();
  35905. case e.TYPES.int64:
  35906. return t.readVarint64();
  35907. case e.TYPES.uint64:
  35908. return t.readVarint64().toUnsigned();
  35909. case e.TYPES.sint64:
  35910. return t.readVarint64ZigZag();
  35911. case e.TYPES.fixed64:
  35912. return t.readUint64();
  35913. case e.TYPES.sfixed64:
  35914. return t.readInt64();
  35915. case e.TYPES.bool:
  35916. return !!t.readVarint32();
  35917. case e.TYPES.enum:
  35918. return t.readVarint32();
  35919. case e.TYPES.float:
  35920. return t.readFloat();
  35921. case e.TYPES.double:
  35922. return t.readDouble();
  35923. case e.TYPES.string:
  35924. return t.readVString();
  35925. case e.TYPES.bytes:
  35926. if (o = t.readVarint32(),
  35927. t.remaining() < o)
  35928. throw Error("Illegal number of bytes for " + this.toString(!0) + ": " + o + " required but got only " + t.remaining());
  35929. return r = t.clone(),
  35930. r.limit = r.offset + o,
  35931. t.offset += o,
  35932. r;
  35933. case e.TYPES.message:
  35934. return o = t.readVarint32(),
  35935. this.resolvedType.decode(t, o);
  35936. case e.TYPES.group:
  35937. return this.resolvedType.decode(t, -1, n)
  35938. }
  35939. throw Error("[INTERNAL] Illegal decode type")
  35940. }
  35941. ,
  35942. u.valueFromString = function(i) {
  35943. if (!this.isMapKey)
  35944. throw Error("valueFromString() called on non-map-key element");
  35945. switch (this.type) {
  35946. case e.TYPES.int32:
  35947. case e.TYPES.sint32:
  35948. case e.TYPES.sfixed32:
  35949. case e.TYPES.uint32:
  35950. case e.TYPES.fixed32:
  35951. return this.verifyValue(parseInt(i));
  35952. case e.TYPES.int64:
  35953. case e.TYPES.sint64:
  35954. case e.TYPES.sfixed64:
  35955. case e.TYPES.uint64:
  35956. case e.TYPES.fixed64:
  35957. return this.verifyValue(i);
  35958. case e.TYPES.bool:
  35959. return "true" === i;
  35960. case e.TYPES.string:
  35961. return this.verifyValue(i);
  35962. case e.TYPES.bytes:
  35963. return t.fromBinary(i)
  35964. }
  35965. }
  35966. ,
  35967. u.valueToString = function(t) {
  35968. if (!this.isMapKey)
  35969. throw Error("valueToString() called on non-map-key element");
  35970. return this.type === e.TYPES.bytes ? t.toString("binary") : t.toString()
  35971. }
  35972. ,
  35973. o.Element = h;
  35974. var d = function(e, t, i, n, r, o) {
  35975. l.call(this, e, t, i, n, o),
  35976. this.className = "Message",
  35977. this.extensions = void 0,
  35978. this.clazz = null,
  35979. this.isGroup = !!r,
  35980. this._fields = null,
  35981. this._fieldsById = null,
  35982. this._fieldsByName = null
  35983. }
  35984. , p = d.prototype = Object.create(l.prototype);
  35985. p.build = function(i) {
  35986. if (this.clazz && !i)
  35987. return this.clazz;
  35988. var n = function(e, i) {
  35989. function n(i, r, o, a) {
  35990. if (null === i || "object" != typeof i) {
  35991. if (a && a instanceof e.Reflect.Enum) {
  35992. var s = e.Reflect.Enum.getName(a.object, i);
  35993. if (null !== s)
  35994. return s
  35995. }
  35996. return i
  35997. }
  35998. if (t.isByteBuffer(i))
  35999. return r ? i.toBase64() : i.toBuffer();
  36000. if (e.Long.isLong(i))
  36001. return o ? i.toString() : e.Long.fromValue(i);
  36002. var l;
  36003. if (Array.isArray(i))
  36004. return l = [],
  36005. i.forEach(function(e, t) {
  36006. l[t] = n(e, r, o, a)
  36007. }),
  36008. l;
  36009. if (l = {},
  36010. i instanceof e.Map) {
  36011. for (var c = i.entries(), h = c.next(); !h.done; h = c.next())
  36012. l[i.keyElem.valueToString(h.value[0])] = n(h.value[1], r, o, i.valueElem.resolvedType);
  36013. return l
  36014. }
  36015. var u = i.$type
  36016. , d = void 0;
  36017. for (var p in i)
  36018. i.hasOwnProperty(p) && (u && (d = u.getChild(p)) ? l[p] = n(i[p], r, o, d.resolvedType) : l[p] = n(i[p], r, o));
  36019. return l
  36020. }
  36021. var r = i.getChildren(e.Reflect.Message.Field)
  36022. , o = i.getChildren(e.Reflect.Message.OneOf)
  36023. , a = function(n, s) {
  36024. e.Builder.Message.call(this);
  36025. for (var l = 0, c = o.length; l < c; ++l)
  36026. this[o[l].name] = null;
  36027. for (l = 0,
  36028. c = r.length; l < c; ++l) {
  36029. var h = r[l];
  36030. this[h.name] = h.repeated ? [] : h.map ? new e.Map(h) : null,
  36031. !h.required && "proto3" !== i.syntax || null === h.defaultValue || (this[h.name] = h.defaultValue)
  36032. }
  36033. if (arguments.length > 0) {
  36034. var u;
  36035. 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)
  36036. for (l = 0,
  36037. c = arguments.length; l < c; ++l)
  36038. "undefined" != typeof (u = arguments[l]) && this.$set(r[l].name, u);
  36039. else
  36040. this.$set(n)
  36041. }
  36042. }
  36043. , s = a.prototype = Object.create(e.Builder.Message.prototype);
  36044. s.add = function(t, n, r) {
  36045. var o = i._fieldsByName[t];
  36046. if (!r) {
  36047. if (!o)
  36048. throw Error(this + "#" + t + " is undefined");
  36049. if (!(o instanceof e.Reflect.Message.Field))
  36050. throw Error(this + "#" + t + " is not a field: " + o.toString(!0));
  36051. if (!o.repeated)
  36052. throw Error(this + "#" + t + " is not a repeated field");
  36053. n = o.verifyValue(n, !0)
  36054. }
  36055. return null === this[t] && (this[t] = []),
  36056. this[t].push(n),
  36057. this
  36058. }
  36059. ,
  36060. s.$add = s.add,
  36061. s.set = function(t, n, r) {
  36062. if (t && "object" == typeof t) {
  36063. r = n;
  36064. for (var o in t)
  36065. t.hasOwnProperty(o) && "undefined" != typeof (n = t[o]) && this.$set(o, n, r);
  36066. return this
  36067. }
  36068. var a = i._fieldsByName[t];
  36069. if (r)
  36070. this[t] = n;
  36071. else {
  36072. if (!a)
  36073. throw Error(this + "#" + t + " is not a field: undefined");
  36074. if (!(a instanceof e.Reflect.Message.Field))
  36075. throw Error(this + "#" + t + " is not a field: " + a.toString(!0));
  36076. this[a.name] = n = a.verifyValue(n)
  36077. }
  36078. if (a && a.oneof) {
  36079. var s = this[a.oneof.name];
  36080. null !== n ? (null !== s && s !== a.name && (this[s] = null),
  36081. this[a.oneof.name] = a.name) : s === t && (this[a.oneof.name] = null)
  36082. }
  36083. return this
  36084. }
  36085. ,
  36086. s.$set = s.set,
  36087. s.get = function(t, n) {
  36088. if (n)
  36089. return this[t];
  36090. var r = i._fieldsByName[t];
  36091. if (!(r && r instanceof e.Reflect.Message.Field))
  36092. throw Error(this + "#" + t + " is not a field: undefined");
  36093. if (!(r instanceof e.Reflect.Message.Field))
  36094. throw Error(this + "#" + t + " is not a field: " + r.toString(!0));
  36095. return this[r.name]
  36096. }
  36097. ,
  36098. s.$get = s.get;
  36099. for (var l = 0; l < r.length; l++) {
  36100. var c = r[l];
  36101. c instanceof e.Reflect.Message.ExtensionField || i.builder.options.populateAccessors && function(e) {
  36102. var t = e.originalName.replace(/(_[a-zA-Z])/g, function(e) {
  36103. return e.toUpperCase().replace("_", "")
  36104. });
  36105. t = t.substring(0, 1).toUpperCase() + t.substring(1);
  36106. var n = e.originalName.replace(/([A-Z])/g, function(e) {
  36107. return "_" + e
  36108. })
  36109. , r = function(t, i) {
  36110. return this[e.name] = i ? t : e.verifyValue(t),
  36111. this
  36112. }
  36113. , o = function() {
  36114. return this[e.name]
  36115. };
  36116. null === i.getChild("set" + t) && (s["set" + t] = r),
  36117. null === i.getChild("set_" + n) && (s["set_" + n] = r),
  36118. null === i.getChild("get" + t) && (s["get" + t] = o),
  36119. null === i.getChild("get_" + n) && (s["get_" + n] = o)
  36120. }(c)
  36121. }
  36122. s.encode = function(e, n) {
  36123. "boolean" == typeof e && (n = e,
  36124. e = void 0);
  36125. var r = !1;
  36126. e || (e = new t,
  36127. r = !0);
  36128. var o = e.littleEndian;
  36129. try {
  36130. return i.encode(this, e.LE(), n),
  36131. (r ? e.flip() : e).LE(o)
  36132. } catch (t) {
  36133. throw e.LE(o),
  36134. t
  36135. }
  36136. }
  36137. ,
  36138. a.encode = function(e, t, i) {
  36139. return new a(e).encode(t, i)
  36140. }
  36141. ,
  36142. s.calculate = function() {
  36143. return i.calculate(this)
  36144. }
  36145. ,
  36146. s.encodeDelimited = function(e, n) {
  36147. var r = !1;
  36148. e || (e = new t,
  36149. r = !0);
  36150. var o = (new t).LE();
  36151. return i.encode(this, o, n).flip(),
  36152. e.writeVarint32(o.remaining()),
  36153. e.append(o),
  36154. r ? e.flip() : e
  36155. }
  36156. ,
  36157. s.encodeAB = function() {
  36158. try {
  36159. return this.encode().toArrayBuffer()
  36160. } catch (e) {
  36161. throw e.encoded && (e.encoded = e.encoded.toArrayBuffer()),
  36162. e
  36163. }
  36164. }
  36165. ,
  36166. s.toArrayBuffer = s.encodeAB,
  36167. s.encodeNB = function() {
  36168. try {
  36169. return this.encode().toBuffer()
  36170. } catch (e) {
  36171. throw e.encoded && (e.encoded = e.encoded.toBuffer()),
  36172. e
  36173. }
  36174. }
  36175. ,
  36176. s.toBuffer = s.encodeNB,
  36177. s.encode64 = function() {
  36178. try {
  36179. return this.encode().toBase64()
  36180. } catch (e) {
  36181. throw e.encoded && (e.encoded = e.encoded.toBase64()),
  36182. e
  36183. }
  36184. }
  36185. ,
  36186. s.toBase64 = s.encode64,
  36187. s.encodeHex = function() {
  36188. try {
  36189. return this.encode().toHex()
  36190. } catch (e) {
  36191. throw e.encoded && (e.encoded = e.encoded.toHex()),
  36192. e
  36193. }
  36194. }
  36195. ,
  36196. s.toHex = s.encodeHex,
  36197. s.toRaw = function(e, t) {
  36198. return n(this, !!e, !!t, this.$type)
  36199. }
  36200. ,
  36201. s.encodeJSON = function() {
  36202. return JSON.stringify(n(this, !0, !0, this.$type))
  36203. }
  36204. ,
  36205. a.decode = function(e, n, r) {
  36206. "string" == typeof n && (r = n,
  36207. n = -1),
  36208. "string" == typeof e && (e = t.wrap(e, r ? r : "base64")),
  36209. e = t.isByteBuffer(e) ? e : t.wrap(e);
  36210. var o = e.littleEndian;
  36211. try {
  36212. var a = i.decode(e.LE());
  36213. return e.LE(o),
  36214. a
  36215. } catch (t) {
  36216. throw e.LE(o),
  36217. t
  36218. }
  36219. }
  36220. ,
  36221. a.decodeDelimited = function(e, n) {
  36222. if ("string" == typeof e && (e = t.wrap(e, n ? n : "base64")),
  36223. e = t.isByteBuffer(e) ? e : t.wrap(e),
  36224. e.remaining() < 1)
  36225. return null;
  36226. var r = e.offset
  36227. , o = e.readVarint32();
  36228. if (e.remaining() < o)
  36229. return e.offset = r,
  36230. null;
  36231. try {
  36232. var a = i.decode(e.slice(e.offset, e.offset + o).LE());
  36233. return e.offset += o,
  36234. a
  36235. } catch (t) {
  36236. throw e.offset += o,
  36237. t
  36238. }
  36239. }
  36240. ,
  36241. a.decode64 = function(e) {
  36242. return a.decode(e, "base64")
  36243. }
  36244. ,
  36245. a.decodeHex = function(e) {
  36246. return a.decode(e, "hex")
  36247. }
  36248. ,
  36249. a.decodeJSON = function(e) {
  36250. return new a(JSON.parse(e))
  36251. }
  36252. ,
  36253. s.toString = function() {
  36254. return i.toString()
  36255. }
  36256. ;
  36257. return Object.defineProperty && (Object.defineProperty(a, "$options", {
  36258. value: i.buildOpt()
  36259. }),
  36260. Object.defineProperty(s, "$options", {
  36261. value: a.$options
  36262. }),
  36263. Object.defineProperty(a, "$type", {
  36264. value: i
  36265. }),
  36266. Object.defineProperty(s, "$type", {
  36267. value: i
  36268. })),
  36269. a
  36270. }(e, this);
  36271. this._fields = [],
  36272. this._fieldsById = {},
  36273. this._fieldsByName = {};
  36274. for (var r, o = 0, a = this.children.length; o < a; o++)
  36275. if (r = this.children[o],
  36276. r instanceof A || r instanceof d || r instanceof E) {
  36277. if (n.hasOwnProperty(r.name))
  36278. throw Error("Illegal reflect child of " + this.toString(!0) + ": " + r.toString(!0) + " cannot override static property '" + r.name + "'");
  36279. n[r.name] = r.build()
  36280. } else if (r instanceof d.Field)
  36281. r.build(),
  36282. this._fields.push(r),
  36283. this._fieldsById[r.id] = r,
  36284. this._fieldsByName[r.name] = r;
  36285. else if (!(r instanceof d.OneOf || r instanceof I))
  36286. throw Error("Illegal reflect child of " + this.toString(!0) + ": " + this.children[o].toString(!0));
  36287. return this.clazz = n
  36288. }
  36289. ,
  36290. p.encode = function(e, t, i) {
  36291. for (var n, r, o = null, a = 0, s = this._fields.length; a < s; ++a)
  36292. n = this._fields[a],
  36293. r = e[n.name],
  36294. n.required && null === r ? null === o && (o = n) : n.encode(i ? r : n.verifyValue(r), t, e);
  36295. if (null !== o) {
  36296. var l = Error("Missing at least one required field for " + this.toString(!0) + ": " + o);
  36297. throw l.encoded = t,
  36298. l
  36299. }
  36300. return t
  36301. }
  36302. ,
  36303. p.calculate = function(e) {
  36304. for (var t, i, n = 0, r = 0, o = this._fields.length; r < o; ++r) {
  36305. if (t = this._fields[r],
  36306. i = e[t.name],
  36307. t.required && null === i)
  36308. throw Error("Missing at least one required field for " + this.toString(!0) + ": " + t);
  36309. n += t.calculate(i, e)
  36310. }
  36311. return n
  36312. }
  36313. ,
  36314. p.decode = function(t, i, n) {
  36315. i = "number" == typeof i ? i : -1;
  36316. for (var o, a, s, l, c = t.offset, h = new this.clazz; t.offset < c + i || i === -1 && t.remaining() > 0; ) {
  36317. if (o = t.readVarint32(),
  36318. a = 7 & o,
  36319. s = o >>> 3,
  36320. a === e.WIRE_TYPES.ENDGROUP) {
  36321. if (s !== n)
  36322. throw Error("Illegal group end indicator for " + this.toString(!0) + ": " + s + " (" + (n ? n + " expected" : "not a group") + ")");
  36323. break
  36324. }
  36325. if (l = this._fieldsById[s]) {
  36326. if (l.repeated && !l.options.packed)
  36327. h[l.name].push(l.decode(a, t));
  36328. else if (l.map) {
  36329. var u = l.decode(a, t);
  36330. h[l.name].set(u[0], u[1])
  36331. } else if (h[l.name] = l.decode(a, t),
  36332. l.oneof) {
  36333. var d = h[l.oneof.name];
  36334. null !== d && d !== l.name && (h[d] = null),
  36335. h[l.oneof.name] = l.name
  36336. }
  36337. } else
  36338. switch (a) {
  36339. case e.WIRE_TYPES.VARINT:
  36340. t.readVarint32();
  36341. break;
  36342. case e.WIRE_TYPES.BITS32:
  36343. t.offset += 4;
  36344. break;
  36345. case e.WIRE_TYPES.BITS64:
  36346. t.offset += 8;
  36347. break;
  36348. case e.WIRE_TYPES.LDELIM:
  36349. var p = t.readVarint32();
  36350. t.offset += p;
  36351. break;
  36352. case e.WIRE_TYPES.STARTGROUP:
  36353. for (; r(s, t); )
  36354. ;
  36355. break;
  36356. default:
  36357. throw Error("Illegal wire type for unknown field " + s + " in " + this.toString(!0) + "#decode: " + a)
  36358. }
  36359. }
  36360. for (var f = 0, g = this._fields.length; f < g; ++f)
  36361. if (l = this._fields[f],
  36362. null === h[l.name])
  36363. if ("proto3" === this.syntax)
  36364. h[l.name] = l.defaultValue;
  36365. else {
  36366. if (l.required) {
  36367. var m = Error("Missing at least one required field for " + this.toString(!0) + ": " + l.name);
  36368. throw m.decoded = h,
  36369. m
  36370. }
  36371. e.populateDefaults && null !== l.defaultValue && (h[l.name] = l.defaultValue)
  36372. }
  36373. return h
  36374. }
  36375. ,
  36376. o.Message = d;
  36377. var f = function(t, i, n, r, o, s, l, c, h, u) {
  36378. a.call(this, t, i, s),
  36379. this.className = "Message.Field",
  36380. this.required = "required" === n,
  36381. this.repeated = "repeated" === n,
  36382. this.map = "map" === n,
  36383. this.keyType = r || null,
  36384. this.type = o,
  36385. this.resolvedType = null,
  36386. this.id = l,
  36387. this.options = c || {},
  36388. this.defaultValue = null,
  36389. this.oneof = h || null,
  36390. this.syntax = u || "proto2",
  36391. this.originalName = this.name,
  36392. this.element = null,
  36393. this.keyElement = null,
  36394. !this.builder.options.convertFieldsToCamelCase || this instanceof d.ExtensionField || (this.name = e.Util.toCamelCase(this.name))
  36395. }
  36396. , g = f.prototype = Object.create(a.prototype);
  36397. g.build = function() {
  36398. this.element = new h(this.type,this.resolvedType,!1,this.syntax),
  36399. this.map && (this.keyElement = new h(this.keyType,void 0,!0,this.syntax)),
  36400. "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)
  36401. }
  36402. ,
  36403. g.verifyValue = function(t, i) {
  36404. function n(e, t) {
  36405. throw Error("Illegal value for " + r.toString(!0) + " of type " + r.type.name + ": " + e + " (" + t + ")")
  36406. }
  36407. i = i || !1;
  36408. var r = this;
  36409. if (null === t)
  36410. return this.required && n(typeof t, "required"),
  36411. "proto3" === this.syntax && this.type !== e.TYPES.message && n(typeof t, "proto3 field without field presence cannot be null"),
  36412. null;
  36413. var o;
  36414. if (this.repeated && !i) {
  36415. Array.isArray(t) || (t = [t]);
  36416. var a = [];
  36417. for (o = 0; o < t.length; o++)
  36418. a.push(this.element.verifyValue(t[o]));
  36419. return a
  36420. }
  36421. return this.map && !i ? t instanceof e.Map ? t : (t instanceof Object || n(typeof t, "expected ProtoBuf.Map or raw object for map field"),
  36422. new e.Map(this,t)) : (!this.repeated && Array.isArray(t) && n(typeof t, "no array expected"),
  36423. this.element.verifyValue(t))
  36424. }
  36425. ,
  36426. g.hasWirePresence = function(t, i) {
  36427. if ("proto3" !== this.syntax)
  36428. return null !== t;
  36429. if (this.oneof && i[this.oneof.name] === this.name)
  36430. return !0;
  36431. switch (this.type) {
  36432. case e.TYPES.int32:
  36433. case e.TYPES.sint32:
  36434. case e.TYPES.sfixed32:
  36435. case e.TYPES.uint32:
  36436. case e.TYPES.fixed32:
  36437. return 0 !== t;
  36438. case e.TYPES.int64:
  36439. case e.TYPES.sint64:
  36440. case e.TYPES.sfixed64:
  36441. case e.TYPES.uint64:
  36442. case e.TYPES.fixed64:
  36443. return 0 !== t.low || 0 !== t.high;
  36444. case e.TYPES.bool:
  36445. return t;
  36446. case e.TYPES.float:
  36447. case e.TYPES.double:
  36448. return 0 !== t;
  36449. case e.TYPES.string:
  36450. return t.length > 0;
  36451. case e.TYPES.bytes:
  36452. return t.remaining() > 0;
  36453. case e.TYPES.enum:
  36454. return 0 !== t;
  36455. case e.TYPES.message:
  36456. return null !== t;
  36457. default:
  36458. return !0
  36459. }
  36460. }
  36461. ,
  36462. g.encode = function(i, n, r) {
  36463. if (null === this.type || "object" != typeof this.type)
  36464. throw Error("[INTERNAL] Unresolved type in " + this.toString(!0) + ": " + this.type);
  36465. if (null === i || this.repeated && 0 == i.length)
  36466. return n;
  36467. try {
  36468. if (this.repeated) {
  36469. var o;
  36470. if (this.options.packed && e.PACKABLE_WIRE_TYPES.indexOf(this.type.wireType) >= 0) {
  36471. n.writeVarint32(this.id << 3 | e.WIRE_TYPES.LDELIM),
  36472. n.ensureCapacity(n.offset += 1);
  36473. var a = n.offset;
  36474. for (o = 0; o < i.length; o++)
  36475. this.element.encodeValue(this.id, i[o], n);
  36476. var s = n.offset - a
  36477. , l = t.calculateVarint32(s);
  36478. if (l > 1) {
  36479. var c = n.slice(a, n.offset);
  36480. a += l - 1,
  36481. n.offset = a,
  36482. n.append(c)
  36483. }
  36484. n.writeVarint32(s, a - l)
  36485. } else
  36486. for (o = 0; o < i.length; o++)
  36487. n.writeVarint32(this.id << 3 | this.type.wireType),
  36488. this.element.encodeValue(this.id, i[o], n)
  36489. } else
  36490. this.map ? i.forEach(function(i, r, o) {
  36491. var a = t.calculateVarint32(8 | this.keyType.wireType) + this.keyElement.calculateLength(1, r) + t.calculateVarint32(16 | this.type.wireType) + this.element.calculateLength(2, i);
  36492. n.writeVarint32(this.id << 3 | e.WIRE_TYPES.LDELIM),
  36493. n.writeVarint32(a),
  36494. n.writeVarint32(8 | this.keyType.wireType),
  36495. this.keyElement.encodeValue(1, r, n),
  36496. n.writeVarint32(16 | this.type.wireType),
  36497. this.element.encodeValue(2, i, n)
  36498. }, this) : this.hasWirePresence(i, r) && (n.writeVarint32(this.id << 3 | this.type.wireType),
  36499. this.element.encodeValue(this.id, i, n))
  36500. } catch (e) {
  36501. throw Error("Illegal value for " + this.toString(!0) + ": " + i + " (" + e + ")")
  36502. }
  36503. return n
  36504. }
  36505. ,
  36506. g.calculate = function(i, n) {
  36507. if (i = this.verifyValue(i),
  36508. null === this.type || "object" != typeof this.type)
  36509. throw Error("[INTERNAL] Unresolved type in " + this.toString(!0) + ": " + this.type);
  36510. if (null === i || this.repeated && 0 == i.length)
  36511. return 0;
  36512. var r = 0;
  36513. try {
  36514. if (this.repeated) {
  36515. var o, a;
  36516. if (this.options.packed && e.PACKABLE_WIRE_TYPES.indexOf(this.type.wireType) >= 0) {
  36517. for (r += t.calculateVarint32(this.id << 3 | e.WIRE_TYPES.LDELIM),
  36518. a = 0,
  36519. o = 0; o < i.length; o++)
  36520. a += this.element.calculateLength(this.id, i[o]);
  36521. r += t.calculateVarint32(a),
  36522. r += a
  36523. } else
  36524. for (o = 0; o < i.length; o++)
  36525. r += t.calculateVarint32(this.id << 3 | this.type.wireType),
  36526. r += this.element.calculateLength(this.id, i[o])
  36527. } else
  36528. this.map ? i.forEach(function(i, n, o) {
  36529. var a = t.calculateVarint32(8 | this.keyType.wireType) + this.keyElement.calculateLength(1, n) + t.calculateVarint32(16 | this.type.wireType) + this.element.calculateLength(2, i);
  36530. r += t.calculateVarint32(this.id << 3 | e.WIRE_TYPES.LDELIM),
  36531. r += t.calculateVarint32(a),
  36532. r += a
  36533. }, this) : this.hasWirePresence(i, n) && (r += t.calculateVarint32(this.id << 3 | this.type.wireType),
  36534. r += this.element.calculateLength(this.id, i))
  36535. } catch (e) {
  36536. throw Error("Illegal value for " + this.toString(!0) + ": " + i + " (" + e + ")")
  36537. }
  36538. return r
  36539. }
  36540. ,
  36541. g.decode = function(t, i, n) {
  36542. 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;
  36543. if (!a)
  36544. throw Error("Illegal wire type for field " + this.toString(!0) + ": " + t + " (" + this.type.wireType + " expected)");
  36545. if (t == e.WIRE_TYPES.LDELIM && this.repeated && this.options.packed && e.PACKABLE_WIRE_TYPES.indexOf(this.type.wireType) >= 0 && !n) {
  36546. o = i.readVarint32(),
  36547. o = i.offset + o;
  36548. for (var s = []; i.offset < o; )
  36549. s.push(this.decode(this.type.wireType, i, !0));
  36550. return s
  36551. }
  36552. if (this.map) {
  36553. var l = h.defaultFieldValue(this.keyType);
  36554. if (r = h.defaultFieldValue(this.type),
  36555. o = i.readVarint32(),
  36556. i.remaining() < o)
  36557. throw Error("Illegal number of bytes for " + this.toString(!0) + ": " + o + " required but got only " + i.remaining());
  36558. var c = i.clone();
  36559. for (c.limit = c.offset + o,
  36560. i.offset += o; c.remaining() > 0; ) {
  36561. var u = c.readVarint32();
  36562. t = 7 & u;
  36563. var d = u >>> 3;
  36564. if (1 === d)
  36565. l = this.keyElement.decode(c, t, d);
  36566. else {
  36567. if (2 !== d)
  36568. throw Error("Unexpected tag in map field key/value submessage");
  36569. r = this.element.decode(c, t, d)
  36570. }
  36571. }
  36572. return [l, r]
  36573. }
  36574. return this.element.decode(i, t, this.id)
  36575. }
  36576. ,
  36577. o.Message.Field = f;
  36578. var m = function(e, t, i, n, r, o, a) {
  36579. f.call(this, e, t, i, null, n, r, o, a),
  36580. this.extension
  36581. };
  36582. m.prototype = Object.create(f.prototype),
  36583. o.Message.ExtensionField = m;
  36584. var v = function(e, t, i) {
  36585. a.call(this, e, t, i),
  36586. this.fields = []
  36587. };
  36588. o.Message.OneOf = v;
  36589. var A = function(e, t, i, n, r) {
  36590. l.call(this, e, t, i, n, r),
  36591. this.className = "Enum",
  36592. this.object = null
  36593. };
  36594. A.getName = function(e, t) {
  36595. for (var i, n = Object.keys(e), r = 0; r < n.length; ++r)
  36596. if (e[i = n[r]] === t)
  36597. return i;
  36598. return null
  36599. }
  36600. ;
  36601. var y = A.prototype = Object.create(l.prototype);
  36602. y.build = function(t) {
  36603. if (this.object && !t)
  36604. return this.object;
  36605. for (var i = new e.Builder.Enum, n = this.getChildren(A.Value), r = 0, o = n.length; r < o; ++r)
  36606. i[n[r].name] = n[r].id;
  36607. return Object.defineProperty && Object.defineProperty(i, "$options", {
  36608. value: this.buildOpt(),
  36609. enumerable: !1
  36610. }),
  36611. this.object = i
  36612. }
  36613. ,
  36614. o.Enum = A;
  36615. var C = function(e, t, i, n) {
  36616. a.call(this, e, t, i),
  36617. this.className = "Enum.Value",
  36618. this.id = n
  36619. };
  36620. C.prototype = Object.create(a.prototype),
  36621. o.Enum.Value = C;
  36622. var I = function(e, t, i, n) {
  36623. a.call(this, e, t, i),
  36624. this.field = n
  36625. };
  36626. I.prototype = Object.create(a.prototype),
  36627. o.Extension = I;
  36628. var E = function(e, t, i, n) {
  36629. l.call(this, e, t, i, n),
  36630. this.className = "Service",
  36631. this.clazz = null
  36632. }
  36633. , b = E.prototype = Object.create(l.prototype);
  36634. b.build = function(i) {
  36635. return this.clazz && !i ? this.clazz : this.clazz = function(e, i) {
  36636. for (var n = function(t) {
  36637. e.Builder.Service.call(this),
  36638. this.rpcImpl = t || function(e, t, i) {
  36639. setTimeout(i.bind(this, Error("Not implemented, see: https://github.com/dcodeIO/ProtoBuf.js/wiki/Services")), 0)
  36640. }
  36641. }, r = n.prototype = Object.create(e.Builder.Service.prototype), o = i.getChildren(e.Reflect.Service.RPCMethod), a = 0; a < o.length; a++)
  36642. !function(e) {
  36643. r[e.name] = function(n, r) {
  36644. try {
  36645. try {
  36646. n = e.resolvedRequestType.clazz.decode(t.wrap(n))
  36647. } catch (e) {
  36648. if (!(e instanceof TypeError))
  36649. throw e
  36650. }
  36651. if (null === n || "object" != typeof n)
  36652. throw Error("Illegal arguments");
  36653. n instanceof e.resolvedRequestType.clazz || (n = new e.resolvedRequestType.clazz(n)),
  36654. this.rpcImpl(e.fqn(), n, function(t, n) {
  36655. if (t)
  36656. return void r(t);
  36657. null === n && (n = "");
  36658. try {
  36659. n = e.resolvedResponseType.clazz.decode(n)
  36660. } catch (e) {}
  36661. 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))
  36662. })
  36663. } catch (e) {
  36664. setTimeout(r.bind(this, e), 0)
  36665. }
  36666. }
  36667. ,
  36668. n[e.name] = function(t, i, r) {
  36669. new n(t)[e.name](i, r)
  36670. }
  36671. ,
  36672. Object.defineProperty && (Object.defineProperty(n[e.name], "$options", {
  36673. value: e.buildOpt()
  36674. }),
  36675. Object.defineProperty(r[e.name], "$options", {
  36676. value: n[e.name].$options
  36677. }))
  36678. }(o[a]);
  36679. return Object.defineProperty && (Object.defineProperty(n, "$options", {
  36680. value: i.buildOpt()
  36681. }),
  36682. Object.defineProperty(r, "$options", {
  36683. value: n.$options
  36684. }),
  36685. Object.defineProperty(n, "$type", {
  36686. value: i
  36687. }),
  36688. Object.defineProperty(r, "$type", {
  36689. value: i
  36690. })),
  36691. n
  36692. }(e, this)
  36693. }
  36694. ,
  36695. o.Service = E;
  36696. var w = function(e, t, i, n) {
  36697. a.call(this, e, t, i),
  36698. this.className = "Service.Method",
  36699. this.options = n || {}
  36700. }
  36701. , _ = w.prototype = Object.create(a.prototype);
  36702. _.buildOpt = c.buildOpt,
  36703. o.Service.Method = w;
  36704. var T = function(e, t, i, n, r, o, a, s) {
  36705. w.call(this, e, t, i, s),
  36706. this.className = "Service.RPCMethod",
  36707. this.requestName = n,
  36708. this.responseName = r,
  36709. this.requestStream = o,
  36710. this.responseStream = a,
  36711. this.resolvedRequestType = null,
  36712. this.resolvedResponseType = null
  36713. };
  36714. return T.prototype = Object.create(w.prototype),
  36715. o.Service.RPCMethod = T,
  36716. o
  36717. }(r),
  36718. r.Builder = function(t, i, n) {
  36719. function r(e) {
  36720. e.messages && e.messages.forEach(function(t) {
  36721. t.syntax = e.syntax,
  36722. r(t)
  36723. }),
  36724. e.enums && e.enums.forEach(function(t) {
  36725. t.syntax = e.syntax
  36726. })
  36727. }
  36728. var o = function(e) {
  36729. this.ns = new n.Namespace(this,null,""),
  36730. this.ptr = this.ns,
  36731. this.resolved = !1,
  36732. this.result = null,
  36733. this.files = {},
  36734. this.importRoot = null,
  36735. this.options = e || {}
  36736. }
  36737. , a = o.prototype;
  36738. return o.isMessage = function(e) {
  36739. return "string" == typeof e.name && ("undefined" == typeof e.values && "undefined" == typeof e.rpc)
  36740. }
  36741. ,
  36742. o.isMessageField = function(e) {
  36743. return "string" == typeof e.rule && "string" == typeof e.name && "string" == typeof e.type && "undefined" != typeof e.id
  36744. }
  36745. ,
  36746. o.isEnum = function(e) {
  36747. return "string" == typeof e.name && !("undefined" == typeof e.values || !Array.isArray(e.values) || 0 === e.values.length)
  36748. }
  36749. ,
  36750. o.isService = function(e) {
  36751. return !("string" != typeof e.name || "object" != typeof e.rpc || !e.rpc)
  36752. }
  36753. ,
  36754. o.isExtend = function(e) {
  36755. return "string" == typeof e.ref
  36756. }
  36757. ,
  36758. a.reset = function() {
  36759. return this.ptr = this.ns,
  36760. this
  36761. }
  36762. ,
  36763. a.define = function(e) {
  36764. if ("string" != typeof e || !i.TYPEREF.test(e))
  36765. throw Error("illegal namespace: " + e);
  36766. return e.split(".").forEach(function(e) {
  36767. var t = this.ptr.getChild(e);
  36768. null === t && this.ptr.addChild(t = new n.Namespace(this,this.ptr,e)),
  36769. this.ptr = t
  36770. }, this),
  36771. this
  36772. }
  36773. ,
  36774. a.create = function(e) {
  36775. if (!e)
  36776. return this;
  36777. if (Array.isArray(e)) {
  36778. if (0 === e.length)
  36779. return this;
  36780. e = e.slice()
  36781. } else
  36782. e = [e];
  36783. for (var i = [e]; i.length > 0; ) {
  36784. if (e = i.pop(),
  36785. !Array.isArray(e))
  36786. throw Error("not a valid namespace: " + JSON.stringify(e));
  36787. for (; e.length > 0; ) {
  36788. var r = e.shift();
  36789. if (o.isMessage(r)) {
  36790. var a = new n.Message(this,this.ptr,r.name,r.options,r.isGroup,r.syntax)
  36791. , s = {};
  36792. r.oneofs && Object.keys(r.oneofs).forEach(function(e) {
  36793. a.addChild(s[e] = new n.Message.OneOf(this,a,e))
  36794. }, this),
  36795. r.fields && r.fields.forEach(function(e) {
  36796. if (null !== a.getChild(0 | e.id))
  36797. throw Error("duplicate or invalid field id in " + a.name + ": " + e.id);
  36798. if (e.options && "object" != typeof e.options)
  36799. throw Error("illegal field options in " + a.name + "#" + e.name);
  36800. var t = null;
  36801. if ("string" == typeof e.oneof && !(t = s[e.oneof]))
  36802. throw Error("illegal oneof in " + a.name + "#" + e.name + ": " + e.oneof);
  36803. e = new n.Message.Field(this,a,e.rule,e.keytype,e.type,e.name,e.id,e.options,t,r.syntax),
  36804. t && t.fields.push(e),
  36805. a.addChild(e)
  36806. }, this);
  36807. var l = [];
  36808. if (r.enums && r.enums.forEach(function(e) {
  36809. l.push(e)
  36810. }),
  36811. r.messages && r.messages.forEach(function(e) {
  36812. l.push(e)
  36813. }),
  36814. r.services && r.services.forEach(function(e) {
  36815. l.push(e)
  36816. }),
  36817. r.extensions && ("number" == typeof r.extensions[0] ? a.extensions = [r.extensions] : a.extensions = r.extensions),
  36818. this.ptr.addChild(a),
  36819. l.length > 0) {
  36820. i.push(e),
  36821. e = l,
  36822. l = null,
  36823. this.ptr = a,
  36824. a = null;
  36825. continue
  36826. }
  36827. l = null
  36828. } else if (o.isEnum(r))
  36829. a = new n.Enum(this,this.ptr,r.name,r.options,r.syntax),
  36830. r.values.forEach(function(e) {
  36831. a.addChild(new n.Enum.Value(this,a,e.name,e.id))
  36832. }, this),
  36833. this.ptr.addChild(a);
  36834. else if (o.isService(r))
  36835. a = new n.Service(this,this.ptr,r.name,r.options),
  36836. Object.keys(r.rpc).forEach(function(e) {
  36837. var t = r.rpc[e];
  36838. a.addChild(new n.Service.RPCMethod(this,a,e,t.request,t.response,!!t.request_stream,!!t.response_stream,t.options))
  36839. }, this),
  36840. this.ptr.addChild(a);
  36841. else {
  36842. if (!o.isExtend(r))
  36843. throw Error("not a valid definition: " + JSON.stringify(r));
  36844. if (a = this.ptr.resolve(r.ref, !0))
  36845. r.fields.forEach(function(e) {
  36846. if (null !== a.getChild(0 | e.id))
  36847. throw Error("duplicate extended field id in " + a.name + ": " + e.id);
  36848. if (a.extensions) {
  36849. var i = !1;
  36850. if (a.extensions.forEach(function(t) {
  36851. e.id >= t[0] && e.id <= t[1] && (i = !0)
  36852. }),
  36853. !i)
  36854. throw Error("illegal extended field id in " + a.name + ": " + e.id + " (not within valid ranges)")
  36855. }
  36856. var r = e.name;
  36857. this.options.convertFieldsToCamelCase && (r = t.Util.toCamelCase(r));
  36858. var o = new n.Message.ExtensionField(this,a,e.rule,e.type,this.ptr.fqn() + "." + r,e.id,e.options)
  36859. , s = new n.Extension(this,this.ptr,e.name,o);
  36860. o.extension = s,
  36861. this.ptr.addChild(s),
  36862. a.addChild(o)
  36863. }, this);
  36864. else if (!/\.?google\.protobuf\./.test(r.ref))
  36865. throw Error("extended message " + r.ref + " is not defined")
  36866. }
  36867. r = null,
  36868. a = null
  36869. }
  36870. e = null,
  36871. this.ptr = this.ptr.parent
  36872. }
  36873. return this.resolved = !1,
  36874. this.result = null,
  36875. this
  36876. }
  36877. ,
  36878. a.import = function(i, n) {
  36879. var o = "/";
  36880. if ("string" == typeof n) {
  36881. if (t.Util.IS_NODE && (n = e("path").resolve(n)),
  36882. this.files[n] === !0)
  36883. return this.reset();
  36884. this.files[n] = !0
  36885. } else if ("object" == typeof n) {
  36886. var a = n.root;
  36887. t.Util.IS_NODE && (a = e("path").resolve(a)),
  36888. (a.indexOf("\\") >= 0 || n.file.indexOf("\\") >= 0) && (o = "\\");
  36889. var s = a + o + n.file;
  36890. if (this.files[s] === !0)
  36891. return this.reset();
  36892. this.files[s] = !0
  36893. }
  36894. if (i.imports && i.imports.length > 0) {
  36895. var l, c = !1;
  36896. "object" == typeof n ? (this.importRoot = n.root,
  36897. c = !0,
  36898. l = this.importRoot,
  36899. n = n.file,
  36900. (l.indexOf("\\") >= 0 || n.indexOf("\\") >= 0) && (o = "\\")) : "string" == typeof n ? this.importRoot ? l = this.importRoot : n.indexOf("/") >= 0 ? (l = n.replace(/\/[^\/]*$/, ""),
  36901. "" === l && (l = "/")) : n.indexOf("\\") >= 0 ? (l = n.replace(/\\[^\\]*$/, ""),
  36902. o = "\\") : l = "." : l = null;
  36903. for (var h = 0; h < i.imports.length; h++)
  36904. if ("string" == typeof i.imports[h]) {
  36905. if (!l)
  36906. throw Error("cannot determine import root");
  36907. var u = i.imports[h];
  36908. if ("google/protobuf/descriptor.proto" === u)
  36909. continue;
  36910. if (u = l + o + u,
  36911. this.files[u] === !0)
  36912. continue;
  36913. /\.proto$/i.test(u) && !t.DotProto && (u = u.replace(/\.proto$/, ".json"));
  36914. var d = t.Util.fetch(u);
  36915. if (null === d)
  36916. throw Error("failed to import '" + u + "' in '" + n + "': file not found");
  36917. /\.json$/i.test(u) ? this.import(JSON.parse(d + ""), u) : this.import(t.DotProto.Parser.parse(d), u)
  36918. } else
  36919. n ? /\.(\w+)$/.test(n) ? this.import(i.imports[h], n.replace(/^(.+)\.(\w+)$/, function(e, t, i) {
  36920. return t + "_import" + h + "." + i
  36921. })) : this.import(i.imports[h], n + "_import" + h) : this.import(i.imports[h]);
  36922. c && (this.importRoot = null)
  36923. }
  36924. i.package && this.define(i.package),
  36925. i.syntax && r(i);
  36926. var p = this.ptr;
  36927. return i.options && Object.keys(i.options).forEach(function(e) {
  36928. p.options[e] = i.options[e]
  36929. }),
  36930. i.messages && (this.create(i.messages),
  36931. this.ptr = p),
  36932. i.enums && (this.create(i.enums),
  36933. this.ptr = p),
  36934. i.services && (this.create(i.services),
  36935. this.ptr = p),
  36936. i.extends && this.create(i.extends),
  36937. this.reset()
  36938. }
  36939. ,
  36940. a.resolveAll = function() {
  36941. var e;
  36942. if (null == this.ptr || "object" == typeof this.ptr.type)
  36943. return this;
  36944. if (this.ptr instanceof n.Namespace)
  36945. this.ptr.children.forEach(function(e) {
  36946. this.ptr = e,
  36947. this.resolveAll()
  36948. }, this);
  36949. else if (this.ptr instanceof n.Message.Field) {
  36950. if (i.TYPE.test(this.ptr.type))
  36951. this.ptr.type = t.TYPES[this.ptr.type];
  36952. else {
  36953. if (!i.TYPEREF.test(this.ptr.type))
  36954. throw Error("illegal type reference in " + this.ptr.toString(!0) + ": " + this.ptr.type);
  36955. if (e = (this.ptr instanceof n.Message.ExtensionField ? this.ptr.extension.parent : this.ptr.parent).resolve(this.ptr.type, !0),
  36956. !e)
  36957. throw Error("unresolvable type reference in " + this.ptr.toString(!0) + ": " + this.ptr.type);
  36958. if (this.ptr.resolvedType = e,
  36959. e instanceof n.Enum) {
  36960. if (this.ptr.type = t.TYPES.enum,
  36961. "proto3" === this.ptr.syntax && "proto3" !== e.syntax)
  36962. throw Error("proto3 message cannot reference proto2 enum")
  36963. } else {
  36964. if (!(e instanceof n.Message))
  36965. throw Error("illegal type reference in " + this.ptr.toString(!0) + ": " + this.ptr.type);
  36966. this.ptr.type = e.isGroup ? t.TYPES.group : t.TYPES.message
  36967. }
  36968. }
  36969. if (this.ptr.map) {
  36970. if (!i.TYPE.test(this.ptr.keyType))
  36971. throw Error("illegal key type for map field in " + this.ptr.toString(!0) + ": " + this.ptr.keyType);
  36972. this.ptr.keyType = t.TYPES[this.ptr.keyType]
  36973. }
  36974. } else if (this.ptr instanceof t.Reflect.Service.Method) {
  36975. if (!(this.ptr instanceof t.Reflect.Service.RPCMethod))
  36976. throw Error("illegal service type in " + this.ptr.toString(!0));
  36977. if (e = this.ptr.parent.resolve(this.ptr.requestName, !0),
  36978. !(e && e instanceof t.Reflect.Message))
  36979. throw Error("Illegal type reference in " + this.ptr.toString(!0) + ": " + this.ptr.requestName);
  36980. if (this.ptr.resolvedRequestType = e,
  36981. e = this.ptr.parent.resolve(this.ptr.responseName, !0),
  36982. !(e && e instanceof t.Reflect.Message))
  36983. throw Error("Illegal type reference in " + this.ptr.toString(!0) + ": " + this.ptr.responseName);
  36984. this.ptr.resolvedResponseType = e
  36985. } else if (!(this.ptr instanceof t.Reflect.Message.OneOf || this.ptr instanceof t.Reflect.Extension || this.ptr instanceof t.Reflect.Enum.Value))
  36986. throw Error("illegal object in namespace: " + typeof this.ptr + ": " + this.ptr);
  36987. return this.reset()
  36988. }
  36989. ,
  36990. a.build = function(e) {
  36991. if (this.reset(),
  36992. this.resolved || (this.resolveAll(),
  36993. this.resolved = !0,
  36994. this.result = null),
  36995. null === this.result && (this.result = this.ns.build()),
  36996. !e)
  36997. return this.result;
  36998. for (var t = "string" == typeof e ? e.split(".") : e, i = this.result, n = 0; n < t.length; n++) {
  36999. if (!i[t[n]]) {
  37000. i = null;
  37001. break
  37002. }
  37003. i = i[t[n]]
  37004. }
  37005. return i
  37006. }
  37007. ,
  37008. a.lookup = function(e, t) {
  37009. return e ? this.ns.resolve(e, t) : this.ns
  37010. }
  37011. ,
  37012. a.toString = function() {
  37013. return "Builder"
  37014. }
  37015. ,
  37016. o.Message = function() {}
  37017. ,
  37018. o.Enum = function() {}
  37019. ,
  37020. o.Service = function() {}
  37021. ,
  37022. o
  37023. }(r, r.Lang, r.Reflect),
  37024. r.Map = function(e, t) {
  37025. function i(e) {
  37026. var t = 0;
  37027. return {
  37028. next: function() {
  37029. return t < e.length ? {
  37030. done: !1,
  37031. value: e[t++]
  37032. } : {
  37033. done: !0
  37034. }
  37035. }
  37036. }
  37037. }
  37038. var n = function(e, i) {
  37039. if (!e.map)
  37040. throw Error("field is not a map");
  37041. if (this.field = e,
  37042. this.keyElem = new t.Element(e.keyType,null,!0,e.syntax),
  37043. this.valueElem = new t.Element(e.type,e.resolvedType,!1,e.syntax),
  37044. this.map = {},
  37045. Object.defineProperty(this, "size", {
  37046. get: function() {
  37047. return Object.keys(this.map).length
  37048. }
  37049. }),
  37050. i)
  37051. for (var n = Object.keys(i), r = 0; r < n.length; r++) {
  37052. var o = this.keyElem.valueFromString(n[r])
  37053. , a = this.valueElem.verifyValue(i[n[r]]);
  37054. this.map[this.keyElem.valueToString(o)] = {
  37055. key: o,
  37056. value: a
  37057. }
  37058. }
  37059. }
  37060. , r = n.prototype;
  37061. return r.clear = function() {
  37062. this.map = {}
  37063. }
  37064. ,
  37065. r.delete = function(e) {
  37066. var t = this.keyElem.valueToString(this.keyElem.verifyValue(e))
  37067. , i = t in this.map;
  37068. return delete this.map[t],
  37069. i
  37070. }
  37071. ,
  37072. r.entries = function() {
  37073. for (var e, t = [], n = Object.keys(this.map), r = 0; r < n.length; r++)
  37074. t.push([(e = this.map[n[r]]).key, e.value]);
  37075. return i(t)
  37076. }
  37077. ,
  37078. r.keys = function() {
  37079. for (var e = [], t = Object.keys(this.map), n = 0; n < t.length; n++)
  37080. e.push(this.map[t[n]].key);
  37081. return i(e)
  37082. }
  37083. ,
  37084. r.values = function() {
  37085. for (var e = [], t = Object.keys(this.map), n = 0; n < t.length; n++)
  37086. e.push(this.map[t[n]].value);
  37087. return i(e)
  37088. }
  37089. ,
  37090. r.forEach = function(e, t) {
  37091. for (var i, n = Object.keys(this.map), r = 0; r < n.length; r++)
  37092. e.call(t, (i = this.map[n[r]]).value, i.key, this)
  37093. }
  37094. ,
  37095. r.set = function(e, t) {
  37096. var i = this.keyElem.verifyValue(e)
  37097. , n = this.valueElem.verifyValue(t);
  37098. return this.map[this.keyElem.valueToString(i)] = {
  37099. key: i,
  37100. value: n
  37101. },
  37102. this
  37103. }
  37104. ,
  37105. r.get = function(e) {
  37106. var t = this.keyElem.valueToString(this.keyElem.verifyValue(e));
  37107. if (t in this.map)
  37108. return this.map[t].value
  37109. }
  37110. ,
  37111. r.has = function(e) {
  37112. var t = this.keyElem.valueToString(this.keyElem.verifyValue(e));
  37113. return t in this.map
  37114. }
  37115. ,
  37116. n
  37117. }(r, r.Reflect),
  37118. r.loadProto = function(e, t, i) {
  37119. return ("string" == typeof t || t && "string" == typeof t.file && "string" == typeof t.root) && (i = t,
  37120. t = void 0),
  37121. r.loadJson(r.DotProto.Parser.parse(e), t, i)
  37122. }
  37123. ,
  37124. r.protoFromString = r.loadProto,
  37125. r.loadProtoFile = function(e, t, i) {
  37126. if (t && "object" == typeof t ? (i = t,
  37127. t = null) : t && "function" == typeof t || (t = null),
  37128. t)
  37129. return r.Util.fetch("string" == typeof e ? e : e.root + "/" + e.file, function(n) {
  37130. if (null === n)
  37131. return void t(Error("Failed to fetch file"));
  37132. try {
  37133. t(null, r.loadProto(n, i, e))
  37134. } catch (e) {
  37135. t(e)
  37136. }
  37137. });
  37138. var n = r.Util.fetch("object" == typeof e ? e.root + "/" + e.file : e);
  37139. return null === n ? null : r.loadProto(n, i, e)
  37140. }
  37141. ,
  37142. r.protoFromFile = r.loadProtoFile,
  37143. r.newBuilder = function(e) {
  37144. return e = e || {},
  37145. "undefined" == typeof e.convertFieldsToCamelCase && (e.convertFieldsToCamelCase = r.convertFieldsToCamelCase),
  37146. "undefined" == typeof e.populateAccessors && (e.populateAccessors = r.populateAccessors),
  37147. new r.Builder(e)
  37148. }
  37149. ,
  37150. r.loadJson = function(e, t, i) {
  37151. return ("string" == typeof t || t && "string" == typeof t.file && "string" == typeof t.root) && (i = t,
  37152. t = null),
  37153. t && "object" == typeof t || (t = r.newBuilder()),
  37154. "string" == typeof e && (e = JSON.parse(e)),
  37155. t.import(e, i),
  37156. t.resolveAll(),
  37157. t
  37158. }
  37159. ,
  37160. r.loadJsonFile = function(e, t, i) {
  37161. if (t && "object" == typeof t ? (i = t,
  37162. t = null) : t && "function" == typeof t || (t = null),
  37163. t)
  37164. return r.Util.fetch("string" == typeof e ? e : e.root + "/" + e.file, function(n) {
  37165. if (null === n)
  37166. return void t(Error("Failed to fetch file"));
  37167. try {
  37168. t(null, r.loadJson(JSON.parse(n), i, e))
  37169. } catch (e) {
  37170. t(e)
  37171. }
  37172. });
  37173. var n = r.Util.fetch("object" == typeof e ? e.root + "/" + e.file : e);
  37174. return null === n ? null : r.loadJson(JSON.parse(n), i, e)
  37175. }
  37176. ,
  37177. r
  37178. })
  37179. }
  37180. ).call(this, e("_process"))
  37181. }
  37182. , {
  37183. _process: 203,
  37184. bytebuffer: 215,
  37185. fs: 197,
  37186. path: 197
  37187. }],
  37188. 215: [function(e, t, i) {
  37189. !function(i, n) {
  37190. "function" == typeof define && define.amd ? define(["long"], n) : "function" == typeof e && "object" == typeof t && t && t.exports ? t.exports = function() {
  37191. var t;
  37192. try {
  37193. t = e("long")
  37194. } catch (e) {}
  37195. return n(t)
  37196. }() : (i.dcodeIO = i.dcodeIO || {}).ByteBuffer = n(i.dcodeIO.Long)
  37197. }(this, function(e) {
  37198. "use strict";
  37199. function t(e) {
  37200. var t = 0;
  37201. return function() {
  37202. return t < e.length ? e.charCodeAt(t++) : null
  37203. }
  37204. }
  37205. function i() {
  37206. var e = []
  37207. , t = [];
  37208. return function() {
  37209. return 0 === arguments.length ? t.join("") + l.apply(String, e) : (e.length + arguments.length > 1024 && (t.push(l.apply(String, e)),
  37210. e.length = 0),
  37211. void Array.prototype.push.apply(e, arguments))
  37212. }
  37213. }
  37214. function n(e, t, i, n, r) {
  37215. 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];
  37216. for (u += d,
  37217. o = p & (1 << -h) - 1,
  37218. p >>= -h,
  37219. h += s; h > 0; o = 256 * o + e[t + u],
  37220. u += d,
  37221. h -= 8)
  37222. ;
  37223. for (a = o & (1 << -h) - 1,
  37224. o >>= -h,
  37225. h += n; h > 0; a = 256 * a + e[t + u],
  37226. u += d,
  37227. h -= 8)
  37228. ;
  37229. if (0 === o)
  37230. o = 1 - c;
  37231. else {
  37232. if (o === l)
  37233. return a ? NaN : (p ? -1 : 1) * (1 / 0);
  37234. a += Math.pow(2, n),
  37235. o -= c
  37236. }
  37237. return (p ? -1 : 1) * a * Math.pow(2, o - n)
  37238. }
  37239. function r(e, t, i, n, r, o) {
  37240. 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;
  37241. for (t = Math.abs(t),
  37242. isNaN(t) || t === 1 / 0 ? (s = isNaN(t) ? 1 : 0,
  37243. a = h) : (a = Math.floor(Math.log(t) / Math.LN2),
  37244. t * (l = Math.pow(2, -a)) < 1 && (a--,
  37245. l *= 2),
  37246. t += a + u >= 1 ? d / l : d * Math.pow(2, 1 - u),
  37247. t * l >= 2 && (a++,
  37248. l /= 2),
  37249. a + u >= h ? (s = 0,
  37250. a = h) : a + u >= 1 ? (s = (t * l - 1) * Math.pow(2, r),
  37251. a += u) : (s = t * Math.pow(2, u - 1) * Math.pow(2, r),
  37252. a = 0)); r >= 8; e[i + p] = 255 & s,
  37253. p += f,
  37254. s /= 256,
  37255. r -= 8)
  37256. ;
  37257. for (a = a << r | s,
  37258. c += r; c > 0; e[i + p] = 255 & a,
  37259. p += f,
  37260. a /= 256,
  37261. c -= 8)
  37262. ;
  37263. e[i + p - f] |= 128 * g
  37264. }
  37265. var o = function(e, t, i) {
  37266. if ("undefined" == typeof e && (e = o.DEFAULT_CAPACITY),
  37267. "undefined" == typeof t && (t = o.DEFAULT_ENDIAN),
  37268. "undefined" == typeof i && (i = o.DEFAULT_NOASSERT),
  37269. !i) {
  37270. if (e |= 0,
  37271. e < 0)
  37272. throw RangeError("Illegal capacity");
  37273. t = !!t,
  37274. i = !!i
  37275. }
  37276. this.buffer = 0 === e ? s : new ArrayBuffer(e),
  37277. this.view = 0 === e ? null : new Uint8Array(this.buffer),
  37278. this.offset = 0,
  37279. this.markedOffset = -1,
  37280. this.limit = e,
  37281. this.littleEndian = t,
  37282. this.noAssert = i
  37283. };
  37284. o.VERSION = "5.0.1",
  37285. o.LITTLE_ENDIAN = !0,
  37286. o.BIG_ENDIAN = !1,
  37287. o.DEFAULT_CAPACITY = 16,
  37288. o.DEFAULT_ENDIAN = o.BIG_ENDIAN,
  37289. o.DEFAULT_NOASSERT = !1,
  37290. o.Long = e || null;
  37291. var a = o.prototype;
  37292. a.__isByteBuffer__,
  37293. Object.defineProperty(a, "__isByteBuffer__", {
  37294. value: !0,
  37295. enumerable: !1,
  37296. configurable: !1
  37297. });
  37298. var s = new ArrayBuffer(0)
  37299. , l = String.fromCharCode;
  37300. o.accessor = function() {
  37301. return Uint8Array
  37302. }
  37303. ,
  37304. o.allocate = function(e, t, i) {
  37305. return new o(e,t,i)
  37306. }
  37307. ,
  37308. o.concat = function(e, t, i, n) {
  37309. "boolean" != typeof t && "string" == typeof t || (n = i,
  37310. i = t,
  37311. t = void 0);
  37312. for (var r, a = 0, s = 0, l = e.length; s < l; ++s)
  37313. o.isByteBuffer(e[s]) || (e[s] = o.wrap(e[s], t)),
  37314. r = e[s].limit - e[s].offset,
  37315. r > 0 && (a += r);
  37316. if (0 === a)
  37317. return new o(0,i,n);
  37318. var c, h = new o(a,i,n);
  37319. for (s = 0; s < l; )
  37320. c = e[s++],
  37321. r = c.limit - c.offset,
  37322. r <= 0 || (h.view.set(c.view.subarray(c.offset, c.limit), h.offset),
  37323. h.offset += r);
  37324. return h.limit = h.offset,
  37325. h.offset = 0,
  37326. h
  37327. }
  37328. ,
  37329. o.isByteBuffer = function(e) {
  37330. return (e && e.__isByteBuffer__) === !0
  37331. }
  37332. ,
  37333. o.type = function() {
  37334. return ArrayBuffer
  37335. }
  37336. ,
  37337. o.wrap = function(e, t, i, n) {
  37338. if ("string" != typeof t && (n = i,
  37339. i = t,
  37340. t = void 0),
  37341. "string" == typeof e)
  37342. switch ("undefined" == typeof t && (t = "utf8"),
  37343. t) {
  37344. case "base64":
  37345. return o.fromBase64(e, i);
  37346. case "hex":
  37347. return o.fromHex(e, i);
  37348. case "binary":
  37349. return o.fromBinary(e, i);
  37350. case "utf8":
  37351. return o.fromUTF8(e, i);
  37352. case "debug":
  37353. return o.fromDebug(e, i);
  37354. default:
  37355. throw Error("Unsupported encoding: " + t)
  37356. }
  37357. if (null === e || "object" != typeof e)
  37358. throw TypeError("Illegal buffer");
  37359. var r;
  37360. if (o.isByteBuffer(e))
  37361. return r = a.clone.call(e),
  37362. r.markedOffset = -1,
  37363. r;
  37364. if (e instanceof Uint8Array)
  37365. r = new o(0,i,n),
  37366. e.length > 0 && (r.buffer = e.buffer,
  37367. r.offset = e.byteOffset,
  37368. r.limit = e.byteOffset + e.byteLength,
  37369. r.view = new Uint8Array(e.buffer));
  37370. else if (e instanceof ArrayBuffer)
  37371. r = new o(0,i,n),
  37372. e.byteLength > 0 && (r.buffer = e,
  37373. r.offset = 0,
  37374. r.limit = e.byteLength,
  37375. r.view = e.byteLength > 0 ? new Uint8Array(e) : null);
  37376. else {
  37377. if ("[object Array]" !== Object.prototype.toString.call(e))
  37378. throw TypeError("Illegal buffer");
  37379. r = new o(e.length,i,n),
  37380. r.limit = e.length;
  37381. for (var s = 0; s < e.length; ++s)
  37382. r.view[s] = e[s]
  37383. }
  37384. return r
  37385. }
  37386. ,
  37387. a.writeBitSet = function(e, t) {
  37388. var i = "undefined" == typeof t;
  37389. if (i && (t = this.offset),
  37390. !this.noAssert) {
  37391. if (!(e instanceof Array))
  37392. throw TypeError("Illegal BitSet: Not an array");
  37393. if ("number" != typeof t || t % 1 !== 0)
  37394. throw TypeError("Illegal offset: " + t + " (not an integer)");
  37395. if (t >>>= 0,
  37396. t < 0 || t + 0 > this.buffer.byteLength)
  37397. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  37398. }
  37399. var n, r = t, o = e.length, a = o >> 3, s = 0;
  37400. for (t += this.writeVarint32(o, t); a--; )
  37401. 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,
  37402. this.writeByte(n, t++);
  37403. if (s < o) {
  37404. var l = 0;
  37405. for (n = 0; s < o; )
  37406. n |= (1 & !!e[s++]) << l++;
  37407. this.writeByte(n, t++)
  37408. }
  37409. return i ? (this.offset = t,
  37410. this) : t - r
  37411. }
  37412. ,
  37413. a.readBitSet = function(e) {
  37414. var t = "undefined" == typeof e;
  37415. t && (e = this.offset);
  37416. var i, n = this.readVarint32(e), r = n.value, o = r >> 3, a = 0, s = [];
  37417. for (e += n.length; o--; )
  37418. i = this.readByte(e++),
  37419. s[a++] = !!(1 & i),
  37420. s[a++] = !!(2 & i),
  37421. s[a++] = !!(4 & i),
  37422. s[a++] = !!(8 & i),
  37423. s[a++] = !!(16 & i),
  37424. s[a++] = !!(32 & i),
  37425. s[a++] = !!(64 & i),
  37426. s[a++] = !!(128 & i);
  37427. if (a < r) {
  37428. var l = 0;
  37429. for (i = this.readByte(e++); a < r; )
  37430. s[a++] = !!(i >> l++ & 1)
  37431. }
  37432. return t && (this.offset = e),
  37433. s
  37434. }
  37435. ,
  37436. a.readBytes = function(e, t) {
  37437. var i = "undefined" == typeof t;
  37438. if (i && (t = this.offset),
  37439. !this.noAssert) {
  37440. if ("number" != typeof t || t % 1 !== 0)
  37441. throw TypeError("Illegal offset: " + t + " (not an integer)");
  37442. if (t >>>= 0,
  37443. t < 0 || t + e > this.buffer.byteLength)
  37444. throw RangeError("Illegal offset: 0 <= " + t + " (+" + e + ") <= " + this.buffer.byteLength)
  37445. }
  37446. var n = this.slice(t, t + e);
  37447. return i && (this.offset += e),
  37448. n
  37449. }
  37450. ,
  37451. a.writeBytes = a.append,
  37452. a.writeInt8 = function(e, t) {
  37453. var i = "undefined" == typeof t;
  37454. if (i && (t = this.offset),
  37455. !this.noAssert) {
  37456. if ("number" != typeof e || e % 1 !== 0)
  37457. throw TypeError("Illegal value: " + e + " (not an integer)");
  37458. if (e |= 0,
  37459. "number" != typeof t || t % 1 !== 0)
  37460. throw TypeError("Illegal offset: " + t + " (not an integer)");
  37461. if (t >>>= 0,
  37462. t < 0 || t + 0 > this.buffer.byteLength)
  37463. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  37464. }
  37465. t += 1;
  37466. var n = this.buffer.byteLength;
  37467. return t > n && this.resize((n *= 2) > t ? n : t),
  37468. t -= 1,
  37469. this.view[t] = e,
  37470. i && (this.offset += 1),
  37471. this
  37472. }
  37473. ,
  37474. a.writeByte = a.writeInt8,
  37475. a.readInt8 = function(e) {
  37476. var t = "undefined" == typeof e;
  37477. if (t && (e = this.offset),
  37478. !this.noAssert) {
  37479. if ("number" != typeof e || e % 1 !== 0)
  37480. throw TypeError("Illegal offset: " + e + " (not an integer)");
  37481. if (e >>>= 0,
  37482. e < 0 || e + 1 > this.buffer.byteLength)
  37483. throw RangeError("Illegal offset: 0 <= " + e + " (+1) <= " + this.buffer.byteLength)
  37484. }
  37485. var i = this.view[e];
  37486. return 128 === (128 & i) && (i = -(255 - i + 1)),
  37487. t && (this.offset += 1),
  37488. i
  37489. }
  37490. ,
  37491. a.readByte = a.readInt8,
  37492. a.writeUint8 = function(e, t) {
  37493. var i = "undefined" == typeof t;
  37494. if (i && (t = this.offset),
  37495. !this.noAssert) {
  37496. if ("number" != typeof e || e % 1 !== 0)
  37497. throw TypeError("Illegal value: " + e + " (not an integer)");
  37498. if (e >>>= 0,
  37499. "number" != typeof t || t % 1 !== 0)
  37500. throw TypeError("Illegal offset: " + t + " (not an integer)");
  37501. if (t >>>= 0,
  37502. t < 0 || t + 0 > this.buffer.byteLength)
  37503. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  37504. }
  37505. t += 1;
  37506. var n = this.buffer.byteLength;
  37507. return t > n && this.resize((n *= 2) > t ? n : t),
  37508. t -= 1,
  37509. this.view[t] = e,
  37510. i && (this.offset += 1),
  37511. this
  37512. }
  37513. ,
  37514. a.writeUInt8 = a.writeUint8,
  37515. a.readUint8 = function(e) {
  37516. var t = "undefined" == typeof e;
  37517. if (t && (e = this.offset),
  37518. !this.noAssert) {
  37519. if ("number" != typeof e || e % 1 !== 0)
  37520. throw TypeError("Illegal offset: " + e + " (not an integer)");
  37521. if (e >>>= 0,
  37522. e < 0 || e + 1 > this.buffer.byteLength)
  37523. throw RangeError("Illegal offset: 0 <= " + e + " (+1) <= " + this.buffer.byteLength)
  37524. }
  37525. var i = this.view[e];
  37526. return t && (this.offset += 1),
  37527. i
  37528. }
  37529. ,
  37530. a.readUInt8 = a.readUint8,
  37531. a.writeInt16 = function(e, t) {
  37532. var i = "undefined" == typeof t;
  37533. if (i && (t = this.offset),
  37534. !this.noAssert) {
  37535. if ("number" != typeof e || e % 1 !== 0)
  37536. throw TypeError("Illegal value: " + e + " (not an integer)");
  37537. if (e |= 0,
  37538. "number" != typeof t || t % 1 !== 0)
  37539. throw TypeError("Illegal offset: " + t + " (not an integer)");
  37540. if (t >>>= 0,
  37541. t < 0 || t + 0 > this.buffer.byteLength)
  37542. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  37543. }
  37544. t += 2;
  37545. var n = this.buffer.byteLength;
  37546. return t > n && this.resize((n *= 2) > t ? n : t),
  37547. t -= 2,
  37548. this.littleEndian ? (this.view[t + 1] = (65280 & e) >>> 8,
  37549. this.view[t] = 255 & e) : (this.view[t] = (65280 & e) >>> 8,
  37550. this.view[t + 1] = 255 & e),
  37551. i && (this.offset += 2),
  37552. this
  37553. }
  37554. ,
  37555. a.writeShort = a.writeInt16,
  37556. a.readInt16 = function(e) {
  37557. var t = "undefined" == typeof e;
  37558. if (t && (e = this.offset),
  37559. !this.noAssert) {
  37560. if ("number" != typeof e || e % 1 !== 0)
  37561. throw TypeError("Illegal offset: " + e + " (not an integer)");
  37562. if (e >>>= 0,
  37563. e < 0 || e + 2 > this.buffer.byteLength)
  37564. throw RangeError("Illegal offset: 0 <= " + e + " (+2) <= " + this.buffer.byteLength)
  37565. }
  37566. var i = 0;
  37567. return this.littleEndian ? (i = this.view[e],
  37568. i |= this.view[e + 1] << 8) : (i = this.view[e] << 8,
  37569. i |= this.view[e + 1]),
  37570. 32768 === (32768 & i) && (i = -(65535 - i + 1)),
  37571. t && (this.offset += 2),
  37572. i
  37573. }
  37574. ,
  37575. a.readShort = a.readInt16,
  37576. a.writeUint16 = function(e, t) {
  37577. var i = "undefined" == typeof t;
  37578. if (i && (t = this.offset),
  37579. !this.noAssert) {
  37580. if ("number" != typeof e || e % 1 !== 0)
  37581. throw TypeError("Illegal value: " + e + " (not an integer)");
  37582. if (e >>>= 0,
  37583. "number" != typeof t || t % 1 !== 0)
  37584. throw TypeError("Illegal offset: " + t + " (not an integer)");
  37585. if (t >>>= 0,
  37586. t < 0 || t + 0 > this.buffer.byteLength)
  37587. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  37588. }
  37589. t += 2;
  37590. var n = this.buffer.byteLength;
  37591. return t > n && this.resize((n *= 2) > t ? n : t),
  37592. t -= 2,
  37593. this.littleEndian ? (this.view[t + 1] = (65280 & e) >>> 8,
  37594. this.view[t] = 255 & e) : (this.view[t] = (65280 & e) >>> 8,
  37595. this.view[t + 1] = 255 & e),
  37596. i && (this.offset += 2),
  37597. this
  37598. }
  37599. ,
  37600. a.writeUInt16 = a.writeUint16,
  37601. a.readUint16 = function(e) {
  37602. var t = "undefined" == typeof e;
  37603. if (t && (e = this.offset),
  37604. !this.noAssert) {
  37605. if ("number" != typeof e || e % 1 !== 0)
  37606. throw TypeError("Illegal offset: " + e + " (not an integer)");
  37607. if (e >>>= 0,
  37608. e < 0 || e + 2 > this.buffer.byteLength)
  37609. throw RangeError("Illegal offset: 0 <= " + e + " (+2) <= " + this.buffer.byteLength)
  37610. }
  37611. var i = 0;
  37612. return this.littleEndian ? (i = this.view[e],
  37613. i |= this.view[e + 1] << 8) : (i = this.view[e] << 8,
  37614. i |= this.view[e + 1]),
  37615. t && (this.offset += 2),
  37616. i
  37617. }
  37618. ,
  37619. a.readUInt16 = a.readUint16,
  37620. a.writeInt32 = function(e, t) {
  37621. var i = "undefined" == typeof t;
  37622. if (i && (t = this.offset),
  37623. !this.noAssert) {
  37624. if ("number" != typeof e || e % 1 !== 0)
  37625. throw TypeError("Illegal value: " + e + " (not an integer)");
  37626. if (e |= 0,
  37627. "number" != typeof t || t % 1 !== 0)
  37628. throw TypeError("Illegal offset: " + t + " (not an integer)");
  37629. if (t >>>= 0,
  37630. t < 0 || t + 0 > this.buffer.byteLength)
  37631. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  37632. }
  37633. t += 4;
  37634. var n = this.buffer.byteLength;
  37635. return t > n && this.resize((n *= 2) > t ? n : t),
  37636. t -= 4,
  37637. this.littleEndian ? (this.view[t + 3] = e >>> 24 & 255,
  37638. this.view[t + 2] = e >>> 16 & 255,
  37639. this.view[t + 1] = e >>> 8 & 255,
  37640. this.view[t] = 255 & e) : (this.view[t] = e >>> 24 & 255,
  37641. this.view[t + 1] = e >>> 16 & 255,
  37642. this.view[t + 2] = e >>> 8 & 255,
  37643. this.view[t + 3] = 255 & e),
  37644. i && (this.offset += 4),
  37645. this
  37646. }
  37647. ,
  37648. a.writeInt = a.writeInt32,
  37649. a.readInt32 = function(e) {
  37650. var t = "undefined" == typeof e;
  37651. if (t && (e = this.offset),
  37652. !this.noAssert) {
  37653. if ("number" != typeof e || e % 1 !== 0)
  37654. throw TypeError("Illegal offset: " + e + " (not an integer)");
  37655. if (e >>>= 0,
  37656. e < 0 || e + 4 > this.buffer.byteLength)
  37657. throw RangeError("Illegal offset: 0 <= " + e + " (+4) <= " + this.buffer.byteLength)
  37658. }
  37659. var i = 0;
  37660. return this.littleEndian ? (i = this.view[e + 2] << 16,
  37661. i |= this.view[e + 1] << 8,
  37662. i |= this.view[e],
  37663. i += this.view[e + 3] << 24 >>> 0) : (i = this.view[e + 1] << 16,
  37664. i |= this.view[e + 2] << 8,
  37665. i |= this.view[e + 3],
  37666. i += this.view[e] << 24 >>> 0),
  37667. i |= 0,
  37668. t && (this.offset += 4),
  37669. i
  37670. }
  37671. ,
  37672. a.readInt = a.readInt32,
  37673. a.writeUint32 = function(e, t) {
  37674. var i = "undefined" == typeof t;
  37675. if (i && (t = this.offset),
  37676. !this.noAssert) {
  37677. if ("number" != typeof e || e % 1 !== 0)
  37678. throw TypeError("Illegal value: " + e + " (not an integer)");
  37679. if (e >>>= 0,
  37680. "number" != typeof t || t % 1 !== 0)
  37681. throw TypeError("Illegal offset: " + t + " (not an integer)");
  37682. if (t >>>= 0,
  37683. t < 0 || t + 0 > this.buffer.byteLength)
  37684. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  37685. }
  37686. t += 4;
  37687. var n = this.buffer.byteLength;
  37688. return t > n && this.resize((n *= 2) > t ? n : t),
  37689. t -= 4,
  37690. this.littleEndian ? (this.view[t + 3] = e >>> 24 & 255,
  37691. this.view[t + 2] = e >>> 16 & 255,
  37692. this.view[t + 1] = e >>> 8 & 255,
  37693. this.view[t] = 255 & e) : (this.view[t] = e >>> 24 & 255,
  37694. this.view[t + 1] = e >>> 16 & 255,
  37695. this.view[t + 2] = e >>> 8 & 255,
  37696. this.view[t + 3] = 255 & e),
  37697. i && (this.offset += 4),
  37698. this
  37699. }
  37700. ,
  37701. a.writeUInt32 = a.writeUint32,
  37702. a.readUint32 = 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 = 0;
  37713. return this.littleEndian ? (i = this.view[e + 2] << 16,
  37714. i |= this.view[e + 1] << 8,
  37715. i |= this.view[e],
  37716. i += this.view[e + 3] << 24 >>> 0) : (i = this.view[e + 1] << 16,
  37717. i |= this.view[e + 2] << 8,
  37718. i |= this.view[e + 3],
  37719. i += this.view[e] << 24 >>> 0),
  37720. t && (this.offset += 4),
  37721. i
  37722. }
  37723. ,
  37724. a.readUInt32 = a.readUint32,
  37725. e && (a.writeInt64 = function(t, i) {
  37726. var n = "undefined" == typeof i;
  37727. if (n && (i = this.offset),
  37728. !this.noAssert) {
  37729. if ("number" == typeof t)
  37730. t = e.fromNumber(t);
  37731. else if ("string" == typeof t)
  37732. t = e.fromString(t);
  37733. else if (!(t && t instanceof e))
  37734. throw TypeError("Illegal value: " + t + " (not an integer or Long)");
  37735. if ("number" != typeof i || i % 1 !== 0)
  37736. throw TypeError("Illegal offset: " + i + " (not an integer)");
  37737. if (i >>>= 0,
  37738. i < 0 || i + 0 > this.buffer.byteLength)
  37739. throw RangeError("Illegal offset: 0 <= " + i + " (+0) <= " + this.buffer.byteLength)
  37740. }
  37741. "number" == typeof t ? t = e.fromNumber(t) : "string" == typeof t && (t = e.fromString(t)),
  37742. i += 8;
  37743. var r = this.buffer.byteLength;
  37744. i > r && this.resize((r *= 2) > i ? r : i),
  37745. i -= 8;
  37746. var o = t.low
  37747. , a = t.high;
  37748. return this.littleEndian ? (this.view[i + 3] = o >>> 24 & 255,
  37749. this.view[i + 2] = o >>> 16 & 255,
  37750. this.view[i + 1] = o >>> 8 & 255,
  37751. this.view[i] = 255 & o,
  37752. i += 4,
  37753. this.view[i + 3] = a >>> 24 & 255,
  37754. this.view[i + 2] = a >>> 16 & 255,
  37755. this.view[i + 1] = a >>> 8 & 255,
  37756. this.view[i] = 255 & a) : (this.view[i] = a >>> 24 & 255,
  37757. this.view[i + 1] = a >>> 16 & 255,
  37758. this.view[i + 2] = a >>> 8 & 255,
  37759. this.view[i + 3] = 255 & a,
  37760. i += 4,
  37761. this.view[i] = o >>> 24 & 255,
  37762. this.view[i + 1] = o >>> 16 & 255,
  37763. this.view[i + 2] = o >>> 8 & 255,
  37764. this.view[i + 3] = 255 & o),
  37765. n && (this.offset += 8),
  37766. this
  37767. }
  37768. ,
  37769. a.writeLong = a.writeInt64,
  37770. a.readInt64 = function(t) {
  37771. var i = "undefined" == typeof t;
  37772. if (i && (t = this.offset),
  37773. !this.noAssert) {
  37774. if ("number" != typeof t || t % 1 !== 0)
  37775. throw TypeError("Illegal offset: " + t + " (not an integer)");
  37776. if (t >>>= 0,
  37777. t < 0 || t + 8 > this.buffer.byteLength)
  37778. throw RangeError("Illegal offset: 0 <= " + t + " (+8) <= " + this.buffer.byteLength)
  37779. }
  37780. var n = 0
  37781. , r = 0;
  37782. this.littleEndian ? (n = this.view[t + 2] << 16,
  37783. n |= this.view[t + 1] << 8,
  37784. n |= this.view[t],
  37785. n += this.view[t + 3] << 24 >>> 0,
  37786. t += 4,
  37787. r = this.view[t + 2] << 16,
  37788. r |= this.view[t + 1] << 8,
  37789. r |= this.view[t],
  37790. r += this.view[t + 3] << 24 >>> 0) : (r = this.view[t + 1] << 16,
  37791. r |= this.view[t + 2] << 8,
  37792. r |= this.view[t + 3],
  37793. r += this.view[t] << 24 >>> 0,
  37794. t += 4,
  37795. n = this.view[t + 1] << 16,
  37796. n |= this.view[t + 2] << 8,
  37797. n |= this.view[t + 3],
  37798. n += this.view[t] << 24 >>> 0);
  37799. var o = new e(n,r,!1);
  37800. return i && (this.offset += 8),
  37801. o
  37802. }
  37803. ,
  37804. a.readLong = a.readInt64,
  37805. a.writeUint64 = function(t, i) {
  37806. var n = "undefined" == typeof i;
  37807. if (n && (i = this.offset),
  37808. !this.noAssert) {
  37809. if ("number" == typeof t)
  37810. t = e.fromNumber(t);
  37811. else if ("string" == typeof t)
  37812. t = e.fromString(t);
  37813. else if (!(t && t instanceof e))
  37814. throw TypeError("Illegal value: " + t + " (not an integer or Long)");
  37815. if ("number" != typeof i || i % 1 !== 0)
  37816. throw TypeError("Illegal offset: " + i + " (not an integer)");
  37817. if (i >>>= 0,
  37818. i < 0 || i + 0 > this.buffer.byteLength)
  37819. throw RangeError("Illegal offset: 0 <= " + i + " (+0) <= " + this.buffer.byteLength)
  37820. }
  37821. "number" == typeof t ? t = e.fromNumber(t) : "string" == typeof t && (t = e.fromString(t)),
  37822. i += 8;
  37823. var r = this.buffer.byteLength;
  37824. i > r && this.resize((r *= 2) > i ? r : i),
  37825. i -= 8;
  37826. var o = t.low
  37827. , a = t.high;
  37828. return this.littleEndian ? (this.view[i + 3] = o >>> 24 & 255,
  37829. this.view[i + 2] = o >>> 16 & 255,
  37830. this.view[i + 1] = o >>> 8 & 255,
  37831. this.view[i] = 255 & o,
  37832. i += 4,
  37833. this.view[i + 3] = a >>> 24 & 255,
  37834. this.view[i + 2] = a >>> 16 & 255,
  37835. this.view[i + 1] = a >>> 8 & 255,
  37836. this.view[i] = 255 & a) : (this.view[i] = a >>> 24 & 255,
  37837. this.view[i + 1] = a >>> 16 & 255,
  37838. this.view[i + 2] = a >>> 8 & 255,
  37839. this.view[i + 3] = 255 & a,
  37840. i += 4,
  37841. this.view[i] = o >>> 24 & 255,
  37842. this.view[i + 1] = o >>> 16 & 255,
  37843. this.view[i + 2] = o >>> 8 & 255,
  37844. this.view[i + 3] = 255 & o),
  37845. n && (this.offset += 8),
  37846. this
  37847. }
  37848. ,
  37849. a.writeUInt64 = a.writeUint64,
  37850. a.readUint64 = function(t) {
  37851. var i = "undefined" == typeof t;
  37852. if (i && (t = this.offset),
  37853. !this.noAssert) {
  37854. if ("number" != typeof t || t % 1 !== 0)
  37855. throw TypeError("Illegal offset: " + t + " (not an integer)");
  37856. if (t >>>= 0,
  37857. t < 0 || t + 8 > this.buffer.byteLength)
  37858. throw RangeError("Illegal offset: 0 <= " + t + " (+8) <= " + this.buffer.byteLength)
  37859. }
  37860. var n = 0
  37861. , r = 0;
  37862. this.littleEndian ? (n = this.view[t + 2] << 16,
  37863. n |= this.view[t + 1] << 8,
  37864. n |= this.view[t],
  37865. n += this.view[t + 3] << 24 >>> 0,
  37866. t += 4,
  37867. r = this.view[t + 2] << 16,
  37868. r |= this.view[t + 1] << 8,
  37869. r |= this.view[t],
  37870. r += this.view[t + 3] << 24 >>> 0) : (r = this.view[t + 1] << 16,
  37871. r |= this.view[t + 2] << 8,
  37872. r |= this.view[t + 3],
  37873. r += this.view[t] << 24 >>> 0,
  37874. t += 4,
  37875. n = this.view[t + 1] << 16,
  37876. n |= this.view[t + 2] << 8,
  37877. n |= this.view[t + 3],
  37878. n += this.view[t] << 24 >>> 0);
  37879. var o = new e(n,r,!0);
  37880. return i && (this.offset += 8),
  37881. o
  37882. }
  37883. ,
  37884. a.readUInt64 = a.readUint64),
  37885. a.writeFloat32 = function(e, t) {
  37886. var i = "undefined" == typeof t;
  37887. if (i && (t = this.offset),
  37888. !this.noAssert) {
  37889. if ("number" != typeof e)
  37890. throw TypeError("Illegal value: " + e + " (not a number)");
  37891. if ("number" != typeof t || t % 1 !== 0)
  37892. throw TypeError("Illegal offset: " + t + " (not an integer)");
  37893. if (t >>>= 0,
  37894. t < 0 || t + 0 > this.buffer.byteLength)
  37895. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  37896. }
  37897. t += 4;
  37898. var n = this.buffer.byteLength;
  37899. return t > n && this.resize((n *= 2) > t ? n : t),
  37900. t -= 4,
  37901. r(this.view, e, t, this.littleEndian, 23, 4),
  37902. i && (this.offset += 4),
  37903. this
  37904. }
  37905. ,
  37906. a.writeFloat = a.writeFloat32,
  37907. a.readFloat32 = function(e) {
  37908. var t = "undefined" == typeof e;
  37909. if (t && (e = this.offset),
  37910. !this.noAssert) {
  37911. if ("number" != typeof e || e % 1 !== 0)
  37912. throw TypeError("Illegal offset: " + e + " (not an integer)");
  37913. if (e >>>= 0,
  37914. e < 0 || e + 4 > this.buffer.byteLength)
  37915. throw RangeError("Illegal offset: 0 <= " + e + " (+4) <= " + this.buffer.byteLength)
  37916. }
  37917. var i = n(this.view, e, this.littleEndian, 23, 4);
  37918. return t && (this.offset += 4),
  37919. i
  37920. }
  37921. ,
  37922. a.readFloat = a.readFloat32,
  37923. a.writeFloat64 = function(e, t) {
  37924. var i = "undefined" == typeof t;
  37925. if (i && (t = this.offset),
  37926. !this.noAssert) {
  37927. if ("number" != typeof e)
  37928. throw TypeError("Illegal value: " + e + " (not a number)");
  37929. if ("number" != typeof t || t % 1 !== 0)
  37930. throw TypeError("Illegal offset: " + t + " (not an integer)");
  37931. if (t >>>= 0,
  37932. t < 0 || t + 0 > this.buffer.byteLength)
  37933. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  37934. }
  37935. t += 8;
  37936. var n = this.buffer.byteLength;
  37937. return t > n && this.resize((n *= 2) > t ? n : t),
  37938. t -= 8,
  37939. r(this.view, e, t, this.littleEndian, 52, 8),
  37940. i && (this.offset += 8),
  37941. this
  37942. }
  37943. ,
  37944. a.writeDouble = a.writeFloat64,
  37945. a.readFloat64 = function(e) {
  37946. var t = "undefined" == typeof e;
  37947. if (t && (e = this.offset),
  37948. !this.noAssert) {
  37949. if ("number" != typeof e || e % 1 !== 0)
  37950. throw TypeError("Illegal offset: " + e + " (not an integer)");
  37951. if (e >>>= 0,
  37952. e < 0 || e + 8 > this.buffer.byteLength)
  37953. throw RangeError("Illegal offset: 0 <= " + e + " (+8) <= " + this.buffer.byteLength)
  37954. }
  37955. var i = n(this.view, e, this.littleEndian, 52, 8);
  37956. return t && (this.offset += 8),
  37957. i
  37958. }
  37959. ,
  37960. a.readDouble = a.readFloat64,
  37961. o.MAX_VARINT32_BYTES = 5,
  37962. o.calculateVarint32 = function(e) {
  37963. return e >>>= 0,
  37964. e < 128 ? 1 : e < 16384 ? 2 : e < 1 << 21 ? 3 : e < 1 << 28 ? 4 : 5
  37965. }
  37966. ,
  37967. o.zigZagEncode32 = function(e) {
  37968. return ((e |= 0) << 1 ^ e >> 31) >>> 0
  37969. }
  37970. ,
  37971. o.zigZagDecode32 = function(e) {
  37972. return e >>> 1 ^ -(1 & e) | 0
  37973. }
  37974. ,
  37975. a.writeVarint32 = function(e, t) {
  37976. var i = "undefined" == typeof t;
  37977. if (i && (t = this.offset),
  37978. !this.noAssert) {
  37979. if ("number" != typeof e || e % 1 !== 0)
  37980. throw TypeError("Illegal value: " + e + " (not an integer)");
  37981. if (e |= 0,
  37982. "number" != typeof t || t % 1 !== 0)
  37983. throw TypeError("Illegal offset: " + t + " (not an integer)");
  37984. if (t >>>= 0,
  37985. t < 0 || t + 0 > this.buffer.byteLength)
  37986. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  37987. }
  37988. var n, r = o.calculateVarint32(e);
  37989. t += r;
  37990. var a = this.buffer.byteLength;
  37991. for (t > a && this.resize((a *= 2) > t ? a : t),
  37992. t -= r,
  37993. e >>>= 0; e >= 128; )
  37994. n = 127 & e | 128,
  37995. this.view[t++] = n,
  37996. e >>>= 7;
  37997. return this.view[t++] = e,
  37998. i ? (this.offset = t,
  37999. this) : r
  38000. }
  38001. ,
  38002. a.writeVarint32ZigZag = function(e, t) {
  38003. return this.writeVarint32(o.zigZagEncode32(e), t)
  38004. }
  38005. ,
  38006. a.readVarint32 = function(e) {
  38007. var t = "undefined" == typeof e;
  38008. if (t && (e = this.offset),
  38009. !this.noAssert) {
  38010. if ("number" != typeof e || e % 1 !== 0)
  38011. throw TypeError("Illegal offset: " + e + " (not an integer)");
  38012. if (e >>>= 0,
  38013. e < 0 || e + 1 > this.buffer.byteLength)
  38014. throw RangeError("Illegal offset: 0 <= " + e + " (+1) <= " + this.buffer.byteLength)
  38015. }
  38016. var i, n = 0, r = 0;
  38017. do {
  38018. if (!this.noAssert && e > this.limit) {
  38019. var o = Error("Truncated");
  38020. throw o.truncated = !0,
  38021. o
  38022. }
  38023. i = this.view[e++],
  38024. n < 5 && (r |= (127 & i) << 7 * n),
  38025. ++n
  38026. } while (0 !== (128 & i));return r |= 0,
  38027. t ? (this.offset = e,
  38028. r) : {
  38029. value: r,
  38030. length: n
  38031. }
  38032. }
  38033. ,
  38034. a.readVarint32ZigZag = function(e) {
  38035. var t = this.readVarint32(e);
  38036. return "object" == typeof t ? t.value = o.zigZagDecode32(t.value) : t = o.zigZagDecode32(t),
  38037. t
  38038. }
  38039. ,
  38040. e && (o.MAX_VARINT64_BYTES = 10,
  38041. o.calculateVarint64 = function(t) {
  38042. "number" == typeof t ? t = e.fromNumber(t) : "string" == typeof t && (t = e.fromString(t));
  38043. var i = t.toInt() >>> 0
  38044. , n = t.shiftRightUnsigned(28).toInt() >>> 0
  38045. , r = t.shiftRightUnsigned(56).toInt() >>> 0;
  38046. 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
  38047. }
  38048. ,
  38049. o.zigZagEncode64 = function(t) {
  38050. return "number" == typeof t ? t = e.fromNumber(t, !1) : "string" == typeof t ? t = e.fromString(t, !1) : t.unsigned !== !1 && (t = t.toSigned()),
  38051. t.shiftLeft(1).xor(t.shiftRight(63)).toUnsigned()
  38052. }
  38053. ,
  38054. o.zigZagDecode64 = function(t) {
  38055. return "number" == typeof t ? t = e.fromNumber(t, !1) : "string" == typeof t ? t = e.fromString(t, !1) : t.unsigned !== !1 && (t = t.toSigned()),
  38056. t.shiftRightUnsigned(1).xor(t.and(e.ONE).toSigned().negate()).toSigned()
  38057. }
  38058. ,
  38059. a.writeVarint64 = function(t, i) {
  38060. var n = "undefined" == typeof i;
  38061. if (n && (i = this.offset),
  38062. !this.noAssert) {
  38063. if ("number" == typeof t)
  38064. t = e.fromNumber(t);
  38065. else if ("string" == typeof t)
  38066. t = e.fromString(t);
  38067. else if (!(t && t instanceof e))
  38068. throw TypeError("Illegal value: " + t + " (not an integer or Long)");
  38069. if ("number" != typeof i || i % 1 !== 0)
  38070. throw TypeError("Illegal offset: " + i + " (not an integer)");
  38071. if (i >>>= 0,
  38072. i < 0 || i + 0 > this.buffer.byteLength)
  38073. throw RangeError("Illegal offset: 0 <= " + i + " (+0) <= " + this.buffer.byteLength)
  38074. }
  38075. "number" == typeof t ? t = e.fromNumber(t, !1) : "string" == typeof t ? t = e.fromString(t, !1) : t.unsigned !== !1 && (t = t.toSigned());
  38076. var r = o.calculateVarint64(t)
  38077. , a = t.toInt() >>> 0
  38078. , s = t.shiftRightUnsigned(28).toInt() >>> 0
  38079. , l = t.shiftRightUnsigned(56).toInt() >>> 0;
  38080. i += r;
  38081. var c = this.buffer.byteLength;
  38082. switch (i > c && this.resize((c *= 2) > i ? c : i),
  38083. i -= r,
  38084. r) {
  38085. case 10:
  38086. this.view[i + 9] = l >>> 7 & 1;
  38087. case 9:
  38088. this.view[i + 8] = 9 !== r ? 128 | l : 127 & l;
  38089. case 8:
  38090. this.view[i + 7] = 8 !== r ? s >>> 21 | 128 : s >>> 21 & 127;
  38091. case 7:
  38092. this.view[i + 6] = 7 !== r ? s >>> 14 | 128 : s >>> 14 & 127;
  38093. case 6:
  38094. this.view[i + 5] = 6 !== r ? s >>> 7 | 128 : s >>> 7 & 127;
  38095. case 5:
  38096. this.view[i + 4] = 5 !== r ? 128 | s : 127 & s;
  38097. case 4:
  38098. this.view[i + 3] = 4 !== r ? a >>> 21 | 128 : a >>> 21 & 127;
  38099. case 3:
  38100. this.view[i + 2] = 3 !== r ? a >>> 14 | 128 : a >>> 14 & 127;
  38101. case 2:
  38102. this.view[i + 1] = 2 !== r ? a >>> 7 | 128 : a >>> 7 & 127;
  38103. case 1:
  38104. this.view[i] = 1 !== r ? 128 | a : 127 & a
  38105. }
  38106. return n ? (this.offset += r,
  38107. this) : r
  38108. }
  38109. ,
  38110. a.writeVarint64ZigZag = function(e, t) {
  38111. return this.writeVarint64(o.zigZagEncode64(e), t)
  38112. }
  38113. ,
  38114. a.readVarint64 = function(t) {
  38115. var i = "undefined" == typeof t;
  38116. if (i && (t = this.offset),
  38117. !this.noAssert) {
  38118. if ("number" != typeof t || t % 1 !== 0)
  38119. throw TypeError("Illegal offset: " + t + " (not an integer)");
  38120. if (t >>>= 0,
  38121. t < 0 || t + 1 > this.buffer.byteLength)
  38122. throw RangeError("Illegal offset: 0 <= " + t + " (+1) <= " + this.buffer.byteLength)
  38123. }
  38124. var n = t
  38125. , r = 0
  38126. , o = 0
  38127. , a = 0
  38128. , s = 0;
  38129. if (s = this.view[t++],
  38130. r = 127 & s,
  38131. 128 & s && (s = this.view[t++],
  38132. r |= (127 & s) << 7,
  38133. (128 & s || this.noAssert && "undefined" == typeof s) && (s = this.view[t++],
  38134. r |= (127 & s) << 14,
  38135. (128 & s || this.noAssert && "undefined" == typeof s) && (s = this.view[t++],
  38136. r |= (127 & s) << 21,
  38137. (128 & s || this.noAssert && "undefined" == typeof s) && (s = this.view[t++],
  38138. o = 127 & s,
  38139. (128 & s || this.noAssert && "undefined" == typeof s) && (s = this.view[t++],
  38140. o |= (127 & s) << 7,
  38141. (128 & s || this.noAssert && "undefined" == typeof s) && (s = this.view[t++],
  38142. o |= (127 & s) << 14,
  38143. (128 & s || this.noAssert && "undefined" == typeof s) && (s = this.view[t++],
  38144. o |= (127 & s) << 21,
  38145. (128 & s || this.noAssert && "undefined" == typeof s) && (s = this.view[t++],
  38146. a = 127 & s,
  38147. (128 & s || this.noAssert && "undefined" == typeof s) && (s = this.view[t++],
  38148. a |= (127 & s) << 7,
  38149. 128 & s || this.noAssert && "undefined" == typeof s))))))))))
  38150. throw Error("Buffer overrun");
  38151. var l = e.fromBits(r | o << 28, o >>> 4 | a << 24, !1);
  38152. return i ? (this.offset = t,
  38153. l) : {
  38154. value: l,
  38155. length: t - n
  38156. }
  38157. }
  38158. ,
  38159. a.readVarint64ZigZag = function(t) {
  38160. var i = this.readVarint64(t);
  38161. return i && i.value instanceof e ? i.value = o.zigZagDecode64(i.value) : i = o.zigZagDecode64(i),
  38162. i
  38163. }
  38164. ),
  38165. a.writeCString = function(e, i) {
  38166. var n = "undefined" == typeof i;
  38167. n && (i = this.offset);
  38168. var r, o = e.length;
  38169. if (!this.noAssert) {
  38170. if ("string" != typeof e)
  38171. throw TypeError("Illegal str: Not a string");
  38172. for (r = 0; r < o; ++r)
  38173. if (0 === e.charCodeAt(r))
  38174. throw RangeError("Illegal str: Contains NULL-characters");
  38175. if ("number" != typeof i || i % 1 !== 0)
  38176. throw TypeError("Illegal offset: " + i + " (not an integer)");
  38177. if (i >>>= 0,
  38178. i < 0 || i + 0 > this.buffer.byteLength)
  38179. throw RangeError("Illegal offset: 0 <= " + i + " (+0) <= " + this.buffer.byteLength)
  38180. }
  38181. o = h.calculateUTF16asUTF8(t(e))[1],
  38182. i += o + 1;
  38183. var a = this.buffer.byteLength;
  38184. return i > a && this.resize((a *= 2) > i ? a : i),
  38185. i -= o + 1,
  38186. h.encodeUTF16toUTF8(t(e), function(e) {
  38187. this.view[i++] = e
  38188. }
  38189. .bind(this)),
  38190. this.view[i++] = 0,
  38191. n ? (this.offset = i,
  38192. this) : o
  38193. }
  38194. ,
  38195. a.readCString = function(e) {
  38196. var t = "undefined" == typeof e;
  38197. if (t && (e = this.offset),
  38198. !this.noAssert) {
  38199. if ("number" != typeof e || e % 1 !== 0)
  38200. throw TypeError("Illegal offset: " + e + " (not an integer)");
  38201. if (e >>>= 0,
  38202. e < 0 || e + 1 > this.buffer.byteLength)
  38203. throw RangeError("Illegal offset: 0 <= " + e + " (+1) <= " + this.buffer.byteLength)
  38204. }
  38205. var n, r = e, o = -1;
  38206. return h.decodeUTF8toUTF16(function() {
  38207. if (0 === o)
  38208. return null;
  38209. if (e >= this.limit)
  38210. throw RangeError("Illegal range: Truncated data, " + e + " < " + this.limit);
  38211. return o = this.view[e++],
  38212. 0 === o ? null : o
  38213. }
  38214. .bind(this), n = i(), !0),
  38215. t ? (this.offset = e,
  38216. n()) : {
  38217. string: n(),
  38218. length: e - r
  38219. }
  38220. }
  38221. ,
  38222. a.writeIString = function(e, i) {
  38223. var n = "undefined" == typeof i;
  38224. if (n && (i = this.offset),
  38225. !this.noAssert) {
  38226. if ("string" != typeof e)
  38227. throw TypeError("Illegal str: Not a string");
  38228. if ("number" != typeof i || i % 1 !== 0)
  38229. throw TypeError("Illegal offset: " + i + " (not an integer)");
  38230. if (i >>>= 0,
  38231. i < 0 || i + 0 > this.buffer.byteLength)
  38232. throw RangeError("Illegal offset: 0 <= " + i + " (+0) <= " + this.buffer.byteLength)
  38233. }
  38234. var r, o = i;
  38235. r = h.calculateUTF16asUTF8(t(e), this.noAssert)[1],
  38236. i += 4 + r;
  38237. var a = this.buffer.byteLength;
  38238. if (i > a && this.resize((a *= 2) > i ? a : i),
  38239. i -= 4 + r,
  38240. this.littleEndian ? (this.view[i + 3] = r >>> 24 & 255,
  38241. this.view[i + 2] = r >>> 16 & 255,
  38242. this.view[i + 1] = r >>> 8 & 255,
  38243. this.view[i] = 255 & r) : (this.view[i] = r >>> 24 & 255,
  38244. this.view[i + 1] = r >>> 16 & 255,
  38245. this.view[i + 2] = r >>> 8 & 255,
  38246. this.view[i + 3] = 255 & r),
  38247. i += 4,
  38248. h.encodeUTF16toUTF8(t(e), function(e) {
  38249. this.view[i++] = e
  38250. }
  38251. .bind(this)),
  38252. i !== o + 4 + r)
  38253. throw RangeError("Illegal range: Truncated data, " + i + " == " + (i + 4 + r));
  38254. return n ? (this.offset = i,
  38255. this) : i - o
  38256. }
  38257. ,
  38258. a.readIString = function(e) {
  38259. var t = "undefined" == typeof e;
  38260. if (t && (e = this.offset),
  38261. !this.noAssert) {
  38262. if ("number" != typeof e || e % 1 !== 0)
  38263. throw TypeError("Illegal offset: " + e + " (not an integer)");
  38264. if (e >>>= 0,
  38265. e < 0 || e + 4 > this.buffer.byteLength)
  38266. throw RangeError("Illegal offset: 0 <= " + e + " (+4) <= " + this.buffer.byteLength)
  38267. }
  38268. var i = e
  38269. , n = this.readUint32(e)
  38270. , r = this.readUTF8String(n, o.METRICS_BYTES, e += 4);
  38271. return e += r.length,
  38272. t ? (this.offset = e,
  38273. r.string) : {
  38274. string: r.string,
  38275. length: e - i
  38276. }
  38277. }
  38278. ,
  38279. o.METRICS_CHARS = "c",
  38280. o.METRICS_BYTES = "b",
  38281. a.writeUTF8String = function(e, i) {
  38282. var n = "undefined" == typeof i;
  38283. if (n && (i = this.offset),
  38284. !this.noAssert) {
  38285. if ("number" != typeof i || i % 1 !== 0)
  38286. throw TypeError("Illegal offset: " + i + " (not an integer)");
  38287. if (i >>>= 0,
  38288. i < 0 || i + 0 > this.buffer.byteLength)
  38289. throw RangeError("Illegal offset: 0 <= " + i + " (+0) <= " + this.buffer.byteLength)
  38290. }
  38291. var r, o = i;
  38292. r = h.calculateUTF16asUTF8(t(e))[1],
  38293. i += r;
  38294. var a = this.buffer.byteLength;
  38295. return i > a && this.resize((a *= 2) > i ? a : i),
  38296. i -= r,
  38297. h.encodeUTF16toUTF8(t(e), function(e) {
  38298. this.view[i++] = e
  38299. }
  38300. .bind(this)),
  38301. n ? (this.offset = i,
  38302. this) : i - o
  38303. }
  38304. ,
  38305. a.writeString = a.writeUTF8String,
  38306. o.calculateUTF8Chars = function(e) {
  38307. return h.calculateUTF16asUTF8(t(e))[0]
  38308. }
  38309. ,
  38310. o.calculateUTF8Bytes = function(e) {
  38311. return h.calculateUTF16asUTF8(t(e))[1]
  38312. }
  38313. ,
  38314. o.calculateString = o.calculateUTF8Bytes,
  38315. a.readUTF8String = function(e, t, n) {
  38316. "number" == typeof t && (n = t,
  38317. t = void 0);
  38318. var r = "undefined" == typeof n;
  38319. if (r && (n = this.offset),
  38320. "undefined" == typeof t && (t = o.METRICS_CHARS),
  38321. !this.noAssert) {
  38322. if ("number" != typeof e || e % 1 !== 0)
  38323. throw TypeError("Illegal length: " + e + " (not an integer)");
  38324. if (e |= 0,
  38325. "number" != typeof n || n % 1 !== 0)
  38326. throw TypeError("Illegal offset: " + n + " (not an integer)");
  38327. if (n >>>= 0,
  38328. n < 0 || n + 0 > this.buffer.byteLength)
  38329. throw RangeError("Illegal offset: 0 <= " + n + " (+0) <= " + this.buffer.byteLength)
  38330. }
  38331. var a, s = 0, l = n;
  38332. if (t === o.METRICS_CHARS) {
  38333. if (a = i(),
  38334. h.decodeUTF8(function() {
  38335. return s < e && n < this.limit ? this.view[n++] : null
  38336. }
  38337. .bind(this), function(e) {
  38338. ++s,
  38339. h.UTF8toUTF16(e, a)
  38340. }),
  38341. s !== e)
  38342. throw RangeError("Illegal range: Truncated data, " + s + " == " + e);
  38343. return r ? (this.offset = n,
  38344. a()) : {
  38345. string: a(),
  38346. length: n - l
  38347. }
  38348. }
  38349. if (t === o.METRICS_BYTES) {
  38350. if (!this.noAssert) {
  38351. if ("number" != typeof n || n % 1 !== 0)
  38352. throw TypeError("Illegal offset: " + n + " (not an integer)");
  38353. if (n >>>= 0,
  38354. n < 0 || n + e > this.buffer.byteLength)
  38355. throw RangeError("Illegal offset: 0 <= " + n + " (+" + e + ") <= " + this.buffer.byteLength)
  38356. }
  38357. var c = n + e;
  38358. if (h.decodeUTF8toUTF16(function() {
  38359. return n < c ? this.view[n++] : null
  38360. }
  38361. .bind(this), a = i(), this.noAssert),
  38362. n !== c)
  38363. throw RangeError("Illegal range: Truncated data, " + n + " == " + c);
  38364. return r ? (this.offset = n,
  38365. a()) : {
  38366. string: a(),
  38367. length: n - l
  38368. }
  38369. }
  38370. throw TypeError("Unsupported metrics: " + t)
  38371. }
  38372. ,
  38373. a.readString = a.readUTF8String,
  38374. a.writeVString = function(e, i) {
  38375. var n = "undefined" == typeof i;
  38376. if (n && (i = this.offset),
  38377. !this.noAssert) {
  38378. if ("string" != typeof e)
  38379. throw TypeError("Illegal str: Not a string");
  38380. if ("number" != typeof i || i % 1 !== 0)
  38381. throw TypeError("Illegal offset: " + i + " (not an integer)");
  38382. if (i >>>= 0,
  38383. i < 0 || i + 0 > this.buffer.byteLength)
  38384. throw RangeError("Illegal offset: 0 <= " + i + " (+0) <= " + this.buffer.byteLength)
  38385. }
  38386. var r, a, s = i;
  38387. r = h.calculateUTF16asUTF8(t(e), this.noAssert)[1],
  38388. a = o.calculateVarint32(r),
  38389. i += a + r;
  38390. var l = this.buffer.byteLength;
  38391. if (i > l && this.resize((l *= 2) > i ? l : i),
  38392. i -= a + r,
  38393. i += this.writeVarint32(r, i),
  38394. h.encodeUTF16toUTF8(t(e), function(e) {
  38395. this.view[i++] = e
  38396. }
  38397. .bind(this)),
  38398. i !== s + r + a)
  38399. throw RangeError("Illegal range: Truncated data, " + i + " == " + (i + r + a));
  38400. return n ? (this.offset = i,
  38401. this) : i - s
  38402. }
  38403. ,
  38404. a.readVString = function(e) {
  38405. var t = "undefined" == typeof e;
  38406. if (t && (e = this.offset),
  38407. !this.noAssert) {
  38408. if ("number" != typeof e || e % 1 !== 0)
  38409. throw TypeError("Illegal offset: " + e + " (not an integer)");
  38410. if (e >>>= 0,
  38411. e < 0 || e + 1 > this.buffer.byteLength)
  38412. throw RangeError("Illegal offset: 0 <= " + e + " (+1) <= " + this.buffer.byteLength)
  38413. }
  38414. var i = e
  38415. , n = this.readVarint32(e)
  38416. , r = this.readUTF8String(n.value, o.METRICS_BYTES, e += n.length);
  38417. return e += r.length,
  38418. t ? (this.offset = e,
  38419. r.string) : {
  38420. string: r.string,
  38421. length: e - i
  38422. }
  38423. }
  38424. ,
  38425. a.append = function(e, t, i) {
  38426. "number" != typeof t && "string" == typeof t || (i = t,
  38427. t = void 0);
  38428. var n = "undefined" == typeof i;
  38429. if (n && (i = this.offset),
  38430. !this.noAssert) {
  38431. if ("number" != typeof i || i % 1 !== 0)
  38432. throw TypeError("Illegal offset: " + i + " (not an integer)");
  38433. if (i >>>= 0,
  38434. i < 0 || i + 0 > this.buffer.byteLength)
  38435. throw RangeError("Illegal offset: 0 <= " + i + " (+0) <= " + this.buffer.byteLength)
  38436. }
  38437. e instanceof o || (e = o.wrap(e, t));
  38438. var r = e.limit - e.offset;
  38439. if (r <= 0)
  38440. return this;
  38441. i += r;
  38442. var a = this.buffer.byteLength;
  38443. return i > a && this.resize((a *= 2) > i ? a : i),
  38444. i -= r,
  38445. this.view.set(e.view.subarray(e.offset, e.limit), i),
  38446. e.offset += r,
  38447. n && (this.offset += r),
  38448. this
  38449. }
  38450. ,
  38451. a.appendTo = function(e, t) {
  38452. return e.append(this, t),
  38453. this
  38454. }
  38455. ,
  38456. a.assert = function(e) {
  38457. return this.noAssert = !e,
  38458. this
  38459. }
  38460. ,
  38461. a.capacity = function() {
  38462. return this.buffer.byteLength
  38463. }
  38464. ,
  38465. a.clear = function() {
  38466. return this.offset = 0,
  38467. this.limit = this.buffer.byteLength,
  38468. this.markedOffset = -1,
  38469. this
  38470. }
  38471. ,
  38472. a.clone = function(e) {
  38473. var t = new o(0,this.littleEndian,this.noAssert);
  38474. return e ? (t.buffer = new ArrayBuffer(this.buffer.byteLength),
  38475. t.view = new Uint8Array(t.buffer)) : (t.buffer = this.buffer,
  38476. t.view = this.view),
  38477. t.offset = this.offset,
  38478. t.markedOffset = this.markedOffset,
  38479. t.limit = this.limit,
  38480. t
  38481. }
  38482. ,
  38483. a.compact = function(e, t) {
  38484. if ("undefined" == typeof e && (e = this.offset),
  38485. "undefined" == typeof t && (t = this.limit),
  38486. !this.noAssert) {
  38487. if ("number" != typeof e || e % 1 !== 0)
  38488. throw TypeError("Illegal begin: Not an integer");
  38489. if (e >>>= 0,
  38490. "number" != typeof t || t % 1 !== 0)
  38491. throw TypeError("Illegal end: Not an integer");
  38492. if (t >>>= 0,
  38493. e < 0 || e > t || t > this.buffer.byteLength)
  38494. throw RangeError("Illegal range: 0 <= " + e + " <= " + t + " <= " + this.buffer.byteLength)
  38495. }
  38496. if (0 === e && t === this.buffer.byteLength)
  38497. return this;
  38498. var i = t - e;
  38499. if (0 === i)
  38500. return this.buffer = s,
  38501. this.view = null,
  38502. this.markedOffset >= 0 && (this.markedOffset -= e),
  38503. this.offset = 0,
  38504. this.limit = 0,
  38505. this;
  38506. var n = new ArrayBuffer(i)
  38507. , r = new Uint8Array(n);
  38508. return r.set(this.view.subarray(e, t)),
  38509. this.buffer = n,
  38510. this.view = r,
  38511. this.markedOffset >= 0 && (this.markedOffset -= e),
  38512. this.offset = 0,
  38513. this.limit = i,
  38514. this
  38515. }
  38516. ,
  38517. a.copy = function(e, t) {
  38518. if ("undefined" == typeof e && (e = this.offset),
  38519. "undefined" == typeof t && (t = this.limit),
  38520. !this.noAssert) {
  38521. if ("number" != typeof e || e % 1 !== 0)
  38522. throw TypeError("Illegal begin: Not an integer");
  38523. if (e >>>= 0,
  38524. "number" != typeof t || t % 1 !== 0)
  38525. throw TypeError("Illegal end: Not an integer");
  38526. if (t >>>= 0,
  38527. e < 0 || e > t || t > this.buffer.byteLength)
  38528. throw RangeError("Illegal range: 0 <= " + e + " <= " + t + " <= " + this.buffer.byteLength)
  38529. }
  38530. if (e === t)
  38531. return new o(0,this.littleEndian,this.noAssert);
  38532. var i = t - e
  38533. , n = new o(i,this.littleEndian,this.noAssert);
  38534. return n.offset = 0,
  38535. n.limit = i,
  38536. n.markedOffset >= 0 && (n.markedOffset -= e),
  38537. this.copyTo(n, 0, e, t),
  38538. n
  38539. }
  38540. ,
  38541. a.copyTo = function(e, t, i, n) {
  38542. var r, a;
  38543. if (!this.noAssert && !o.isByteBuffer(e))
  38544. throw TypeError("Illegal target: Not a ByteBuffer");
  38545. if (t = (a = "undefined" == typeof t) ? e.offset : 0 | t,
  38546. i = (r = "undefined" == typeof i) ? this.offset : 0 | i,
  38547. n = "undefined" == typeof n ? this.limit : 0 | n,
  38548. t < 0 || t > e.buffer.byteLength)
  38549. throw RangeError("Illegal target range: 0 <= " + t + " <= " + e.buffer.byteLength);
  38550. if (i < 0 || n > this.buffer.byteLength)
  38551. throw RangeError("Illegal source range: 0 <= " + i + " <= " + this.buffer.byteLength);
  38552. var s = n - i;
  38553. return 0 === s ? e : (e.ensureCapacity(t + s),
  38554. e.view.set(this.view.subarray(i, n), t),
  38555. r && (this.offset += s),
  38556. a && (e.offset += s),
  38557. this)
  38558. }
  38559. ,
  38560. a.ensureCapacity = function(e) {
  38561. var t = this.buffer.byteLength;
  38562. return t < e ? this.resize((t *= 2) > e ? t : e) : this
  38563. }
  38564. ,
  38565. a.fill = function(e, t, i) {
  38566. var n = "undefined" == typeof t;
  38567. if (n && (t = this.offset),
  38568. "string" == typeof e && e.length > 0 && (e = e.charCodeAt(0)),
  38569. "undefined" == typeof t && (t = this.offset),
  38570. "undefined" == typeof i && (i = this.limit),
  38571. !this.noAssert) {
  38572. if ("number" != typeof e || e % 1 !== 0)
  38573. throw TypeError("Illegal value: " + e + " (not an integer)");
  38574. if (e |= 0,
  38575. "number" != typeof t || t % 1 !== 0)
  38576. throw TypeError("Illegal begin: Not an integer");
  38577. if (t >>>= 0,
  38578. "number" != typeof i || i % 1 !== 0)
  38579. throw TypeError("Illegal end: Not an integer");
  38580. if (i >>>= 0,
  38581. t < 0 || t > i || i > this.buffer.byteLength)
  38582. throw RangeError("Illegal range: 0 <= " + t + " <= " + i + " <= " + this.buffer.byteLength)
  38583. }
  38584. if (t >= i)
  38585. return this;
  38586. for (; t < i; )
  38587. this.view[t++] = e;
  38588. return n && (this.offset = t),
  38589. this
  38590. }
  38591. ,
  38592. a.flip = function() {
  38593. return this.limit = this.offset,
  38594. this.offset = 0,
  38595. this
  38596. }
  38597. ,
  38598. a.mark = function(e) {
  38599. if (e = "undefined" == typeof e ? this.offset : e,
  38600. !this.noAssert) {
  38601. if ("number" != typeof e || e % 1 !== 0)
  38602. throw TypeError("Illegal offset: " + e + " (not an integer)");
  38603. if (e >>>= 0,
  38604. e < 0 || e + 0 > this.buffer.byteLength)
  38605. throw RangeError("Illegal offset: 0 <= " + e + " (+0) <= " + this.buffer.byteLength)
  38606. }
  38607. return this.markedOffset = e,
  38608. this
  38609. }
  38610. ,
  38611. a.order = function(e) {
  38612. if (!this.noAssert && "boolean" != typeof e)
  38613. throw TypeError("Illegal littleEndian: Not a boolean");
  38614. return this.littleEndian = !!e,
  38615. this
  38616. }
  38617. ,
  38618. a.LE = function(e) {
  38619. return this.littleEndian = "undefined" == typeof e || !!e,
  38620. this
  38621. }
  38622. ,
  38623. a.BE = function(e) {
  38624. return this.littleEndian = "undefined" != typeof e && !e,
  38625. this
  38626. }
  38627. ,
  38628. a.prepend = function(e, t, i) {
  38629. "number" != typeof t && "string" == typeof t || (i = t,
  38630. t = void 0);
  38631. var n = "undefined" == typeof i;
  38632. if (n && (i = this.offset),
  38633. !this.noAssert) {
  38634. if ("number" != typeof i || i % 1 !== 0)
  38635. throw TypeError("Illegal offset: " + i + " (not an integer)");
  38636. if (i >>>= 0,
  38637. i < 0 || i + 0 > this.buffer.byteLength)
  38638. throw RangeError("Illegal offset: 0 <= " + i + " (+0) <= " + this.buffer.byteLength)
  38639. }
  38640. e instanceof o || (e = o.wrap(e, t));
  38641. var r = e.limit - e.offset;
  38642. if (r <= 0)
  38643. return this;
  38644. var a = r - i;
  38645. if (a > 0) {
  38646. var s = new ArrayBuffer(this.buffer.byteLength + a)
  38647. , l = new Uint8Array(s);
  38648. l.set(this.view.subarray(i, this.buffer.byteLength), r),
  38649. this.buffer = s,
  38650. this.view = l,
  38651. this.offset += a,
  38652. this.markedOffset >= 0 && (this.markedOffset += a),
  38653. this.limit += a,
  38654. i += a
  38655. } else {
  38656. new Uint8Array(this.buffer)
  38657. }
  38658. return this.view.set(e.view.subarray(e.offset, e.limit), i - r),
  38659. e.offset = e.limit,
  38660. n && (this.offset -= r),
  38661. this
  38662. }
  38663. ,
  38664. a.prependTo = function(e, t) {
  38665. return e.prepend(this, t),
  38666. this
  38667. }
  38668. ,
  38669. a.printDebug = function(e) {
  38670. "function" != typeof e && (e = console.log.bind(console)),
  38671. e(this.toString() + "\n-------------------------------------------------------------------\n" + this.toDebug(!0))
  38672. }
  38673. ,
  38674. a.remaining = function() {
  38675. return this.limit - this.offset
  38676. }
  38677. ,
  38678. a.reset = function() {
  38679. return this.markedOffset >= 0 ? (this.offset = this.markedOffset,
  38680. this.markedOffset = -1) : this.offset = 0,
  38681. this
  38682. }
  38683. ,
  38684. a.resize = function(e) {
  38685. if (!this.noAssert) {
  38686. if ("number" != typeof e || e % 1 !== 0)
  38687. throw TypeError("Illegal capacity: " + e + " (not an integer)");
  38688. if (e |= 0,
  38689. e < 0)
  38690. throw RangeError("Illegal capacity: 0 <= " + e)
  38691. }
  38692. if (this.buffer.byteLength < e) {
  38693. var t = new ArrayBuffer(e)
  38694. , i = new Uint8Array(t);
  38695. i.set(this.view),
  38696. this.buffer = t,
  38697. this.view = i
  38698. }
  38699. return this
  38700. }
  38701. ,
  38702. a.reverse = function(e, t) {
  38703. if ("undefined" == typeof e && (e = this.offset),
  38704. "undefined" == typeof t && (t = this.limit),
  38705. !this.noAssert) {
  38706. if ("number" != typeof e || e % 1 !== 0)
  38707. throw TypeError("Illegal begin: Not an integer");
  38708. if (e >>>= 0,
  38709. "number" != typeof t || t % 1 !== 0)
  38710. throw TypeError("Illegal end: Not an integer");
  38711. if (t >>>= 0,
  38712. e < 0 || e > t || t > this.buffer.byteLength)
  38713. throw RangeError("Illegal range: 0 <= " + e + " <= " + t + " <= " + this.buffer.byteLength)
  38714. }
  38715. return e === t ? this : (Array.prototype.reverse.call(this.view.subarray(e, t)),
  38716. this)
  38717. }
  38718. ,
  38719. a.skip = function(e) {
  38720. if (!this.noAssert) {
  38721. if ("number" != typeof e || e % 1 !== 0)
  38722. throw TypeError("Illegal length: " + e + " (not an integer)");
  38723. e |= 0
  38724. }
  38725. var t = this.offset + e;
  38726. if (!this.noAssert && (t < 0 || t > this.buffer.byteLength))
  38727. throw RangeError("Illegal length: 0 <= " + this.offset + " + " + e + " <= " + this.buffer.byteLength);
  38728. return this.offset = t,
  38729. this
  38730. }
  38731. ,
  38732. a.slice = function(e, t) {
  38733. if ("undefined" == typeof e && (e = this.offset),
  38734. "undefined" == typeof t && (t = this.limit),
  38735. !this.noAssert) {
  38736. if ("number" != typeof e || e % 1 !== 0)
  38737. throw TypeError("Illegal begin: Not an integer");
  38738. if (e >>>= 0,
  38739. "number" != typeof t || t % 1 !== 0)
  38740. throw TypeError("Illegal end: Not an integer");
  38741. if (t >>>= 0,
  38742. e < 0 || e > t || t > this.buffer.byteLength)
  38743. throw RangeError("Illegal range: 0 <= " + e + " <= " + t + " <= " + this.buffer.byteLength)
  38744. }
  38745. var i = this.clone();
  38746. return i.offset = e,
  38747. i.limit = t,
  38748. i
  38749. }
  38750. ,
  38751. a.toBuffer = function(e) {
  38752. var t = this.offset
  38753. , i = this.limit;
  38754. if (!this.noAssert) {
  38755. if ("number" != typeof t || t % 1 !== 0)
  38756. throw TypeError("Illegal offset: Not an integer");
  38757. if (t >>>= 0,
  38758. "number" != typeof i || i % 1 !== 0)
  38759. throw TypeError("Illegal limit: Not an integer");
  38760. if (i >>>= 0,
  38761. t < 0 || t > i || i > this.buffer.byteLength)
  38762. throw RangeError("Illegal range: 0 <= " + t + " <= " + i + " <= " + this.buffer.byteLength)
  38763. }
  38764. if (!e && 0 === t && i === this.buffer.byteLength)
  38765. return this.buffer;
  38766. if (t === i)
  38767. return s;
  38768. var n = new ArrayBuffer(i - t);
  38769. return new Uint8Array(n).set(new Uint8Array(this.buffer).subarray(t, i), 0),
  38770. n
  38771. }
  38772. ,
  38773. a.toArrayBuffer = a.toBuffer,
  38774. a.toString = function(e, t, i) {
  38775. if ("undefined" == typeof e)
  38776. return "ByteBufferAB(offset=" + this.offset + ",markedOffset=" + this.markedOffset + ",limit=" + this.limit + ",capacity=" + this.capacity() + ")";
  38777. switch ("number" == typeof e && (e = "utf8",
  38778. t = e,
  38779. i = t),
  38780. e) {
  38781. case "utf8":
  38782. return this.toUTF8(t, i);
  38783. case "base64":
  38784. return this.toBase64(t, i);
  38785. case "hex":
  38786. return this.toHex(t, i);
  38787. case "binary":
  38788. return this.toBinary(t, i);
  38789. case "debug":
  38790. return this.toDebug();
  38791. case "columns":
  38792. return this.toColumns();
  38793. default:
  38794. throw Error("Unsupported encoding: " + e)
  38795. }
  38796. }
  38797. ;
  38798. var c = function() {
  38799. 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)
  38800. i[t[n]] = n;
  38801. return e.encode = function(e, i) {
  38802. for (var n, r; null !== (n = e()); )
  38803. i(t[n >> 2 & 63]),
  38804. r = (3 & n) << 4,
  38805. null !== (n = e()) ? (r |= n >> 4 & 15,
  38806. i(t[63 & (r | n >> 4 & 15)]),
  38807. r = (15 & n) << 2,
  38808. null !== (n = e()) ? (i(t[63 & (r | n >> 6 & 3)]),
  38809. i(t[63 & n])) : (i(t[63 & r]),
  38810. i(61))) : (i(t[63 & r]),
  38811. i(61),
  38812. i(61))
  38813. }
  38814. ,
  38815. e.decode = function(e, t) {
  38816. function n(e) {
  38817. throw Error("Illegal character code: " + e)
  38818. }
  38819. for (var r, o, a; null !== (r = e()); )
  38820. if (o = i[r],
  38821. "undefined" == typeof o && n(r),
  38822. null !== (r = e()) && (a = i[r],
  38823. "undefined" == typeof a && n(r),
  38824. t(o << 2 >>> 0 | (48 & a) >> 4),
  38825. null !== (r = e()))) {
  38826. if (o = i[r],
  38827. "undefined" == typeof o) {
  38828. if (61 === r)
  38829. break;
  38830. n(r)
  38831. }
  38832. if (t((15 & a) << 4 >>> 0 | (60 & o) >> 2),
  38833. null !== (r = e())) {
  38834. if (a = i[r],
  38835. "undefined" == typeof a) {
  38836. if (61 === r)
  38837. break;
  38838. n(r)
  38839. }
  38840. t((3 & o) << 6 >>> 0 | a)
  38841. }
  38842. }
  38843. }
  38844. ,
  38845. e.test = function(e) {
  38846. return /^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/.test(e)
  38847. }
  38848. ,
  38849. e
  38850. }();
  38851. a.toBase64 = function(e, t) {
  38852. if ("undefined" == typeof e && (e = this.offset),
  38853. "undefined" == typeof t && (t = this.limit),
  38854. e |= 0,
  38855. t |= 0,
  38856. e < 0 || t > this.capacity || e > t)
  38857. throw RangeError("begin, end");
  38858. var n;
  38859. return c.encode(function() {
  38860. return e < t ? this.view[e++] : null
  38861. }
  38862. .bind(this), n = i()),
  38863. n()
  38864. }
  38865. ,
  38866. o.fromBase64 = function(e, i) {
  38867. if ("string" != typeof e)
  38868. throw TypeError("str");
  38869. var n = new o(e.length / 4 * 3,i)
  38870. , r = 0;
  38871. return c.decode(t(e), function(e) {
  38872. n.view[r++] = e
  38873. }),
  38874. n.limit = r,
  38875. n
  38876. }
  38877. ,
  38878. o.btoa = function(e) {
  38879. return o.fromBinary(e).toBase64()
  38880. }
  38881. ,
  38882. o.atob = function(e) {
  38883. return o.fromBase64(e).toBinary()
  38884. }
  38885. ,
  38886. a.toBinary = function(e, t) {
  38887. if ("undefined" == typeof e && (e = this.offset),
  38888. "undefined" == typeof t && (t = this.limit),
  38889. e |= 0,
  38890. t |= 0,
  38891. e < 0 || t > this.capacity() || e > t)
  38892. throw RangeError("begin, end");
  38893. if (e === t)
  38894. return "";
  38895. for (var i = [], n = []; e < t; )
  38896. i.push(this.view[e++]),
  38897. i.length >= 1024 && (n.push(String.fromCharCode.apply(String, i)),
  38898. i = []);
  38899. return n.join("") + String.fromCharCode.apply(String, i)
  38900. }
  38901. ,
  38902. o.fromBinary = function(e, t) {
  38903. if ("string" != typeof e)
  38904. throw TypeError("str");
  38905. for (var i, n = 0, r = e.length, a = new o(r,t); n < r; ) {
  38906. if (i = e.charCodeAt(n),
  38907. i > 255)
  38908. throw RangeError("illegal char code: " + i);
  38909. a.view[n++] = i
  38910. }
  38911. return a.limit = r,
  38912. a
  38913. }
  38914. ,
  38915. a.toDebug = function(e) {
  38916. for (var t, i = -1, n = this.buffer.byteLength, r = "", o = "", a = ""; i < n; ) {
  38917. if (i !== -1 && (t = this.view[i],
  38918. r += t < 16 ? "0" + t.toString(16).toUpperCase() : t.toString(16).toUpperCase(),
  38919. e && (o += t > 32 && t < 127 ? String.fromCharCode(t) : ".")),
  38920. ++i,
  38921. e && i > 0 && i % 16 === 0 && i !== n) {
  38922. for (; r.length < 51; )
  38923. r += " ";
  38924. a += r + o + "\n",
  38925. r = o = ""
  38926. }
  38927. 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 ? " " : ""
  38928. }
  38929. if (e && " " !== r) {
  38930. for (; r.length < 51; )
  38931. r += " ";
  38932. a += r + o + "\n"
  38933. }
  38934. return e ? a : r
  38935. }
  38936. ,
  38937. o.fromDebug = function(e, t, i) {
  38938. 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; ) {
  38939. switch (n = e.charAt(l++)) {
  38940. case "!":
  38941. if (!i) {
  38942. if (u || d || p) {
  38943. f = !0;
  38944. break
  38945. }
  38946. u = d = p = !0
  38947. }
  38948. s.offset = s.markedOffset = s.limit = c,
  38949. h = !1;
  38950. break;
  38951. case "|":
  38952. if (!i) {
  38953. if (u || p) {
  38954. f = !0;
  38955. break
  38956. }
  38957. u = p = !0
  38958. }
  38959. s.offset = s.limit = c,
  38960. h = !1;
  38961. break;
  38962. case "[":
  38963. if (!i) {
  38964. if (u || d) {
  38965. f = !0;
  38966. break
  38967. }
  38968. u = d = !0
  38969. }
  38970. s.offset = s.markedOffset = c,
  38971. h = !1;
  38972. break;
  38973. case "<":
  38974. if (!i) {
  38975. if (u) {
  38976. f = !0;
  38977. break
  38978. }
  38979. u = !0
  38980. }
  38981. s.offset = c,
  38982. h = !1;
  38983. break;
  38984. case "]":
  38985. if (!i) {
  38986. if (p || d) {
  38987. f = !0;
  38988. break
  38989. }
  38990. p = d = !0
  38991. }
  38992. s.limit = s.markedOffset = c,
  38993. h = !1;
  38994. break;
  38995. case ">":
  38996. if (!i) {
  38997. if (p) {
  38998. f = !0;
  38999. break
  39000. }
  39001. p = !0
  39002. }
  39003. s.limit = c,
  39004. h = !1;
  39005. break;
  39006. case "'":
  39007. if (!i) {
  39008. if (d) {
  39009. f = !0;
  39010. break
  39011. }
  39012. d = !0
  39013. }
  39014. s.markedOffset = c,
  39015. h = !1;
  39016. break;
  39017. case " ":
  39018. h = !1;
  39019. break;
  39020. default:
  39021. if (!i && h) {
  39022. f = !0;
  39023. break
  39024. }
  39025. if (r = parseInt(n + e.charAt(l++), 16),
  39026. !i && (isNaN(r) || r < 0 || r > 255))
  39027. throw TypeError("Illegal str: Not a debug encoded string");
  39028. s.view[c++] = r,
  39029. h = !0
  39030. }
  39031. if (f)
  39032. throw TypeError("Illegal str: Invalid symbol at " + l)
  39033. }
  39034. if (!i) {
  39035. if (!u || !p)
  39036. throw TypeError("Illegal str: Missing offset or limit");
  39037. if (c < s.buffer.byteLength)
  39038. throw TypeError("Illegal str: Not a debug encoded string (is it hex?) " + c + " < " + a)
  39039. }
  39040. return s
  39041. }
  39042. ,
  39043. a.toHex = function(e, t) {
  39044. if (e = "undefined" == typeof e ? this.offset : e,
  39045. t = "undefined" == typeof t ? this.limit : t,
  39046. !this.noAssert) {
  39047. if ("number" != typeof e || e % 1 !== 0)
  39048. throw TypeError("Illegal begin: Not an integer");
  39049. if (e >>>= 0,
  39050. "number" != typeof t || t % 1 !== 0)
  39051. throw TypeError("Illegal end: Not an integer");
  39052. if (t >>>= 0,
  39053. e < 0 || e > t || t > this.buffer.byteLength)
  39054. throw RangeError("Illegal range: 0 <= " + e + " <= " + t + " <= " + this.buffer.byteLength)
  39055. }
  39056. for (var i, n = new Array(t - e); e < t; )
  39057. i = this.view[e++],
  39058. i < 16 ? n.push("0", i.toString(16)) : n.push(i.toString(16));
  39059. return n.join("")
  39060. }
  39061. ,
  39062. o.fromHex = function(e, t, i) {
  39063. if (!i) {
  39064. if ("string" != typeof e)
  39065. throw TypeError("Illegal str: Not a string");
  39066. if (e.length % 2 !== 0)
  39067. throw TypeError("Illegal str: Length not a multiple of 2")
  39068. }
  39069. for (var n, r = e.length, a = new o(r / 2 | 0,t), s = 0, l = 0; s < r; s += 2) {
  39070. if (n = parseInt(e.substring(s, s + 2), 16),
  39071. !i && (!isFinite(n) || n < 0 || n > 255))
  39072. throw TypeError("Illegal str: Contains non-hex characters");
  39073. a.view[l++] = n
  39074. }
  39075. return a.limit = l,
  39076. a
  39077. }
  39078. ;
  39079. var h = function() {
  39080. var e = {};
  39081. return e.MAX_CODEPOINT = 1114111,
  39082. e.encodeUTF8 = function(e, t) {
  39083. var i = null;
  39084. for ("number" == typeof e && (i = e,
  39085. e = function() {
  39086. return null
  39087. }
  39088. ); null !== i || null !== (i = e()); )
  39089. i < 128 ? t(127 & i) : i < 2048 ? (t(i >> 6 & 31 | 192),
  39090. t(63 & i | 128)) : i < 65536 ? (t(i >> 12 & 15 | 224),
  39091. t(i >> 6 & 63 | 128),
  39092. t(63 & i | 128)) : (t(i >> 18 & 7 | 240),
  39093. t(i >> 12 & 63 | 128),
  39094. t(i >> 6 & 63 | 128),
  39095. t(63 & i | 128)),
  39096. i = null
  39097. }
  39098. ,
  39099. e.decodeUTF8 = function(e, t) {
  39100. for (var i, n, r, o, a = function(e) {
  39101. e = e.slice(0, e.indexOf(null));
  39102. var t = Error(e.toString());
  39103. throw t.name = "TruncatedError",
  39104. t.bytes = e,
  39105. t
  39106. }; null !== (i = e()); )
  39107. if (0 === (128 & i))
  39108. t(i);
  39109. else if (192 === (224 & i))
  39110. null === (n = e()) && a([i, n]),
  39111. t((31 & i) << 6 | 63 & n);
  39112. else if (224 === (240 & i))
  39113. (null === (n = e()) || null === (r = e())) && a([i, n, r]),
  39114. t((15 & i) << 12 | (63 & n) << 6 | 63 & r);
  39115. else {
  39116. if (240 !== (248 & i))
  39117. throw RangeError("Illegal starting byte: " + i);
  39118. (null === (n = e()) || null === (r = e()) || null === (o = e())) && a([i, n, r, o]),
  39119. t((7 & i) << 18 | (63 & n) << 12 | (63 & r) << 6 | 63 & o)
  39120. }
  39121. }
  39122. ,
  39123. e.UTF16toUTF8 = function(e, t) {
  39124. for (var i, n = null; ; ) {
  39125. if (null === (i = null !== n ? n : e()))
  39126. break;
  39127. i >= 55296 && i <= 57343 && null !== (n = e()) && n >= 56320 && n <= 57343 ? (t(1024 * (i - 55296) + n - 56320 + 65536),
  39128. n = null) : t(i)
  39129. }
  39130. null !== n && t(n)
  39131. }
  39132. ,
  39133. e.UTF8toUTF16 = function(e, t) {
  39134. var i = null;
  39135. for ("number" == typeof e && (i = e,
  39136. e = function() {
  39137. return null
  39138. }
  39139. ); null !== i || null !== (i = e()); )
  39140. i <= 65535 ? t(i) : (i -= 65536,
  39141. t((i >> 10) + 55296),
  39142. t(i % 1024 + 56320)),
  39143. i = null
  39144. }
  39145. ,
  39146. e.encodeUTF16toUTF8 = function(t, i) {
  39147. e.UTF16toUTF8(t, function(t) {
  39148. e.encodeUTF8(t, i)
  39149. })
  39150. }
  39151. ,
  39152. e.decodeUTF8toUTF16 = function(t, i) {
  39153. e.decodeUTF8(t, function(t) {
  39154. e.UTF8toUTF16(t, i)
  39155. })
  39156. }
  39157. ,
  39158. e.calculateCodePoint = function(e) {
  39159. return e < 128 ? 1 : e < 2048 ? 2 : e < 65536 ? 3 : 4
  39160. }
  39161. ,
  39162. e.calculateUTF8 = function(e) {
  39163. for (var t, i = 0; null !== (t = e()); )
  39164. i += t < 128 ? 1 : t < 2048 ? 2 : t < 65536 ? 3 : 4;
  39165. return i
  39166. }
  39167. ,
  39168. e.calculateUTF16asUTF8 = function(t) {
  39169. var i = 0
  39170. , n = 0;
  39171. return e.UTF16toUTF8(t, function(e) {
  39172. ++i,
  39173. n += e < 128 ? 1 : e < 2048 ? 2 : e < 65536 ? 3 : 4
  39174. }),
  39175. [i, n]
  39176. }
  39177. ,
  39178. e
  39179. }();
  39180. return a.toUTF8 = function(e, t) {
  39181. if ("undefined" == typeof e && (e = this.offset),
  39182. "undefined" == typeof t && (t = this.limit),
  39183. !this.noAssert) {
  39184. if ("number" != typeof e || e % 1 !== 0)
  39185. throw TypeError("Illegal begin: Not an integer");
  39186. if (e >>>= 0,
  39187. "number" != typeof t || t % 1 !== 0)
  39188. throw TypeError("Illegal end: Not an integer");
  39189. if (t >>>= 0,
  39190. e < 0 || e > t || t > this.buffer.byteLength)
  39191. throw RangeError("Illegal range: 0 <= " + e + " <= " + t + " <= " + this.buffer.byteLength)
  39192. }
  39193. var n;
  39194. try {
  39195. h.decodeUTF8toUTF16(function() {
  39196. return e < t ? this.view[e++] : null
  39197. }
  39198. .bind(this), n = i())
  39199. } catch (i) {
  39200. if (e !== t)
  39201. throw RangeError("Illegal range: Truncated data, " + e + " != " + t)
  39202. }
  39203. return n()
  39204. }
  39205. ,
  39206. o.fromUTF8 = function(e, i, n) {
  39207. if (!n && "string" != typeof e)
  39208. throw TypeError("Illegal str: Not a string");
  39209. var r = new o(h.calculateUTF16asUTF8(t(e), !0)[1],i,n)
  39210. , a = 0;
  39211. return h.encodeUTF16toUTF8(t(e), function(e) {
  39212. r.view[a++] = e
  39213. }),
  39214. r.limit = a,
  39215. r
  39216. }
  39217. ,
  39218. o
  39219. })
  39220. }
  39221. , {
  39222. long: 216
  39223. }],
  39224. 216: [function(e, t, i) {
  39225. !function(i, n) {
  39226. "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()
  39227. }(this, function() {
  39228. "use strict";
  39229. function e(e, t, i) {
  39230. this.low = 0 | e,
  39231. this.high = 0 | t,
  39232. this.unsigned = !!i
  39233. }
  39234. function t(e) {
  39235. return (e && e.__isLong__) === !0
  39236. }
  39237. function i(e, t) {
  39238. var i, n, o;
  39239. return t ? (e >>>= 0,
  39240. (o = 0 <= e && e < 256) && (n = l[e]) ? n : (i = r(e, (0 | e) < 0 ? -1 : 0, !0),
  39241. o && (l[e] = i),
  39242. i)) : (e |= 0,
  39243. (o = -128 <= e && e < 128) && (n = s[e]) ? n : (i = r(e, e < 0 ? -1 : 0, !1),
  39244. o && (s[e] = i),
  39245. i))
  39246. }
  39247. function n(e, t) {
  39248. if (isNaN(e) || !isFinite(e))
  39249. return t ? m : g;
  39250. if (t) {
  39251. if (e < 0)
  39252. return m;
  39253. if (e >= d)
  39254. return I
  39255. } else {
  39256. if (e <= -p)
  39257. return E;
  39258. if (e + 1 >= p)
  39259. return C
  39260. }
  39261. return e < 0 ? n(-e, t).neg() : r(e % u | 0, e / u | 0, t)
  39262. }
  39263. function r(t, i, n) {
  39264. return new e(t,i,n)
  39265. }
  39266. function o(e, t, i) {
  39267. if (0 === e.length)
  39268. throw Error("empty string");
  39269. if ("NaN" === e || "Infinity" === e || "+Infinity" === e || "-Infinity" === e)
  39270. return g;
  39271. if ("number" == typeof t ? (i = t,
  39272. t = !1) : t = !!t,
  39273. i = i || 10,
  39274. i < 2 || 36 < i)
  39275. throw RangeError("radix");
  39276. var r;
  39277. if ((r = e.indexOf("-")) > 0)
  39278. throw Error("interior hyphen");
  39279. if (0 === r)
  39280. return o(e.substring(1), t, i).neg();
  39281. for (var a = n(c(i, 8)), s = g, l = 0; l < e.length; l += 8) {
  39282. var h = Math.min(8, e.length - l)
  39283. , u = parseInt(e.substring(l, l + h), i);
  39284. if (h < 8) {
  39285. var d = n(c(i, h));
  39286. s = s.mul(d).add(n(u))
  39287. } else
  39288. s = s.mul(a),
  39289. s = s.add(n(u))
  39290. }
  39291. return s.unsigned = t,
  39292. s
  39293. }
  39294. function a(t) {
  39295. return t instanceof e ? t : "number" == typeof t ? n(t) : "string" == typeof t ? o(t) : r(t.low, t.high, t.unsigned)
  39296. }
  39297. e.prototype.__isLong__,
  39298. Object.defineProperty(e.prototype, "__isLong__", {
  39299. value: !0,
  39300. enumerable: !1,
  39301. configurable: !1
  39302. }),
  39303. e.isLong = t;
  39304. var s = {}
  39305. , l = {};
  39306. e.fromInt = i,
  39307. e.fromNumber = n,
  39308. e.fromBits = r;
  39309. var c = Math.pow;
  39310. e.fromString = o,
  39311. e.fromValue = a;
  39312. var h = 1 << 24
  39313. , u = 4294967296
  39314. , d = 0x10000000000000000
  39315. , p = d / 2
  39316. , f = i(h)
  39317. , g = i(0);
  39318. e.ZERO = g;
  39319. var m = i(0, !0);
  39320. e.UZERO = m;
  39321. var v = i(1);
  39322. e.ONE = v;
  39323. var A = i(1, !0);
  39324. e.UONE = A;
  39325. var y = i(-1);
  39326. e.NEG_ONE = y;
  39327. var C = r(-1, 2147483647, !1);
  39328. e.MAX_VALUE = C;
  39329. var I = r(-1, -1, !0);
  39330. e.MAX_UNSIGNED_VALUE = I;
  39331. var E = r(0, -2147483648, !1);
  39332. e.MIN_VALUE = E;
  39333. var b = e.prototype;
  39334. return b.toInt = function() {
  39335. return this.unsigned ? this.low >>> 0 : this.low
  39336. }
  39337. ,
  39338. b.toNumber = function() {
  39339. return this.unsigned ? (this.high >>> 0) * u + (this.low >>> 0) : this.high * u + (this.low >>> 0)
  39340. }
  39341. ,
  39342. b.toString = function(e) {
  39343. if (e = e || 10,
  39344. e < 2 || 36 < e)
  39345. throw RangeError("radix");
  39346. if (this.isZero())
  39347. return "0";
  39348. if (this.isNegative()) {
  39349. if (this.eq(E)) {
  39350. var t = n(e)
  39351. , i = this.div(t)
  39352. , r = i.mul(t).sub(this);
  39353. return i.toString(e) + r.toInt().toString(e)
  39354. }
  39355. return "-" + this.neg().toString(e)
  39356. }
  39357. for (var o = n(c(e, 6), this.unsigned), a = this, s = ""; ; ) {
  39358. var l = a.div(o)
  39359. , h = a.sub(l.mul(o)).toInt() >>> 0
  39360. , u = h.toString(e);
  39361. if (a = l,
  39362. a.isZero())
  39363. return u + s;
  39364. for (; u.length < 6; )
  39365. u = "0" + u;
  39366. s = "" + u + s
  39367. }
  39368. }
  39369. ,
  39370. b.getHighBits = function() {
  39371. return this.high
  39372. }
  39373. ,
  39374. b.getHighBitsUnsigned = function() {
  39375. return this.high >>> 0
  39376. }
  39377. ,
  39378. b.getLowBits = function() {
  39379. return this.low
  39380. }
  39381. ,
  39382. b.getLowBitsUnsigned = function() {
  39383. return this.low >>> 0
  39384. }
  39385. ,
  39386. b.getNumBitsAbs = function() {
  39387. if (this.isNegative())
  39388. return this.eq(E) ? 64 : this.neg().getNumBitsAbs();
  39389. for (var e = 0 != this.high ? this.high : this.low, t = 31; t > 0 && 0 == (e & 1 << t); t--)
  39390. ;
  39391. return 0 != this.high ? t + 33 : t + 1
  39392. }
  39393. ,
  39394. b.isZero = function() {
  39395. return 0 === this.high && 0 === this.low
  39396. }
  39397. ,
  39398. b.isNegative = function() {
  39399. return !this.unsigned && this.high < 0
  39400. }
  39401. ,
  39402. b.isPositive = function() {
  39403. return this.unsigned || this.high >= 0
  39404. }
  39405. ,
  39406. b.isOdd = function() {
  39407. return 1 === (1 & this.low)
  39408. }
  39409. ,
  39410. b.isEven = function() {
  39411. return 0 === (1 & this.low)
  39412. }
  39413. ,
  39414. b.equals = function(e) {
  39415. return t(e) || (e = a(e)),
  39416. (this.unsigned === e.unsigned || this.high >>> 31 !== 1 || e.high >>> 31 !== 1) && (this.high === e.high && this.low === e.low)
  39417. }
  39418. ,
  39419. b.eq = b.equals,
  39420. b.notEquals = function(e) {
  39421. return !this.eq(e)
  39422. }
  39423. ,
  39424. b.neq = b.notEquals,
  39425. b.lessThan = function(e) {
  39426. return this.comp(e) < 0
  39427. }
  39428. ,
  39429. b.lt = b.lessThan,
  39430. b.lessThanOrEqual = function(e) {
  39431. return this.comp(e) <= 0
  39432. }
  39433. ,
  39434. b.lte = b.lessThanOrEqual,
  39435. b.greaterThan = function(e) {
  39436. return this.comp(e) > 0
  39437. }
  39438. ,
  39439. b.gt = b.greaterThan,
  39440. b.greaterThanOrEqual = function(e) {
  39441. return this.comp(e) >= 0
  39442. }
  39443. ,
  39444. b.gte = b.greaterThanOrEqual,
  39445. b.compare = function(e) {
  39446. if (t(e) || (e = a(e)),
  39447. this.eq(e))
  39448. return 0;
  39449. var i = this.isNegative()
  39450. , n = e.isNegative();
  39451. 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
  39452. }
  39453. ,
  39454. b.comp = b.compare,
  39455. b.negate = function() {
  39456. return !this.unsigned && this.eq(E) ? E : this.not().add(v)
  39457. }
  39458. ,
  39459. b.neg = b.negate,
  39460. b.add = function(e) {
  39461. t(e) || (e = a(e));
  39462. var i = this.high >>> 16
  39463. , n = 65535 & this.high
  39464. , o = this.low >>> 16
  39465. , s = 65535 & this.low
  39466. , l = e.high >>> 16
  39467. , c = 65535 & e.high
  39468. , h = e.low >>> 16
  39469. , u = 65535 & e.low
  39470. , d = 0
  39471. , p = 0
  39472. , f = 0
  39473. , g = 0;
  39474. return g += s + u,
  39475. f += g >>> 16,
  39476. g &= 65535,
  39477. f += o + h,
  39478. p += f >>> 16,
  39479. f &= 65535,
  39480. p += n + c,
  39481. d += p >>> 16,
  39482. p &= 65535,
  39483. d += i + l,
  39484. d &= 65535,
  39485. r(f << 16 | g, d << 16 | p, this.unsigned)
  39486. }
  39487. ,
  39488. b.subtract = function(e) {
  39489. return t(e) || (e = a(e)),
  39490. this.add(e.neg())
  39491. }
  39492. ,
  39493. b.sub = b.subtract,
  39494. b.multiply = function(e) {
  39495. if (this.isZero())
  39496. return g;
  39497. if (t(e) || (e = a(e)),
  39498. e.isZero())
  39499. return g;
  39500. if (this.eq(E))
  39501. return e.isOdd() ? E : g;
  39502. if (e.eq(E))
  39503. return this.isOdd() ? E : g;
  39504. if (this.isNegative())
  39505. return e.isNegative() ? this.neg().mul(e.neg()) : this.neg().mul(e).neg();
  39506. if (e.isNegative())
  39507. return this.mul(e.neg()).neg();
  39508. if (this.lt(f) && e.lt(f))
  39509. return n(this.toNumber() * e.toNumber(), this.unsigned);
  39510. var i = this.high >>> 16
  39511. , o = 65535 & this.high
  39512. , s = this.low >>> 16
  39513. , l = 65535 & this.low
  39514. , c = e.high >>> 16
  39515. , h = 65535 & e.high
  39516. , u = e.low >>> 16
  39517. , d = 65535 & e.low
  39518. , p = 0
  39519. , m = 0
  39520. , v = 0
  39521. , A = 0;
  39522. return A += l * d,
  39523. v += A >>> 16,
  39524. A &= 65535,
  39525. v += s * d,
  39526. m += v >>> 16,
  39527. v &= 65535,
  39528. v += l * u,
  39529. m += v >>> 16,
  39530. v &= 65535,
  39531. m += o * d,
  39532. p += m >>> 16,
  39533. m &= 65535,
  39534. m += s * u,
  39535. p += m >>> 16,
  39536. m &= 65535,
  39537. m += l * h,
  39538. p += m >>> 16,
  39539. m &= 65535,
  39540. p += i * d + o * u + s * h + l * c,
  39541. p &= 65535,
  39542. r(v << 16 | A, p << 16 | m, this.unsigned)
  39543. }
  39544. ,
  39545. b.mul = b.multiply,
  39546. b.divide = function(e) {
  39547. if (t(e) || (e = a(e)),
  39548. e.isZero())
  39549. throw Error("division by zero");
  39550. if (this.isZero())
  39551. return this.unsigned ? m : g;
  39552. var i, r, o;
  39553. if (this.unsigned) {
  39554. if (e.unsigned || (e = e.toUnsigned()),
  39555. e.gt(this))
  39556. return m;
  39557. if (e.gt(this.shru(1)))
  39558. return A;
  39559. o = m
  39560. } else {
  39561. if (this.eq(E)) {
  39562. if (e.eq(v) || e.eq(y))
  39563. return E;
  39564. if (e.eq(E))
  39565. return v;
  39566. var s = this.shr(1);
  39567. return i = s.div(e).shl(1),
  39568. i.eq(g) ? e.isNegative() ? v : y : (r = this.sub(e.mul(i)),
  39569. o = i.add(r.div(e)))
  39570. }
  39571. if (e.eq(E))
  39572. return this.unsigned ? m : g;
  39573. if (this.isNegative())
  39574. return e.isNegative() ? this.neg().div(e.neg()) : this.neg().div(e).neg();
  39575. if (e.isNegative())
  39576. return this.div(e.neg()).neg();
  39577. o = g
  39578. }
  39579. for (r = this; r.gte(e); ) {
  39580. i = Math.max(1, Math.floor(r.toNumber() / e.toNumber()));
  39581. 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); )
  39582. i -= h,
  39583. u = n(i, this.unsigned),
  39584. d = u.mul(e);
  39585. u.isZero() && (u = v),
  39586. o = o.add(u),
  39587. r = r.sub(d)
  39588. }
  39589. return o
  39590. }
  39591. ,
  39592. b.div = b.divide,
  39593. b.modulo = function(e) {
  39594. return t(e) || (e = a(e)),
  39595. this.sub(this.div(e).mul(e))
  39596. }
  39597. ,
  39598. b.mod = b.modulo,
  39599. b.not = function() {
  39600. return r(~this.low, ~this.high, this.unsigned)
  39601. }
  39602. ,
  39603. b.and = function(e) {
  39604. return t(e) || (e = a(e)),
  39605. r(this.low & e.low, this.high & e.high, this.unsigned)
  39606. }
  39607. ,
  39608. b.or = function(e) {
  39609. return t(e) || (e = a(e)),
  39610. r(this.low | e.low, this.high | e.high, this.unsigned)
  39611. }
  39612. ,
  39613. b.xor = function(e) {
  39614. return t(e) || (e = a(e)),
  39615. r(this.low ^ e.low, this.high ^ e.high, this.unsigned)
  39616. }
  39617. ,
  39618. b.shiftLeft = function(e) {
  39619. return t(e) && (e = e.toInt()),
  39620. 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)
  39621. }
  39622. ,
  39623. b.shl = b.shiftLeft,
  39624. b.shiftRight = function(e) {
  39625. return t(e) && (e = e.toInt()),
  39626. 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)
  39627. }
  39628. ,
  39629. b.shr = b.shiftRight,
  39630. b.shiftRightUnsigned = function(e) {
  39631. if (t(e) && (e = e.toInt()),
  39632. e &= 63,
  39633. 0 === e)
  39634. return this;
  39635. var i = this.high;
  39636. if (e < 32) {
  39637. var n = this.low;
  39638. return r(n >>> e | i << 32 - e, i >>> e, this.unsigned)
  39639. }
  39640. return 32 === e ? r(i, 0, this.unsigned) : r(i >>> e - 32, 0, this.unsigned)
  39641. }
  39642. ,
  39643. b.shru = b.shiftRightUnsigned,
  39644. b.toSigned = function() {
  39645. return this.unsigned ? r(this.low, this.high, !1) : this
  39646. }
  39647. ,
  39648. b.toUnsigned = function() {
  39649. return this.unsigned ? this : r(this.low, this.high, !0)
  39650. }
  39651. ,
  39652. b.toBytes = function(e) {
  39653. return e ? this.toBytesLE() : this.toBytesBE()
  39654. }
  39655. ,
  39656. b.toBytesLE = function() {
  39657. var e = this.high
  39658. , t = this.low;
  39659. return [255 & t, t >>> 8 & 255, t >>> 16 & 255, t >>> 24 & 255, 255 & e, e >>> 8 & 255, e >>> 16 & 255, e >>> 24 & 255]
  39660. }
  39661. ,
  39662. b.toBytesBE = function() {
  39663. var e = this.high
  39664. , t = this.low;
  39665. return [e >>> 24 & 255, e >>> 16 & 255, e >>> 8 & 255, 255 & e, t >>> 24 & 255, t >>> 16 & 255, t >>> 8 & 255, 255 & t]
  39666. }
  39667. ,
  39668. e
  39669. })
  39670. }
  39671. , {}],
  39672. 217: [function(e, t, i) {
  39673. var n = {
  39674. REVISION: "75"
  39675. };
  39676. "function" == typeof define && define.amd ? define("three", n) : "undefined" != typeof i && "undefined" != typeof t && (t.exports = n),
  39677. void 0 === Number.EPSILON && (Number.EPSILON = Math.pow(2, -52)),
  39678. void 0 === Math.sign && (Math.sign = function(e) {
  39679. return e < 0 ? -1 : e > 0 ? 1 : +e
  39680. }
  39681. ),
  39682. void 0 === Function.prototype.name && void 0 !== Object.defineProperty && Object.defineProperty(Function.prototype, "name", {
  39683. get: function() {
  39684. return this.toString().match(/^\s*function\s*(\S*)\s*\(/)[1]
  39685. }
  39686. }),
  39687. void 0 === Object.assign && Object.defineProperty(Object, "assign", {
  39688. writable: !0,
  39689. configurable: !0,
  39690. value: function(e) {
  39691. "use strict";
  39692. if (void 0 === e || null === e)
  39693. throw new TypeError("Cannot convert first argument to object");
  39694. for (var t = Object(e), i = 1, n = arguments.length; i !== n; ++i) {
  39695. var r = arguments[i];
  39696. if (void 0 !== r && null !== r) {
  39697. r = Object(r);
  39698. for (var o = Object.keys(r), a = 0, s = o.length; a !== s; ++a) {
  39699. var l = o[a]
  39700. , c = Object.getOwnPropertyDescriptor(r, l);
  39701. void 0 !== c && c.enumerable && (t[l] = r[l])
  39702. }
  39703. }
  39704. }
  39705. return t
  39706. }
  39707. }),
  39708. n.MOUSE = {
  39709. LEFT: 0,
  39710. MIDDLE: 1,
  39711. RIGHT: 2
  39712. },
  39713. n.CullFaceNone = 0,
  39714. n.CullFaceBack = 1,
  39715. n.CullFaceFront = 2,
  39716. n.CullFaceFrontBack = 3,
  39717. n.FrontFaceDirectionCW = 0,
  39718. n.FrontFaceDirectionCCW = 1,
  39719. n.BasicShadowMap = 0,
  39720. n.PCFShadowMap = 1,
  39721. n.PCFSoftShadowMap = 2,
  39722. n.FrontSide = 0,
  39723. n.BackSide = 1,
  39724. n.DoubleSide = 2,
  39725. n.FlatShading = 1,
  39726. n.SmoothShading = 2,
  39727. n.NoColors = 0,
  39728. n.FaceColors = 1,
  39729. n.VertexColors = 2,
  39730. n.NoBlending = 0,
  39731. n.NormalBlending = 1,
  39732. n.AdditiveBlending = 2,
  39733. n.SubtractiveBlending = 3,
  39734. n.MultiplyBlending = 4,
  39735. n.CustomBlending = 5,
  39736. n.AddEquation = 100,
  39737. n.SubtractEquation = 101,
  39738. n.ReverseSubtractEquation = 102,
  39739. n.MinEquation = 103,
  39740. n.MaxEquation = 104,
  39741. n.ZeroFactor = 200,
  39742. n.OneFactor = 201,
  39743. n.SrcColorFactor = 202,
  39744. n.OneMinusSrcColorFactor = 203,
  39745. n.SrcAlphaFactor = 204,
  39746. n.OneMinusSrcAlphaFactor = 205,
  39747. n.DstAlphaFactor = 206,
  39748. n.OneMinusDstAlphaFactor = 207,
  39749. n.DstColorFactor = 208,
  39750. n.OneMinusDstColorFactor = 209,
  39751. n.SrcAlphaSaturateFactor = 210,
  39752. n.NeverDepth = 0,
  39753. n.AlwaysDepth = 1,
  39754. n.LessDepth = 2,
  39755. n.LessEqualDepth = 3,
  39756. n.EqualDepth = 4,
  39757. n.GreaterEqualDepth = 5,
  39758. n.GreaterDepth = 6,
  39759. n.NotEqualDepth = 7,
  39760. n.MultiplyOperation = 0,
  39761. n.MixOperation = 1,
  39762. n.AddOperation = 2,
  39763. n.NoToneMapping = 0,
  39764. n.LinearToneMapping = 1,
  39765. n.ReinhardToneMapping = 2,
  39766. n.Uncharted2ToneMapping = 3,
  39767. n.CineonToneMapping = 4,
  39768. n.UVMapping = 300,
  39769. n.CubeReflectionMapping = 301,
  39770. n.CubeRefractionMapping = 302,
  39771. n.EquirectangularReflectionMapping = 303,
  39772. n.EquirectangularRefractionMapping = 304,
  39773. n.SphericalReflectionMapping = 305,
  39774. n.CubeUVReflectionMapping = 306,
  39775. n.CubeUVRefractionMapping = 307,
  39776. n.RepeatWrapping = 1e3,
  39777. n.ClampToEdgeWrapping = 1001,
  39778. n.MirroredRepeatWrapping = 1002,
  39779. n.NearestFilter = 1003,
  39780. n.NearestMipMapNearestFilter = 1004,
  39781. n.NearestMipMapLinearFilter = 1005,
  39782. n.LinearFilter = 1006,
  39783. n.LinearMipMapNearestFilter = 1007,
  39784. n.LinearMipMapLinearFilter = 1008,
  39785. n.UnsignedByteType = 1009,
  39786. n.ByteType = 1010,
  39787. n.ShortType = 1011,
  39788. n.UnsignedShortType = 1012,
  39789. n.IntType = 1013,
  39790. n.UnsignedIntType = 1014,
  39791. n.FloatType = 1015,
  39792. n.HalfFloatType = 1025,
  39793. n.UnsignedShort4444Type = 1016,
  39794. n.UnsignedShort5551Type = 1017,
  39795. n.UnsignedShort565Type = 1018,
  39796. n.AlphaFormat = 1019,
  39797. n.RGBFormat = 1020,
  39798. n.RGBAFormat = 1021,
  39799. n.LuminanceFormat = 1022,
  39800. n.LuminanceAlphaFormat = 1023,
  39801. n.RGBEFormat = n.RGBAFormat,
  39802. n.RGB_S3TC_DXT1_Format = 2001,
  39803. n.RGBA_S3TC_DXT1_Format = 2002,
  39804. n.RGBA_S3TC_DXT3_Format = 2003,
  39805. n.RGBA_S3TC_DXT5_Format = 2004,
  39806. n.RGB_PVRTC_4BPPV1_Format = 2100,
  39807. n.RGB_PVRTC_2BPPV1_Format = 2101,
  39808. n.RGBA_PVRTC_4BPPV1_Format = 2102,
  39809. n.RGBA_PVRTC_2BPPV1_Format = 2103,
  39810. n.RGB_ETC1_Format = 2151,
  39811. n.LoopOnce = 2200,
  39812. n.LoopRepeat = 2201,
  39813. n.LoopPingPong = 2202,
  39814. n.InterpolateDiscrete = 2300,
  39815. n.InterpolateLinear = 2301,
  39816. n.InterpolateSmooth = 2302,
  39817. n.ZeroCurvatureEnding = 2400,
  39818. n.ZeroSlopeEnding = 2401,
  39819. n.WrapAroundEnding = 2402,
  39820. n.TrianglesDrawMode = 0,
  39821. n.TriangleStripDrawMode = 1,
  39822. n.TriangleFanDrawMode = 2,
  39823. n.LinearEncoding = 3e3,
  39824. n.sRGBEncoding = 3001,
  39825. n.GammaEncoding = 3007,
  39826. n.RGBEEncoding = 3002,
  39827. n.LogLuvEncoding = 3003,
  39828. n.RGBM7Encoding = 3004,
  39829. n.RGBM16Encoding = 3005,
  39830. n.RGBDEncoding = 3006,
  39831. n.Color = function(e) {
  39832. return 3 === arguments.length ? this.fromArray(arguments) : this.set(e)
  39833. }
  39834. ,
  39835. n.Color.prototype = {
  39836. constructor: n.Color,
  39837. r: 1,
  39838. g: 1,
  39839. b: 1,
  39840. set: function(e) {
  39841. return e instanceof n.Color ? this.copy(e) : "number" == typeof e ? this.setHex(e) : "string" == typeof e && this.setStyle(e),
  39842. this
  39843. },
  39844. setScalar: function(e) {
  39845. this.r = e,
  39846. this.g = e,
  39847. this.b = e
  39848. },
  39849. setHex: function(e) {
  39850. return e = Math.floor(e),
  39851. this.r = (e >> 16 & 255) / 255,
  39852. this.g = (e >> 8 & 255) / 255,
  39853. this.b = (255 & e) / 255,
  39854. this
  39855. },
  39856. setRGB: function(e, t, i) {
  39857. return this.r = e,
  39858. this.g = t,
  39859. this.b = i,
  39860. this
  39861. },
  39862. setHSL: function() {
  39863. function e(e, t, i) {
  39864. return i < 0 && (i += 1),
  39865. i > 1 && (i -= 1),
  39866. i < 1 / 6 ? e + 6 * (t - e) * i : i < .5 ? t : i < 2 / 3 ? e + 6 * (t - e) * (2 / 3 - i) : e
  39867. }
  39868. return function(t, i, r) {
  39869. if (t = n.Math.euclideanModulo(t, 1),
  39870. i = n.Math.clamp(i, 0, 1),
  39871. r = n.Math.clamp(r, 0, 1),
  39872. 0 === i)
  39873. this.r = this.g = this.b = r;
  39874. else {
  39875. var o = r <= .5 ? r * (1 + i) : r + i - r * i
  39876. , a = 2 * r - o;
  39877. this.r = e(a, o, t + 1 / 3),
  39878. this.g = e(a, o, t),
  39879. this.b = e(a, o, t - 1 / 3)
  39880. }
  39881. return this
  39882. }
  39883. }(),
  39884. setStyle: function(e) {
  39885. function t(t) {
  39886. void 0 !== t && parseFloat(t) < 1 && console.warn("THREE.Color: Alpha component of " + e + " will be ignored.")
  39887. }
  39888. var i;
  39889. if (i = /^((?:rgb|hsl)a?)\(\s*([^\)]*)\)/.exec(e)) {
  39890. var r, o = i[1], a = i[2];
  39891. switch (o) {
  39892. case "rgb":
  39893. case "rgba":
  39894. if (r = /^(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(a))
  39895. return this.r = Math.min(255, parseInt(r[1], 10)) / 255,
  39896. this.g = Math.min(255, parseInt(r[2], 10)) / 255,
  39897. this.b = Math.min(255, parseInt(r[3], 10)) / 255,
  39898. t(r[5]),
  39899. this;
  39900. if (r = /^(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(a))
  39901. return this.r = Math.min(100, parseInt(r[1], 10)) / 100,
  39902. this.g = Math.min(100, parseInt(r[2], 10)) / 100,
  39903. this.b = Math.min(100, parseInt(r[3], 10)) / 100,
  39904. t(r[5]),
  39905. this;
  39906. break;
  39907. case "hsl":
  39908. case "hsla":
  39909. if (r = /^([0-9]*\.?[0-9]+)\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(a)) {
  39910. var s = parseFloat(r[1]) / 360
  39911. , l = parseInt(r[2], 10) / 100
  39912. , c = parseInt(r[3], 10) / 100;
  39913. return t(r[5]),
  39914. this.setHSL(s, l, c)
  39915. }
  39916. }
  39917. } else if (i = /^\#([A-Fa-f0-9]+)$/.exec(e)) {
  39918. var h = i[1]
  39919. , u = h.length;
  39920. if (3 === u)
  39921. return this.r = parseInt(h.charAt(0) + h.charAt(0), 16) / 255,
  39922. this.g = parseInt(h.charAt(1) + h.charAt(1), 16) / 255,
  39923. this.b = parseInt(h.charAt(2) + h.charAt(2), 16) / 255,
  39924. this;
  39925. if (6 === u)
  39926. return this.r = parseInt(h.charAt(0) + h.charAt(1), 16) / 255,
  39927. this.g = parseInt(h.charAt(2) + h.charAt(3), 16) / 255,
  39928. this.b = parseInt(h.charAt(4) + h.charAt(5), 16) / 255,
  39929. this
  39930. }
  39931. if (e && e.length > 0) {
  39932. var h = n.ColorKeywords[e];
  39933. void 0 !== h ? this.setHex(h) : console.warn("THREE.Color: Unknown color " + e)
  39934. }
  39935. return this
  39936. },
  39937. clone: function() {
  39938. return new this.constructor(this.r,this.g,this.b)
  39939. },
  39940. copy: function(e) {
  39941. return this.r = e.r,
  39942. this.g = e.g,
  39943. this.b = e.b,
  39944. this
  39945. },
  39946. copyGammaToLinear: function(e, t) {
  39947. return void 0 === t && (t = 2),
  39948. this.r = Math.pow(e.r, t),
  39949. this.g = Math.pow(e.g, t),
  39950. this.b = Math.pow(e.b, t),
  39951. this
  39952. },
  39953. copyLinearToGamma: function(e, t) {
  39954. void 0 === t && (t = 2);
  39955. var i = t > 0 ? 1 / t : 1;
  39956. return this.r = Math.pow(e.r, i),
  39957. this.g = Math.pow(e.g, i),
  39958. this.b = Math.pow(e.b, i),
  39959. this
  39960. },
  39961. convertGammaToLinear: function() {
  39962. var e = this.r
  39963. , t = this.g
  39964. , i = this.b;
  39965. return this.r = e * e,
  39966. this.g = t * t,
  39967. this.b = i * i,
  39968. this
  39969. },
  39970. convertLinearToGamma: function() {
  39971. return this.r = Math.sqrt(this.r),
  39972. this.g = Math.sqrt(this.g),
  39973. this.b = Math.sqrt(this.b),
  39974. this
  39975. },
  39976. getHex: function() {
  39977. return 255 * this.r << 16 ^ 255 * this.g << 8 ^ 255 * this.b << 0
  39978. },
  39979. getHexString: function() {
  39980. return ("000000" + this.getHex().toString(16)).slice(-6)
  39981. },
  39982. getHSL: function(e) {
  39983. var t, i, n = e || {
  39984. h: 0,
  39985. s: 0,
  39986. l: 0
  39987. }, 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;
  39988. if (l === s)
  39989. t = 0,
  39990. i = 0;
  39991. else {
  39992. var h = s - l;
  39993. switch (i = c <= .5 ? h / (s + l) : h / (2 - s - l),
  39994. s) {
  39995. case r:
  39996. t = (o - a) / h + (o < a ? 6 : 0);
  39997. break;
  39998. case o:
  39999. t = (a - r) / h + 2;
  40000. break;
  40001. case a:
  40002. t = (r - o) / h + 4
  40003. }
  40004. t /= 6
  40005. }
  40006. return n.h = t,
  40007. n.s = i,
  40008. n.l = c,
  40009. n
  40010. },
  40011. getStyle: function() {
  40012. return "rgb(" + (255 * this.r | 0) + "," + (255 * this.g | 0) + "," + (255 * this.b | 0) + ")"
  40013. },
  40014. offsetHSL: function(e, t, i) {
  40015. var n = this.getHSL();
  40016. return n.h += e,
  40017. n.s += t,
  40018. n.l += i,
  40019. this.setHSL(n.h, n.s, n.l),
  40020. this
  40021. },
  40022. add: function(e) {
  40023. return this.r += e.r,
  40024. this.g += e.g,
  40025. this.b += e.b,
  40026. this
  40027. },
  40028. addColors: function(e, t) {
  40029. return this.r = e.r + t.r,
  40030. this.g = e.g + t.g,
  40031. this.b = e.b + t.b,
  40032. this
  40033. },
  40034. addScalar: function(e) {
  40035. return this.r += e,
  40036. this.g += e,
  40037. this.b += e,
  40038. this
  40039. },
  40040. multiply: function(e) {
  40041. return this.r *= e.r,
  40042. this.g *= e.g,
  40043. this.b *= e.b,
  40044. this
  40045. },
  40046. multiplyScalar: function(e) {
  40047. return this.r *= e,
  40048. this.g *= e,
  40049. this.b *= e,
  40050. this
  40051. },
  40052. lerp: function(e, t) {
  40053. return this.r += (e.r - this.r) * t,
  40054. this.g += (e.g - this.g) * t,
  40055. this.b += (e.b - this.b) * t,
  40056. this
  40057. },
  40058. equals: function(e) {
  40059. return e.r === this.r && e.g === this.g && e.b === this.b
  40060. },
  40061. fromArray: function(e, t) {
  40062. return void 0 === t && (t = 0),
  40063. this.r = e[t],
  40064. this.g = e[t + 1],
  40065. this.b = e[t + 2],
  40066. this
  40067. },
  40068. toArray: function(e, t) {
  40069. return void 0 === e && (e = []),
  40070. void 0 === t && (t = 0),
  40071. e[t] = this.r,
  40072. e[t + 1] = this.g,
  40073. e[t + 2] = this.b,
  40074. e
  40075. }
  40076. },
  40077. n.ColorKeywords = {
  40078. aliceblue: 15792383,
  40079. antiquewhite: 16444375,
  40080. aqua: 65535,
  40081. aquamarine: 8388564,
  40082. azure: 15794175,
  40083. beige: 16119260,
  40084. bisque: 16770244,
  40085. black: 0,
  40086. blanchedalmond: 16772045,
  40087. blue: 255,
  40088. blueviolet: 9055202,
  40089. brown: 10824234,
  40090. burlywood: 14596231,
  40091. cadetblue: 6266528,
  40092. chartreuse: 8388352,
  40093. chocolate: 13789470,
  40094. coral: 16744272,
  40095. cornflowerblue: 6591981,
  40096. cornsilk: 16775388,
  40097. crimson: 14423100,
  40098. cyan: 65535,
  40099. darkblue: 139,
  40100. darkcyan: 35723,
  40101. darkgoldenrod: 12092939,
  40102. darkgray: 11119017,
  40103. darkgreen: 25600,
  40104. darkgrey: 11119017,
  40105. darkkhaki: 12433259,
  40106. darkmagenta: 9109643,
  40107. darkolivegreen: 5597999,
  40108. darkorange: 16747520,
  40109. darkorchid: 10040012,
  40110. darkred: 9109504,
  40111. darksalmon: 15308410,
  40112. darkseagreen: 9419919,
  40113. darkslateblue: 4734347,
  40114. darkslategray: 3100495,
  40115. darkslategrey: 3100495,
  40116. darkturquoise: 52945,
  40117. darkviolet: 9699539,
  40118. deeppink: 16716947,
  40119. deepskyblue: 49151,
  40120. dimgray: 6908265,
  40121. dimgrey: 6908265,
  40122. dodgerblue: 2003199,
  40123. firebrick: 11674146,
  40124. floralwhite: 16775920,
  40125. forestgreen: 2263842,
  40126. fuchsia: 16711935,
  40127. gainsboro: 14474460,
  40128. ghostwhite: 16316671,
  40129. gold: 16766720,
  40130. goldenrod: 14329120,
  40131. gray: 8421504,
  40132. green: 32768,
  40133. greenyellow: 11403055,
  40134. grey: 8421504,
  40135. honeydew: 15794160,
  40136. hotpink: 16738740,
  40137. indianred: 13458524,
  40138. indigo: 4915330,
  40139. ivory: 16777200,
  40140. khaki: 15787660,
  40141. lavender: 15132410,
  40142. lavenderblush: 16773365,
  40143. lawngreen: 8190976,
  40144. lemonchiffon: 16775885,
  40145. lightblue: 11393254,
  40146. lightcoral: 15761536,
  40147. lightcyan: 14745599,
  40148. lightgoldenrodyellow: 16448210,
  40149. lightgray: 13882323,
  40150. lightgreen: 9498256,
  40151. lightgrey: 13882323,
  40152. lightpink: 16758465,
  40153. lightsalmon: 16752762,
  40154. lightseagreen: 2142890,
  40155. lightskyblue: 8900346,
  40156. lightslategray: 7833753,
  40157. lightslategrey: 7833753,
  40158. lightsteelblue: 11584734,
  40159. lightyellow: 16777184,
  40160. lime: 65280,
  40161. limegreen: 3329330,
  40162. linen: 16445670,
  40163. magenta: 16711935,
  40164. maroon: 8388608,
  40165. mediumaquamarine: 6737322,
  40166. mediumblue: 205,
  40167. mediumorchid: 12211667,
  40168. mediumpurple: 9662683,
  40169. mediumseagreen: 3978097,
  40170. mediumslateblue: 8087790,
  40171. mediumspringgreen: 64154,
  40172. mediumturquoise: 4772300,
  40173. mediumvioletred: 13047173,
  40174. midnightblue: 1644912,
  40175. mintcream: 16121850,
  40176. mistyrose: 16770273,
  40177. moccasin: 16770229,
  40178. navajowhite: 16768685,
  40179. navy: 128,
  40180. oldlace: 16643558,
  40181. olive: 8421376,
  40182. olivedrab: 7048739,
  40183. orange: 16753920,
  40184. orangered: 16729344,
  40185. orchid: 14315734,
  40186. palegoldenrod: 15657130,
  40187. palegreen: 10025880,
  40188. paleturquoise: 11529966,
  40189. palevioletred: 14381203,
  40190. papayawhip: 16773077,
  40191. peachpuff: 16767673,
  40192. peru: 13468991,
  40193. pink: 16761035,
  40194. plum: 14524637,
  40195. powderblue: 11591910,
  40196. purple: 8388736,
  40197. red: 16711680,
  40198. rosybrown: 12357519,
  40199. royalblue: 4286945,
  40200. saddlebrown: 9127187,
  40201. salmon: 16416882,
  40202. sandybrown: 16032864,
  40203. seagreen: 3050327,
  40204. seashell: 16774638,
  40205. sienna: 10506797,
  40206. silver: 12632256,
  40207. skyblue: 8900331,
  40208. slateblue: 6970061,
  40209. slategray: 7372944,
  40210. slategrey: 7372944,
  40211. snow: 16775930,
  40212. springgreen: 65407,
  40213. steelblue: 4620980,
  40214. tan: 13808780,
  40215. teal: 32896,
  40216. thistle: 14204888,
  40217. tomato: 16737095,
  40218. turquoise: 4251856,
  40219. violet: 15631086,
  40220. wheat: 16113331,
  40221. white: 16777215,
  40222. whitesmoke: 16119285,
  40223. yellow: 16776960,
  40224. yellowgreen: 10145074
  40225. },
  40226. n.Quaternion = function(e, t, i, n) {
  40227. this._x = e || 0,
  40228. this._y = t || 0,
  40229. this._z = i || 0,
  40230. this._w = void 0 !== n ? n : 1
  40231. }
  40232. ,
  40233. n.Quaternion.prototype = {
  40234. constructor: n.Quaternion,
  40235. get x() {
  40236. return this._x
  40237. },
  40238. set x(e) {
  40239. this._x = e,
  40240. this.onChangeCallback()
  40241. },
  40242. get y() {
  40243. return this._y
  40244. },
  40245. set y(e) {
  40246. this._y = e,
  40247. this.onChangeCallback()
  40248. },
  40249. get z() {
  40250. return this._z
  40251. },
  40252. set z(e) {
  40253. this._z = e,
  40254. this.onChangeCallback()
  40255. },
  40256. get w() {
  40257. return this._w
  40258. },
  40259. set w(e) {
  40260. this._w = e,
  40261. this.onChangeCallback()
  40262. },
  40263. set: function(e, t, i, n) {
  40264. return this._x = e,
  40265. this._y = t,
  40266. this._z = i,
  40267. this._w = n,
  40268. this.onChangeCallback(),
  40269. this
  40270. },
  40271. clone: function() {
  40272. return new this.constructor(this._x,this._y,this._z,this._w)
  40273. },
  40274. copy: function(e) {
  40275. return this._x = e.x,
  40276. this._y = e.y,
  40277. this._z = e.z,
  40278. this._w = e.w,
  40279. this.onChangeCallback(),
  40280. this
  40281. },
  40282. setFromEuler: function(e, t) {
  40283. if (e instanceof n.Euler == !1)
  40284. throw new Error("THREE.Quaternion: .setFromEuler() now expects a Euler rotation rather than a Vector3 and order.");
  40285. var i = Math.cos(e._x / 2)
  40286. , r = Math.cos(e._y / 2)
  40287. , o = Math.cos(e._z / 2)
  40288. , a = Math.sin(e._x / 2)
  40289. , s = Math.sin(e._y / 2)
  40290. , l = Math.sin(e._z / 2)
  40291. , c = e.order;
  40292. return "XYZ" === c ? (this._x = a * r * o + i * s * l,
  40293. this._y = i * s * o - a * r * l,
  40294. this._z = i * r * l + a * s * o,
  40295. this._w = i * r * o - a * s * l) : "YXZ" === c ? (this._x = a * r * o + i * s * l,
  40296. this._y = i * s * o - a * r * l,
  40297. this._z = i * r * l - a * s * o,
  40298. this._w = i * r * o + a * s * l) : "ZXY" === c ? (this._x = a * r * o - i * s * l,
  40299. this._y = i * s * o + a * r * l,
  40300. this._z = i * r * l + a * s * o,
  40301. this._w = i * r * o - a * s * l) : "ZYX" === c ? (this._x = a * r * o - i * s * l,
  40302. this._y = i * s * o + a * r * l,
  40303. this._z = i * r * l - a * s * o,
  40304. this._w = i * r * o + a * s * l) : "YZX" === c ? (this._x = a * r * o + i * s * l,
  40305. this._y = i * s * o + a * r * l,
  40306. this._z = i * r * l - a * s * o,
  40307. this._w = i * r * o - a * s * l) : "XZY" === c && (this._x = a * r * o - i * s * l,
  40308. this._y = i * s * o - a * r * l,
  40309. this._z = i * r * l + a * s * o,
  40310. this._w = i * r * o + a * s * l),
  40311. t !== !1 && this.onChangeCallback(),
  40312. this
  40313. },
  40314. setFromAxisAngle: function(e, t) {
  40315. var i = t / 2
  40316. , n = Math.sin(i);
  40317. return this._x = e.x * n,
  40318. this._y = e.y * n,
  40319. this._z = e.z * n,
  40320. this._w = Math.cos(i),
  40321. this.onChangeCallback(),
  40322. this
  40323. },
  40324. setFromRotationMatrix: function(e) {
  40325. 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;
  40326. return d > 0 ? (t = .5 / Math.sqrt(d + 1),
  40327. this._w = .25 / t,
  40328. this._x = (h - l) * t,
  40329. this._y = (o - c) * t,
  40330. this._z = (a - r) * t) : n > s && n > u ? (t = 2 * Math.sqrt(1 + n - s - u),
  40331. this._w = (h - l) / t,
  40332. this._x = .25 * t,
  40333. this._y = (r + a) / t,
  40334. this._z = (o + c) / t) : s > u ? (t = 2 * Math.sqrt(1 + s - n - u),
  40335. this._w = (o - c) / t,
  40336. this._x = (r + a) / t,
  40337. this._y = .25 * t,
  40338. this._z = (l + h) / t) : (t = 2 * Math.sqrt(1 + u - n - s),
  40339. this._w = (a - r) / t,
  40340. this._x = (o + c) / t,
  40341. this._y = (l + h) / t,
  40342. this._z = .25 * t),
  40343. this.onChangeCallback(),
  40344. this
  40345. },
  40346. setFromUnitVectors: function() {
  40347. var e, t, i = 1e-6;
  40348. return function(r, o) {
  40349. return void 0 === e && (e = new n.Vector3),
  40350. t = r.dot(o) + 1,
  40351. t < i ? (t = 0,
  40352. 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),
  40353. this._x = e.x,
  40354. this._y = e.y,
  40355. this._z = e.z,
  40356. this._w = t,
  40357. this.normalize(),
  40358. this
  40359. }
  40360. }(),
  40361. inverse: function() {
  40362. return this.conjugate().normalize(),
  40363. this
  40364. },
  40365. conjugate: function() {
  40366. return this._x *= -1,
  40367. this._y *= -1,
  40368. this._z *= -1,
  40369. this.onChangeCallback(),
  40370. this
  40371. },
  40372. dot: function(e) {
  40373. return this._x * e._x + this._y * e._y + this._z * e._z + this._w * e._w
  40374. },
  40375. lengthSq: function() {
  40376. return this._x * this._x + this._y * this._y + this._z * this._z + this._w * this._w
  40377. },
  40378. length: function() {
  40379. return Math.sqrt(this._x * this._x + this._y * this._y + this._z * this._z + this._w * this._w)
  40380. },
  40381. normalize: function() {
  40382. var e = this.length();
  40383. return 0 === e ? (this._x = 0,
  40384. this._y = 0,
  40385. this._z = 0,
  40386. this._w = 1) : (e = 1 / e,
  40387. this._x = this._x * e,
  40388. this._y = this._y * e,
  40389. this._z = this._z * e,
  40390. this._w = this._w * e),
  40391. this.onChangeCallback(),
  40392. this
  40393. },
  40394. multiply: function(e, t) {
  40395. return void 0 !== t ? (console.warn("THREE.Quaternion: .multiply() now only accepts one argument. Use .multiplyQuaternions( a, b ) instead."),
  40396. this.multiplyQuaternions(e, t)) : this.multiplyQuaternions(this, e)
  40397. },
  40398. multiplyQuaternions: function(e, t) {
  40399. var i = e._x
  40400. , n = e._y
  40401. , r = e._z
  40402. , o = e._w
  40403. , a = t._x
  40404. , s = t._y
  40405. , l = t._z
  40406. , c = t._w;
  40407. return this._x = i * c + o * a + n * l - r * s,
  40408. this._y = n * c + o * s + r * a - i * l,
  40409. this._z = r * c + o * l + i * s - n * a,
  40410. this._w = o * c - i * a - n * s - r * l,
  40411. this.onChangeCallback(),
  40412. this
  40413. },
  40414. slerp: function(e, t) {
  40415. if (0 === t)
  40416. return this;
  40417. if (1 === t)
  40418. return this.copy(e);
  40419. var i = this._x
  40420. , n = this._y
  40421. , r = this._z
  40422. , o = this._w
  40423. , a = o * e._w + i * e._x + n * e._y + r * e._z;
  40424. if (a < 0 ? (this._w = -e._w,
  40425. this._x = -e._x,
  40426. this._y = -e._y,
  40427. this._z = -e._z,
  40428. a = -a) : this.copy(e),
  40429. a >= 1)
  40430. return this._w = o,
  40431. this._x = i,
  40432. this._y = n,
  40433. this._z = r,
  40434. this;
  40435. var s = Math.sqrt(1 - a * a);
  40436. if (Math.abs(s) < .001)
  40437. return this._w = .5 * (o + this._w),
  40438. this._x = .5 * (i + this._x),
  40439. this._y = .5 * (n + this._y),
  40440. this._z = .5 * (r + this._z),
  40441. this;
  40442. var l = Math.atan2(s, a)
  40443. , c = Math.sin((1 - t) * l) / s
  40444. , h = Math.sin(t * l) / s;
  40445. return this._w = o * c + this._w * h,
  40446. this._x = i * c + this._x * h,
  40447. this._y = n * c + this._y * h,
  40448. this._z = r * c + this._z * h,
  40449. this.onChangeCallback(),
  40450. this
  40451. },
  40452. equals: function(e) {
  40453. return e._x === this._x && e._y === this._y && e._z === this._z && e._w === this._w
  40454. },
  40455. fromArray: function(e, t) {
  40456. return void 0 === t && (t = 0),
  40457. this._x = e[t],
  40458. this._y = e[t + 1],
  40459. this._z = e[t + 2],
  40460. this._w = e[t + 3],
  40461. this.onChangeCallback(),
  40462. this
  40463. },
  40464. toArray: function(e, t) {
  40465. return void 0 === e && (e = []),
  40466. void 0 === t && (t = 0),
  40467. e[t] = this._x,
  40468. e[t + 1] = this._y,
  40469. e[t + 2] = this._z,
  40470. e[t + 3] = this._w,
  40471. e
  40472. },
  40473. onChange: function(e) {
  40474. return this.onChangeCallback = e,
  40475. this
  40476. },
  40477. onChangeCallback: function() {}
  40478. },
  40479. Object.assign(n.Quaternion, {
  40480. slerp: function(e, t, i, n) {
  40481. return i.copy(e).slerp(t, n)
  40482. },
  40483. slerpFlat: function(e, t, i, n, r, o, a) {
  40484. var s = i[n + 0]
  40485. , l = i[n + 1]
  40486. , c = i[n + 2]
  40487. , h = i[n + 3]
  40488. , u = r[o + 0]
  40489. , d = r[o + 1]
  40490. , p = r[o + 2]
  40491. , f = r[o + 3];
  40492. if (h !== f || s !== u || l !== d || c !== p) {
  40493. var g = 1 - a
  40494. , m = s * u + l * d + c * p + h * f
  40495. , v = m >= 0 ? 1 : -1
  40496. , A = 1 - m * m;
  40497. if (A > Number.EPSILON) {
  40498. var y = Math.sqrt(A)
  40499. , C = Math.atan2(y, m * v);
  40500. g = Math.sin(g * C) / y,
  40501. a = Math.sin(a * C) / y
  40502. }
  40503. var I = a * v;
  40504. if (s = s * g + u * I,
  40505. l = l * g + d * I,
  40506. c = c * g + p * I,
  40507. h = h * g + f * I,
  40508. g === 1 - a) {
  40509. var E = 1 / Math.sqrt(s * s + l * l + c * c + h * h);
  40510. s *= E,
  40511. l *= E,
  40512. c *= E,
  40513. h *= E
  40514. }
  40515. }
  40516. e[t] = s,
  40517. e[t + 1] = l,
  40518. e[t + 2] = c,
  40519. e[t + 3] = h
  40520. }
  40521. }),
  40522. n.Vector2 = function(e, t) {
  40523. this.x = e || 0,
  40524. this.y = t || 0
  40525. }
  40526. ,
  40527. n.Vector2.prototype = {
  40528. constructor: n.Vector2,
  40529. get width() {
  40530. return this.x
  40531. },
  40532. set width(e) {
  40533. this.x = e
  40534. },
  40535. get height() {
  40536. return this.y
  40537. },
  40538. set height(e) {
  40539. this.y = e
  40540. },
  40541. set: function(e, t) {
  40542. return this.x = e,
  40543. this.y = t,
  40544. this
  40545. },
  40546. setScalar: function(e) {
  40547. return this.x = e,
  40548. this.y = e,
  40549. this
  40550. },
  40551. setX: function(e) {
  40552. return this.x = e,
  40553. this
  40554. },
  40555. setY: function(e) {
  40556. return this.y = e,
  40557. this
  40558. },
  40559. setComponent: function(e, t) {
  40560. switch (e) {
  40561. case 0:
  40562. this.x = t;
  40563. break;
  40564. case 1:
  40565. this.y = t;
  40566. break;
  40567. default:
  40568. throw new Error("index is out of range: " + e)
  40569. }
  40570. },
  40571. getComponent: function(e) {
  40572. switch (e) {
  40573. case 0:
  40574. return this.x;
  40575. case 1:
  40576. return this.y;
  40577. default:
  40578. throw new Error("index is out of range: " + e)
  40579. }
  40580. },
  40581. clone: function() {
  40582. return new this.constructor(this.x,this.y)
  40583. },
  40584. copy: function(e) {
  40585. return this.x = e.x,
  40586. this.y = e.y,
  40587. this
  40588. },
  40589. add: function(e, t) {
  40590. return void 0 !== t ? (console.warn("THREE.Vector2: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),
  40591. this.addVectors(e, t)) : (this.x += e.x,
  40592. this.y += e.y,
  40593. this)
  40594. },
  40595. addScalar: function(e) {
  40596. return this.x += e,
  40597. this.y += e,
  40598. this
  40599. },
  40600. addVectors: function(e, t) {
  40601. return this.x = e.x + t.x,
  40602. this.y = e.y + t.y,
  40603. this
  40604. },
  40605. addScaledVector: function(e, t) {
  40606. return this.x += e.x * t,
  40607. this.y += e.y * t,
  40608. this
  40609. },
  40610. sub: function(e, t) {
  40611. return void 0 !== t ? (console.warn("THREE.Vector2: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),
  40612. this.subVectors(e, t)) : (this.x -= e.x,
  40613. this.y -= e.y,
  40614. this)
  40615. },
  40616. subScalar: function(e) {
  40617. return this.x -= e,
  40618. this.y -= e,
  40619. this
  40620. },
  40621. subVectors: function(e, t) {
  40622. return this.x = e.x - t.x,
  40623. this.y = e.y - t.y,
  40624. this
  40625. },
  40626. multiply: function(e) {
  40627. return this.x *= e.x,
  40628. this.y *= e.y,
  40629. this
  40630. },
  40631. multiplyScalar: function(e) {
  40632. return isFinite(e) ? (this.x *= e,
  40633. this.y *= e) : (this.x = 0,
  40634. this.y = 0),
  40635. this
  40636. },
  40637. divide: function(e) {
  40638. return this.x /= e.x,
  40639. this.y /= e.y,
  40640. this
  40641. },
  40642. divideScalar: function(e) {
  40643. return this.multiplyScalar(1 / e)
  40644. },
  40645. min: function(e) {
  40646. return this.x = Math.min(this.x, e.x),
  40647. this.y = Math.min(this.y, e.y),
  40648. this
  40649. },
  40650. max: function(e) {
  40651. return this.x = Math.max(this.x, e.x),
  40652. this.y = Math.max(this.y, e.y),
  40653. this
  40654. },
  40655. clamp: function(e, t) {
  40656. return this.x = Math.max(e.x, Math.min(t.x, this.x)),
  40657. this.y = Math.max(e.y, Math.min(t.y, this.y)),
  40658. this
  40659. },
  40660. clampScalar: function() {
  40661. var e, t;
  40662. return function(i, r) {
  40663. return void 0 === e && (e = new n.Vector2,
  40664. t = new n.Vector2),
  40665. e.set(i, i),
  40666. t.set(r, r),
  40667. this.clamp(e, t)
  40668. }
  40669. }(),
  40670. clampLength: function(e, t) {
  40671. var i = this.length();
  40672. return this.multiplyScalar(Math.max(e, Math.min(t, i)) / i),
  40673. this
  40674. },
  40675. floor: function() {
  40676. return this.x = Math.floor(this.x),
  40677. this.y = Math.floor(this.y),
  40678. this
  40679. },
  40680. ceil: function() {
  40681. return this.x = Math.ceil(this.x),
  40682. this.y = Math.ceil(this.y),
  40683. this
  40684. },
  40685. round: function() {
  40686. return this.x = Math.round(this.x),
  40687. this.y = Math.round(this.y),
  40688. this
  40689. },
  40690. roundToZero: function() {
  40691. return this.x = this.x < 0 ? Math.ceil(this.x) : Math.floor(this.x),
  40692. this.y = this.y < 0 ? Math.ceil(this.y) : Math.floor(this.y),
  40693. this
  40694. },
  40695. negate: function() {
  40696. return this.x = -this.x,
  40697. this.y = -this.y,
  40698. this
  40699. },
  40700. dot: function(e) {
  40701. return this.x * e.x + this.y * e.y
  40702. },
  40703. lengthSq: function() {
  40704. return this.x * this.x + this.y * this.y
  40705. },
  40706. length: function() {
  40707. return Math.sqrt(this.x * this.x + this.y * this.y)
  40708. },
  40709. lengthManhattan: function() {
  40710. return Math.abs(this.x) + Math.abs(this.y)
  40711. },
  40712. normalize: function() {
  40713. return this.divideScalar(this.length())
  40714. },
  40715. angle: function() {
  40716. var e = Math.atan2(this.y, this.x);
  40717. return e < 0 && (e += 2 * Math.PI),
  40718. e
  40719. },
  40720. distanceTo: function(e) {
  40721. return Math.sqrt(this.distanceToSquared(e))
  40722. },
  40723. distanceToSquared: function(e) {
  40724. var t = this.x - e.x
  40725. , i = this.y - e.y;
  40726. return t * t + i * i
  40727. },
  40728. setLength: function(e) {
  40729. return this.multiplyScalar(e / this.length())
  40730. },
  40731. lerp: function(e, t) {
  40732. return this.x += (e.x - this.x) * t,
  40733. this.y += (e.y - this.y) * t,
  40734. this
  40735. },
  40736. lerpVectors: function(e, t, i) {
  40737. return this.subVectors(t, e).multiplyScalar(i).add(e),
  40738. this
  40739. },
  40740. equals: function(e) {
  40741. return e.x === this.x && e.y === this.y
  40742. },
  40743. fromArray: function(e, t) {
  40744. return void 0 === t && (t = 0),
  40745. this.x = e[t],
  40746. this.y = e[t + 1],
  40747. this
  40748. },
  40749. toArray: function(e, t) {
  40750. return void 0 === e && (e = []),
  40751. void 0 === t && (t = 0),
  40752. e[t] = this.x,
  40753. e[t + 1] = this.y,
  40754. e
  40755. },
  40756. fromAttribute: function(e, t, i) {
  40757. return void 0 === i && (i = 0),
  40758. t = t * e.itemSize + i,
  40759. this.x = e.array[t],
  40760. this.y = e.array[t + 1],
  40761. this
  40762. },
  40763. rotateAround: function(e, t) {
  40764. var i = Math.cos(t)
  40765. , n = Math.sin(t)
  40766. , r = this.x - e.x
  40767. , o = this.y - e.y;
  40768. return this.x = r * i - o * n + e.x,
  40769. this.y = r * n + o * i + e.y,
  40770. this
  40771. }
  40772. },
  40773. n.Vector3 = function(e, t, i) {
  40774. this.x = e || 0,
  40775. this.y = t || 0,
  40776. this.z = i || 0
  40777. }
  40778. ,
  40779. n.Vector3.prototype = {
  40780. constructor: n.Vector3,
  40781. set: function(e, t, i) {
  40782. return this.x = e,
  40783. this.y = t,
  40784. this.z = i,
  40785. this
  40786. },
  40787. setScalar: function(e) {
  40788. return this.x = e,
  40789. this.y = e,
  40790. this.z = e,
  40791. this
  40792. },
  40793. setX: function(e) {
  40794. return this.x = e,
  40795. this
  40796. },
  40797. setY: function(e) {
  40798. return this.y = e,
  40799. this
  40800. },
  40801. setZ: function(e) {
  40802. return this.z = e,
  40803. this
  40804. },
  40805. setComponent: function(e, t) {
  40806. switch (e) {
  40807. case 0:
  40808. this.x = t;
  40809. break;
  40810. case 1:
  40811. this.y = t;
  40812. break;
  40813. case 2:
  40814. this.z = t;
  40815. break;
  40816. default:
  40817. throw new Error("index is out of range: " + e)
  40818. }
  40819. },
  40820. getComponent: function(e) {
  40821. switch (e) {
  40822. case 0:
  40823. return this.x;
  40824. case 1:
  40825. return this.y;
  40826. case 2:
  40827. return this.z;
  40828. default:
  40829. throw new Error("index is out of range: " + e)
  40830. }
  40831. },
  40832. clone: function() {
  40833. return new this.constructor(this.x,this.y,this.z)
  40834. },
  40835. copy: function(e) {
  40836. return this.x = e.x,
  40837. this.y = e.y,
  40838. this.z = e.z,
  40839. this
  40840. },
  40841. add: function(e, t) {
  40842. return void 0 !== t ? (console.warn("THREE.Vector3: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),
  40843. this.addVectors(e, t)) : (this.x += e.x,
  40844. this.y += e.y,
  40845. this.z += e.z,
  40846. this)
  40847. },
  40848. addScalar: function(e) {
  40849. return this.x += e,
  40850. this.y += e,
  40851. this.z += e,
  40852. this
  40853. },
  40854. addVectors: function(e, t) {
  40855. return this.x = e.x + t.x,
  40856. this.y = e.y + t.y,
  40857. this.z = e.z + t.z,
  40858. this
  40859. },
  40860. addScaledVector: function(e, t) {
  40861. return this.x += e.x * t,
  40862. this.y += e.y * t,
  40863. this.z += e.z * t,
  40864. this
  40865. },
  40866. sub: function(e, t) {
  40867. return void 0 !== t ? (console.warn("THREE.Vector3: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),
  40868. this.subVectors(e, t)) : (this.x -= e.x,
  40869. this.y -= e.y,
  40870. this.z -= e.z,
  40871. this)
  40872. },
  40873. subScalar: function(e) {
  40874. return this.x -= e,
  40875. this.y -= e,
  40876. this.z -= e,
  40877. this
  40878. },
  40879. subVectors: function(e, t) {
  40880. return this.x = e.x - t.x,
  40881. this.y = e.y - t.y,
  40882. this.z = e.z - t.z,
  40883. this
  40884. },
  40885. multiply: function(e, t) {
  40886. return void 0 !== t ? (console.warn("THREE.Vector3: .multiply() now only accepts one argument. Use .multiplyVectors( a, b ) instead."),
  40887. this.multiplyVectors(e, t)) : (this.x *= e.x,
  40888. this.y *= e.y,
  40889. this.z *= e.z,
  40890. this)
  40891. },
  40892. multiplyScalar: function(e) {
  40893. return isFinite(e) ? (this.x *= e,
  40894. this.y *= e,
  40895. this.z *= e) : (this.x = 0,
  40896. this.y = 0,
  40897. this.z = 0),
  40898. this
  40899. },
  40900. multiplyVectors: function(e, t) {
  40901. return this.x = e.x * t.x,
  40902. this.y = e.y * t.y,
  40903. this.z = e.z * t.z,
  40904. this
  40905. },
  40906. applyEuler: function() {
  40907. var e;
  40908. return function(t) {
  40909. return t instanceof n.Euler == !1 && console.error("THREE.Vector3: .applyEuler() now expects an Euler rotation rather than a Vector3 and order."),
  40910. void 0 === e && (e = new n.Quaternion),
  40911. this.applyQuaternion(e.setFromEuler(t)),
  40912. this
  40913. }
  40914. }(),
  40915. applyAxisAngle: function() {
  40916. var e;
  40917. return function(t, i) {
  40918. return void 0 === e && (e = new n.Quaternion),
  40919. this.applyQuaternion(e.setFromAxisAngle(t, i)),
  40920. this
  40921. }
  40922. }(),
  40923. applyMatrix3: function(e) {
  40924. var t = this.x
  40925. , i = this.y
  40926. , n = this.z
  40927. , r = e.elements;
  40928. return this.x = r[0] * t + r[3] * i + r[6] * n,
  40929. this.y = r[1] * t + r[4] * i + r[7] * n,
  40930. this.z = r[2] * t + r[5] * i + r[8] * n,
  40931. this
  40932. },
  40933. applyMatrix4: function(e) {
  40934. var t = this.x
  40935. , i = this.y
  40936. , n = this.z
  40937. , r = e.elements;
  40938. return this.x = r[0] * t + r[4] * i + r[8] * n + r[12],
  40939. this.y = r[1] * t + r[5] * i + r[9] * n + r[13],
  40940. this.z = r[2] * t + r[6] * i + r[10] * n + r[14],
  40941. this
  40942. },
  40943. applyProjection: function(e) {
  40944. var t = this.x
  40945. , i = this.y
  40946. , n = this.z
  40947. , r = e.elements
  40948. , o = 1 / (r[3] * t + r[7] * i + r[11] * n + r[15]);
  40949. return this.x = (r[0] * t + r[4] * i + r[8] * n + r[12]) * o,
  40950. this.y = (r[1] * t + r[5] * i + r[9] * n + r[13]) * o,
  40951. this.z = (r[2] * t + r[6] * i + r[10] * n + r[14]) * o,
  40952. this
  40953. },
  40954. applyQuaternion: function(e) {
  40955. var t = this.x
  40956. , i = this.y
  40957. , n = this.z
  40958. , r = e.x
  40959. , o = e.y
  40960. , a = e.z
  40961. , s = e.w
  40962. , l = s * t + o * n - a * i
  40963. , c = s * i + a * t - r * n
  40964. , h = s * n + r * i - o * t
  40965. , u = -r * t - o * i - a * n;
  40966. return this.x = l * s + u * -r + c * -a - h * -o,
  40967. this.y = c * s + u * -o + h * -r - l * -a,
  40968. this.z = h * s + u * -a + l * -o - c * -r,
  40969. this
  40970. },
  40971. project: function() {
  40972. var e;
  40973. return function(t) {
  40974. return void 0 === e && (e = new n.Matrix4),
  40975. e.multiplyMatrices(t.projectionMatrix, e.getInverse(t.matrixWorld)),
  40976. this.applyProjection(e)
  40977. }
  40978. }(),
  40979. unproject: function() {
  40980. var e;
  40981. return function(t) {
  40982. return void 0 === e && (e = new n.Matrix4),
  40983. e.multiplyMatrices(t.matrixWorld, e.getInverse(t.projectionMatrix)),
  40984. this.applyProjection(e)
  40985. }
  40986. }(),
  40987. transformDirection: function(e) {
  40988. var t = this.x
  40989. , i = this.y
  40990. , n = this.z
  40991. , r = e.elements;
  40992. return this.x = r[0] * t + r[4] * i + r[8] * n,
  40993. this.y = r[1] * t + r[5] * i + r[9] * n,
  40994. this.z = r[2] * t + r[6] * i + r[10] * n,
  40995. this.normalize(),
  40996. this
  40997. },
  40998. divide: function(e) {
  40999. return this.x /= e.x,
  41000. this.y /= e.y,
  41001. this.z /= e.z,
  41002. this
  41003. },
  41004. divideScalar: function(e) {
  41005. return this.multiplyScalar(1 / e)
  41006. },
  41007. min: function(e) {
  41008. return this.x = Math.min(this.x, e.x),
  41009. this.y = Math.min(this.y, e.y),
  41010. this.z = Math.min(this.z, e.z),
  41011. this
  41012. },
  41013. max: function(e) {
  41014. return this.x = Math.max(this.x, e.x),
  41015. this.y = Math.max(this.y, e.y),
  41016. this.z = Math.max(this.z, e.z),
  41017. this
  41018. },
  41019. clamp: function(e, t) {
  41020. return this.x = Math.max(e.x, Math.min(t.x, this.x)),
  41021. this.y = Math.max(e.y, Math.min(t.y, this.y)),
  41022. this.z = Math.max(e.z, Math.min(t.z, this.z)),
  41023. this
  41024. },
  41025. clampScalar: function() {
  41026. var e, t;
  41027. return function(i, r) {
  41028. return void 0 === e && (e = new n.Vector3,
  41029. t = new n.Vector3),
  41030. e.set(i, i, i),
  41031. t.set(r, r, r),
  41032. this.clamp(e, t)
  41033. }
  41034. }(),
  41035. clampLength: function(e, t) {
  41036. var i = this.length();
  41037. return this.multiplyScalar(Math.max(e, Math.min(t, i)) / i),
  41038. this
  41039. },
  41040. floor: function() {
  41041. return this.x = Math.floor(this.x),
  41042. this.y = Math.floor(this.y),
  41043. this.z = Math.floor(this.z),
  41044. this
  41045. },
  41046. ceil: function() {
  41047. return this.x = Math.ceil(this.x),
  41048. this.y = Math.ceil(this.y),
  41049. this.z = Math.ceil(this.z),
  41050. this
  41051. },
  41052. round: function() {
  41053. return this.x = Math.round(this.x),
  41054. this.y = Math.round(this.y),
  41055. this.z = Math.round(this.z),
  41056. this
  41057. },
  41058. roundToZero: function() {
  41059. return this.x = this.x < 0 ? Math.ceil(this.x) : Math.floor(this.x),
  41060. this.y = this.y < 0 ? Math.ceil(this.y) : Math.floor(this.y),
  41061. this.z = this.z < 0 ? Math.ceil(this.z) : Math.floor(this.z),
  41062. this
  41063. },
  41064. negate: function() {
  41065. return this.x = -this.x,
  41066. this.y = -this.y,
  41067. this.z = -this.z,
  41068. this
  41069. },
  41070. dot: function(e) {
  41071. return this.x * e.x + this.y * e.y + this.z * e.z
  41072. },
  41073. lengthSq: function() {
  41074. return this.x * this.x + this.y * this.y + this.z * this.z
  41075. },
  41076. length: function() {
  41077. return Math.sqrt(this.x * this.x + this.y * this.y + this.z * this.z)
  41078. },
  41079. lengthManhattan: function() {
  41080. return Math.abs(this.x) + Math.abs(this.y) + Math.abs(this.z)
  41081. },
  41082. normalize: function() {
  41083. return this.divideScalar(this.length())
  41084. },
  41085. setLength: function(e) {
  41086. return this.multiplyScalar(e / this.length())
  41087. },
  41088. lerp: function(e, t) {
  41089. return this.x += (e.x - this.x) * t,
  41090. this.y += (e.y - this.y) * t,
  41091. this.z += (e.z - this.z) * t,
  41092. this
  41093. },
  41094. lerpVectors: function(e, t, i) {
  41095. return this.subVectors(t, e).multiplyScalar(i).add(e),
  41096. this
  41097. },
  41098. cross: function(e, t) {
  41099. if (void 0 !== t)
  41100. return console.warn("THREE.Vector3: .cross() now only accepts one argument. Use .crossVectors( a, b ) instead."),
  41101. this.crossVectors(e, t);
  41102. var i = this.x
  41103. , n = this.y
  41104. , r = this.z;
  41105. return this.x = n * e.z - r * e.y,
  41106. this.y = r * e.x - i * e.z,
  41107. this.z = i * e.y - n * e.x,
  41108. this
  41109. },
  41110. crossVectors: function(e, t) {
  41111. var i = e.x
  41112. , n = e.y
  41113. , r = e.z
  41114. , o = t.x
  41115. , a = t.y
  41116. , s = t.z;
  41117. return this.x = n * s - r * a,
  41118. this.y = r * o - i * s,
  41119. this.z = i * a - n * o,
  41120. this
  41121. },
  41122. projectOnVector: function() {
  41123. var e, t;
  41124. return function(i) {
  41125. return void 0 === e && (e = new n.Vector3),
  41126. e.copy(i).normalize(),
  41127. t = this.dot(e),
  41128. this.copy(e).multiplyScalar(t)
  41129. }
  41130. }(),
  41131. projectOnPlane: function() {
  41132. var e;
  41133. return function(t) {
  41134. return void 0 === e && (e = new n.Vector3),
  41135. e.copy(this).projectOnVector(t),
  41136. this.sub(e)
  41137. }
  41138. }(),
  41139. reflect: function() {
  41140. var e;
  41141. return function(t) {
  41142. return void 0 === e && (e = new n.Vector3),
  41143. this.sub(e.copy(t).multiplyScalar(2 * this.dot(t)))
  41144. }
  41145. }(),
  41146. angleTo: function(e) {
  41147. var t = this.dot(e) / Math.sqrt(this.lengthSq() * e.lengthSq());
  41148. return Math.acos(n.Math.clamp(t, -1, 1))
  41149. },
  41150. distanceTo: function(e) {
  41151. return Math.sqrt(this.distanceToSquared(e))
  41152. },
  41153. distanceToSquared: function(e) {
  41154. var t = this.x - e.x
  41155. , i = this.y - e.y
  41156. , n = this.z - e.z;
  41157. return t * t + i * i + n * n
  41158. },
  41159. setFromSpherical: function(e) {
  41160. var t = Math.sin(e.phi) * e.radius;
  41161. return this.x = t * Math.sin(e.theta),
  41162. this.y = Math.cos(e.phi) * e.radius,
  41163. this.z = t * Math.cos(e.theta),
  41164. this
  41165. },
  41166. setFromMatrixPosition: function(e) {
  41167. return this.setFromMatrixColumn(e, 3)
  41168. },
  41169. setFromMatrixScale: function(e) {
  41170. var t = this.setFromMatrixColumn(e, 0).length()
  41171. , i = this.setFromMatrixColumn(e, 1).length()
  41172. , n = this.setFromMatrixColumn(e, 2).length();
  41173. return this.x = t,
  41174. this.y = i,
  41175. this.z = n,
  41176. this
  41177. },
  41178. setFromMatrixColumn: function(e, t) {
  41179. return "number" == typeof e && (console.warn("THREE.Vector3: setFromMatrixColumn now expects ( matrix, index )."),
  41180. e = arguments[1],
  41181. t = arguments[0]),
  41182. this.fromArray(e.elements, 4 * t)
  41183. },
  41184. equals: function(e) {
  41185. return e.x === this.x && e.y === this.y && e.z === this.z
  41186. },
  41187. fromArray: function(e, t) {
  41188. return void 0 === t && (t = 0),
  41189. this.x = e[t],
  41190. this.y = e[t + 1],
  41191. this.z = e[t + 2],
  41192. this
  41193. },
  41194. toArray: function(e, t) {
  41195. return void 0 === e && (e = []),
  41196. void 0 === t && (t = 0),
  41197. e[t] = this.x,
  41198. e[t + 1] = this.y,
  41199. e[t + 2] = this.z,
  41200. e
  41201. },
  41202. fromAttribute: function(e, t, i) {
  41203. return void 0 === i && (i = 0),
  41204. t = t * e.itemSize + i,
  41205. this.x = e.array[t],
  41206. this.y = e.array[t + 1],
  41207. this.z = e.array[t + 2],
  41208. this
  41209. }
  41210. },
  41211. n.Vector4 = function(e, t, i, n) {
  41212. this.x = e || 0,
  41213. this.y = t || 0,
  41214. this.z = i || 0,
  41215. this.w = void 0 !== n ? n : 1
  41216. }
  41217. ,
  41218. n.Vector4.prototype = {
  41219. constructor: n.Vector4,
  41220. set: function(e, t, i, n) {
  41221. return this.x = e,
  41222. this.y = t,
  41223. this.z = i,
  41224. this.w = n,
  41225. this
  41226. },
  41227. setScalar: function(e) {
  41228. return this.x = e,
  41229. this.y = e,
  41230. this.z = e,
  41231. this.w = e,
  41232. this
  41233. },
  41234. setX: function(e) {
  41235. return this.x = e,
  41236. this
  41237. },
  41238. setY: function(e) {
  41239. return this.y = e,
  41240. this
  41241. },
  41242. setZ: function(e) {
  41243. return this.z = e,
  41244. this
  41245. },
  41246. setW: function(e) {
  41247. return this.w = e,
  41248. this
  41249. },
  41250. setComponent: function(e, t) {
  41251. switch (e) {
  41252. case 0:
  41253. this.x = t;
  41254. break;
  41255. case 1:
  41256. this.y = t;
  41257. break;
  41258. case 2:
  41259. this.z = t;
  41260. break;
  41261. case 3:
  41262. this.w = t;
  41263. break;
  41264. default:
  41265. throw new Error("index is out of range: " + e)
  41266. }
  41267. },
  41268. getComponent: function(e) {
  41269. switch (e) {
  41270. case 0:
  41271. return this.x;
  41272. case 1:
  41273. return this.y;
  41274. case 2:
  41275. return this.z;
  41276. case 3:
  41277. return this.w;
  41278. default:
  41279. throw new Error("index is out of range: " + e)
  41280. }
  41281. },
  41282. clone: function() {
  41283. return new this.constructor(this.x,this.y,this.z,this.w)
  41284. },
  41285. copy: function(e) {
  41286. return this.x = e.x,
  41287. this.y = e.y,
  41288. this.z = e.z,
  41289. this.w = void 0 !== e.w ? e.w : 1,
  41290. this
  41291. },
  41292. add: function(e, t) {
  41293. return void 0 !== t ? (console.warn("THREE.Vector4: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),
  41294. this.addVectors(e, t)) : (this.x += e.x,
  41295. this.y += e.y,
  41296. this.z += e.z,
  41297. this.w += e.w,
  41298. this)
  41299. },
  41300. addScalar: function(e) {
  41301. return this.x += e,
  41302. this.y += e,
  41303. this.z += e,
  41304. this.w += e,
  41305. this
  41306. },
  41307. addVectors: function(e, t) {
  41308. return this.x = e.x + t.x,
  41309. this.y = e.y + t.y,
  41310. this.z = e.z + t.z,
  41311. this.w = e.w + t.w,
  41312. this
  41313. },
  41314. addScaledVector: function(e, t) {
  41315. return this.x += e.x * t,
  41316. this.y += e.y * t,
  41317. this.z += e.z * t,
  41318. this.w += e.w * t,
  41319. this
  41320. },
  41321. sub: function(e, t) {
  41322. return void 0 !== t ? (console.warn("THREE.Vector4: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),
  41323. this.subVectors(e, t)) : (this.x -= e.x,
  41324. this.y -= e.y,
  41325. this.z -= e.z,
  41326. this.w -= e.w,
  41327. this)
  41328. },
  41329. subScalar: function(e) {
  41330. return this.x -= e,
  41331. this.y -= e,
  41332. this.z -= e,
  41333. this.w -= e,
  41334. this
  41335. },
  41336. subVectors: function(e, t) {
  41337. return this.x = e.x - t.x,
  41338. this.y = e.y - t.y,
  41339. this.z = e.z - t.z,
  41340. this.w = e.w - t.w,
  41341. this
  41342. },
  41343. multiplyScalar: function(e) {
  41344. return isFinite(e) ? (this.x *= e,
  41345. this.y *= e,
  41346. this.z *= e,
  41347. this.w *= e) : (this.x = 0,
  41348. this.y = 0,
  41349. this.z = 0,
  41350. this.w = 0),
  41351. this
  41352. },
  41353. applyMatrix4: function(e) {
  41354. var t = this.x
  41355. , i = this.y
  41356. , n = this.z
  41357. , r = this.w
  41358. , o = e.elements;
  41359. return this.x = o[0] * t + o[4] * i + o[8] * n + o[12] * r,
  41360. this.y = o[1] * t + o[5] * i + o[9] * n + o[13] * r,
  41361. this.z = o[2] * t + o[6] * i + o[10] * n + o[14] * r,
  41362. this.w = o[3] * t + o[7] * i + o[11] * n + o[15] * r,
  41363. this
  41364. },
  41365. divideScalar: function(e) {
  41366. return this.multiplyScalar(1 / e)
  41367. },
  41368. setAxisAngleFromQuaternion: function(e) {
  41369. this.w = 2 * Math.acos(e.w);
  41370. var t = Math.sqrt(1 - e.w * e.w);
  41371. return t < 1e-4 ? (this.x = 1,
  41372. this.y = 0,
  41373. this.z = 0) : (this.x = e.x / t,
  41374. this.y = e.y / t,
  41375. this.z = e.z / t),
  41376. this
  41377. },
  41378. setAxisAngleFromRotationMatrix: function(e) {
  41379. 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];
  41380. if (Math.abs(c - u) < o && Math.abs(h - f) < o && Math.abs(p - g) < o) {
  41381. if (Math.abs(c + u) < a && Math.abs(h + f) < a && Math.abs(p + g) < a && Math.abs(l + d + m - 3) < a)
  41382. return this.set(1, 0, 0, 0),
  41383. this;
  41384. t = Math.PI;
  41385. var v = (l + 1) / 2
  41386. , A = (d + 1) / 2
  41387. , y = (m + 1) / 2
  41388. , C = (c + u) / 4
  41389. , I = (h + f) / 4
  41390. , E = (p + g) / 4;
  41391. return v > A && v > y ? v < o ? (i = 0,
  41392. n = .707106781,
  41393. r = .707106781) : (i = Math.sqrt(v),
  41394. n = C / i,
  41395. r = I / i) : A > y ? A < o ? (i = .707106781,
  41396. n = 0,
  41397. r = .707106781) : (n = Math.sqrt(A),
  41398. i = C / n,
  41399. r = E / n) : y < o ? (i = .707106781,
  41400. n = .707106781,
  41401. r = 0) : (r = Math.sqrt(y),
  41402. i = I / r,
  41403. n = E / r),
  41404. this.set(i, n, r, t),
  41405. this
  41406. }
  41407. var b = Math.sqrt((g - p) * (g - p) + (h - f) * (h - f) + (u - c) * (u - c));
  41408. return Math.abs(b) < .001 && (b = 1),
  41409. this.x = (g - p) / b,
  41410. this.y = (h - f) / b,
  41411. this.z = (u - c) / b,
  41412. this.w = Math.acos((l + d + m - 1) / 2),
  41413. this
  41414. },
  41415. min: function(e) {
  41416. return this.x = Math.min(this.x, e.x),
  41417. this.y = Math.min(this.y, e.y),
  41418. this.z = Math.min(this.z, e.z),
  41419. this.w = Math.min(this.w, e.w),
  41420. this
  41421. },
  41422. max: function(e) {
  41423. return this.x = Math.max(this.x, e.x),
  41424. this.y = Math.max(this.y, e.y),
  41425. this.z = Math.max(this.z, e.z),
  41426. this.w = Math.max(this.w, e.w),
  41427. this
  41428. },
  41429. clamp: function(e, t) {
  41430. return this.x = Math.max(e.x, Math.min(t.x, this.x)),
  41431. this.y = Math.max(e.y, Math.min(t.y, this.y)),
  41432. this.z = Math.max(e.z, Math.min(t.z, this.z)),
  41433. this.w = Math.max(e.w, Math.min(t.w, this.w)),
  41434. this
  41435. },
  41436. clampScalar: function() {
  41437. var e, t;
  41438. return function(i, r) {
  41439. return void 0 === e && (e = new n.Vector4,
  41440. t = new n.Vector4),
  41441. e.set(i, i, i, i),
  41442. t.set(r, r, r, r),
  41443. this.clamp(e, t)
  41444. }
  41445. }(),
  41446. floor: function() {
  41447. return this.x = Math.floor(this.x),
  41448. this.y = Math.floor(this.y),
  41449. this.z = Math.floor(this.z),
  41450. this.w = Math.floor(this.w),
  41451. this
  41452. },
  41453. ceil: function() {
  41454. return this.x = Math.ceil(this.x),
  41455. this.y = Math.ceil(this.y),
  41456. this.z = Math.ceil(this.z),
  41457. this.w = Math.ceil(this.w),
  41458. this
  41459. },
  41460. round: function() {
  41461. return this.x = Math.round(this.x),
  41462. this.y = Math.round(this.y),
  41463. this.z = Math.round(this.z),
  41464. this.w = Math.round(this.w),
  41465. this
  41466. },
  41467. roundToZero: function() {
  41468. return this.x = this.x < 0 ? Math.ceil(this.x) : Math.floor(this.x),
  41469. this.y = this.y < 0 ? Math.ceil(this.y) : Math.floor(this.y),
  41470. this.z = this.z < 0 ? Math.ceil(this.z) : Math.floor(this.z),
  41471. this.w = this.w < 0 ? Math.ceil(this.w) : Math.floor(this.w),
  41472. this
  41473. },
  41474. negate: function() {
  41475. return this.x = -this.x,
  41476. this.y = -this.y,
  41477. this.z = -this.z,
  41478. this.w = -this.w,
  41479. this
  41480. },
  41481. dot: function(e) {
  41482. return this.x * e.x + this.y * e.y + this.z * e.z + this.w * e.w
  41483. },
  41484. lengthSq: function() {
  41485. return this.x * this.x + this.y * this.y + this.z * this.z + this.w * this.w
  41486. },
  41487. length: function() {
  41488. return Math.sqrt(this.x * this.x + this.y * this.y + this.z * this.z + this.w * this.w)
  41489. },
  41490. lengthManhattan: function() {
  41491. return Math.abs(this.x) + Math.abs(this.y) + Math.abs(this.z) + Math.abs(this.w)
  41492. },
  41493. normalize: function() {
  41494. return this.divideScalar(this.length())
  41495. },
  41496. setLength: function(e) {
  41497. return this.multiplyScalar(e / this.length())
  41498. },
  41499. lerp: function(e, t) {
  41500. return this.x += (e.x - this.x) * t,
  41501. this.y += (e.y - this.y) * t,
  41502. this.z += (e.z - this.z) * t,
  41503. this.w += (e.w - this.w) * t,
  41504. this
  41505. },
  41506. lerpVectors: function(e, t, i) {
  41507. return this.subVectors(t, e).multiplyScalar(i).add(e),
  41508. this
  41509. },
  41510. equals: function(e) {
  41511. return e.x === this.x && e.y === this.y && e.z === this.z && e.w === this.w
  41512. },
  41513. fromArray: function(e, t) {
  41514. return void 0 === t && (t = 0),
  41515. this.x = e[t],
  41516. this.y = e[t + 1],
  41517. this.z = e[t + 2],
  41518. this.w = e[t + 3],
  41519. this
  41520. },
  41521. toArray: function(e, t) {
  41522. return void 0 === e && (e = []),
  41523. void 0 === t && (t = 0),
  41524. e[t] = this.x,
  41525. e[t + 1] = this.y,
  41526. e[t + 2] = this.z,
  41527. e[t + 3] = this.w,
  41528. e
  41529. },
  41530. fromAttribute: function(e, t, i) {
  41531. return void 0 === i && (i = 0),
  41532. t = t * e.itemSize + i,
  41533. this.x = e.array[t],
  41534. this.y = e.array[t + 1],
  41535. this.z = e.array[t + 2],
  41536. this.w = e.array[t + 3],
  41537. this
  41538. }
  41539. },
  41540. n.Euler = function(e, t, i, r) {
  41541. this._x = e || 0,
  41542. this._y = t || 0,
  41543. this._z = i || 0,
  41544. this._order = r || n.Euler.DefaultOrder
  41545. }
  41546. ,
  41547. n.Euler.RotationOrders = ["XYZ", "YZX", "ZXY", "XZY", "YXZ", "ZYX"],
  41548. n.Euler.DefaultOrder = "XYZ",
  41549. n.Euler.prototype = {
  41550. constructor: n.Euler,
  41551. get x() {
  41552. return this._x
  41553. },
  41554. set x(e) {
  41555. this._x = e,
  41556. this.onChangeCallback()
  41557. },
  41558. get y() {
  41559. return this._y
  41560. },
  41561. set y(e) {
  41562. this._y = e,
  41563. this.onChangeCallback()
  41564. },
  41565. get z() {
  41566. return this._z
  41567. },
  41568. set z(e) {
  41569. this._z = e,
  41570. this.onChangeCallback()
  41571. },
  41572. get order() {
  41573. return this._order
  41574. },
  41575. set order(e) {
  41576. this._order = e,
  41577. this.onChangeCallback()
  41578. },
  41579. set: function(e, t, i, n) {
  41580. return this._x = e,
  41581. this._y = t,
  41582. this._z = i,
  41583. this._order = n || this._order,
  41584. this.onChangeCallback(),
  41585. this
  41586. },
  41587. clone: function() {
  41588. return new this.constructor(this._x,this._y,this._z,this._order)
  41589. },
  41590. copy: function(e) {
  41591. return this._x = e._x,
  41592. this._y = e._y,
  41593. this._z = e._z,
  41594. this._order = e._order,
  41595. this.onChangeCallback(),
  41596. this
  41597. },
  41598. setFromRotationMatrix: function(e, t, i) {
  41599. var r = n.Math.clamp
  41600. , o = e.elements
  41601. , a = o[0]
  41602. , s = o[4]
  41603. , l = o[8]
  41604. , c = o[1]
  41605. , h = o[5]
  41606. , u = o[9]
  41607. , d = o[2]
  41608. , p = o[6]
  41609. , f = o[10];
  41610. return t = t || this._order,
  41611. "XYZ" === t ? (this._y = Math.asin(r(l, -1, 1)),
  41612. Math.abs(l) < .99999 ? (this._x = Math.atan2(-u, f),
  41613. this._z = Math.atan2(-s, a)) : (this._x = Math.atan2(p, h),
  41614. this._z = 0)) : "YXZ" === t ? (this._x = Math.asin(-r(u, -1, 1)),
  41615. Math.abs(u) < .99999 ? (this._y = Math.atan2(l, f),
  41616. this._z = Math.atan2(c, h)) : (this._y = Math.atan2(-d, a),
  41617. this._z = 0)) : "ZXY" === t ? (this._x = Math.asin(r(p, -1, 1)),
  41618. Math.abs(p) < .99999 ? (this._y = Math.atan2(-d, f),
  41619. this._z = Math.atan2(-s, h)) : (this._y = 0,
  41620. this._z = Math.atan2(c, a))) : "ZYX" === t ? (this._y = Math.asin(-r(d, -1, 1)),
  41621. Math.abs(d) < .99999 ? (this._x = Math.atan2(p, f),
  41622. this._z = Math.atan2(c, a)) : (this._x = 0,
  41623. this._z = Math.atan2(-s, h))) : "YZX" === t ? (this._z = Math.asin(r(c, -1, 1)),
  41624. Math.abs(c) < .99999 ? (this._x = Math.atan2(-u, h),
  41625. this._y = Math.atan2(-d, a)) : (this._x = 0,
  41626. this._y = Math.atan2(l, f))) : "XZY" === t ? (this._z = Math.asin(-r(s, -1, 1)),
  41627. Math.abs(s) < .99999 ? (this._x = Math.atan2(p, h),
  41628. this._y = Math.atan2(l, a)) : (this._x = Math.atan2(-u, f),
  41629. this._y = 0)) : console.warn("THREE.Euler: .setFromRotationMatrix() given unsupported order: " + t),
  41630. this._order = t,
  41631. i !== !1 && this.onChangeCallback(),
  41632. this
  41633. },
  41634. setFromQuaternion: function() {
  41635. var e;
  41636. return function(t, i, r) {
  41637. return void 0 === e && (e = new n.Matrix4),
  41638. e.makeRotationFromQuaternion(t),
  41639. this.setFromRotationMatrix(e, i, r),
  41640. this
  41641. }
  41642. }(),
  41643. setFromVector3: function(e, t) {
  41644. return this.set(e.x, e.y, e.z, t || this._order)
  41645. },
  41646. reorder: function() {
  41647. var e = new n.Quaternion;
  41648. return function(t) {
  41649. e.setFromEuler(this),
  41650. this.setFromQuaternion(e, t)
  41651. }
  41652. }(),
  41653. equals: function(e) {
  41654. return e._x === this._x && e._y === this._y && e._z === this._z && e._order === this._order
  41655. },
  41656. fromArray: function(e) {
  41657. return this._x = e[0],
  41658. this._y = e[1],
  41659. this._z = e[2],
  41660. void 0 !== e[3] && (this._order = e[3]),
  41661. this.onChangeCallback(),
  41662. this
  41663. },
  41664. toArray: function(e, t) {
  41665. return void 0 === e && (e = []),
  41666. void 0 === t && (t = 0),
  41667. e[t] = this._x,
  41668. e[t + 1] = this._y,
  41669. e[t + 2] = this._z,
  41670. e[t + 3] = this._order,
  41671. e
  41672. },
  41673. toVector3: function(e) {
  41674. return e ? e.set(this._x, this._y, this._z) : new n.Vector3(this._x,this._y,this._z)
  41675. },
  41676. onChange: function(e) {
  41677. return this.onChangeCallback = e,
  41678. this
  41679. },
  41680. onChangeCallback: function() {}
  41681. },
  41682. n.Line3 = function(e, t) {
  41683. this.start = void 0 !== e ? e : new n.Vector3,
  41684. this.end = void 0 !== t ? t : new n.Vector3
  41685. }
  41686. ,
  41687. n.Line3.prototype = {
  41688. constructor: n.Line3,
  41689. set: function(e, t) {
  41690. return this.start.copy(e),
  41691. this.end.copy(t),
  41692. this
  41693. },
  41694. clone: function() {
  41695. return (new this.constructor).copy(this)
  41696. },
  41697. copy: function(e) {
  41698. return this.start.copy(e.start),
  41699. this.end.copy(e.end),
  41700. this
  41701. },
  41702. center: function(e) {
  41703. var t = e || new n.Vector3;
  41704. return t.addVectors(this.start, this.end).multiplyScalar(.5)
  41705. },
  41706. delta: function(e) {
  41707. var t = e || new n.Vector3;
  41708. return t.subVectors(this.end, this.start)
  41709. },
  41710. distanceSq: function() {
  41711. return this.start.distanceToSquared(this.end)
  41712. },
  41713. distance: function() {
  41714. return this.start.distanceTo(this.end)
  41715. },
  41716. at: function(e, t) {
  41717. var i = t || new n.Vector3;
  41718. return this.delta(i).multiplyScalar(e).add(this.start)
  41719. },
  41720. closestPointToPointParameter: function() {
  41721. var e = new n.Vector3
  41722. , t = new n.Vector3;
  41723. return function(i, r) {
  41724. e.subVectors(i, this.start),
  41725. t.subVectors(this.end, this.start);
  41726. var o = t.dot(t)
  41727. , a = t.dot(e)
  41728. , s = a / o;
  41729. return r && (s = n.Math.clamp(s, 0, 1)),
  41730. s
  41731. }
  41732. }(),
  41733. closestPointToPoint: function(e, t, i) {
  41734. var r = this.closestPointToPointParameter(e, t)
  41735. , o = i || new n.Vector3;
  41736. return this.delta(o).multiplyScalar(r).add(this.start)
  41737. },
  41738. applyMatrix4: function(e) {
  41739. return this.start.applyMatrix4(e),
  41740. this.end.applyMatrix4(e),
  41741. this
  41742. },
  41743. equals: function(e) {
  41744. return e.start.equals(this.start) && e.end.equals(this.end)
  41745. }
  41746. },
  41747. n.Box2 = function(e, t) {
  41748. this.min = void 0 !== e ? e : new n.Vector2(+(1 / 0),+(1 / 0)),
  41749. this.max = void 0 !== t ? t : new n.Vector2(-(1 / 0),-(1 / 0))
  41750. }
  41751. ,
  41752. n.Box2.prototype = {
  41753. constructor: n.Box2,
  41754. set: function(e, t) {
  41755. return this.min.copy(e),
  41756. this.max.copy(t),
  41757. this
  41758. },
  41759. setFromPoints: function(e) {
  41760. this.makeEmpty();
  41761. for (var t = 0, i = e.length; t < i; t++)
  41762. this.expandByPoint(e[t]);
  41763. return this
  41764. },
  41765. setFromCenterAndSize: function() {
  41766. var e = new n.Vector2;
  41767. return function(t, i) {
  41768. var n = e.copy(i).multiplyScalar(.5);
  41769. return this.min.copy(t).sub(n),
  41770. this.max.copy(t).add(n),
  41771. this
  41772. }
  41773. }(),
  41774. clone: function() {
  41775. return (new this.constructor).copy(this)
  41776. },
  41777. copy: function(e) {
  41778. return this.min.copy(e.min),
  41779. this.max.copy(e.max),
  41780. this
  41781. },
  41782. makeEmpty: function() {
  41783. return this.min.x = this.min.y = +(1 / 0),
  41784. this.max.x = this.max.y = -(1 / 0),
  41785. this
  41786. },
  41787. isEmpty: function() {
  41788. return this.max.x < this.min.x || this.max.y < this.min.y
  41789. },
  41790. center: function(e) {
  41791. var t = e || new n.Vector2;
  41792. return t.addVectors(this.min, this.max).multiplyScalar(.5)
  41793. },
  41794. size: function(e) {
  41795. var t = e || new n.Vector2;
  41796. return t.subVectors(this.max, this.min)
  41797. },
  41798. expandByPoint: function(e) {
  41799. return this.min.min(e),
  41800. this.max.max(e),
  41801. this
  41802. },
  41803. expandByVector: function(e) {
  41804. return this.min.sub(e),
  41805. this.max.add(e),
  41806. this
  41807. },
  41808. expandByScalar: function(e) {
  41809. return this.min.addScalar(-e),
  41810. this.max.addScalar(e),
  41811. this
  41812. },
  41813. containsPoint: function(e) {
  41814. return !(e.x < this.min.x || e.x > this.max.x || e.y < this.min.y || e.y > this.max.y)
  41815. },
  41816. containsBox: function(e) {
  41817. 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
  41818. },
  41819. getParameter: function(e, t) {
  41820. var i = t || new n.Vector2;
  41821. 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))
  41822. },
  41823. intersectsBox: function(e) {
  41824. 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)
  41825. },
  41826. clampPoint: function(e, t) {
  41827. var i = t || new n.Vector2;
  41828. return i.copy(e).clamp(this.min, this.max)
  41829. },
  41830. distanceToPoint: function() {
  41831. var e = new n.Vector2;
  41832. return function(t) {
  41833. var i = e.copy(t).clamp(this.min, this.max);
  41834. return i.sub(t).length()
  41835. }
  41836. }(),
  41837. intersect: function(e) {
  41838. return this.min.max(e.min),
  41839. this.max.min(e.max),
  41840. this
  41841. },
  41842. union: function(e) {
  41843. return this.min.min(e.min),
  41844. this.max.max(e.max),
  41845. this
  41846. },
  41847. translate: function(e) {
  41848. return this.min.add(e),
  41849. this.max.add(e),
  41850. this
  41851. },
  41852. equals: function(e) {
  41853. return e.min.equals(this.min) && e.max.equals(this.max)
  41854. }
  41855. },
  41856. n.Box3 = function(e, t) {
  41857. this.min = void 0 !== e ? e : new n.Vector3(+(1 / 0),+(1 / 0),+(1 / 0)),
  41858. this.max = void 0 !== t ? t : new n.Vector3(-(1 / 0),-(1 / 0),-(1 / 0))
  41859. }
  41860. ,
  41861. n.Box3.prototype = {
  41862. constructor: n.Box3,
  41863. set: function(e, t) {
  41864. return this.min.copy(e),
  41865. this.max.copy(t),
  41866. this
  41867. },
  41868. setFromArray: function(e) {
  41869. this.makeEmpty();
  41870. 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) {
  41871. var c = e[s]
  41872. , h = e[s + 1]
  41873. , u = e[s + 2];
  41874. c < t && (t = c),
  41875. h < i && (i = h),
  41876. u < n && (n = u),
  41877. c > r && (r = c),
  41878. h > o && (o = h),
  41879. u > a && (a = u)
  41880. }
  41881. this.min.set(t, i, n),
  41882. this.max.set(r, o, a)
  41883. },
  41884. setFromPoints: function(e) {
  41885. this.makeEmpty();
  41886. for (var t = 0, i = e.length; t < i; t++)
  41887. this.expandByPoint(e[t]);
  41888. return this
  41889. },
  41890. setFromCenterAndSize: function() {
  41891. var e = new n.Vector3;
  41892. return function(t, i) {
  41893. var n = e.copy(i).multiplyScalar(.5);
  41894. return this.min.copy(t).sub(n),
  41895. this.max.copy(t).add(n),
  41896. this
  41897. }
  41898. }(),
  41899. setFromObject: function() {
  41900. var e;
  41901. return function(t) {
  41902. void 0 === e && (e = new n.Box3);
  41903. var i = this;
  41904. return this.makeEmpty(),
  41905. t.updateMatrixWorld(!0),
  41906. t.traverse(function(t) {
  41907. var n = t.geometry;
  41908. void 0 !== n && (null === n.boundingBox && n.computeBoundingBox(),
  41909. n.boundingBox.isEmpty() === !1 && (e.copy(n.boundingBox),
  41910. e.applyMatrix4(t.matrixWorld),
  41911. i.union(e)))
  41912. }),
  41913. this
  41914. }
  41915. }(),
  41916. clone: function() {
  41917. return (new this.constructor).copy(this)
  41918. },
  41919. copy: function(e) {
  41920. return this.min.copy(e.min),
  41921. this.max.copy(e.max),
  41922. this
  41923. },
  41924. makeEmpty: function() {
  41925. return this.min.x = this.min.y = this.min.z = +(1 / 0),
  41926. this.max.x = this.max.y = this.max.z = -(1 / 0),
  41927. this
  41928. },
  41929. isEmpty: function() {
  41930. return this.max.x < this.min.x || this.max.y < this.min.y || this.max.z < this.min.z
  41931. },
  41932. center: function(e) {
  41933. var t = e || new n.Vector3;
  41934. return t.addVectors(this.min, this.max).multiplyScalar(.5)
  41935. },
  41936. size: function(e) {
  41937. var t = e || new n.Vector3;
  41938. return t.subVectors(this.max, this.min)
  41939. },
  41940. expandByPoint: function(e) {
  41941. return this.min.min(e),
  41942. this.max.max(e),
  41943. this
  41944. },
  41945. expandByVector: function(e) {
  41946. return this.min.sub(e),
  41947. this.max.add(e),
  41948. this
  41949. },
  41950. expandByScalar: function(e) {
  41951. return this.min.addScalar(-e),
  41952. this.max.addScalar(e),
  41953. this
  41954. },
  41955. containsPoint: function(e) {
  41956. 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)
  41957. },
  41958. containsBox: function(e) {
  41959. 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
  41960. },
  41961. getParameter: function(e, t) {
  41962. var i = t || new n.Vector3;
  41963. 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))
  41964. },
  41965. intersectsBox: function(e) {
  41966. 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)
  41967. },
  41968. intersectsSphere: function() {
  41969. var e;
  41970. return function(t) {
  41971. return void 0 === e && (e = new n.Vector3),
  41972. this.clampPoint(t.center, e),
  41973. e.distanceToSquared(t.center) <= t.radius * t.radius
  41974. }
  41975. }(),
  41976. intersectsPlane: function(e) {
  41977. var t, i;
  41978. return e.normal.x > 0 ? (t = e.normal.x * this.min.x,
  41979. i = e.normal.x * this.max.x) : (t = e.normal.x * this.max.x,
  41980. i = e.normal.x * this.min.x),
  41981. e.normal.y > 0 ? (t += e.normal.y * this.min.y,
  41982. i += e.normal.y * this.max.y) : (t += e.normal.y * this.max.y,
  41983. i += e.normal.y * this.min.y),
  41984. e.normal.z > 0 ? (t += e.normal.z * this.min.z,
  41985. i += e.normal.z * this.max.z) : (t += e.normal.z * this.max.z,
  41986. i += e.normal.z * this.min.z),
  41987. t <= e.constant && i >= e.constant
  41988. },
  41989. clampPoint: function(e, t) {
  41990. var i = t || new n.Vector3;
  41991. return i.copy(e).clamp(this.min, this.max)
  41992. },
  41993. distanceToPoint: function() {
  41994. var e = new n.Vector3;
  41995. return function(t) {
  41996. var i = e.copy(t).clamp(this.min, this.max);
  41997. return i.sub(t).length()
  41998. }
  41999. }(),
  42000. getBoundingSphere: function() {
  42001. var e = new n.Vector3;
  42002. return function(t) {
  42003. var i = t || new n.Sphere;
  42004. return i.center = this.center(),
  42005. i.radius = .5 * this.size(e).length(),
  42006. i
  42007. }
  42008. }(),
  42009. intersect: function(e) {
  42010. return this.min.max(e.min),
  42011. this.max.min(e.max),
  42012. this
  42013. },
  42014. union: function(e) {
  42015. return this.min.min(e.min),
  42016. this.max.max(e.max),
  42017. this
  42018. },
  42019. applyMatrix4: function() {
  42020. 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];
  42021. return function(t) {
  42022. return e[0].set(this.min.x, this.min.y, this.min.z).applyMatrix4(t),
  42023. e[1].set(this.min.x, this.min.y, this.max.z).applyMatrix4(t),
  42024. e[2].set(this.min.x, this.max.y, this.min.z).applyMatrix4(t),
  42025. e[3].set(this.min.x, this.max.y, this.max.z).applyMatrix4(t),
  42026. e[4].set(this.max.x, this.min.y, this.min.z).applyMatrix4(t),
  42027. e[5].set(this.max.x, this.min.y, this.max.z).applyMatrix4(t),
  42028. e[6].set(this.max.x, this.max.y, this.min.z).applyMatrix4(t),
  42029. e[7].set(this.max.x, this.max.y, this.max.z).applyMatrix4(t),
  42030. this.makeEmpty(),
  42031. this.setFromPoints(e),
  42032. this
  42033. }
  42034. }(),
  42035. translate: function(e) {
  42036. return this.min.add(e),
  42037. this.max.add(e),
  42038. this
  42039. },
  42040. equals: function(e) {
  42041. return e.min.equals(this.min) && e.max.equals(this.max)
  42042. }
  42043. },
  42044. n.Matrix3 = function() {
  42045. this.elements = new Float32Array([1, 0, 0, 0, 1, 0, 0, 0, 1]),
  42046. arguments.length > 0 && console.error("THREE.Matrix3: the constructor no longer reads arguments. use .set() instead.")
  42047. }
  42048. ,
  42049. n.Matrix3.prototype = {
  42050. constructor: n.Matrix3,
  42051. set: function(e, t, i, n, r, o, a, s, l) {
  42052. var c = this.elements;
  42053. return c[0] = e,
  42054. c[1] = n,
  42055. c[2] = a,
  42056. c[3] = t,
  42057. c[4] = r,
  42058. c[5] = s,
  42059. c[6] = i,
  42060. c[7] = o,
  42061. c[8] = l,
  42062. this
  42063. },
  42064. identity: function() {
  42065. return this.set(1, 0, 0, 0, 1, 0, 0, 0, 1),
  42066. this
  42067. },
  42068. clone: function() {
  42069. return (new this.constructor).fromArray(this.elements)
  42070. },
  42071. copy: function(e) {
  42072. var t = e.elements;
  42073. return this.set(t[0], t[3], t[6], t[1], t[4], t[7], t[2], t[5], t[8]),
  42074. this
  42075. },
  42076. setFromMatrix4: function(e) {
  42077. var t = e.elements;
  42078. return this.set(t[0], t[4], t[8], t[1], t[5], t[9], t[2], t[6], t[10]),
  42079. this
  42080. },
  42081. applyToVector3Array: function() {
  42082. var e;
  42083. return function(t, i, r) {
  42084. void 0 === e && (e = new n.Vector3),
  42085. void 0 === i && (i = 0),
  42086. void 0 === r && (r = t.length);
  42087. for (var o = 0, a = i; o < r; o += 3,
  42088. a += 3)
  42089. e.fromArray(t, a),
  42090. e.applyMatrix3(this),
  42091. e.toArray(t, a);
  42092. return t
  42093. }
  42094. }(),
  42095. applyToBuffer: function() {
  42096. var e;
  42097. return function(t, i, r) {
  42098. void 0 === e && (e = new n.Vector3),
  42099. void 0 === i && (i = 0),
  42100. void 0 === r && (r = t.length / t.itemSize);
  42101. for (var o = 0, a = i; o < r; o++,
  42102. a++)
  42103. e.x = t.getX(a),
  42104. e.y = t.getY(a),
  42105. e.z = t.getZ(a),
  42106. e.applyMatrix3(this),
  42107. t.setXYZ(e.x, e.y, e.z);
  42108. return t
  42109. }
  42110. }(),
  42111. multiplyScalar: function(e) {
  42112. var t = this.elements;
  42113. return t[0] *= e,
  42114. t[3] *= e,
  42115. t[6] *= e,
  42116. t[1] *= e,
  42117. t[4] *= e,
  42118. t[7] *= e,
  42119. t[2] *= e,
  42120. t[5] *= e,
  42121. t[8] *= e,
  42122. this
  42123. },
  42124. determinant: function() {
  42125. var e = this.elements
  42126. , t = e[0]
  42127. , i = e[1]
  42128. , n = e[2]
  42129. , r = e[3]
  42130. , o = e[4]
  42131. , a = e[5]
  42132. , s = e[6]
  42133. , l = e[7]
  42134. , c = e[8];
  42135. return t * o * c - t * a * l - i * r * c + i * a * s + n * r * l - n * o * s
  42136. },
  42137. getInverse: function(e, t) {
  42138. e instanceof n.Matrix4 && console.warn("THREE.Matrix3.getInverse no longer takes a Matrix4 argument.");
  42139. var i = e.elements
  42140. , r = this.elements
  42141. , o = i[0]
  42142. , a = i[1]
  42143. , s = i[2]
  42144. , l = i[3]
  42145. , c = i[4]
  42146. , h = i[5]
  42147. , u = i[6]
  42148. , d = i[7]
  42149. , p = i[8]
  42150. , f = p * c - h * d
  42151. , g = h * u - p * l
  42152. , m = d * l - c * u
  42153. , v = o * f + a * g + s * m;
  42154. if (0 === v) {
  42155. var A = "THREE.Matrix3.getInverse(): can't invert matrix, determinant is 0";
  42156. if (t)
  42157. throw new Error(A);
  42158. return console.warn(A),
  42159. this.identity()
  42160. }
  42161. return r[0] = f,
  42162. r[1] = s * d - p * a,
  42163. r[2] = h * a - s * c,
  42164. r[3] = g,
  42165. r[4] = p * o - s * u,
  42166. r[5] = s * l - h * o,
  42167. r[6] = m,
  42168. r[7] = a * u - d * o,
  42169. r[8] = c * o - a * l,
  42170. this.multiplyScalar(1 / v)
  42171. },
  42172. transpose: function() {
  42173. var e, t = this.elements;
  42174. return e = t[1],
  42175. t[1] = t[3],
  42176. t[3] = e,
  42177. e = t[2],
  42178. t[2] = t[6],
  42179. t[6] = e,
  42180. e = t[5],
  42181. t[5] = t[7],
  42182. t[7] = e,
  42183. this
  42184. },
  42185. flattenToArrayOffset: function(e, t) {
  42186. var i = this.elements;
  42187. return e[t] = i[0],
  42188. e[t + 1] = i[1],
  42189. e[t + 2] = i[2],
  42190. e[t + 3] = i[3],
  42191. e[t + 4] = i[4],
  42192. e[t + 5] = i[5],
  42193. e[t + 6] = i[6],
  42194. e[t + 7] = i[7],
  42195. e[t + 8] = i[8],
  42196. e
  42197. },
  42198. getNormalMatrix: function(e) {
  42199. return this.setFromMatrix4(e).getInverse(this).transpose()
  42200. },
  42201. transposeIntoArray: function(e) {
  42202. var t = this.elements;
  42203. return e[0] = t[0],
  42204. e[1] = t[3],
  42205. e[2] = t[6],
  42206. e[3] = t[1],
  42207. e[4] = t[4],
  42208. e[5] = t[7],
  42209. e[6] = t[2],
  42210. e[7] = t[5],
  42211. e[8] = t[8],
  42212. this
  42213. },
  42214. fromArray: function(e) {
  42215. return this.elements.set(e),
  42216. this
  42217. },
  42218. toArray: function() {
  42219. var e = this.elements;
  42220. return [e[0], e[1], e[2], e[3], e[4], e[5], e[6], e[7], e[8]]
  42221. }
  42222. },
  42223. n.Matrix4 = function() {
  42224. this.elements = new Float32Array([1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1]),
  42225. arguments.length > 0 && console.error("THREE.Matrix4: the constructor no longer reads arguments. use .set() instead.")
  42226. }
  42227. ,
  42228. n.Matrix4.prototype = {
  42229. constructor: n.Matrix4,
  42230. set: function(e, t, i, n, r, o, a, s, l, c, h, u, d, p, f, g) {
  42231. var m = this.elements;
  42232. return m[0] = e,
  42233. m[4] = t,
  42234. m[8] = i,
  42235. m[12] = n,
  42236. m[1] = r,
  42237. m[5] = o,
  42238. m[9] = a,
  42239. m[13] = s,
  42240. m[2] = l,
  42241. m[6] = c,
  42242. m[10] = h,
  42243. m[14] = u,
  42244. m[3] = d,
  42245. m[7] = p,
  42246. m[11] = f,
  42247. m[15] = g,
  42248. this
  42249. },
  42250. identity: function() {
  42251. return this.set(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1),
  42252. this
  42253. },
  42254. clone: function() {
  42255. return (new n.Matrix4).fromArray(this.elements)
  42256. },
  42257. copy: function(e) {
  42258. return this.elements.set(e.elements),
  42259. this
  42260. },
  42261. copyPosition: function(e) {
  42262. var t = this.elements
  42263. , i = e.elements;
  42264. return t[12] = i[12],
  42265. t[13] = i[13],
  42266. t[14] = i[14],
  42267. this
  42268. },
  42269. extractBasis: function(e, t, i) {
  42270. return e.setFromMatrixColumn(this, 0),
  42271. t.setFromMatrixColumn(this, 1),
  42272. i.setFromMatrixColumn(this, 2),
  42273. this
  42274. },
  42275. makeBasis: function(e, t, i) {
  42276. 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),
  42277. this
  42278. },
  42279. extractRotation: function() {
  42280. var e;
  42281. return function(t) {
  42282. void 0 === e && (e = new n.Vector3);
  42283. var i = this.elements
  42284. , r = t.elements
  42285. , o = 1 / e.setFromMatrixColumn(t, 0).length()
  42286. , a = 1 / e.setFromMatrixColumn(t, 1).length()
  42287. , s = 1 / e.setFromMatrixColumn(t, 2).length();
  42288. return i[0] = r[0] * o,
  42289. i[1] = r[1] * o,
  42290. i[2] = r[2] * o,
  42291. i[4] = r[4] * a,
  42292. i[5] = r[5] * a,
  42293. i[6] = r[6] * a,
  42294. i[8] = r[8] * s,
  42295. i[9] = r[9] * s,
  42296. i[10] = r[10] * s,
  42297. this
  42298. }
  42299. }(),
  42300. makeRotationFromEuler: function(e) {
  42301. e instanceof n.Euler == !1 && console.error("THREE.Matrix: .makeRotationFromEuler() now expects a Euler rotation rather than a Vector3 and order.");
  42302. var t = this.elements
  42303. , i = e.x
  42304. , r = e.y
  42305. , o = e.z
  42306. , a = Math.cos(i)
  42307. , s = Math.sin(i)
  42308. , l = Math.cos(r)
  42309. , c = Math.sin(r)
  42310. , h = Math.cos(o)
  42311. , u = Math.sin(o);
  42312. if ("XYZ" === e.order) {
  42313. var d = a * h
  42314. , p = a * u
  42315. , f = s * h
  42316. , g = s * u;
  42317. t[0] = l * h,
  42318. t[4] = -l * u,
  42319. t[8] = c,
  42320. t[1] = p + f * c,
  42321. t[5] = d - g * c,
  42322. t[9] = -s * l,
  42323. t[2] = g - d * c,
  42324. t[6] = f + p * c,
  42325. t[10] = a * l
  42326. } else if ("YXZ" === e.order) {
  42327. var m = l * h
  42328. , v = l * u
  42329. , A = c * h
  42330. , y = c * u;
  42331. t[0] = m + y * s,
  42332. t[4] = A * s - v,
  42333. t[8] = a * c,
  42334. t[1] = a * u,
  42335. t[5] = a * h,
  42336. t[9] = -s,
  42337. t[2] = v * s - A,
  42338. t[6] = y + m * s,
  42339. t[10] = a * l
  42340. } else if ("ZXY" === e.order) {
  42341. var m = l * h
  42342. , v = l * u
  42343. , A = c * h
  42344. , y = c * u;
  42345. t[0] = m - y * s,
  42346. t[4] = -a * u,
  42347. t[8] = A + v * s,
  42348. t[1] = v + A * s,
  42349. t[5] = a * h,
  42350. t[9] = y - m * s,
  42351. t[2] = -a * c,
  42352. t[6] = s,
  42353. t[10] = a * l
  42354. } else if ("ZYX" === e.order) {
  42355. var d = a * h
  42356. , p = a * u
  42357. , f = s * h
  42358. , g = s * u;
  42359. t[0] = l * h,
  42360. t[4] = f * c - p,
  42361. t[8] = d * c + g,
  42362. t[1] = l * u,
  42363. t[5] = g * c + d,
  42364. t[9] = p * c - f,
  42365. t[2] = -c,
  42366. t[6] = s * l,
  42367. t[10] = a * l
  42368. } else if ("YZX" === e.order) {
  42369. var C = a * l
  42370. , I = a * c
  42371. , E = s * l
  42372. , b = s * c;
  42373. t[0] = l * h,
  42374. t[4] = b - C * u,
  42375. t[8] = E * u + I,
  42376. t[1] = u,
  42377. t[5] = a * h,
  42378. t[9] = -s * h,
  42379. t[2] = -c * h,
  42380. t[6] = I * u + E,
  42381. t[10] = C - b * u
  42382. } else if ("XZY" === e.order) {
  42383. var C = a * l
  42384. , I = a * c
  42385. , E = s * l
  42386. , b = s * c;
  42387. t[0] = l * h,
  42388. t[4] = -u,
  42389. t[8] = c * h,
  42390. t[1] = C * u + b,
  42391. t[5] = a * h,
  42392. t[9] = I * u - E,
  42393. t[2] = E * u - I,
  42394. t[6] = s * h,
  42395. t[10] = b * u + C
  42396. }
  42397. return t[3] = 0,
  42398. t[7] = 0,
  42399. t[11] = 0,
  42400. t[12] = 0,
  42401. t[13] = 0,
  42402. t[14] = 0,
  42403. t[15] = 1,
  42404. this
  42405. },
  42406. makeRotationFromQuaternion: function(e) {
  42407. var t = this.elements
  42408. , i = e.x
  42409. , n = e.y
  42410. , r = e.z
  42411. , o = e.w
  42412. , a = i + i
  42413. , s = n + n
  42414. , l = r + r
  42415. , c = i * a
  42416. , h = i * s
  42417. , u = i * l
  42418. , d = n * s
  42419. , p = n * l
  42420. , f = r * l
  42421. , g = o * a
  42422. , m = o * s
  42423. , v = o * l;
  42424. return t[0] = 1 - (d + f),
  42425. t[4] = h - v,
  42426. t[8] = u + m,
  42427. t[1] = h + v,
  42428. t[5] = 1 - (c + f),
  42429. t[9] = p - g,
  42430. t[2] = u - m,
  42431. t[6] = p + g,
  42432. t[10] = 1 - (c + d),
  42433. t[3] = 0,
  42434. t[7] = 0,
  42435. t[11] = 0,
  42436. t[12] = 0,
  42437. t[13] = 0,
  42438. t[14] = 0,
  42439. t[15] = 1,
  42440. this
  42441. },
  42442. lookAt: function() {
  42443. var e, t, i;
  42444. return function(r, o, a) {
  42445. void 0 === e && (e = new n.Vector3),
  42446. void 0 === t && (t = new n.Vector3),
  42447. void 0 === i && (i = new n.Vector3);
  42448. var s = this.elements;
  42449. return i.subVectors(r, o).normalize(),
  42450. 0 === i.lengthSq() && (i.z = 1),
  42451. e.crossVectors(a, i).normalize(),
  42452. 0 === e.lengthSq() && (i.x += 1e-4,
  42453. e.crossVectors(a, i).normalize()),
  42454. t.crossVectors(i, e),
  42455. s[0] = e.x,
  42456. s[4] = t.x,
  42457. s[8] = i.x,
  42458. s[1] = e.y,
  42459. s[5] = t.y,
  42460. s[9] = i.y,
  42461. s[2] = e.z,
  42462. s[6] = t.z,
  42463. s[10] = i.z,
  42464. this
  42465. }
  42466. }(),
  42467. multiply: function(e, t) {
  42468. return void 0 !== t ? (console.warn("THREE.Matrix4: .multiply() now only accepts one argument. Use .multiplyMatrices( a, b ) instead."),
  42469. this.multiplyMatrices(e, t)) : this.multiplyMatrices(this, e)
  42470. },
  42471. multiplyMatrices: function(e, t) {
  42472. var i = e.elements
  42473. , n = t.elements
  42474. , r = this.elements
  42475. , o = i[0]
  42476. , a = i[4]
  42477. , s = i[8]
  42478. , l = i[12]
  42479. , c = i[1]
  42480. , h = i[5]
  42481. , u = i[9]
  42482. , d = i[13]
  42483. , p = i[2]
  42484. , f = i[6]
  42485. , g = i[10]
  42486. , m = i[14]
  42487. , v = i[3]
  42488. , A = i[7]
  42489. , y = i[11]
  42490. , C = i[15]
  42491. , I = n[0]
  42492. , E = n[4]
  42493. , b = n[8]
  42494. , w = n[12]
  42495. , _ = n[1]
  42496. , T = n[5]
  42497. , x = n[9]
  42498. , S = n[13]
  42499. , M = n[2]
  42500. , R = n[6]
  42501. , P = n[10]
  42502. , O = n[14]
  42503. , L = n[3]
  42504. , D = n[7]
  42505. , N = n[11]
  42506. , B = n[15];
  42507. return r[0] = o * I + a * _ + s * M + l * L,
  42508. r[4] = o * E + a * T + s * R + l * D,
  42509. r[8] = o * b + a * x + s * P + l * N,
  42510. r[12] = o * w + a * S + s * O + l * B,
  42511. r[1] = c * I + h * _ + u * M + d * L,
  42512. r[5] = c * E + h * T + u * R + d * D,
  42513. r[9] = c * b + h * x + u * P + d * N,
  42514. r[13] = c * w + h * S + u * O + d * B,
  42515. r[2] = p * I + f * _ + g * M + m * L,
  42516. r[6] = p * E + f * T + g * R + m * D,
  42517. r[10] = p * b + f * x + g * P + m * N,
  42518. r[14] = p * w + f * S + g * O + m * B,
  42519. r[3] = v * I + A * _ + y * M + C * L,
  42520. r[7] = v * E + A * T + y * R + C * D,
  42521. r[11] = v * b + A * x + y * P + C * N,
  42522. r[15] = v * w + A * S + y * O + C * B,
  42523. this
  42524. },
  42525. multiplyToArray: function(e, t, i) {
  42526. var n = this.elements;
  42527. return this.multiplyMatrices(e, t),
  42528. i[0] = n[0],
  42529. i[1] = n[1],
  42530. i[2] = n[2],
  42531. i[3] = n[3],
  42532. i[4] = n[4],
  42533. i[5] = n[5],
  42534. i[6] = n[6],
  42535. i[7] = n[7],
  42536. i[8] = n[8],
  42537. i[9] = n[9],
  42538. i[10] = n[10],
  42539. i[11] = n[11],
  42540. i[12] = n[12],
  42541. i[13] = n[13],
  42542. i[14] = n[14],
  42543. i[15] = n[15],
  42544. this
  42545. },
  42546. multiplyScalar: function(e) {
  42547. var t = this.elements;
  42548. return t[0] *= e,
  42549. t[4] *= e,
  42550. t[8] *= e,
  42551. t[12] *= e,
  42552. t[1] *= e,
  42553. t[5] *= e,
  42554. t[9] *= e,
  42555. t[13] *= e,
  42556. t[2] *= e,
  42557. t[6] *= e,
  42558. t[10] *= e,
  42559. t[14] *= e,
  42560. t[3] *= e,
  42561. t[7] *= e,
  42562. t[11] *= e,
  42563. t[15] *= e,
  42564. this
  42565. },
  42566. applyToVector3Array: function() {
  42567. var e;
  42568. return function(t, i, r) {
  42569. void 0 === e && (e = new n.Vector3),
  42570. void 0 === i && (i = 0),
  42571. void 0 === r && (r = t.length);
  42572. for (var o = 0, a = i; o < r; o += 3,
  42573. a += 3)
  42574. e.fromArray(t, a),
  42575. e.applyMatrix4(this),
  42576. e.toArray(t, a);
  42577. return t
  42578. }
  42579. }(),
  42580. applyToBuffer: function() {
  42581. var e;
  42582. return function(t, i, r) {
  42583. void 0 === e && (e = new n.Vector3),
  42584. void 0 === i && (i = 0),
  42585. void 0 === r && (r = t.length / t.itemSize);
  42586. for (var o = 0, a = i; o < r; o++,
  42587. a++)
  42588. e.x = t.getX(a),
  42589. e.y = t.getY(a),
  42590. e.z = t.getZ(a),
  42591. e.applyMatrix4(this),
  42592. t.setXYZ(e.x, e.y, e.z);
  42593. return t
  42594. }
  42595. }(),
  42596. determinant: function() {
  42597. var e = this.elements
  42598. , t = e[0]
  42599. , i = e[4]
  42600. , n = e[8]
  42601. , r = e[12]
  42602. , o = e[1]
  42603. , a = e[5]
  42604. , s = e[9]
  42605. , l = e[13]
  42606. , c = e[2]
  42607. , h = e[6]
  42608. , u = e[10]
  42609. , d = e[14]
  42610. , p = e[3]
  42611. , f = e[7]
  42612. , g = e[11]
  42613. , m = e[15];
  42614. 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)
  42615. },
  42616. transpose: function() {
  42617. var e, t = this.elements;
  42618. return e = t[1],
  42619. t[1] = t[4],
  42620. t[4] = e,
  42621. e = t[2],
  42622. t[2] = t[8],
  42623. t[8] = e,
  42624. e = t[6],
  42625. t[6] = t[9],
  42626. t[9] = e,
  42627. e = t[3],
  42628. t[3] = t[12],
  42629. t[12] = e,
  42630. e = t[7],
  42631. t[7] = t[13],
  42632. t[13] = e,
  42633. e = t[11],
  42634. t[11] = t[14],
  42635. t[14] = e,
  42636. this
  42637. },
  42638. flattenToArrayOffset: function(e, t) {
  42639. var i = this.elements;
  42640. return e[t] = i[0],
  42641. e[t + 1] = i[1],
  42642. e[t + 2] = i[2],
  42643. e[t + 3] = i[3],
  42644. e[t + 4] = i[4],
  42645. e[t + 5] = i[5],
  42646. e[t + 6] = i[6],
  42647. e[t + 7] = i[7],
  42648. e[t + 8] = i[8],
  42649. e[t + 9] = i[9],
  42650. e[t + 10] = i[10],
  42651. e[t + 11] = i[11],
  42652. e[t + 12] = i[12],
  42653. e[t + 13] = i[13],
  42654. e[t + 14] = i[14],
  42655. e[t + 15] = i[15],
  42656. e
  42657. },
  42658. getPosition: function() {
  42659. var e;
  42660. return function() {
  42661. return void 0 === e && (e = new n.Vector3),
  42662. console.warn("THREE.Matrix4: .getPosition() has been removed. Use Vector3.setFromMatrixPosition( matrix ) instead."),
  42663. e.setFromMatrixColumn(this, 3)
  42664. }
  42665. }(),
  42666. setPosition: function(e) {
  42667. var t = this.elements;
  42668. return t[12] = e.x,
  42669. t[13] = e.y,
  42670. t[14] = e.z,
  42671. this
  42672. },
  42673. getInverse: function(e, t) {
  42674. var i = this.elements
  42675. , n = e.elements
  42676. , r = n[0]
  42677. , o = n[1]
  42678. , a = n[2]
  42679. , s = n[3]
  42680. , l = n[4]
  42681. , c = n[5]
  42682. , h = n[6]
  42683. , u = n[7]
  42684. , d = n[8]
  42685. , p = n[9]
  42686. , f = n[10]
  42687. , g = n[11]
  42688. , m = n[12]
  42689. , v = n[13]
  42690. , A = n[14]
  42691. , y = n[15]
  42692. , C = p * A * u - v * f * u + v * h * g - c * A * g - p * h * y + c * f * y
  42693. , I = m * f * u - d * A * u - m * h * g + l * A * g + d * h * y - l * f * y
  42694. , E = d * v * u - m * p * u + m * c * g - l * v * g - d * c * y + l * p * y
  42695. , b = m * p * h - d * v * h - m * c * f + l * v * f + d * c * A - l * p * A
  42696. , w = r * C + o * I + a * E + s * b;
  42697. if (0 === w) {
  42698. var _ = "THREE.Matrix4.getInverse(): can't invert matrix, determinant is 0";
  42699. if (t)
  42700. throw new Error(_);
  42701. return console.warn(_),
  42702. this.identity()
  42703. }
  42704. return i[0] = C,
  42705. i[1] = v * f * s - p * A * s - v * a * g + o * A * g + p * a * y - o * f * y,
  42706. i[2] = c * A * s - v * h * s + v * a * u - o * A * u - c * a * y + o * h * y,
  42707. i[3] = p * h * s - c * f * s - p * a * u + o * f * u + c * a * g - o * h * g,
  42708. i[4] = I,
  42709. i[5] = d * A * s - m * f * s + m * a * g - r * A * g - d * a * y + r * f * y,
  42710. i[6] = m * h * s - l * A * s - m * a * u + r * A * u + l * a * y - r * h * y,
  42711. i[7] = l * f * s - d * h * s + d * a * u - r * f * u - l * a * g + r * h * g,
  42712. i[8] = E,
  42713. i[9] = m * p * s - d * v * s - m * o * g + r * v * g + d * o * y - r * p * y,
  42714. i[10] = l * v * s - m * c * s + m * o * u - r * v * u - l * o * y + r * c * y,
  42715. i[11] = d * c * s - l * p * s - d * o * u + r * p * u + l * o * g - r * c * g,
  42716. i[12] = b,
  42717. i[13] = d * v * a - m * p * a + m * o * f - r * v * f - d * o * A + r * p * A,
  42718. i[14] = m * c * a - l * v * a - m * o * h + r * v * h + l * o * A - r * c * A,
  42719. i[15] = l * p * a - d * c * a + d * o * h - r * p * h - l * o * f + r * c * f,
  42720. this.multiplyScalar(1 / w)
  42721. },
  42722. scale: function(e) {
  42723. var t = this.elements
  42724. , i = e.x
  42725. , n = e.y
  42726. , r = e.z;
  42727. return t[0] *= i,
  42728. t[4] *= n,
  42729. t[8] *= r,
  42730. t[1] *= i,
  42731. t[5] *= n,
  42732. t[9] *= r,
  42733. t[2] *= i,
  42734. t[6] *= n,
  42735. t[10] *= r,
  42736. t[3] *= i,
  42737. t[7] *= n,
  42738. t[11] *= r,
  42739. this
  42740. },
  42741. getMaxScaleOnAxis: function() {
  42742. var e = this.elements
  42743. , t = e[0] * e[0] + e[1] * e[1] + e[2] * e[2]
  42744. , i = e[4] * e[4] + e[5] * e[5] + e[6] * e[6]
  42745. , n = e[8] * e[8] + e[9] * e[9] + e[10] * e[10];
  42746. return Math.sqrt(Math.max(t, i, n))
  42747. },
  42748. makeTranslation: function(e, t, i) {
  42749. return this.set(1, 0, 0, e, 0, 1, 0, t, 0, 0, 1, i, 0, 0, 0, 1),
  42750. this
  42751. },
  42752. makeRotationX: function(e) {
  42753. var t = Math.cos(e)
  42754. , i = Math.sin(e);
  42755. return this.set(1, 0, 0, 0, 0, t, -i, 0, 0, i, t, 0, 0, 0, 0, 1),
  42756. this
  42757. },
  42758. makeRotationY: function(e) {
  42759. var t = Math.cos(e)
  42760. , i = Math.sin(e);
  42761. return this.set(t, 0, i, 0, 0, 1, 0, 0, -i, 0, t, 0, 0, 0, 0, 1),
  42762. this
  42763. },
  42764. makeRotationZ: function(e) {
  42765. var t = Math.cos(e)
  42766. , i = Math.sin(e);
  42767. return this.set(t, -i, 0, 0, i, t, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1),
  42768. this
  42769. },
  42770. makeRotationAxis: function(e, t) {
  42771. var i = Math.cos(t)
  42772. , n = Math.sin(t)
  42773. , r = 1 - i
  42774. , o = e.x
  42775. , a = e.y
  42776. , s = e.z
  42777. , l = r * o
  42778. , c = r * a;
  42779. 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),
  42780. this
  42781. },
  42782. makeScale: function(e, t, i) {
  42783. return this.set(e, 0, 0, 0, 0, t, 0, 0, 0, 0, i, 0, 0, 0, 0, 1),
  42784. this
  42785. },
  42786. compose: function(e, t, i) {
  42787. return this.makeRotationFromQuaternion(t),
  42788. this.scale(i),
  42789. this.setPosition(e),
  42790. this
  42791. },
  42792. decompose: function() {
  42793. var e, t;
  42794. return function(i, r, o) {
  42795. void 0 === e && (e = new n.Vector3),
  42796. void 0 === t && (t = new n.Matrix4);
  42797. var a = this.elements
  42798. , s = e.set(a[0], a[1], a[2]).length()
  42799. , l = e.set(a[4], a[5], a[6]).length()
  42800. , c = e.set(a[8], a[9], a[10]).length()
  42801. , h = this.determinant();
  42802. h < 0 && (s = -s),
  42803. i.x = a[12],
  42804. i.y = a[13],
  42805. i.z = a[14],
  42806. t.elements.set(this.elements);
  42807. var u = 1 / s
  42808. , d = 1 / l
  42809. , p = 1 / c;
  42810. return t.elements[0] *= u,
  42811. t.elements[1] *= u,
  42812. t.elements[2] *= u,
  42813. t.elements[4] *= d,
  42814. t.elements[5] *= d,
  42815. t.elements[6] *= d,
  42816. t.elements[8] *= p,
  42817. t.elements[9] *= p,
  42818. t.elements[10] *= p,
  42819. r.setFromRotationMatrix(t),
  42820. o.x = s,
  42821. o.y = l,
  42822. o.z = c,
  42823. this
  42824. }
  42825. }(),
  42826. makeFrustum: function(e, t, i, n, r, o) {
  42827. var a = this.elements
  42828. , s = 2 * r / (t - e)
  42829. , l = 2 * r / (n - i)
  42830. , c = (t + e) / (t - e)
  42831. , h = (n + i) / (n - i)
  42832. , u = -(o + r) / (o - r)
  42833. , d = -2 * o * r / (o - r);
  42834. return a[0] = s,
  42835. a[4] = 0,
  42836. a[8] = c,
  42837. a[12] = 0,
  42838. a[1] = 0,
  42839. a[5] = l,
  42840. a[9] = h,
  42841. a[13] = 0,
  42842. a[2] = 0,
  42843. a[6] = 0,
  42844. a[10] = u,
  42845. a[14] = d,
  42846. a[3] = 0,
  42847. a[7] = 0,
  42848. a[11] = -1,
  42849. a[15] = 0,
  42850. this
  42851. },
  42852. makePerspective: function(e, t, i, r) {
  42853. var o = i * Math.tan(n.Math.degToRad(.5 * e))
  42854. , a = -o
  42855. , s = a * t
  42856. , l = o * t;
  42857. return this.makeFrustum(s, l, a, o, i, r)
  42858. },
  42859. makeOrthographic: function(e, t, i, n, r, o) {
  42860. var a = this.elements
  42861. , s = 1 / (t - e)
  42862. , l = 1 / (i - n)
  42863. , c = 1 / (o - r)
  42864. , h = (t + e) * s
  42865. , u = (i + n) * l
  42866. , d = (o + r) * c;
  42867. return a[0] = 2 * s,
  42868. a[4] = 0,
  42869. a[8] = 0,
  42870. a[12] = -h,
  42871. a[1] = 0,
  42872. a[5] = 2 * l,
  42873. a[9] = 0,
  42874. a[13] = -u,
  42875. a[2] = 0,
  42876. a[6] = 0,
  42877. a[10] = -2 * c,
  42878. a[14] = -d,
  42879. a[3] = 0,
  42880. a[7] = 0,
  42881. a[11] = 0,
  42882. a[15] = 1,
  42883. this
  42884. },
  42885. equals: function(e) {
  42886. for (var t = this.elements, i = e.elements, n = 0; n < 16; n++)
  42887. if (t[n] !== i[n])
  42888. return !1;
  42889. return !0
  42890. },
  42891. fromArray: function(e) {
  42892. return this.elements.set(e),
  42893. this
  42894. },
  42895. toArray: function() {
  42896. var e = this.elements;
  42897. 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]]
  42898. }
  42899. },
  42900. n.Ray = function(e, t) {
  42901. this.origin = void 0 !== e ? e : new n.Vector3,
  42902. this.direction = void 0 !== t ? t : new n.Vector3
  42903. }
  42904. ,
  42905. n.Ray.prototype = {
  42906. constructor: n.Ray,
  42907. set: function(e, t) {
  42908. return this.origin.copy(e),
  42909. this.direction.copy(t),
  42910. this
  42911. },
  42912. clone: function() {
  42913. return (new this.constructor).copy(this)
  42914. },
  42915. copy: function(e) {
  42916. return this.origin.copy(e.origin),
  42917. this.direction.copy(e.direction),
  42918. this
  42919. },
  42920. at: function(e, t) {
  42921. var i = t || new n.Vector3;
  42922. return i.copy(this.direction).multiplyScalar(e).add(this.origin)
  42923. },
  42924. lookAt: function(e) {
  42925. this.direction.copy(e).sub(this.origin).normalize()
  42926. },
  42927. recast: function() {
  42928. var e = new n.Vector3;
  42929. return function(t) {
  42930. return this.origin.copy(this.at(t, e)),
  42931. this
  42932. }
  42933. }(),
  42934. closestPointToPoint: function(e, t) {
  42935. var i = t || new n.Vector3;
  42936. i.subVectors(e, this.origin);
  42937. var r = i.dot(this.direction);
  42938. return r < 0 ? i.copy(this.origin) : i.copy(this.direction).multiplyScalar(r).add(this.origin)
  42939. },
  42940. distanceToPoint: function(e) {
  42941. return Math.sqrt(this.distanceSqToPoint(e))
  42942. },
  42943. distanceSqToPoint: function() {
  42944. var e = new n.Vector3;
  42945. return function(t) {
  42946. var i = e.subVectors(t, this.origin).dot(this.direction);
  42947. return i < 0 ? this.origin.distanceToSquared(t) : (e.copy(this.direction).multiplyScalar(i).add(this.origin),
  42948. e.distanceToSquared(t))
  42949. }
  42950. }(),
  42951. distanceSqToSegment: function() {
  42952. var e = new n.Vector3
  42953. , t = new n.Vector3
  42954. , i = new n.Vector3;
  42955. return function(n, r, o, a) {
  42956. e.copy(n).add(r).multiplyScalar(.5),
  42957. t.copy(r).sub(n).normalize(),
  42958. i.copy(this.origin).sub(e);
  42959. 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);
  42960. if (m > 0)
  42961. if (s = d * f - p,
  42962. l = d * p - f,
  42963. h = u * m,
  42964. s >= 0)
  42965. if (l >= -h)
  42966. if (l <= h) {
  42967. var v = 1 / m;
  42968. s *= v,
  42969. l *= v,
  42970. c = s * (s + d * l + 2 * p) + l * (d * s + l + 2 * f) + g
  42971. } else
  42972. l = u,
  42973. s = Math.max(0, -(d * l + p)),
  42974. c = -s * s + l * (l + 2 * f) + g;
  42975. else
  42976. l = -u,
  42977. s = Math.max(0, -(d * l + p)),
  42978. c = -s * s + l * (l + 2 * f) + g;
  42979. else
  42980. l <= -h ? (s = Math.max(0, -(-d * u + p)),
  42981. l = s > 0 ? -u : Math.min(Math.max(-u, -f), u),
  42982. c = -s * s + l * (l + 2 * f) + g) : l <= h ? (s = 0,
  42983. l = Math.min(Math.max(-u, -f), u),
  42984. c = l * (l + 2 * f) + g) : (s = Math.max(0, -(d * u + p)),
  42985. l = s > 0 ? u : Math.min(Math.max(-u, -f), u),
  42986. c = -s * s + l * (l + 2 * f) + g);
  42987. else
  42988. l = d > 0 ? -u : u,
  42989. s = Math.max(0, -(d * l + p)),
  42990. c = -s * s + l * (l + 2 * f) + g;
  42991. return o && o.copy(this.direction).multiplyScalar(s).add(this.origin),
  42992. a && a.copy(t).multiplyScalar(l).add(e),
  42993. c
  42994. }
  42995. }(),
  42996. intersectSphere: function() {
  42997. var e = new n.Vector3;
  42998. return function(t, i) {
  42999. e.subVectors(t.center, this.origin);
  43000. var n = e.dot(this.direction)
  43001. , r = e.dot(e) - n * n
  43002. , o = t.radius * t.radius;
  43003. if (r > o)
  43004. return null;
  43005. var a = Math.sqrt(o - r)
  43006. , s = n - a
  43007. , l = n + a;
  43008. return s < 0 && l < 0 ? null : s < 0 ? this.at(l, i) : this.at(s, i)
  43009. }
  43010. }(),
  43011. intersectsSphere: function(e) {
  43012. return this.distanceToPoint(e.center) <= e.radius
  43013. },
  43014. distanceToPlane: function(e) {
  43015. var t = e.normal.dot(this.direction);
  43016. if (0 === t)
  43017. return 0 === e.distanceToPoint(this.origin) ? 0 : null;
  43018. var i = -(this.origin.dot(e.normal) + e.constant) / t;
  43019. return i >= 0 ? i : null
  43020. },
  43021. intersectPlane: function(e, t) {
  43022. var i = this.distanceToPlane(e);
  43023. return null === i ? null : this.at(i, t)
  43024. },
  43025. intersectsPlane: function(e) {
  43026. var t = e.distanceToPoint(this.origin);
  43027. if (0 === t)
  43028. return !0;
  43029. var i = e.normal.dot(this.direction);
  43030. return i * t < 0
  43031. },
  43032. intersectBox: function(e, t) {
  43033. 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;
  43034. return l >= 0 ? (i = (e.min.x - u.x) * l,
  43035. n = (e.max.x - u.x) * l) : (i = (e.max.x - u.x) * l,
  43036. n = (e.min.x - u.x) * l),
  43037. c >= 0 ? (r = (e.min.y - u.y) * c,
  43038. o = (e.max.y - u.y) * c) : (r = (e.max.y - u.y) * c,
  43039. o = (e.min.y - u.y) * c),
  43040. i > o || r > n ? null : ((r > i || i !== i) && (i = r),
  43041. (o < n || n !== n) && (n = o),
  43042. h >= 0 ? (a = (e.min.z - u.z) * h,
  43043. s = (e.max.z - u.z) * h) : (a = (e.max.z - u.z) * h,
  43044. s = (e.min.z - u.z) * h),
  43045. i > s || a > n ? null : ((a > i || i !== i) && (i = a),
  43046. (s < n || n !== n) && (n = s),
  43047. n < 0 ? null : this.at(i >= 0 ? i : n, t)))
  43048. },
  43049. intersectsBox: function() {
  43050. var e = new n.Vector3;
  43051. return function(t) {
  43052. return null !== this.intersectBox(t, e)
  43053. }
  43054. }(),
  43055. intersectTriangle: function() {
  43056. var e = new n.Vector3
  43057. , t = new n.Vector3
  43058. , i = new n.Vector3
  43059. , r = new n.Vector3;
  43060. return function(n, o, a, s, l) {
  43061. t.subVectors(o, n),
  43062. i.subVectors(a, n),
  43063. r.crossVectors(t, i);
  43064. var c, h = this.direction.dot(r);
  43065. if (h > 0) {
  43066. if (s)
  43067. return null;
  43068. c = 1
  43069. } else {
  43070. if (!(h < 0))
  43071. return null;
  43072. c = -1,
  43073. h = -h
  43074. }
  43075. e.subVectors(this.origin, n);
  43076. var u = c * this.direction.dot(i.crossVectors(e, i));
  43077. if (u < 0)
  43078. return null;
  43079. var d = c * this.direction.dot(t.cross(e));
  43080. if (d < 0)
  43081. return null;
  43082. if (u + d > h)
  43083. return null;
  43084. var p = -c * e.dot(r);
  43085. return p < 0 ? null : this.at(p / h, l)
  43086. }
  43087. }(),
  43088. applyMatrix4: function(e) {
  43089. return this.direction.add(this.origin).applyMatrix4(e),
  43090. this.origin.applyMatrix4(e),
  43091. this.direction.sub(this.origin),
  43092. this.direction.normalize(),
  43093. this
  43094. },
  43095. equals: function(e) {
  43096. return e.origin.equals(this.origin) && e.direction.equals(this.direction)
  43097. }
  43098. },
  43099. n.Sphere = function(e, t) {
  43100. this.center = void 0 !== e ? e : new n.Vector3,
  43101. this.radius = void 0 !== t ? t : 0
  43102. }
  43103. ,
  43104. n.Sphere.prototype = {
  43105. constructor: n.Sphere,
  43106. set: function(e, t) {
  43107. return this.center.copy(e),
  43108. this.radius = t,
  43109. this
  43110. },
  43111. setFromPoints: function() {
  43112. var e = new n.Box3;
  43113. return function(t, i) {
  43114. var n = this.center;
  43115. void 0 !== i ? n.copy(i) : e.setFromPoints(t).center(n);
  43116. for (var r = 0, o = 0, a = t.length; o < a; o++)
  43117. r = Math.max(r, n.distanceToSquared(t[o]));
  43118. return this.radius = Math.sqrt(r),
  43119. this
  43120. }
  43121. }(),
  43122. clone: function() {
  43123. return (new this.constructor).copy(this)
  43124. },
  43125. copy: function(e) {
  43126. return this.center.copy(e.center),
  43127. this.radius = e.radius,
  43128. this
  43129. },
  43130. empty: function() {
  43131. return this.radius <= 0
  43132. },
  43133. containsPoint: function(e) {
  43134. return e.distanceToSquared(this.center) <= this.radius * this.radius
  43135. },
  43136. distanceToPoint: function(e) {
  43137. return e.distanceTo(this.center) - this.radius
  43138. },
  43139. intersectsSphere: function(e) {
  43140. var t = this.radius + e.radius;
  43141. return e.center.distanceToSquared(this.center) <= t * t
  43142. },
  43143. intersectsBox: function(e) {
  43144. return e.intersectsSphere(this)
  43145. },
  43146. intersectsPlane: function(e) {
  43147. return Math.abs(this.center.dot(e.normal) - e.constant) <= this.radius
  43148. },
  43149. clampPoint: function(e, t) {
  43150. var i = this.center.distanceToSquared(e)
  43151. , r = t || new n.Vector3;
  43152. return r.copy(e),
  43153. i > this.radius * this.radius && (r.sub(this.center).normalize(),
  43154. r.multiplyScalar(this.radius).add(this.center)),
  43155. r
  43156. },
  43157. getBoundingBox: function(e) {
  43158. var t = e || new n.Box3;
  43159. return t.set(this.center, this.center),
  43160. t.expandByScalar(this.radius),
  43161. t
  43162. },
  43163. applyMatrix4: function(e) {
  43164. return this.center.applyMatrix4(e),
  43165. this.radius = this.radius * e.getMaxScaleOnAxis(),
  43166. this
  43167. },
  43168. translate: function(e) {
  43169. return this.center.add(e),
  43170. this
  43171. },
  43172. equals: function(e) {
  43173. return e.center.equals(this.center) && e.radius === this.radius
  43174. }
  43175. },
  43176. n.Frustum = function(e, t, i, r, o, a) {
  43177. 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]
  43178. }
  43179. ,
  43180. n.Frustum.prototype = {
  43181. constructor: n.Frustum,
  43182. set: function(e, t, i, n, r, o) {
  43183. var a = this.planes;
  43184. return a[0].copy(e),
  43185. a[1].copy(t),
  43186. a[2].copy(i),
  43187. a[3].copy(n),
  43188. a[4].copy(r),
  43189. a[5].copy(o),
  43190. this
  43191. },
  43192. clone: function() {
  43193. return (new this.constructor).copy(this)
  43194. },
  43195. copy: function(e) {
  43196. for (var t = this.planes, i = 0; i < 6; i++)
  43197. t[i].copy(e.planes[i]);
  43198. return this
  43199. },
  43200. setFromMatrix: function(e) {
  43201. var t = this.planes
  43202. , i = e.elements
  43203. , n = i[0]
  43204. , r = i[1]
  43205. , o = i[2]
  43206. , a = i[3]
  43207. , s = i[4]
  43208. , l = i[5]
  43209. , c = i[6]
  43210. , h = i[7]
  43211. , u = i[8]
  43212. , d = i[9]
  43213. , p = i[10]
  43214. , f = i[11]
  43215. , g = i[12]
  43216. , m = i[13]
  43217. , v = i[14]
  43218. , A = i[15];
  43219. return t[0].setComponents(a - n, h - s, f - u, A - g).normalize(),
  43220. t[1].setComponents(a + n, h + s, f + u, A + g).normalize(),
  43221. t[2].setComponents(a + r, h + l, f + d, A + m).normalize(),
  43222. t[3].setComponents(a - r, h - l, f - d, A - m).normalize(),
  43223. t[4].setComponents(a - o, h - c, f - p, A - v).normalize(),
  43224. t[5].setComponents(a + o, h + c, f + p, A + v).normalize(),
  43225. this
  43226. },
  43227. intersectsObject: function() {
  43228. var e = new n.Sphere;
  43229. return function(t) {
  43230. var i = t.geometry;
  43231. return null === i.boundingSphere && i.computeBoundingSphere(),
  43232. e.copy(i.boundingSphere),
  43233. e.applyMatrix4(t.matrixWorld),
  43234. this.intersectsSphere(e)
  43235. }
  43236. }(),
  43237. intersectsSphere: function(e) {
  43238. for (var t = this.planes, i = e.center, n = -e.radius, r = 0; r < 6; r++) {
  43239. var o = t[r].distanceToPoint(i);
  43240. if (o < n)
  43241. return !1
  43242. }
  43243. return !0
  43244. },
  43245. intersectsBox: function() {
  43246. var e = new n.Vector3
  43247. , t = new n.Vector3;
  43248. return function(i) {
  43249. for (var n = this.planes, r = 0; r < 6; r++) {
  43250. var o = n[r];
  43251. e.x = o.normal.x > 0 ? i.min.x : i.max.x,
  43252. t.x = o.normal.x > 0 ? i.max.x : i.min.x,
  43253. e.y = o.normal.y > 0 ? i.min.y : i.max.y,
  43254. t.y = o.normal.y > 0 ? i.max.y : i.min.y,
  43255. e.z = o.normal.z > 0 ? i.min.z : i.max.z,
  43256. t.z = o.normal.z > 0 ? i.max.z : i.min.z;
  43257. var a = o.distanceToPoint(e)
  43258. , s = o.distanceToPoint(t);
  43259. if (a < 0 && s < 0)
  43260. return !1
  43261. }
  43262. return !0
  43263. }
  43264. }(),
  43265. containsPoint: function(e) {
  43266. for (var t = this.planes, i = 0; i < 6; i++)
  43267. if (t[i].distanceToPoint(e) < 0)
  43268. return !1;
  43269. return !0
  43270. }
  43271. },
  43272. n.Plane = function(e, t) {
  43273. this.normal = void 0 !== e ? e : new n.Vector3(1,0,0),
  43274. this.constant = void 0 !== t ? t : 0
  43275. }
  43276. ,
  43277. n.Plane.prototype = {
  43278. constructor: n.Plane,
  43279. set: function(e, t) {
  43280. return this.normal.copy(e),
  43281. this.constant = t,
  43282. this
  43283. },
  43284. setComponents: function(e, t, i, n) {
  43285. return this.normal.set(e, t, i),
  43286. this.constant = n,
  43287. this
  43288. },
  43289. setFromNormalAndCoplanarPoint: function(e, t) {
  43290. return this.normal.copy(e),
  43291. this.constant = -t.dot(this.normal),
  43292. this
  43293. },
  43294. setFromCoplanarPoints: function() {
  43295. var e = new n.Vector3
  43296. , t = new n.Vector3;
  43297. return function(i, n, r) {
  43298. var o = e.subVectors(r, n).cross(t.subVectors(i, n)).normalize();
  43299. return this.setFromNormalAndCoplanarPoint(o, i),
  43300. this
  43301. }
  43302. }(),
  43303. clone: function() {
  43304. return (new this.constructor).copy(this)
  43305. },
  43306. copy: function(e) {
  43307. return this.normal.copy(e.normal),
  43308. this.constant = e.constant,
  43309. this
  43310. },
  43311. normalize: function() {
  43312. var e = 1 / this.normal.length();
  43313. return this.normal.multiplyScalar(e),
  43314. this.constant *= e,
  43315. this
  43316. },
  43317. negate: function() {
  43318. return this.constant *= -1,
  43319. this.normal.negate(),
  43320. this
  43321. },
  43322. distanceToPoint: function(e) {
  43323. return this.normal.dot(e) + this.constant
  43324. },
  43325. distanceToSphere: function(e) {
  43326. return this.distanceToPoint(e.center) - e.radius
  43327. },
  43328. projectPoint: function(e, t) {
  43329. return this.orthoPoint(e, t).sub(e).negate()
  43330. },
  43331. orthoPoint: function(e, t) {
  43332. var i = this.distanceToPoint(e)
  43333. , r = t || new n.Vector3;
  43334. return r.copy(this.normal).multiplyScalar(i)
  43335. },
  43336. intersectLine: function() {
  43337. var e = new n.Vector3;
  43338. return function(t, i) {
  43339. var r = i || new n.Vector3
  43340. , o = t.delta(e)
  43341. , a = this.normal.dot(o);
  43342. if (0 !== a) {
  43343. var s = -(t.start.dot(this.normal) + this.constant) / a;
  43344. if (!(s < 0 || s > 1))
  43345. return r.copy(o).multiplyScalar(s).add(t.start)
  43346. } else if (0 === this.distanceToPoint(t.start))
  43347. return r.copy(t.start)
  43348. }
  43349. }(),
  43350. intersectsLine: function(e) {
  43351. var t = this.distanceToPoint(e.start)
  43352. , i = this.distanceToPoint(e.end);
  43353. return t < 0 && i > 0 || i < 0 && t > 0
  43354. },
  43355. intersectsBox: function(e) {
  43356. return e.intersectsPlane(this)
  43357. },
  43358. intersectsSphere: function(e) {
  43359. return e.intersectsPlane(this)
  43360. },
  43361. coplanarPoint: function(e) {
  43362. var t = e || new n.Vector3;
  43363. return t.copy(this.normal).multiplyScalar(-this.constant)
  43364. },
  43365. applyMatrix4: function() {
  43366. var e = new n.Vector3
  43367. , t = new n.Vector3
  43368. , i = new n.Matrix3;
  43369. return function(n, r) {
  43370. var o = r || i.getNormalMatrix(n)
  43371. , a = e.copy(this.normal).applyMatrix3(o)
  43372. , s = this.coplanarPoint(t);
  43373. return s.applyMatrix4(n),
  43374. this.setFromNormalAndCoplanarPoint(a, s),
  43375. this
  43376. }
  43377. }(),
  43378. translate: function(e) {
  43379. return this.constant = this.constant - e.dot(this.normal),
  43380. this
  43381. },
  43382. equals: function(e) {
  43383. return e.normal.equals(this.normal) && e.constant === this.constant
  43384. }
  43385. },
  43386. n.Spherical = function(e, t, i) {
  43387. return this.radius = void 0 !== e ? e : 1,
  43388. this.phi = void 0 !== t ? t : 0,
  43389. this.theta = void 0 !== i ? i : 0,
  43390. this
  43391. }
  43392. ,
  43393. n.Spherical.prototype = {
  43394. constructor: n.Spherical,
  43395. set: function(e, t, i) {
  43396. this.radius = e,
  43397. this.phi = t,
  43398. this.theta = i
  43399. },
  43400. clone: function() {
  43401. return (new this.constructor).copy(this)
  43402. },
  43403. copy: function(e) {
  43404. return this.radius.copy(e.radius),
  43405. this.phi.copy(e.phi),
  43406. this.theta.copy(e.theta),
  43407. this
  43408. },
  43409. makeSafe: function() {
  43410. var e = 1e-6;
  43411. this.phi = Math.max(e, Math.min(Math.PI - e, this.phi))
  43412. },
  43413. setFromVector3: function(e) {
  43414. return this.radius = e.length(),
  43415. 0 === this.radius ? (this.theta = 0,
  43416. this.phi = 0) : (this.theta = Math.atan2(e.x, e.z),
  43417. this.phi = Math.acos(n.Math.clamp(e.y / this.radius, -1, 1))),
  43418. this
  43419. }
  43420. },
  43421. n.Math = {
  43422. generateUUID: function() {
  43423. var e, t = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split(""), i = new Array(36), n = 0;
  43424. return function() {
  43425. for (var r = 0; r < 36; r++)
  43426. 8 === r || 13 === r || 18 === r || 23 === r ? i[r] = "-" : 14 === r ? i[r] = "4" : (n <= 2 && (n = 33554432 + 16777216 * Math.random() | 0),
  43427. e = 15 & n,
  43428. n >>= 4,
  43429. i[r] = t[19 === r ? 3 & e | 8 : e]);
  43430. return i.join("")
  43431. }
  43432. }(),
  43433. clamp: function(e, t, i) {
  43434. return Math.max(t, Math.min(i, e))
  43435. },
  43436. euclideanModulo: function(e, t) {
  43437. return (e % t + t) % t
  43438. },
  43439. mapLinear: function(e, t, i, n, r) {
  43440. return n + (e - t) * (r - n) / (i - t)
  43441. },
  43442. smoothstep: function(e, t, i) {
  43443. return e <= t ? 0 : e >= i ? 1 : (e = (e - t) / (i - t),
  43444. e * e * (3 - 2 * e))
  43445. },
  43446. smootherstep: function(e, t, i) {
  43447. return e <= t ? 0 : e >= i ? 1 : (e = (e - t) / (i - t),
  43448. e * e * e * (e * (6 * e - 15) + 10))
  43449. },
  43450. random16: function() {
  43451. return console.warn("THREE.Math.random16() has been deprecated. Use Math.random() instead."),
  43452. Math.random()
  43453. },
  43454. randInt: function(e, t) {
  43455. return e + Math.floor(Math.random() * (t - e + 1))
  43456. },
  43457. randFloat: function(e, t) {
  43458. return e + Math.random() * (t - e)
  43459. },
  43460. randFloatSpread: function(e) {
  43461. return e * (.5 - Math.random())
  43462. },
  43463. degToRad: function() {
  43464. var e = Math.PI / 180;
  43465. return function(t) {
  43466. return t * e
  43467. }
  43468. }(),
  43469. radToDeg: function() {
  43470. var e = 180 / Math.PI;
  43471. return function(t) {
  43472. return t * e
  43473. }
  43474. }(),
  43475. isPowerOfTwo: function(e) {
  43476. return 0 === (e & e - 1) && 0 !== e
  43477. },
  43478. nearestPowerOfTwo: function(e) {
  43479. return Math.pow(2, Math.round(Math.log(e) / Math.LN2))
  43480. },
  43481. nextPowerOfTwo: function(e) {
  43482. return e--,
  43483. e |= e >> 1,
  43484. e |= e >> 2,
  43485. e |= e >> 4,
  43486. e |= e >> 8,
  43487. e |= e >> 16,
  43488. e++,
  43489. e
  43490. }
  43491. },
  43492. n.Spline = function(e) {
  43493. function t(e, t, i, n, r, o, a) {
  43494. var s = .5 * (i - e)
  43495. , l = .5 * (n - t);
  43496. return (2 * (t - i) + s + l) * a + (-3 * (t - i) - 2 * s - l) * o + s * r + t
  43497. }
  43498. this.points = e;
  43499. var i, r, o, a, s, l, c, h, u, d = [], p = {
  43500. x: 0,
  43501. y: 0,
  43502. z: 0
  43503. };
  43504. this.initFromArray = function(e) {
  43505. this.points = [];
  43506. for (var t = 0; t < e.length; t++)
  43507. this.points[t] = {
  43508. x: e[t][0],
  43509. y: e[t][1],
  43510. z: e[t][2]
  43511. }
  43512. }
  43513. ,
  43514. this.getPoint = function(e) {
  43515. return i = (this.points.length - 1) * e,
  43516. r = Math.floor(i),
  43517. o = i - r,
  43518. d[0] = 0 === r ? r : r - 1,
  43519. d[1] = r,
  43520. d[2] = r > this.points.length - 2 ? this.points.length - 1 : r + 1,
  43521. d[3] = r > this.points.length - 3 ? this.points.length - 1 : r + 2,
  43522. l = this.points[d[0]],
  43523. c = this.points[d[1]],
  43524. h = this.points[d[2]],
  43525. u = this.points[d[3]],
  43526. a = o * o,
  43527. s = o * a,
  43528. p.x = t(l.x, c.x, h.x, u.x, o, a, s),
  43529. p.y = t(l.y, c.y, h.y, u.y, o, a, s),
  43530. p.z = t(l.z, c.z, h.z, u.z, o, a, s),
  43531. p
  43532. }
  43533. ,
  43534. this.getControlPointsArray = function() {
  43535. var e, t, i = this.points.length, n = [];
  43536. for (e = 0; e < i; e++)
  43537. t = this.points[e],
  43538. n[e] = [t.x, t.y, t.z];
  43539. return n
  43540. }
  43541. ,
  43542. this.getLength = function(e) {
  43543. var t, i, r, o, a = 0, s = 0, l = 0, c = new n.Vector3, h = new n.Vector3, u = [], d = 0;
  43544. for (u[0] = 0,
  43545. e || (e = 100),
  43546. r = this.points.length * e,
  43547. c.copy(this.points[0]),
  43548. t = 1; t < r; t++)
  43549. i = t / r,
  43550. o = this.getPoint(i),
  43551. h.copy(o),
  43552. d += h.distanceTo(c),
  43553. c.copy(o),
  43554. a = (this.points.length - 1) * i,
  43555. s = Math.floor(a),
  43556. s !== l && (u[s] = d,
  43557. l = s);
  43558. return u[u.length] = d,
  43559. {
  43560. chunks: u,
  43561. total: d
  43562. }
  43563. }
  43564. ,
  43565. this.reparametrizeByArcLength = function(e) {
  43566. var t, i, r, o, a, s, l, c, h = [], u = new n.Vector3, d = this.getLength();
  43567. for (h.push(u.copy(this.points[0]).clone()),
  43568. t = 1; t < this.points.length; t++) {
  43569. for (s = d.chunks[t] - d.chunks[t - 1],
  43570. l = Math.ceil(e * s / d.total),
  43571. o = (t - 1) / (this.points.length - 1),
  43572. a = t / (this.points.length - 1),
  43573. i = 1; i < l - 1; i++)
  43574. r = o + i * (1 / l) * (a - o),
  43575. c = this.getPoint(r),
  43576. h.push(u.copy(c).clone());
  43577. h.push(u.copy(this.points[t]).clone())
  43578. }
  43579. this.points = h
  43580. }
  43581. }
  43582. ,
  43583. n.Triangle = function(e, t, i) {
  43584. this.a = void 0 !== e ? e : new n.Vector3,
  43585. this.b = void 0 !== t ? t : new n.Vector3,
  43586. this.c = void 0 !== i ? i : new n.Vector3
  43587. }
  43588. ,
  43589. n.Triangle.normal = function() {
  43590. var e = new n.Vector3;
  43591. return function(t, i, r, o) {
  43592. var a = o || new n.Vector3;
  43593. a.subVectors(r, i),
  43594. e.subVectors(t, i),
  43595. a.cross(e);
  43596. var s = a.lengthSq();
  43597. return s > 0 ? a.multiplyScalar(1 / Math.sqrt(s)) : a.set(0, 0, 0)
  43598. }
  43599. }(),
  43600. n.Triangle.barycoordFromPoint = function() {
  43601. var e = new n.Vector3
  43602. , t = new n.Vector3
  43603. , i = new n.Vector3;
  43604. return function(r, o, a, s, l) {
  43605. e.subVectors(s, o),
  43606. t.subVectors(a, o),
  43607. i.subVectors(r, o);
  43608. var c = e.dot(e)
  43609. , h = e.dot(t)
  43610. , u = e.dot(i)
  43611. , d = t.dot(t)
  43612. , p = t.dot(i)
  43613. , f = c * d - h * h
  43614. , g = l || new n.Vector3;
  43615. if (0 === f)
  43616. return g.set(-2, -1, -1);
  43617. var m = 1 / f
  43618. , v = (d * u - h * p) * m
  43619. , A = (c * p - h * u) * m;
  43620. return g.set(1 - v - A, A, v)
  43621. }
  43622. }(),
  43623. n.Triangle.containsPoint = function() {
  43624. var e = new n.Vector3;
  43625. return function(t, i, r, o) {
  43626. var a = n.Triangle.barycoordFromPoint(t, i, r, o, e);
  43627. return a.x >= 0 && a.y >= 0 && a.x + a.y <= 1
  43628. }
  43629. }(),
  43630. n.Triangle.prototype = {
  43631. constructor: n.Triangle,
  43632. set: function(e, t, i) {
  43633. return this.a.copy(e),
  43634. this.b.copy(t),
  43635. this.c.copy(i),
  43636. this
  43637. },
  43638. setFromPointsAndIndices: function(e, t, i, n) {
  43639. return this.a.copy(e[t]),
  43640. this.b.copy(e[i]),
  43641. this.c.copy(e[n]),
  43642. this
  43643. },
  43644. clone: function() {
  43645. return (new this.constructor).copy(this)
  43646. },
  43647. copy: function(e) {
  43648. return this.a.copy(e.a),
  43649. this.b.copy(e.b),
  43650. this.c.copy(e.c),
  43651. this
  43652. },
  43653. area: function() {
  43654. var e = new n.Vector3
  43655. , t = new n.Vector3;
  43656. return function() {
  43657. return e.subVectors(this.c, this.b),
  43658. t.subVectors(this.a, this.b),
  43659. .5 * e.cross(t).length()
  43660. }
  43661. }(),
  43662. midpoint: function(e) {
  43663. var t = e || new n.Vector3;
  43664. return t.addVectors(this.a, this.b).add(this.c).multiplyScalar(1 / 3)
  43665. },
  43666. normal: function(e) {
  43667. return n.Triangle.normal(this.a, this.b, this.c, e)
  43668. },
  43669. plane: function(e) {
  43670. var t = e || new n.Plane;
  43671. return t.setFromCoplanarPoints(this.a, this.b, this.c)
  43672. },
  43673. barycoordFromPoint: function(e, t) {
  43674. return n.Triangle.barycoordFromPoint(e, this.a, this.b, this.c, t)
  43675. },
  43676. containsPoint: function(e) {
  43677. return n.Triangle.containsPoint(e, this.a, this.b, this.c)
  43678. },
  43679. equals: function(e) {
  43680. return e.a.equals(this.a) && e.b.equals(this.b) && e.c.equals(this.c)
  43681. }
  43682. },
  43683. n.Interpolant = function(e, t, i, n) {
  43684. this.parameterPositions = e,
  43685. this._cachedIndex = 0,
  43686. this.resultBuffer = void 0 !== n ? n : new t.constructor(i),
  43687. this.sampleValues = t,
  43688. this.valueSize = i
  43689. }
  43690. ,
  43691. n.Interpolant.prototype = {
  43692. constructor: n.Interpolant,
  43693. evaluate: function(e) {
  43694. var t = this.parameterPositions
  43695. , i = this._cachedIndex
  43696. , n = t[i]
  43697. , r = t[i - 1];
  43698. e: {
  43699. t: {
  43700. var o;
  43701. i: {
  43702. n: if (!(e < n)) {
  43703. for (var a = i + 2; ; ) {
  43704. if (void 0 === n) {
  43705. if (e < r)
  43706. break n;
  43707. return i = t.length,
  43708. this._cachedIndex = i,
  43709. this.afterEnd_(i - 1, e, r)
  43710. }
  43711. if (i === a)
  43712. break;
  43713. if (r = n,
  43714. n = t[++i],
  43715. e < n)
  43716. break t
  43717. }
  43718. o = t.length;
  43719. break i
  43720. }
  43721. {
  43722. if (e >= r)
  43723. break e;
  43724. var s = t[1];
  43725. e < s && (i = 2,
  43726. r = s);
  43727. for (var a = i - 2; ; ) {
  43728. if (void 0 === r)
  43729. return this._cachedIndex = 0,
  43730. this.beforeStart_(0, e, n);
  43731. if (i === a)
  43732. break;
  43733. if (n = r,
  43734. r = t[--i - 1],
  43735. e >= r)
  43736. break t
  43737. }
  43738. o = i,
  43739. i = 0
  43740. }
  43741. }
  43742. for (; i < o; ) {
  43743. var l = i + o >>> 1;
  43744. e < t[l] ? o = l : i = l + 1
  43745. }
  43746. if (n = t[i],
  43747. r = t[i - 1],
  43748. void 0 === r)
  43749. return this._cachedIndex = 0,
  43750. this.beforeStart_(0, e, n);
  43751. if (void 0 === n)
  43752. return i = t.length,
  43753. this._cachedIndex = i,
  43754. this.afterEnd_(i - 1, r, e)
  43755. }
  43756. this._cachedIndex = i,
  43757. this.intervalChanged_(i, r, n)
  43758. }
  43759. return this.interpolate_(i, r, e, n)
  43760. },
  43761. settings: null,
  43762. DefaultSettings_: {},
  43763. getSettings_: function() {
  43764. return this.settings || this.DefaultSettings_
  43765. },
  43766. copySampleValue_: function(e) {
  43767. for (var t = this.resultBuffer, i = this.sampleValues, n = this.valueSize, r = e * n, o = 0; o !== n; ++o)
  43768. t[o] = i[r + o];
  43769. return t
  43770. },
  43771. interpolate_: function(e, t, i, n) {
  43772. throw new Error("call to abstract method")
  43773. },
  43774. intervalChanged_: function(e, t, i) {}
  43775. },
  43776. Object.assign(n.Interpolant.prototype, {
  43777. beforeStart_: n.Interpolant.prototype.copySampleValue_,
  43778. afterEnd_: n.Interpolant.prototype.copySampleValue_
  43779. }),
  43780. n.CubicInterpolant = function(e, t, i, r) {
  43781. n.Interpolant.call(this, e, t, i, r),
  43782. this._weightPrev = -0,
  43783. this._offsetPrev = -0,
  43784. this._weightNext = -0,
  43785. this._offsetNext = -0
  43786. }
  43787. ,
  43788. n.CubicInterpolant.prototype = Object.assign(Object.create(n.Interpolant.prototype), {
  43789. constructor: n.CubicInterpolant,
  43790. DefaultSettings_: {
  43791. endingStart: n.ZeroCurvatureEnding,
  43792. endingEnd: n.ZeroCurvatureEnding
  43793. },
  43794. intervalChanged_: function(e, t, i) {
  43795. var r = this.parameterPositions
  43796. , o = e - 2
  43797. , a = e + 1
  43798. , s = r[o]
  43799. , l = r[a];
  43800. if (void 0 === s)
  43801. switch (this.getSettings_().endingStart) {
  43802. case n.ZeroSlopeEnding:
  43803. o = e,
  43804. s = 2 * t - i;
  43805. break;
  43806. case n.WrapAroundEnding:
  43807. o = r.length - 2,
  43808. s = t + r[o] - r[o + 1];
  43809. break;
  43810. default:
  43811. o = e,
  43812. s = i
  43813. }
  43814. if (void 0 === l)
  43815. switch (this.getSettings_().endingEnd) {
  43816. case n.ZeroSlopeEnding:
  43817. a = e,
  43818. l = 2 * i - t;
  43819. break;
  43820. case n.WrapAroundEnding:
  43821. a = 1,
  43822. l = i + r[1] - r[0];
  43823. break;
  43824. default:
  43825. a = e - 1,
  43826. l = t
  43827. }
  43828. var c = .5 * (i - t)
  43829. , h = this.valueSize;
  43830. this._weightPrev = c / (t - s),
  43831. this._weightNext = c / (l - i),
  43832. this._offsetPrev = o * h,
  43833. this._offsetNext = a * h
  43834. },
  43835. interpolate_: function(e, t, i, n) {
  43836. 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)
  43837. r[C] = m * o[c + C] + v * o[l + C] + A * o[s + C] + y * o[h + C];
  43838. return r
  43839. }
  43840. }),
  43841. n.DiscreteInterpolant = function(e, t, i, r) {
  43842. n.Interpolant.call(this, e, t, i, r)
  43843. }
  43844. ,
  43845. n.DiscreteInterpolant.prototype = Object.assign(Object.create(n.Interpolant.prototype), {
  43846. constructor: n.DiscreteInterpolant,
  43847. interpolate_: function(e, t, i, n) {
  43848. return this.copySampleValue_(e - 1)
  43849. }
  43850. }),
  43851. n.LinearInterpolant = function(e, t, i, r) {
  43852. n.Interpolant.call(this, e, t, i, r)
  43853. }
  43854. ,
  43855. n.LinearInterpolant.prototype = Object.assign(Object.create(n.Interpolant.prototype), {
  43856. constructor: n.LinearInterpolant,
  43857. interpolate_: function(e, t, i, n) {
  43858. 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)
  43859. r[u] = o[l + u] * h + o[s + u] * c;
  43860. return r
  43861. }
  43862. }),
  43863. n.QuaternionLinearInterpolant = function(e, t, i, r) {
  43864. n.Interpolant.call(this, e, t, i, r)
  43865. }
  43866. ,
  43867. n.QuaternionLinearInterpolant.prototype = Object.assign(Object.create(n.Interpolant.prototype), {
  43868. constructor: n.QuaternionLinearInterpolant,
  43869. interpolate_: function(e, t, i, r) {
  43870. 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)
  43871. n.Quaternion.slerpFlat(o, 0, a, l - s, a, l, c);
  43872. return o
  43873. }
  43874. }),
  43875. n.Clock = function(e) {
  43876. this.autoStart = void 0 === e || e,
  43877. this.startTime = 0,
  43878. this.oldTime = 0,
  43879. this.elapsedTime = 0,
  43880. this.running = !1
  43881. }
  43882. ,
  43883. n.Clock.prototype = {
  43884. constructor: n.Clock,
  43885. start: function() {
  43886. this.startTime = performance.now(),
  43887. this.oldTime = this.startTime,
  43888. this.running = !0
  43889. },
  43890. stop: function() {
  43891. this.getElapsedTime(),
  43892. this.running = !1
  43893. },
  43894. getElapsedTime: function() {
  43895. return this.getDelta(),
  43896. this.elapsedTime
  43897. },
  43898. getDelta: function() {
  43899. var e = 0;
  43900. if (this.autoStart && !this.running && this.start(),
  43901. this.running) {
  43902. var t = performance.now();
  43903. e = .001 * (t - this.oldTime),
  43904. this.oldTime = t,
  43905. this.elapsedTime += e
  43906. }
  43907. return e
  43908. }
  43909. },
  43910. n.EventDispatcher = function() {}
  43911. ,
  43912. n.EventDispatcher.prototype = {
  43913. constructor: n.EventDispatcher,
  43914. apply: function(e) {
  43915. e.addEventListener = n.EventDispatcher.prototype.addEventListener,
  43916. e.hasEventListener = n.EventDispatcher.prototype.hasEventListener,
  43917. e.removeEventListener = n.EventDispatcher.prototype.removeEventListener,
  43918. e.dispatchEvent = n.EventDispatcher.prototype.dispatchEvent
  43919. },
  43920. addEventListener: function(e, t) {
  43921. void 0 === this._listeners && (this._listeners = {});
  43922. var i = this._listeners;
  43923. void 0 === i[e] && (i[e] = []),
  43924. i[e].indexOf(t) === -1 && i[e].push(t)
  43925. },
  43926. hasEventListener: function(e, t) {
  43927. if (void 0 === this._listeners)
  43928. return !1;
  43929. var i = this._listeners;
  43930. return void 0 !== i[e] && i[e].indexOf(t) !== -1
  43931. },
  43932. removeEventListener: function(e, t) {
  43933. if (void 0 !== this._listeners) {
  43934. var i = this._listeners
  43935. , n = i[e];
  43936. if (void 0 !== n) {
  43937. var r = n.indexOf(t);
  43938. r !== -1 && n.splice(r, 1)
  43939. }
  43940. }
  43941. },
  43942. dispatchEvent: function(e) {
  43943. if (void 0 !== this._listeners) {
  43944. var t = this._listeners
  43945. , i = t[e.type];
  43946. if (void 0 !== i) {
  43947. e.target = this;
  43948. for (var n = [], r = i.length, o = 0; o < r; o++)
  43949. n[o] = i[o];
  43950. for (var o = 0; o < r; o++)
  43951. n[o].call(this, e)
  43952. }
  43953. }
  43954. }
  43955. },
  43956. n.Layers = function() {
  43957. this.mask = 1
  43958. }
  43959. ,
  43960. n.Layers.prototype = {
  43961. constructor: n.Layers,
  43962. set: function(e) {
  43963. this.mask = 1 << e
  43964. },
  43965. enable: function(e) {
  43966. this.mask |= 1 << e
  43967. },
  43968. toggle: function(e) {
  43969. this.mask ^= 1 << e
  43970. },
  43971. disable: function(e) {
  43972. this.mask &= ~(1 << e)
  43973. },
  43974. test: function(e) {
  43975. return 0 !== (this.mask & e.mask)
  43976. }
  43977. },
  43978. function(e) {
  43979. function t(e, t) {
  43980. return e.distance - t.distance
  43981. }
  43982. function i(e, t, n, r) {
  43983. if (e.visible !== !1 && (e.raycast(t, n),
  43984. r === !0))
  43985. for (var o = e.children, a = 0, s = o.length; a < s; a++)
  43986. i(o[a], t, n, !0)
  43987. }
  43988. e.Raycaster = function(t, i, n, r) {
  43989. this.ray = new e.Ray(t,i),
  43990. this.near = n || 0,
  43991. this.far = r || 1 / 0,
  43992. this.params = {
  43993. Mesh: {},
  43994. Line: {},
  43995. LOD: {},
  43996. Points: {
  43997. threshold: 1
  43998. },
  43999. Sprite: {}
  44000. },
  44001. Object.defineProperties(this.params, {
  44002. PointCloud: {
  44003. get: function() {
  44004. return console.warn("THREE.Raycaster: params.PointCloud has been renamed to params.Points."),
  44005. this.Points
  44006. }
  44007. }
  44008. })
  44009. }
  44010. ,
  44011. e.Raycaster.prototype = {
  44012. constructor: e.Raycaster,
  44013. linePrecision: 1,
  44014. set: function(e, t) {
  44015. this.ray.set(e, t)
  44016. },
  44017. setFromCamera: function(t, i) {
  44018. i instanceof e.PerspectiveCamera ? (this.ray.origin.setFromMatrixPosition(i.matrixWorld),
  44019. 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),
  44020. this.ray.direction.set(0, 0, -1).transformDirection(i.matrixWorld)) : console.error("THREE.Raycaster: Unsupported camera type.")
  44021. },
  44022. intersectObject: function(e, n) {
  44023. var r = [];
  44024. return i(e, this, r, n),
  44025. r.sort(t),
  44026. r
  44027. },
  44028. intersectObjects: function(e, n) {
  44029. var r = [];
  44030. if (Array.isArray(e) === !1)
  44031. return console.warn("THREE.Raycaster.intersectObjects: objects is not an Array."),
  44032. r;
  44033. for (var o = 0, a = e.length; o < a; o++)
  44034. i(e[o], this, r, n);
  44035. return r.sort(t),
  44036. r
  44037. }
  44038. }
  44039. }(n),
  44040. n.Object3D = function() {
  44041. function e() {
  44042. o.setFromEuler(r, !1)
  44043. }
  44044. function t() {
  44045. r.setFromQuaternion(o, void 0, !1)
  44046. }
  44047. Object.defineProperty(this, "id", {
  44048. value: n.Object3DIdCount++
  44049. }),
  44050. this.uuid = n.Math.generateUUID(),
  44051. this.name = "",
  44052. this.type = "Object3D",
  44053. this.parent = null,
  44054. this.children = [],
  44055. this.up = n.Object3D.DefaultUp.clone();
  44056. var i = new n.Vector3
  44057. , r = new n.Euler
  44058. , o = new n.Quaternion
  44059. , a = new n.Vector3(1,1,1);
  44060. r.onChange(e),
  44061. o.onChange(t),
  44062. Object.defineProperties(this, {
  44063. position: {
  44064. enumerable: !0,
  44065. value: i
  44066. },
  44067. rotation: {
  44068. enumerable: !0,
  44069. value: r
  44070. },
  44071. quaternion: {
  44072. enumerable: !0,
  44073. value: o
  44074. },
  44075. scale: {
  44076. enumerable: !0,
  44077. value: a
  44078. },
  44079. modelViewMatrix: {
  44080. value: new n.Matrix4
  44081. },
  44082. normalMatrix: {
  44083. value: new n.Matrix3
  44084. }
  44085. }),
  44086. this.rotationAutoUpdate = !0,
  44087. this.matrix = new n.Matrix4,
  44088. this.matrixWorld = new n.Matrix4,
  44089. this.matrixAutoUpdate = n.Object3D.DefaultMatrixAutoUpdate,
  44090. this.matrixWorldNeedsUpdate = !1,
  44091. this.layers = new n.Layers,
  44092. this.visible = !0,
  44093. this.castShadow = !1,
  44094. this.receiveShadow = !1,
  44095. this.frustumCulled = !0,
  44096. this.renderOrder = 0,
  44097. this.userData = {}
  44098. }
  44099. ,
  44100. n.Object3D.DefaultUp = new n.Vector3(0,1,0),
  44101. n.Object3D.DefaultMatrixAutoUpdate = !0,
  44102. n.Object3D.prototype = {
  44103. constructor: n.Object3D,
  44104. applyMatrix: function(e) {
  44105. this.matrix.multiplyMatrices(e, this.matrix),
  44106. this.matrix.decompose(this.position, this.quaternion, this.scale)
  44107. },
  44108. setRotationFromAxisAngle: function(e, t) {
  44109. this.quaternion.setFromAxisAngle(e, t)
  44110. },
  44111. setRotationFromEuler: function(e) {
  44112. this.quaternion.setFromEuler(e, !0)
  44113. },
  44114. setRotationFromMatrix: function(e) {
  44115. this.quaternion.setFromRotationMatrix(e)
  44116. },
  44117. setRotationFromQuaternion: function(e) {
  44118. this.quaternion.copy(e)
  44119. },
  44120. rotateOnAxis: function() {
  44121. var e = new n.Quaternion;
  44122. return function(t, i) {
  44123. return e.setFromAxisAngle(t, i),
  44124. this.quaternion.multiply(e),
  44125. this
  44126. }
  44127. }(),
  44128. rotateX: function() {
  44129. var e = new n.Vector3(1,0,0);
  44130. return function(t) {
  44131. return this.rotateOnAxis(e, t)
  44132. }
  44133. }(),
  44134. rotateY: function() {
  44135. var e = new n.Vector3(0,1,0);
  44136. return function(t) {
  44137. return this.rotateOnAxis(e, t)
  44138. }
  44139. }(),
  44140. rotateZ: function() {
  44141. var e = new n.Vector3(0,0,1);
  44142. return function(t) {
  44143. return this.rotateOnAxis(e, t)
  44144. }
  44145. }(),
  44146. translateOnAxis: function() {
  44147. var e = new n.Vector3;
  44148. return function(t, i) {
  44149. return e.copy(t).applyQuaternion(this.quaternion),
  44150. this.position.add(e.multiplyScalar(i)),
  44151. this
  44152. }
  44153. }(),
  44154. translateX: function() {
  44155. var e = new n.Vector3(1,0,0);
  44156. return function(t) {
  44157. return this.translateOnAxis(e, t)
  44158. }
  44159. }(),
  44160. translateY: function() {
  44161. var e = new n.Vector3(0,1,0);
  44162. return function(t) {
  44163. return this.translateOnAxis(e, t)
  44164. }
  44165. }(),
  44166. translateZ: function() {
  44167. var e = new n.Vector3(0,0,1);
  44168. return function(t) {
  44169. return this.translateOnAxis(e, t)
  44170. }
  44171. }(),
  44172. localToWorld: function(e) {
  44173. return e.applyMatrix4(this.matrixWorld)
  44174. },
  44175. worldToLocal: function() {
  44176. var e = new n.Matrix4;
  44177. return function(t) {
  44178. return t.applyMatrix4(e.getInverse(this.matrixWorld))
  44179. }
  44180. }(),
  44181. lookAt: function() {
  44182. var e = new n.Matrix4;
  44183. return function(t) {
  44184. e.lookAt(t, this.position, this.up),
  44185. this.quaternion.setFromRotationMatrix(e)
  44186. }
  44187. }(),
  44188. add: function(e) {
  44189. if (arguments.length > 1) {
  44190. for (var t = 0; t < arguments.length; t++)
  44191. this.add(arguments[t]);
  44192. return this
  44193. }
  44194. return e === this ? (console.error("THREE.Object3D.add: object can't be added as a child of itself.", e),
  44195. this) : (e instanceof n.Object3D ? (null !== e.parent && e.parent.remove(e),
  44196. e.parent = this,
  44197. e.dispatchEvent({
  44198. type: "added"
  44199. }),
  44200. this.children.push(e)) : console.error("THREE.Object3D.add: object not an instance of THREE.Object3D.", e),
  44201. this)
  44202. },
  44203. remove: function(e) {
  44204. if (arguments.length > 1)
  44205. for (var t = 0; t < arguments.length; t++)
  44206. this.remove(arguments[t]);
  44207. var i = this.children.indexOf(e);
  44208. i !== -1 && (e.parent = null,
  44209. e.dispatchEvent({
  44210. type: "removed"
  44211. }),
  44212. this.children.splice(i, 1))
  44213. },
  44214. getObjectById: function(e) {
  44215. return this.getObjectByProperty("id", e)
  44216. },
  44217. getObjectByName: function(e) {
  44218. return this.getObjectByProperty("name", e)
  44219. },
  44220. getObjectByProperty: function(e, t) {
  44221. if (this[e] === t)
  44222. return this;
  44223. for (var i = 0, n = this.children.length; i < n; i++) {
  44224. var r = this.children[i]
  44225. , o = r.getObjectByProperty(e, t);
  44226. if (void 0 !== o)
  44227. return o
  44228. }
  44229. },
  44230. getWorldPosition: function(e) {
  44231. var t = e || new n.Vector3;
  44232. return this.updateMatrixWorld(!0),
  44233. t.setFromMatrixPosition(this.matrixWorld)
  44234. },
  44235. getWorldQuaternion: function() {
  44236. var e = new n.Vector3
  44237. , t = new n.Vector3;
  44238. return function(i) {
  44239. var r = i || new n.Quaternion;
  44240. return this.updateMatrixWorld(!0),
  44241. this.matrixWorld.decompose(e, r, t),
  44242. r
  44243. }
  44244. }(),
  44245. getWorldRotation: function() {
  44246. var e = new n.Quaternion;
  44247. return function(t) {
  44248. var i = t || new n.Euler;
  44249. return this.getWorldQuaternion(e),
  44250. i.setFromQuaternion(e, this.rotation.order, !1)
  44251. }
  44252. }(),
  44253. getWorldScale: function() {
  44254. var e = new n.Vector3
  44255. , t = new n.Quaternion;
  44256. return function(i) {
  44257. var r = i || new n.Vector3;
  44258. return this.updateMatrixWorld(!0),
  44259. this.matrixWorld.decompose(e, t, r),
  44260. r
  44261. }
  44262. }(),
  44263. getWorldDirection: function() {
  44264. var e = new n.Quaternion;
  44265. return function(t) {
  44266. var i = t || new n.Vector3;
  44267. return this.getWorldQuaternion(e),
  44268. i.set(0, 0, 1).applyQuaternion(e)
  44269. }
  44270. }(),
  44271. raycast: function() {},
  44272. traverse: function(e) {
  44273. e(this);
  44274. for (var t = this.children, i = 0, n = t.length; i < n; i++)
  44275. t[i].traverse(e)
  44276. },
  44277. traverseVisible: function(e) {
  44278. if (this.visible !== !1) {
  44279. e(this);
  44280. for (var t = this.children, i = 0, n = t.length; i < n; i++)
  44281. t[i].traverseVisible(e)
  44282. }
  44283. },
  44284. traverseAncestors: function(e) {
  44285. var t = this.parent;
  44286. null !== t && (e(t),
  44287. t.traverseAncestors(e))
  44288. },
  44289. updateMatrix: function() {
  44290. this.matrix.compose(this.position, this.quaternion, this.scale),
  44291. this.matrixWorldNeedsUpdate = !0
  44292. },
  44293. updateMatrixWorld: function(e) {
  44294. this.matrixAutoUpdate === !0 && this.updateMatrix(),
  44295. this.matrixWorldNeedsUpdate !== !0 && e !== !0 || (null === this.parent ? this.matrixWorld.copy(this.matrix) : this.matrixWorld.multiplyMatrices(this.parent.matrixWorld, this.matrix),
  44296. this.matrixWorldNeedsUpdate = !1,
  44297. e = !0);
  44298. for (var t = 0, i = this.children.length; t < i; t++)
  44299. this.children[t].updateMatrixWorld(e)
  44300. },
  44301. toJSON: function(e) {
  44302. function t(e) {
  44303. var t = [];
  44304. for (var i in e) {
  44305. var n = e[i];
  44306. delete n.metadata,
  44307. t.push(n)
  44308. }
  44309. return t
  44310. }
  44311. var i = void 0 === e
  44312. , n = {};
  44313. i && (e = {
  44314. geometries: {},
  44315. materials: {},
  44316. textures: {},
  44317. images: {}
  44318. },
  44319. n.metadata = {
  44320. version: 4.4,
  44321. type: "Object",
  44322. generator: "Object3D.toJSON"
  44323. });
  44324. var r = {};
  44325. if (r.uuid = this.uuid,
  44326. r.type = this.type,
  44327. "" !== this.name && (r.name = this.name),
  44328. "{}" !== JSON.stringify(this.userData) && (r.userData = this.userData),
  44329. this.castShadow === !0 && (r.castShadow = !0),
  44330. this.receiveShadow === !0 && (r.receiveShadow = !0),
  44331. this.visible === !1 && (r.visible = !1),
  44332. r.matrix = this.matrix.toArray(),
  44333. void 0 !== this.geometry && (void 0 === e.geometries[this.geometry.uuid] && (e.geometries[this.geometry.uuid] = this.geometry.toJSON(e)),
  44334. r.geometry = this.geometry.uuid),
  44335. void 0 !== this.material && (void 0 === e.materials[this.material.uuid] && (e.materials[this.material.uuid] = this.material.toJSON(e)),
  44336. r.material = this.material.uuid),
  44337. this.children.length > 0) {
  44338. r.children = [];
  44339. for (var o = 0; o < this.children.length; o++)
  44340. r.children.push(this.children[o].toJSON(e).object)
  44341. }
  44342. if (i) {
  44343. var a = t(e.geometries)
  44344. , s = t(e.materials)
  44345. , l = t(e.textures)
  44346. , c = t(e.images);
  44347. a.length > 0 && (n.geometries = a),
  44348. s.length > 0 && (n.materials = s),
  44349. l.length > 0 && (n.textures = l),
  44350. c.length > 0 && (n.images = c)
  44351. }
  44352. return n.object = r,
  44353. n
  44354. },
  44355. clone: function(e) {
  44356. return (new this.constructor).copy(this, e)
  44357. },
  44358. copy: function(e, t) {
  44359. if (void 0 === t && (t = !0),
  44360. this.name = e.name,
  44361. this.up.copy(e.up),
  44362. this.position.copy(e.position),
  44363. this.quaternion.copy(e.quaternion),
  44364. this.scale.copy(e.scale),
  44365. this.rotationAutoUpdate = e.rotationAutoUpdate,
  44366. this.matrix.copy(e.matrix),
  44367. this.matrixWorld.copy(e.matrixWorld),
  44368. this.matrixAutoUpdate = e.matrixAutoUpdate,
  44369. this.matrixWorldNeedsUpdate = e.matrixWorldNeedsUpdate,
  44370. this.visible = e.visible,
  44371. this.castShadow = e.castShadow,
  44372. this.receiveShadow = e.receiveShadow,
  44373. this.frustumCulled = e.frustumCulled,
  44374. this.renderOrder = e.renderOrder,
  44375. this.userData = JSON.parse(JSON.stringify(e.userData)),
  44376. t === !0)
  44377. for (var i = 0; i < e.children.length; i++) {
  44378. var n = e.children[i];
  44379. this.add(n.clone())
  44380. }
  44381. return this
  44382. }
  44383. },
  44384. n.EventDispatcher.prototype.apply(n.Object3D.prototype),
  44385. n.Object3DIdCount = 0,
  44386. n.Face3 = function(e, t, i, r, o, a) {
  44387. this.a = e,
  44388. this.b = t,
  44389. this.c = i,
  44390. this.normal = r instanceof n.Vector3 ? r : new n.Vector3,
  44391. this.vertexNormals = Array.isArray(r) ? r : [],
  44392. this.color = o instanceof n.Color ? o : new n.Color,
  44393. this.vertexColors = Array.isArray(o) ? o : [],
  44394. this.materialIndex = void 0 !== a ? a : 0
  44395. }
  44396. ,
  44397. n.Face3.prototype = {
  44398. constructor: n.Face3,
  44399. clone: function() {
  44400. return (new this.constructor).copy(this)
  44401. },
  44402. copy: function(e) {
  44403. this.a = e.a,
  44404. this.b = e.b,
  44405. this.c = e.c,
  44406. this.normal.copy(e.normal),
  44407. this.color.copy(e.color),
  44408. this.materialIndex = e.materialIndex;
  44409. for (var t = 0, i = e.vertexNormals.length; t < i; t++)
  44410. this.vertexNormals[t] = e.vertexNormals[t].clone();
  44411. for (var t = 0, i = e.vertexColors.length; t < i; t++)
  44412. this.vertexColors[t] = e.vertexColors[t].clone();
  44413. return this
  44414. }
  44415. },
  44416. n.BufferAttribute = function(e, t) {
  44417. this.uuid = n.Math.generateUUID(),
  44418. this.array = e,
  44419. this.itemSize = t,
  44420. this.dynamic = !1,
  44421. this.updateRange = {
  44422. offset: 0,
  44423. count: -1
  44424. },
  44425. this.version = 0
  44426. }
  44427. ,
  44428. n.BufferAttribute.prototype = {
  44429. constructor: n.BufferAttribute,
  44430. get count() {
  44431. return this.array.length / this.itemSize
  44432. },
  44433. set needsUpdate(e) {
  44434. e === !0 && this.version++
  44435. },
  44436. setDynamic: function(e) {
  44437. return this.dynamic = e,
  44438. this
  44439. },
  44440. copy: function(e) {
  44441. return this.array = new e.array.constructor(e.array),
  44442. this.itemSize = e.itemSize,
  44443. this.dynamic = e.dynamic,
  44444. this
  44445. },
  44446. copyAt: function(e, t, i) {
  44447. e *= this.itemSize,
  44448. i *= t.itemSize;
  44449. for (var n = 0, r = this.itemSize; n < r; n++)
  44450. this.array[e + n] = t.array[i + n];
  44451. return this
  44452. },
  44453. copyArray: function(e) {
  44454. return this.array.set(e),
  44455. this
  44456. },
  44457. copyColorsArray: function(e) {
  44458. for (var t = this.array, i = 0, r = 0, o = e.length; r < o; r++) {
  44459. var a = e[r];
  44460. void 0 === a && (console.warn("THREE.BufferAttribute.copyColorsArray(): color is undefined", r),
  44461. a = new n.Color),
  44462. t[i++] = a.r,
  44463. t[i++] = a.g,
  44464. t[i++] = a.b
  44465. }
  44466. return this
  44467. },
  44468. copyIndicesArray: function(e) {
  44469. for (var t = this.array, i = 0, n = 0, r = e.length; n < r; n++) {
  44470. var o = e[n];
  44471. t[i++] = o.a,
  44472. t[i++] = o.b,
  44473. t[i++] = o.c
  44474. }
  44475. return this
  44476. },
  44477. copyVector2sArray: function(e) {
  44478. for (var t = this.array, i = 0, r = 0, o = e.length; r < o; r++) {
  44479. var a = e[r];
  44480. void 0 === a && (console.warn("THREE.BufferAttribute.copyVector2sArray(): vector is undefined", r),
  44481. a = new n.Vector2),
  44482. t[i++] = a.x,
  44483. t[i++] = a.y
  44484. }
  44485. return this
  44486. },
  44487. copyVector3sArray: function(e) {
  44488. for (var t = this.array, i = 0, r = 0, o = e.length; r < o; r++) {
  44489. var a = e[r];
  44490. void 0 === a && (console.warn("THREE.BufferAttribute.copyVector3sArray(): vector is undefined", r),
  44491. a = new n.Vector3),
  44492. t[i++] = a.x,
  44493. t[i++] = a.y,
  44494. t[i++] = a.z
  44495. }
  44496. return this
  44497. },
  44498. copyVector4sArray: function(e) {
  44499. for (var t = this.array, i = 0, r = 0, o = e.length; r < o; r++) {
  44500. var a = e[r];
  44501. void 0 === a && (console.warn("THREE.BufferAttribute.copyVector4sArray(): vector is undefined", r),
  44502. a = new n.Vector4),
  44503. t[i++] = a.x,
  44504. t[i++] = a.y,
  44505. t[i++] = a.z,
  44506. t[i++] = a.w
  44507. }
  44508. return this
  44509. },
  44510. set: function(e, t) {
  44511. return void 0 === t && (t = 0),
  44512. this.array.set(e, t),
  44513. this
  44514. },
  44515. getX: function(e) {
  44516. return this.array[e * this.itemSize]
  44517. },
  44518. setX: function(e, t) {
  44519. return this.array[e * this.itemSize] = t,
  44520. this
  44521. },
  44522. getY: function(e) {
  44523. return this.array[e * this.itemSize + 1]
  44524. },
  44525. setY: function(e, t) {
  44526. return this.array[e * this.itemSize + 1] = t,
  44527. this
  44528. },
  44529. getZ: function(e) {
  44530. return this.array[e * this.itemSize + 2]
  44531. },
  44532. setZ: function(e, t) {
  44533. return this.array[e * this.itemSize + 2] = t,
  44534. this
  44535. },
  44536. getW: function(e) {
  44537. return this.array[e * this.itemSize + 3]
  44538. },
  44539. setW: function(e, t) {
  44540. return this.array[e * this.itemSize + 3] = t,
  44541. this
  44542. },
  44543. setXY: function(e, t, i) {
  44544. return e *= this.itemSize,
  44545. this.array[e + 0] = t,
  44546. this.array[e + 1] = i,
  44547. this
  44548. },
  44549. setXYZ: function(e, t, i, n) {
  44550. return e *= this.itemSize,
  44551. this.array[e + 0] = t,
  44552. this.array[e + 1] = i,
  44553. this.array[e + 2] = n,
  44554. this
  44555. },
  44556. setXYZW: function(e, t, i, n, r) {
  44557. return e *= this.itemSize,
  44558. this.array[e + 0] = t,
  44559. this.array[e + 1] = i,
  44560. this.array[e + 2] = n,
  44561. this.array[e + 3] = r,
  44562. this
  44563. },
  44564. clone: function() {
  44565. return (new this.constructor).copy(this)
  44566. }
  44567. },
  44568. n.Int8Attribute = function(e, t) {
  44569. return new n.BufferAttribute(new Int8Array(e),t)
  44570. }
  44571. ,
  44572. n.Uint8Attribute = function(e, t) {
  44573. return new n.BufferAttribute(new Uint8Array(e),t)
  44574. }
  44575. ,
  44576. n.Uint8ClampedAttribute = function(e, t) {
  44577. return new n.BufferAttribute(new Uint8ClampedArray(e),t)
  44578. }
  44579. ,
  44580. n.Int16Attribute = function(e, t) {
  44581. return new n.BufferAttribute(new Int16Array(e),t)
  44582. }
  44583. ,
  44584. n.Uint16Attribute = function(e, t) {
  44585. return new n.BufferAttribute(new Uint16Array(e),t)
  44586. }
  44587. ;
  44588. n.Int32Attribute = function(e, t) {
  44589. return new n.BufferAttribute(new Int32Array(e),t)
  44590. }
  44591. ;
  44592. n.Uint32Attribute = function(e, t) {
  44593. return new n.BufferAttribute(new Uint32Array(e),t)
  44594. }
  44595. ,
  44596. n.Float32Attribute = function(e, t) {
  44597. return new n.BufferAttribute(new Float32Array(e),t)
  44598. }
  44599. ,
  44600. n.Float64Attribute = function(e, t) {
  44601. return new n.BufferAttribute(new Float64Array(e),t)
  44602. }
  44603. ,
  44604. n.DynamicBufferAttribute = function(e, t) {
  44605. return console.warn("THREE.DynamicBufferAttribute has been removed. Use new THREE.BufferAttribute().setDynamic( true ) instead."),
  44606. new n.BufferAttribute(e,t).setDynamic(!0)
  44607. }
  44608. ,
  44609. n.InstancedBufferAttribute = function(e, t, i) {
  44610. n.BufferAttribute.call(this, e, t),
  44611. this.meshPerAttribute = i || 1
  44612. }
  44613. ,
  44614. n.InstancedBufferAttribute.prototype = Object.create(n.BufferAttribute.prototype),
  44615. n.InstancedBufferAttribute.prototype.constructor = n.InstancedBufferAttribute,
  44616. n.InstancedBufferAttribute.prototype.copy = function(e) {
  44617. return n.BufferAttribute.prototype.copy.call(this, e),
  44618. this.meshPerAttribute = e.meshPerAttribute,
  44619. this
  44620. }
  44621. ,
  44622. n.InterleavedBuffer = function(e, t) {
  44623. this.uuid = n.Math.generateUUID(),
  44624. this.array = e,
  44625. this.stride = t,
  44626. this.dynamic = !1,
  44627. this.updateRange = {
  44628. offset: 0,
  44629. count: -1
  44630. },
  44631. this.version = 0
  44632. }
  44633. ,
  44634. n.InterleavedBuffer.prototype = {
  44635. constructor: n.InterleavedBuffer,
  44636. get length() {
  44637. return this.array.length
  44638. },
  44639. get count() {
  44640. return this.array.length / this.stride
  44641. },
  44642. set needsUpdate(e) {
  44643. e === !0 && this.version++
  44644. },
  44645. setDynamic: function(e) {
  44646. return this.dynamic = e,
  44647. this
  44648. },
  44649. copy: function(e) {
  44650. return this.array = new e.array.constructor(e.array),
  44651. this.stride = e.stride,
  44652. this.dynamic = e.dynamic,
  44653. this
  44654. },
  44655. copyAt: function(e, t, i) {
  44656. e *= this.stride,
  44657. i *= t.stride;
  44658. for (var n = 0, r = this.stride; n < r; n++)
  44659. this.array[e + n] = t.array[i + n];
  44660. return this
  44661. },
  44662. set: function(e, t) {
  44663. return void 0 === t && (t = 0),
  44664. this.array.set(e, t),
  44665. this
  44666. },
  44667. clone: function() {
  44668. return (new this.constructor).copy(this)
  44669. }
  44670. },
  44671. n.InstancedInterleavedBuffer = function(e, t, i) {
  44672. n.InterleavedBuffer.call(this, e, t),
  44673. this.meshPerAttribute = i || 1
  44674. }
  44675. ,
  44676. n.InstancedInterleavedBuffer.prototype = Object.create(n.InterleavedBuffer.prototype),
  44677. n.InstancedInterleavedBuffer.prototype.constructor = n.InstancedInterleavedBuffer,
  44678. n.InstancedInterleavedBuffer.prototype.copy = function(e) {
  44679. return n.InterleavedBuffer.prototype.copy.call(this, e),
  44680. this.meshPerAttribute = e.meshPerAttribute,
  44681. this
  44682. }
  44683. ,
  44684. n.InterleavedBufferAttribute = function(e, t, i) {
  44685. this.uuid = n.Math.generateUUID(),
  44686. this.data = e,
  44687. this.itemSize = t,
  44688. this.offset = i
  44689. }
  44690. ,
  44691. n.InterleavedBufferAttribute.prototype = {
  44692. constructor: n.InterleavedBufferAttribute,
  44693. get length() {
  44694. return console.warn("THREE.BufferAttribute: .length has been deprecated. Please use .count."),
  44695. this.array.length
  44696. },
  44697. get count() {
  44698. return this.data.count
  44699. },
  44700. setX: function(e, t) {
  44701. return this.data.array[e * this.data.stride + this.offset] = t,
  44702. this
  44703. },
  44704. setY: function(e, t) {
  44705. return this.data.array[e * this.data.stride + this.offset + 1] = t,
  44706. this
  44707. },
  44708. setZ: function(e, t) {
  44709. return this.data.array[e * this.data.stride + this.offset + 2] = t,
  44710. this
  44711. },
  44712. setW: function(e, t) {
  44713. return this.data.array[e * this.data.stride + this.offset + 3] = t,
  44714. this
  44715. },
  44716. getX: function(e) {
  44717. return this.data.array[e * this.data.stride + this.offset]
  44718. },
  44719. getY: function(e) {
  44720. return this.data.array[e * this.data.stride + this.offset + 1]
  44721. },
  44722. getZ: function(e) {
  44723. return this.data.array[e * this.data.stride + this.offset + 2]
  44724. },
  44725. getW: function(e) {
  44726. return this.data.array[e * this.data.stride + this.offset + 3]
  44727. },
  44728. setXY: function(e, t, i) {
  44729. return e = e * this.data.stride + this.offset,
  44730. this.data.array[e + 0] = t,
  44731. this.data.array[e + 1] = i,
  44732. this
  44733. },
  44734. setXYZ: function(e, t, i, n) {
  44735. return e = e * this.data.stride + this.offset,
  44736. this.data.array[e + 0] = t,
  44737. this.data.array[e + 1] = i,
  44738. this.data.array[e + 2] = n,
  44739. this
  44740. },
  44741. setXYZW: function(e, t, i, n, r) {
  44742. return e = e * this.data.stride + this.offset,
  44743. this.data.array[e + 0] = t,
  44744. this.data.array[e + 1] = i,
  44745. this.data.array[e + 2] = n,
  44746. this.data.array[e + 3] = r,
  44747. this
  44748. }
  44749. },
  44750. n.Geometry = function() {
  44751. Object.defineProperty(this, "id", {
  44752. value: n.GeometryIdCount++
  44753. }),
  44754. this.uuid = n.Math.generateUUID(),
  44755. this.name = "",
  44756. this.type = "Geometry",
  44757. this.vertices = [],
  44758. this.colors = [],
  44759. this.faces = [],
  44760. this.faceVertexUvs = [[]],
  44761. this.morphTargets = [],
  44762. this.morphNormals = [],
  44763. this.skinWeights = [],
  44764. this.skinIndices = [],
  44765. this.lineDistances = [],
  44766. this.boundingBox = null,
  44767. this.boundingSphere = null,
  44768. this.verticesNeedUpdate = !1,
  44769. this.elementsNeedUpdate = !1,
  44770. this.uvsNeedUpdate = !1,
  44771. this.normalsNeedUpdate = !1,
  44772. this.colorsNeedUpdate = !1,
  44773. this.lineDistancesNeedUpdate = !1,
  44774. this.groupsNeedUpdate = !1
  44775. }
  44776. ,
  44777. n.Geometry.prototype = {
  44778. constructor: n.Geometry,
  44779. applyMatrix: function(e) {
  44780. for (var t = (new n.Matrix3).getNormalMatrix(e), i = 0, r = this.vertices.length; i < r; i++) {
  44781. var o = this.vertices[i];
  44782. o.applyMatrix4(e)
  44783. }
  44784. for (var i = 0, r = this.faces.length; i < r; i++) {
  44785. var a = this.faces[i];
  44786. a.normal.applyMatrix3(t).normalize();
  44787. for (var s = 0, l = a.vertexNormals.length; s < l; s++)
  44788. a.vertexNormals[s].applyMatrix3(t).normalize()
  44789. }
  44790. return null !== this.boundingBox && this.computeBoundingBox(),
  44791. null !== this.boundingSphere && this.computeBoundingSphere(),
  44792. this.verticesNeedUpdate = !0,
  44793. this.normalsNeedUpdate = !0,
  44794. this
  44795. },
  44796. rotateX: function() {
  44797. var e;
  44798. return function(t) {
  44799. return void 0 === e && (e = new n.Matrix4),
  44800. e.makeRotationX(t),
  44801. this.applyMatrix(e),
  44802. this
  44803. }
  44804. }(),
  44805. rotateY: function() {
  44806. var e;
  44807. return function(t) {
  44808. return void 0 === e && (e = new n.Matrix4),
  44809. e.makeRotationY(t),
  44810. this.applyMatrix(e),
  44811. this
  44812. }
  44813. }(),
  44814. rotateZ: function() {
  44815. var e;
  44816. return function(t) {
  44817. return void 0 === e && (e = new n.Matrix4),
  44818. e.makeRotationZ(t),
  44819. this.applyMatrix(e),
  44820. this
  44821. }
  44822. }(),
  44823. translate: function() {
  44824. var e;
  44825. return function(t, i, r) {
  44826. return void 0 === e && (e = new n.Matrix4),
  44827. e.makeTranslation(t, i, r),
  44828. this.applyMatrix(e),
  44829. this
  44830. }
  44831. }(),
  44832. scale: function() {
  44833. var e;
  44834. return function(t, i, r) {
  44835. return void 0 === e && (e = new n.Matrix4),
  44836. e.makeScale(t, i, r),
  44837. this.applyMatrix(e),
  44838. this
  44839. }
  44840. }(),
  44841. lookAt: function() {
  44842. var e;
  44843. return function(t) {
  44844. void 0 === e && (e = new n.Object3D),
  44845. e.lookAt(t),
  44846. e.updateMatrix(),
  44847. this.applyMatrix(e.matrix)
  44848. }
  44849. }(),
  44850. fromBufferGeometry: function(e) {
  44851. function t(e, t, r, o) {
  44852. var a = void 0 !== s ? [u[e].clone(), u[t].clone(), u[r].clone()] : []
  44853. , f = void 0 !== l ? [i.colors[e].clone(), i.colors[t].clone(), i.colors[r].clone()] : []
  44854. , g = new n.Face3(e,t,r,a,f,o);
  44855. i.faces.push(g),
  44856. void 0 !== c && i.faceVertexUvs[0].push([d[e].clone(), d[t].clone(), d[r].clone()]),
  44857. void 0 !== h && i.faceVertexUvs[1].push([p[e].clone(), p[t].clone(), p[r].clone()])
  44858. }
  44859. var i = this
  44860. , r = null !== e.index ? e.index.array : void 0
  44861. , o = e.attributes
  44862. , a = o.position.array
  44863. , s = void 0 !== o.normal ? o.normal.array : void 0
  44864. , l = void 0 !== o.color ? o.color.array : void 0
  44865. , c = void 0 !== o.uv ? o.uv.array : void 0
  44866. , h = void 0 !== o.uv2 ? o.uv2.array : void 0;
  44867. void 0 !== h && (this.faceVertexUvs[1] = []);
  44868. for (var u = [], d = [], p = [], f = 0, g = 0; f < a.length; f += 3,
  44869. g += 2)
  44870. i.vertices.push(new n.Vector3(a[f],a[f + 1],a[f + 2])),
  44871. void 0 !== s && u.push(new n.Vector3(s[f],s[f + 1],s[f + 2])),
  44872. void 0 !== l && i.colors.push(new n.Color(l[f],l[f + 1],l[f + 2])),
  44873. void 0 !== c && d.push(new n.Vector2(c[g],c[g + 1])),
  44874. void 0 !== h && p.push(new n.Vector2(h[g],h[g + 1]));
  44875. if (void 0 !== r) {
  44876. var m = e.groups;
  44877. if (m.length > 0)
  44878. for (var f = 0; f < m.length; f++)
  44879. for (var v = m[f], A = v.start, y = v.count, g = A, C = A + y; g < C; g += 3)
  44880. t(r[g], r[g + 1], r[g + 2], v.materialIndex);
  44881. else
  44882. for (var f = 0; f < r.length; f += 3)
  44883. t(r[f], r[f + 1], r[f + 2])
  44884. } else
  44885. for (var f = 0; f < a.length / 3; f += 3)
  44886. t(f, f + 1, f + 2);
  44887. return this.computeFaceNormals(),
  44888. null !== e.boundingBox && (this.boundingBox = e.boundingBox.clone()),
  44889. null !== e.boundingSphere && (this.boundingSphere = e.boundingSphere.clone()),
  44890. this
  44891. },
  44892. center: function() {
  44893. this.computeBoundingBox();
  44894. var e = this.boundingBox.center().negate();
  44895. return this.translate(e.x, e.y, e.z),
  44896. e
  44897. },
  44898. normalize: function() {
  44899. this.computeBoundingSphere();
  44900. var e = this.boundingSphere.center
  44901. , t = this.boundingSphere.radius
  44902. , i = 0 === t ? 1 : 1 / t
  44903. , r = new n.Matrix4;
  44904. 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),
  44905. this.applyMatrix(r),
  44906. this
  44907. },
  44908. computeFaceNormals: function() {
  44909. for (var e = new n.Vector3, t = new n.Vector3, i = 0, r = this.faces.length; i < r; i++) {
  44910. var o = this.faces[i]
  44911. , a = this.vertices[o.a]
  44912. , s = this.vertices[o.b]
  44913. , l = this.vertices[o.c];
  44914. e.subVectors(l, s),
  44915. t.subVectors(a, s),
  44916. e.cross(t),
  44917. e.normalize(),
  44918. o.normal.copy(e)
  44919. }
  44920. },
  44921. computeVertexNormals: function(e) {
  44922. void 0 === e && (e = !0);
  44923. var t, i, r, o, a, s;
  44924. for (s = new Array(this.vertices.length),
  44925. t = 0,
  44926. i = this.vertices.length; t < i; t++)
  44927. s[t] = new n.Vector3;
  44928. if (e) {
  44929. var l, c, h, u = new n.Vector3, d = new n.Vector3;
  44930. for (r = 0,
  44931. o = this.faces.length; r < o; r++)
  44932. a = this.faces[r],
  44933. l = this.vertices[a.a],
  44934. c = this.vertices[a.b],
  44935. h = this.vertices[a.c],
  44936. u.subVectors(h, c),
  44937. d.subVectors(l, c),
  44938. u.cross(d),
  44939. s[a.a].add(u),
  44940. s[a.b].add(u),
  44941. s[a.c].add(u)
  44942. } else
  44943. for (r = 0,
  44944. o = this.faces.length; r < o; r++)
  44945. a = this.faces[r],
  44946. s[a.a].add(a.normal),
  44947. s[a.b].add(a.normal),
  44948. s[a.c].add(a.normal);
  44949. for (t = 0,
  44950. i = this.vertices.length; t < i; t++)
  44951. s[t].normalize();
  44952. for (r = 0,
  44953. o = this.faces.length; r < o; r++) {
  44954. a = this.faces[r];
  44955. var p = a.vertexNormals;
  44956. 3 === p.length ? (p[0].copy(s[a.a]),
  44957. p[1].copy(s[a.b]),
  44958. p[2].copy(s[a.c])) : (p[0] = s[a.a].clone(),
  44959. p[1] = s[a.b].clone(),
  44960. p[2] = s[a.c].clone())
  44961. }
  44962. this.faces.length > 0 && (this.normalsNeedUpdate = !0)
  44963. },
  44964. computeMorphNormals: function() {
  44965. var e, t, i, r, o;
  44966. for (i = 0,
  44967. r = this.faces.length; i < r; i++)
  44968. for (o = this.faces[i],
  44969. o.__originalFaceNormal ? o.__originalFaceNormal.copy(o.normal) : o.__originalFaceNormal = o.normal.clone(),
  44970. o.__originalVertexNormals || (o.__originalVertexNormals = []),
  44971. e = 0,
  44972. t = o.vertexNormals.length; e < t; e++)
  44973. o.__originalVertexNormals[e] ? o.__originalVertexNormals[e].copy(o.vertexNormals[e]) : o.__originalVertexNormals[e] = o.vertexNormals[e].clone();
  44974. var a = new n.Geometry;
  44975. for (a.faces = this.faces,
  44976. e = 0,
  44977. t = this.morphTargets.length; e < t; e++) {
  44978. if (!this.morphNormals[e]) {
  44979. this.morphNormals[e] = {},
  44980. this.morphNormals[e].faceNormals = [],
  44981. this.morphNormals[e].vertexNormals = [];
  44982. var s, l, c = this.morphNormals[e].faceNormals, h = this.morphNormals[e].vertexNormals;
  44983. for (i = 0,
  44984. r = this.faces.length; i < r; i++)
  44985. s = new n.Vector3,
  44986. l = {
  44987. a: new n.Vector3,
  44988. b: new n.Vector3,
  44989. c: new n.Vector3
  44990. },
  44991. c.push(s),
  44992. h.push(l)
  44993. }
  44994. var u = this.morphNormals[e];
  44995. a.vertices = this.morphTargets[e].vertices,
  44996. a.computeFaceNormals(),
  44997. a.computeVertexNormals();
  44998. var s, l;
  44999. for (i = 0,
  45000. r = this.faces.length; i < r; i++)
  45001. o = this.faces[i],
  45002. s = u.faceNormals[i],
  45003. l = u.vertexNormals[i],
  45004. s.copy(o.normal),
  45005. l.a.copy(o.vertexNormals[0]),
  45006. l.b.copy(o.vertexNormals[1]),
  45007. l.c.copy(o.vertexNormals[2])
  45008. }
  45009. for (i = 0,
  45010. r = this.faces.length; i < r; i++)
  45011. o = this.faces[i],
  45012. o.normal = o.__originalFaceNormal,
  45013. o.vertexNormals = o.__originalVertexNormals
  45014. },
  45015. computeTangents: function() {
  45016. console.warn("THREE.Geometry: .computeTangents() has been removed.")
  45017. },
  45018. computeLineDistances: function() {
  45019. for (var e = 0, t = this.vertices, i = 0, n = t.length; i < n; i++)
  45020. i > 0 && (e += t[i].distanceTo(t[i - 1])),
  45021. this.lineDistances[i] = e
  45022. },
  45023. computeBoundingBox: function() {
  45024. null === this.boundingBox && (this.boundingBox = new n.Box3),
  45025. this.boundingBox.setFromPoints(this.vertices)
  45026. },
  45027. computeBoundingSphere: function() {
  45028. null === this.boundingSphere && (this.boundingSphere = new n.Sphere),
  45029. this.boundingSphere.setFromPoints(this.vertices)
  45030. },
  45031. merge: function(e, t, i) {
  45032. if (e instanceof n.Geometry == !1)
  45033. return void console.error("THREE.Geometry.merge(): geometry not an instance of THREE.Geometry.", e);
  45034. 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];
  45035. void 0 === i && (i = 0),
  45036. void 0 !== t && (r = (new n.Matrix3).getNormalMatrix(t));
  45037. for (var d = 0, p = s.length; d < p; d++) {
  45038. var f = s[d]
  45039. , g = f.clone();
  45040. void 0 !== t && g.applyMatrix4(t),
  45041. a.push(g)
  45042. }
  45043. for (d = 0,
  45044. p = c.length; d < p; d++) {
  45045. var m, v, A, y = c[d], C = y.vertexNormals, I = y.vertexColors;
  45046. m = new n.Face3(y.a + o,y.b + o,y.c + o),
  45047. m.normal.copy(y.normal),
  45048. void 0 !== r && m.normal.applyMatrix3(r).normalize();
  45049. for (var E = 0, b = C.length; E < b; E++)
  45050. v = C[E].clone(),
  45051. void 0 !== r && v.applyMatrix3(r).normalize(),
  45052. m.vertexNormals.push(v);
  45053. m.color.copy(y.color);
  45054. for (var E = 0, b = I.length; E < b; E++)
  45055. A = I[E],
  45056. m.vertexColors.push(A.clone());
  45057. m.materialIndex = y.materialIndex + i,
  45058. l.push(m)
  45059. }
  45060. for (d = 0,
  45061. p = u.length; d < p; d++) {
  45062. var w = u[d]
  45063. , _ = [];
  45064. if (void 0 !== w) {
  45065. for (var E = 0, b = w.length; E < b; E++)
  45066. _.push(w[E].clone());
  45067. h.push(_)
  45068. }
  45069. }
  45070. },
  45071. mergeMesh: function(e) {
  45072. return e instanceof n.Mesh == !1 ? void console.error("THREE.Geometry.mergeMesh(): mesh not an instance of THREE.Mesh.", e) : (e.matrixAutoUpdate && e.updateMatrix(),
  45073. void this.merge(e.geometry, e.matrix))
  45074. },
  45075. mergeVertices: function() {
  45076. var e, t, i, n, r, o, a, s, l = {}, c = [], h = [], u = 4, d = Math.pow(10, u);
  45077. for (i = 0,
  45078. n = this.vertices.length; i < n; i++)
  45079. e = this.vertices[i],
  45080. t = Math.round(e.x * d) + "_" + Math.round(e.y * d) + "_" + Math.round(e.z * d),
  45081. void 0 === l[t] ? (l[t] = i,
  45082. c.push(this.vertices[i]),
  45083. h[i] = c.length - 1) : h[i] = h[l[t]];
  45084. var p = [];
  45085. for (i = 0,
  45086. n = this.faces.length; i < n; i++) {
  45087. r = this.faces[i],
  45088. r.a = h[r.a],
  45089. r.b = h[r.b],
  45090. r.c = h[r.c],
  45091. o = [r.a, r.b, r.c];
  45092. for (var f = -1, g = 0; g < 3; g++)
  45093. if (o[g] === o[(g + 1) % 3]) {
  45094. f = g,
  45095. p.push(i);
  45096. break
  45097. }
  45098. }
  45099. for (i = p.length - 1; i >= 0; i--) {
  45100. var m = p[i];
  45101. for (this.faces.splice(m, 1),
  45102. a = 0,
  45103. s = this.faceVertexUvs.length; a < s; a++)
  45104. this.faceVertexUvs[a].splice(m, 1)
  45105. }
  45106. var v = this.vertices.length - c.length;
  45107. return this.vertices = c,
  45108. v
  45109. },
  45110. sortFacesByMaterialIndex: function() {
  45111. function e(e, t) {
  45112. return e.materialIndex - t.materialIndex
  45113. }
  45114. for (var t = this.faces, i = t.length, n = 0; n < i; n++)
  45115. t[n]._id = n;
  45116. t.sort(e);
  45117. var r, o, a = this.faceVertexUvs[0], s = this.faceVertexUvs[1];
  45118. a && a.length === i && (r = []),
  45119. s && s.length === i && (o = []);
  45120. for (var n = 0; n < i; n++) {
  45121. var l = t[n]._id;
  45122. r && r.push(a[l]),
  45123. o && o.push(s[l])
  45124. }
  45125. r && (this.faceVertexUvs[0] = r),
  45126. o && (this.faceVertexUvs[1] = o)
  45127. },
  45128. toJSON: function() {
  45129. function e(e, t, i) {
  45130. return i ? e | 1 << t : e & ~(1 << t)
  45131. }
  45132. function t(e) {
  45133. var t = e.x.toString() + e.y.toString() + e.z.toString();
  45134. return void 0 !== d[t] ? d[t] : (d[t] = u.length / 3,
  45135. u.push(e.x, e.y, e.z),
  45136. d[t])
  45137. }
  45138. function i(e) {
  45139. var t = e.r.toString() + e.g.toString() + e.b.toString();
  45140. return void 0 !== f[t] ? f[t] : (f[t] = p.length,
  45141. p.push(e.getHex()),
  45142. f[t])
  45143. }
  45144. function n(e) {
  45145. var t = e.x.toString() + e.y.toString();
  45146. return void 0 !== m[t] ? m[t] : (m[t] = g.length / 2,
  45147. g.push(e.x, e.y),
  45148. m[t])
  45149. }
  45150. var r = {
  45151. metadata: {
  45152. version: 4.4,
  45153. type: "Geometry",
  45154. generator: "Geometry.toJSON"
  45155. }
  45156. };
  45157. if (r.uuid = this.uuid,
  45158. r.type = this.type,
  45159. "" !== this.name && (r.name = this.name),
  45160. void 0 !== this.parameters) {
  45161. var o = this.parameters;
  45162. for (var a in o)
  45163. void 0 !== o[a] && (r[a] = o[a]);
  45164. return r
  45165. }
  45166. for (var s = [], l = 0; l < this.vertices.length; l++) {
  45167. var c = this.vertices[l];
  45168. s.push(c.x, c.y, c.z)
  45169. }
  45170. for (var h = [], u = [], d = {}, p = [], f = {}, g = [], m = {}, l = 0; l < this.faces.length; l++) {
  45171. var v = this.faces[l]
  45172. , A = !0
  45173. , y = !1
  45174. , C = void 0 !== this.faceVertexUvs[0][l]
  45175. , I = v.normal.length() > 0
  45176. , E = v.vertexNormals.length > 0
  45177. , b = 1 !== v.color.r || 1 !== v.color.g || 1 !== v.color.b
  45178. , w = v.vertexColors.length > 0
  45179. , _ = 0;
  45180. if (_ = e(_, 0, 0),
  45181. _ = e(_, 1, A),
  45182. _ = e(_, 2, y),
  45183. _ = e(_, 3, C),
  45184. _ = e(_, 4, I),
  45185. _ = e(_, 5, E),
  45186. _ = e(_, 6, b),
  45187. _ = e(_, 7, w),
  45188. h.push(_),
  45189. h.push(v.a, v.b, v.c),
  45190. h.push(v.materialIndex),
  45191. C) {
  45192. var T = this.faceVertexUvs[0][l];
  45193. h.push(n(T[0]), n(T[1]), n(T[2]))
  45194. }
  45195. if (I && h.push(t(v.normal)),
  45196. E) {
  45197. var x = v.vertexNormals;
  45198. h.push(t(x[0]), t(x[1]), t(x[2]))
  45199. }
  45200. if (b && h.push(i(v.color)),
  45201. w) {
  45202. var S = v.vertexColors;
  45203. h.push(i(S[0]), i(S[1]), i(S[2]))
  45204. }
  45205. }
  45206. return r.data = {},
  45207. r.data.vertices = s,
  45208. r.data.normals = u,
  45209. p.length > 0 && (r.data.colors = p),
  45210. g.length > 0 && (r.data.uvs = [g]),
  45211. r.data.faces = h,
  45212. r
  45213. },
  45214. clone: function() {
  45215. return (new n.Geometry).copy(this)
  45216. },
  45217. copy: function(e) {
  45218. this.vertices = [],
  45219. this.faces = [],
  45220. this.faceVertexUvs = [[]];
  45221. for (var t = e.vertices, i = 0, n = t.length; i < n; i++)
  45222. this.vertices.push(t[i].clone());
  45223. for (var r = e.faces, i = 0, n = r.length; i < n; i++)
  45224. this.faces.push(r[i].clone());
  45225. for (var i = 0, n = e.faceVertexUvs.length; i < n; i++) {
  45226. var o = e.faceVertexUvs[i];
  45227. void 0 === this.faceVertexUvs[i] && (this.faceVertexUvs[i] = []);
  45228. for (var a = 0, s = o.length; a < s; a++) {
  45229. for (var l = o[a], c = [], h = 0, u = l.length; h < u; h++) {
  45230. var d = l[h];
  45231. c.push(d.clone())
  45232. }
  45233. this.faceVertexUvs[i].push(c)
  45234. }
  45235. }
  45236. return this
  45237. },
  45238. dispose: function() {
  45239. this.dispatchEvent({
  45240. type: "dispose"
  45241. })
  45242. }
  45243. },
  45244. n.EventDispatcher.prototype.apply(n.Geometry.prototype),
  45245. n.GeometryIdCount = 0,
  45246. n.DirectGeometry = function() {
  45247. Object.defineProperty(this, "id", {
  45248. value: n.GeometryIdCount++
  45249. }),
  45250. this.uuid = n.Math.generateUUID(),
  45251. this.name = "",
  45252. this.type = "DirectGeometry",
  45253. this.indices = [],
  45254. this.vertices = [],
  45255. this.normals = [],
  45256. this.colors = [],
  45257. this.uvs = [],
  45258. this.uvs2 = [],
  45259. this.groups = [],
  45260. this.morphTargets = {},
  45261. this.skinWeights = [],
  45262. this.skinIndices = [],
  45263. this.boundingBox = null,
  45264. this.boundingSphere = null,
  45265. this.verticesNeedUpdate = !1,
  45266. this.normalsNeedUpdate = !1,
  45267. this.colorsNeedUpdate = !1,
  45268. this.uvsNeedUpdate = !1,
  45269. this.groupsNeedUpdate = !1
  45270. }
  45271. ,
  45272. n.DirectGeometry.prototype = {
  45273. constructor: n.DirectGeometry,
  45274. computeBoundingBox: n.Geometry.prototype.computeBoundingBox,
  45275. computeBoundingSphere: n.Geometry.prototype.computeBoundingSphere,
  45276. computeFaceNormals: function() {
  45277. console.warn("THREE.DirectGeometry: computeFaceNormals() is not a method of this type of geometry.")
  45278. },
  45279. computeVertexNormals: function() {
  45280. console.warn("THREE.DirectGeometry: computeVertexNormals() is not a method of this type of geometry.")
  45281. },
  45282. computeGroups: function(e) {
  45283. for (var t, i, n = [], r = e.faces, o = 0; o < r.length; o++) {
  45284. var a = r[o];
  45285. a.materialIndex !== i && (i = a.materialIndex,
  45286. void 0 !== t && (t.count = 3 * o - t.start,
  45287. n.push(t)),
  45288. t = {
  45289. start: 3 * o,
  45290. materialIndex: i
  45291. })
  45292. }
  45293. void 0 !== t && (t.count = 3 * o - t.start,
  45294. n.push(t)),
  45295. this.groups = n
  45296. },
  45297. fromGeometry: function(e) {
  45298. 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;
  45299. if (c > 0) {
  45300. t = [];
  45301. for (var h = 0; h < c; h++)
  45302. t[h] = [];
  45303. this.morphTargets.position = t
  45304. }
  45305. var u, d = e.morphNormals, p = d.length;
  45306. if (p > 0) {
  45307. u = [];
  45308. for (var h = 0; h < p; h++)
  45309. u[h] = [];
  45310. this.morphTargets.normal = u
  45311. }
  45312. for (var f = e.skinIndices, g = e.skinWeights, m = f.length === r.length, v = g.length === r.length, h = 0; h < i.length; h++) {
  45313. var A = i[h];
  45314. this.vertices.push(r[A.a], r[A.b], r[A.c]);
  45315. var y = A.vertexNormals;
  45316. if (3 === y.length)
  45317. this.normals.push(y[0], y[1], y[2]);
  45318. else {
  45319. var C = A.normal;
  45320. this.normals.push(C, C, C)
  45321. }
  45322. var I = A.vertexColors;
  45323. if (3 === I.length)
  45324. this.colors.push(I[0], I[1], I[2]);
  45325. else {
  45326. var E = A.color;
  45327. this.colors.push(E, E, E)
  45328. }
  45329. if (a === !0) {
  45330. var b = o[0][h];
  45331. void 0 !== b ? this.uvs.push(b[0], b[1], b[2]) : (console.warn("THREE.DirectGeometry.fromGeometry(): Undefined vertexUv ", h),
  45332. this.uvs.push(new n.Vector2, new n.Vector2, new n.Vector2))
  45333. }
  45334. if (s === !0) {
  45335. var b = o[1][h];
  45336. void 0 !== b ? this.uvs2.push(b[0], b[1], b[2]) : (console.warn("THREE.DirectGeometry.fromGeometry(): Undefined vertexUv2 ", h),
  45337. this.uvs2.push(new n.Vector2, new n.Vector2, new n.Vector2))
  45338. }
  45339. for (var w = 0; w < c; w++) {
  45340. var _ = l[w].vertices;
  45341. t[w].push(_[A.a], _[A.b], _[A.c])
  45342. }
  45343. for (var w = 0; w < p; w++) {
  45344. var T = d[w].vertexNormals[h];
  45345. u[w].push(T.a, T.b, T.c)
  45346. }
  45347. m && this.skinIndices.push(f[A.a], f[A.b], f[A.c]),
  45348. v && this.skinWeights.push(g[A.a], g[A.b], g[A.c])
  45349. }
  45350. return this.computeGroups(e),
  45351. this.verticesNeedUpdate = e.verticesNeedUpdate,
  45352. this.normalsNeedUpdate = e.normalsNeedUpdate,
  45353. this.colorsNeedUpdate = e.colorsNeedUpdate,
  45354. this.uvsNeedUpdate = e.uvsNeedUpdate,
  45355. this.groupsNeedUpdate = e.groupsNeedUpdate,
  45356. this
  45357. },
  45358. dispose: function() {
  45359. this.dispatchEvent({
  45360. type: "dispose"
  45361. })
  45362. }
  45363. },
  45364. n.EventDispatcher.prototype.apply(n.DirectGeometry.prototype),
  45365. n.BufferGeometry = function() {
  45366. Object.defineProperty(this, "id", {
  45367. value: n.GeometryIdCount++
  45368. }),
  45369. this.uuid = n.Math.generateUUID(),
  45370. this.name = "",
  45371. this.type = "BufferGeometry",
  45372. this.index = null,
  45373. this.attributes = {},
  45374. this.morphAttributes = {},
  45375. this.groups = [],
  45376. this.boundingBox = null,
  45377. this.boundingSphere = null,
  45378. this.drawRange = {
  45379. start: 0,
  45380. count: 1 / 0
  45381. }
  45382. }
  45383. ,
  45384. n.BufferGeometry.prototype = {
  45385. constructor: n.BufferGeometry,
  45386. getIndex: function() {
  45387. return this.index
  45388. },
  45389. setIndex: function(e) {
  45390. this.index = e
  45391. },
  45392. addAttribute: function(e, t) {
  45393. return t instanceof n.BufferAttribute == !1 && t instanceof n.InterleavedBufferAttribute == !1 ? (console.warn("THREE.BufferGeometry: .addAttribute() now expects ( name, attribute )."),
  45394. void this.addAttribute(e, new n.BufferAttribute(arguments[1],arguments[2]))) : "index" === e ? (console.warn("THREE.BufferGeometry.addAttribute: Use .setIndex() for index attribute."),
  45395. void this.setIndex(t)) : (this.attributes[e] = t,
  45396. this)
  45397. },
  45398. getAttribute: function(e) {
  45399. return this.attributes[e]
  45400. },
  45401. removeAttribute: function(e) {
  45402. return delete this.attributes[e],
  45403. this
  45404. },
  45405. addGroup: function(e, t, i) {
  45406. this.groups.push({
  45407. start: e,
  45408. count: t,
  45409. materialIndex: void 0 !== i ? i : 0
  45410. })
  45411. },
  45412. clearGroups: function() {
  45413. this.groups = []
  45414. },
  45415. setDrawRange: function(e, t) {
  45416. this.drawRange.start = e,
  45417. this.drawRange.count = t
  45418. },
  45419. applyMatrix: function(e) {
  45420. var t = this.attributes.position;
  45421. void 0 !== t && (e.applyToVector3Array(t.array),
  45422. t.needsUpdate = !0);
  45423. var i = this.attributes.normal;
  45424. if (void 0 !== i) {
  45425. var r = (new n.Matrix3).getNormalMatrix(e);
  45426. r.applyToVector3Array(i.array),
  45427. i.needsUpdate = !0
  45428. }
  45429. return null !== this.boundingBox && this.computeBoundingBox(),
  45430. null !== this.boundingSphere && this.computeBoundingSphere(),
  45431. this
  45432. },
  45433. rotateX: function() {
  45434. var e;
  45435. return function(t) {
  45436. return void 0 === e && (e = new n.Matrix4),
  45437. e.makeRotationX(t),
  45438. this.applyMatrix(e),
  45439. this
  45440. }
  45441. }(),
  45442. rotateY: function() {
  45443. var e;
  45444. return function(t) {
  45445. return void 0 === e && (e = new n.Matrix4),
  45446. e.makeRotationY(t),
  45447. this.applyMatrix(e),
  45448. this
  45449. }
  45450. }(),
  45451. rotateZ: function() {
  45452. var e;
  45453. return function(t) {
  45454. return void 0 === e && (e = new n.Matrix4),
  45455. e.makeRotationZ(t),
  45456. this.applyMatrix(e),
  45457. this
  45458. }
  45459. }(),
  45460. translate: function() {
  45461. var e;
  45462. return function(t, i, r) {
  45463. return void 0 === e && (e = new n.Matrix4),
  45464. e.makeTranslation(t, i, r),
  45465. this.applyMatrix(e),
  45466. this
  45467. }
  45468. }(),
  45469. scale: function() {
  45470. var e;
  45471. return function(t, i, r) {
  45472. return void 0 === e && (e = new n.Matrix4),
  45473. e.makeScale(t, i, r),
  45474. this.applyMatrix(e),
  45475. this
  45476. }
  45477. }(),
  45478. lookAt: function() {
  45479. var e;
  45480. return function(t) {
  45481. void 0 === e && (e = new n.Object3D),
  45482. e.lookAt(t),
  45483. e.updateMatrix(),
  45484. this.applyMatrix(e.matrix)
  45485. }
  45486. }(),
  45487. center: function() {
  45488. this.computeBoundingBox();
  45489. var e = this.boundingBox.center().negate();
  45490. return this.translate(e.x, e.y, e.z),
  45491. e
  45492. },
  45493. setFromObject: function(e) {
  45494. var t = e.geometry;
  45495. if (e instanceof n.Points || e instanceof n.Line) {
  45496. var i = new n.Float32Attribute(3 * t.vertices.length,3)
  45497. , r = new n.Float32Attribute(3 * t.colors.length,3);
  45498. if (this.addAttribute("position", i.copyVector3sArray(t.vertices)),
  45499. this.addAttribute("color", r.copyColorsArray(t.colors)),
  45500. t.lineDistances && t.lineDistances.length === t.vertices.length) {
  45501. var o = new n.Float32Attribute(t.lineDistances.length,1);
  45502. this.addAttribute("lineDistance", o.copyArray(t.lineDistances))
  45503. }
  45504. null !== t.boundingSphere && (this.boundingSphere = t.boundingSphere.clone()),
  45505. null !== t.boundingBox && (this.boundingBox = t.boundingBox.clone())
  45506. } else
  45507. e instanceof n.Mesh && t instanceof n.Geometry && this.fromGeometry(t);
  45508. return this
  45509. },
  45510. updateFromObject: function(e) {
  45511. var t = e.geometry;
  45512. if (e instanceof n.Mesh) {
  45513. var i = t.__directGeometry;
  45514. if (void 0 === i)
  45515. return this.fromGeometry(t);
  45516. i.verticesNeedUpdate = t.verticesNeedUpdate,
  45517. i.normalsNeedUpdate = t.normalsNeedUpdate,
  45518. i.colorsNeedUpdate = t.colorsNeedUpdate,
  45519. i.uvsNeedUpdate = t.uvsNeedUpdate,
  45520. i.groupsNeedUpdate = t.groupsNeedUpdate,
  45521. t.verticesNeedUpdate = !1,
  45522. t.normalsNeedUpdate = !1,
  45523. t.colorsNeedUpdate = !1,
  45524. t.uvsNeedUpdate = !1,
  45525. t.groupsNeedUpdate = !1,
  45526. t = i
  45527. }
  45528. if (t.verticesNeedUpdate === !0) {
  45529. var r = this.attributes.position;
  45530. void 0 !== r && (r.copyVector3sArray(t.vertices),
  45531. r.needsUpdate = !0),
  45532. t.verticesNeedUpdate = !1
  45533. }
  45534. if (t.normalsNeedUpdate === !0) {
  45535. var r = this.attributes.normal;
  45536. void 0 !== r && (r.copyVector3sArray(t.normals),
  45537. r.needsUpdate = !0),
  45538. t.normalsNeedUpdate = !1
  45539. }
  45540. if (t.colorsNeedUpdate === !0) {
  45541. var r = this.attributes.color;
  45542. void 0 !== r && (r.copyColorsArray(t.colors),
  45543. r.needsUpdate = !0),
  45544. t.colorsNeedUpdate = !1
  45545. }
  45546. if (t.uvsNeedUpdate) {
  45547. var r = this.attributes.uv;
  45548. void 0 !== r && (r.copyVector2sArray(t.uvs),
  45549. r.needsUpdate = !0),
  45550. t.uvsNeedUpdate = !1
  45551. }
  45552. if (t.lineDistancesNeedUpdate) {
  45553. var r = this.attributes.lineDistance;
  45554. void 0 !== r && (r.copyArray(t.lineDistances),
  45555. r.needsUpdate = !0),
  45556. t.lineDistancesNeedUpdate = !1
  45557. }
  45558. return t.groupsNeedUpdate && (t.computeGroups(e.geometry),
  45559. this.groups = t.groups,
  45560. t.groupsNeedUpdate = !1),
  45561. this
  45562. },
  45563. fromGeometry: function(e) {
  45564. return e.__directGeometry = (new n.DirectGeometry).fromGeometry(e),
  45565. this.fromDirectGeometry(e.__directGeometry)
  45566. },
  45567. fromDirectGeometry: function(e) {
  45568. var t = new Float32Array(3 * e.vertices.length);
  45569. if (this.addAttribute("position", new n.BufferAttribute(t,3).copyVector3sArray(e.vertices)),
  45570. e.normals.length > 0) {
  45571. var i = new Float32Array(3 * e.normals.length);
  45572. this.addAttribute("normal", new n.BufferAttribute(i,3).copyVector3sArray(e.normals))
  45573. }
  45574. if (e.colors.length > 0) {
  45575. var r = new Float32Array(3 * e.colors.length);
  45576. this.addAttribute("color", new n.BufferAttribute(r,3).copyColorsArray(e.colors))
  45577. }
  45578. if (e.uvs.length > 0) {
  45579. var o = new Float32Array(2 * e.uvs.length);
  45580. this.addAttribute("uv", new n.BufferAttribute(o,2).copyVector2sArray(e.uvs))
  45581. }
  45582. if (e.uvs2.length > 0) {
  45583. var a = new Float32Array(2 * e.uvs2.length);
  45584. this.addAttribute("uv2", new n.BufferAttribute(a,2).copyVector2sArray(e.uvs2))
  45585. }
  45586. if (e.indices.length > 0) {
  45587. var s = e.vertices.length > 65535 ? Uint32Array : Uint16Array
  45588. , l = new s(3 * e.indices.length);
  45589. this.setIndex(new n.BufferAttribute(l,1).copyIndicesArray(e.indices))
  45590. }
  45591. this.groups = e.groups;
  45592. for (var c in e.morphTargets) {
  45593. for (var h = [], u = e.morphTargets[c], d = 0, p = u.length; d < p; d++) {
  45594. var f = u[d]
  45595. , g = new n.Float32Attribute(3 * f.length,3);
  45596. h.push(g.copyVector3sArray(f))
  45597. }
  45598. this.morphAttributes[c] = h
  45599. }
  45600. if (e.skinIndices.length > 0) {
  45601. var m = new n.Float32Attribute(4 * e.skinIndices.length,4);
  45602. this.addAttribute("skinIndex", m.copyVector4sArray(e.skinIndices))
  45603. }
  45604. if (e.skinWeights.length > 0) {
  45605. var v = new n.Float32Attribute(4 * e.skinWeights.length,4);
  45606. this.addAttribute("skinWeight", v.copyVector4sArray(e.skinWeights))
  45607. }
  45608. return null !== e.boundingSphere && (this.boundingSphere = e.boundingSphere.clone()),
  45609. null !== e.boundingBox && (this.boundingBox = e.boundingBox.clone()),
  45610. this
  45611. },
  45612. computeBoundingBox: function() {
  45613. new n.Vector3;
  45614. return function() {
  45615. null === this.boundingBox && (this.boundingBox = new n.Box3);
  45616. var e = this.attributes.position.array;
  45617. e && this.boundingBox.setFromArray(e),
  45618. void 0 !== e && 0 !== e.length || (this.boundingBox.min.set(0, 0, 0),
  45619. this.boundingBox.max.set(0, 0, 0)),
  45620. (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)
  45621. }
  45622. }(),
  45623. computeBoundingSphere: function() {
  45624. var e = new n.Box3
  45625. , t = new n.Vector3;
  45626. return function() {
  45627. null === this.boundingSphere && (this.boundingSphere = new n.Sphere);
  45628. var i = this.attributes.position.array;
  45629. if (i) {
  45630. var r = this.boundingSphere.center;
  45631. e.setFromArray(i),
  45632. e.center(r);
  45633. for (var o = 0, a = 0, s = i.length; a < s; a += 3)
  45634. t.fromArray(i, a),
  45635. o = Math.max(o, r.distanceToSquared(t));
  45636. this.boundingSphere.radius = Math.sqrt(o),
  45637. isNaN(this.boundingSphere.radius) && console.error('THREE.BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.', this)
  45638. }
  45639. }
  45640. }(),
  45641. computeFaceNormals: function() {},
  45642. computeVertexNormals: function() {
  45643. var e = this.index
  45644. , t = this.attributes
  45645. , i = this.groups;
  45646. if (t.position) {
  45647. var r = t.position.array;
  45648. if (void 0 === t.normal)
  45649. this.addAttribute("normal", new n.BufferAttribute(new Float32Array(r.length),3));
  45650. else
  45651. for (var o = t.normal.array, a = 0, s = o.length; a < s; a++)
  45652. o[a] = 0;
  45653. 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;
  45654. if (e) {
  45655. var v = e.array;
  45656. 0 === i.length && this.addGroup(0, v.length);
  45657. for (var A = 0, y = i.length; A < y; ++A)
  45658. for (var C = i[A], I = C.start, E = C.count, a = I, s = I + E; a < s; a += 3)
  45659. l = 3 * v[a + 0],
  45660. c = 3 * v[a + 1],
  45661. h = 3 * v[a + 2],
  45662. d.fromArray(r, l),
  45663. p.fromArray(r, c),
  45664. f.fromArray(r, h),
  45665. g.subVectors(f, p),
  45666. m.subVectors(d, p),
  45667. g.cross(m),
  45668. u[l] += g.x,
  45669. u[l + 1] += g.y,
  45670. u[l + 2] += g.z,
  45671. u[c] += g.x,
  45672. u[c + 1] += g.y,
  45673. u[c + 2] += g.z,
  45674. u[h] += g.x,
  45675. u[h + 1] += g.y,
  45676. u[h + 2] += g.z
  45677. } else
  45678. for (var a = 0, s = r.length; a < s; a += 9)
  45679. d.fromArray(r, a),
  45680. p.fromArray(r, a + 3),
  45681. f.fromArray(r, a + 6),
  45682. g.subVectors(f, p),
  45683. m.subVectors(d, p),
  45684. g.cross(m),
  45685. u[a] = g.x,
  45686. u[a + 1] = g.y,
  45687. u[a + 2] = g.z,
  45688. u[a + 3] = g.x,
  45689. u[a + 4] = g.y,
  45690. u[a + 5] = g.z,
  45691. u[a + 6] = g.x,
  45692. u[a + 7] = g.y,
  45693. u[a + 8] = g.z;
  45694. this.normalizeNormals(),
  45695. t.normal.needsUpdate = !0
  45696. }
  45697. },
  45698. merge: function(e, t) {
  45699. if (e instanceof n.BufferGeometry == !1)
  45700. return void console.error("THREE.BufferGeometry.merge(): geometry not an instance of THREE.BufferGeometry.", e);
  45701. void 0 === t && (t = 0);
  45702. var i = this.attributes;
  45703. for (var r in i)
  45704. if (void 0 !== e.attributes[r])
  45705. 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++,
  45706. u++)
  45707. a[u] = l[h];
  45708. return this
  45709. },
  45710. normalizeNormals: function() {
  45711. for (var e, t, i, n, r = this.attributes.normal.array, o = 0, a = r.length; o < a; o += 3)
  45712. e = r[o],
  45713. t = r[o + 1],
  45714. i = r[o + 2],
  45715. n = 1 / Math.sqrt(e * e + t * t + i * i),
  45716. r[o] *= n,
  45717. r[o + 1] *= n,
  45718. r[o + 2] *= n
  45719. },
  45720. toNonIndexed: function() {
  45721. if (null === this.index)
  45722. return console.warn("THREE.BufferGeometry.toNonIndexed(): Geometry is already non-indexed."),
  45723. this;
  45724. var e = new n.BufferGeometry
  45725. , t = this.index.array
  45726. , i = this.attributes;
  45727. for (var r in i) {
  45728. 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++) {
  45729. c = t[u] * s;
  45730. for (var p = 0; p < s; p++)
  45731. l[h++] = a[c++]
  45732. }
  45733. e.addAttribute(r, new n.BufferAttribute(l,s))
  45734. }
  45735. return e
  45736. },
  45737. toJSON: function() {
  45738. var e = {
  45739. metadata: {
  45740. version: 4.4,
  45741. type: "BufferGeometry",
  45742. generator: "BufferGeometry.toJSON"
  45743. }
  45744. };
  45745. if (e.uuid = this.uuid,
  45746. e.type = this.type,
  45747. "" !== this.name && (e.name = this.name),
  45748. void 0 !== this.parameters) {
  45749. var t = this.parameters;
  45750. for (var i in t)
  45751. void 0 !== t[i] && (e[i] = t[i]);
  45752. return e
  45753. }
  45754. e.data = {
  45755. attributes: {}
  45756. };
  45757. var n = this.index;
  45758. if (null !== n) {
  45759. var r = Array.prototype.slice.call(n.array);
  45760. e.data.index = {
  45761. type: n.array.constructor.name,
  45762. array: r
  45763. }
  45764. }
  45765. var o = this.attributes;
  45766. for (var i in o) {
  45767. var a = o[i]
  45768. , r = Array.prototype.slice.call(a.array);
  45769. e.data.attributes[i] = {
  45770. itemSize: a.itemSize,
  45771. type: a.array.constructor.name,
  45772. array: r
  45773. }
  45774. }
  45775. var s = this.groups;
  45776. s.length > 0 && (e.data.groups = JSON.parse(JSON.stringify(s)));
  45777. var l = this.boundingSphere;
  45778. return null !== l && (e.data.boundingSphere = {
  45779. center: l.center.toArray(),
  45780. radius: l.radius
  45781. }),
  45782. e
  45783. },
  45784. clone: function() {
  45785. return (new n.BufferGeometry).copy(this)
  45786. },
  45787. copy: function(e) {
  45788. var t = e.index;
  45789. null !== t && this.setIndex(t.clone());
  45790. var i = e.attributes;
  45791. for (var n in i) {
  45792. var r = i[n];
  45793. this.addAttribute(n, r.clone())
  45794. }
  45795. for (var o = e.groups, a = 0, s = o.length; a < s; a++) {
  45796. var l = o[a];
  45797. this.addGroup(l.start, l.count)
  45798. }
  45799. return this
  45800. },
  45801. dispose: function() {
  45802. this.dispatchEvent({
  45803. type: "dispose"
  45804. })
  45805. }
  45806. },
  45807. n.EventDispatcher.prototype.apply(n.BufferGeometry.prototype),
  45808. n.BufferGeometry.MaxIndex = 65535,
  45809. n.InstancedBufferGeometry = function() {
  45810. n.BufferGeometry.call(this),
  45811. this.type = "InstancedBufferGeometry",
  45812. this.maxInstancedCount = void 0
  45813. }
  45814. ,
  45815. n.InstancedBufferGeometry.prototype = Object.create(n.BufferGeometry.prototype),
  45816. n.InstancedBufferGeometry.prototype.constructor = n.InstancedBufferGeometry,
  45817. n.InstancedBufferGeometry.prototype.addGroup = function(e, t, i) {
  45818. this.groups.push({
  45819. start: e,
  45820. count: t,
  45821. instances: i
  45822. })
  45823. }
  45824. ,
  45825. n.InstancedBufferGeometry.prototype.copy = function(e) {
  45826. var t = e.index;
  45827. null !== t && this.setIndex(t.clone());
  45828. var i = e.attributes;
  45829. for (var n in i) {
  45830. var r = i[n];
  45831. this.addAttribute(n, r.clone())
  45832. }
  45833. for (var o = e.groups, a = 0, s = o.length; a < s; a++) {
  45834. var l = o[a];
  45835. this.addGroup(l.start, l.count, l.instances)
  45836. }
  45837. return this
  45838. }
  45839. ,
  45840. n.EventDispatcher.prototype.apply(n.InstancedBufferGeometry.prototype),
  45841. n.Uniform = function(e, t) {
  45842. this.type = e,
  45843. this.value = t,
  45844. this.dynamic = !1
  45845. }
  45846. ,
  45847. n.Uniform.prototype = {
  45848. constructor: n.Uniform,
  45849. onUpdate: function(e) {
  45850. return this.dynamic = !0,
  45851. this.onUpdateCallback = e,
  45852. this
  45853. }
  45854. },
  45855. n.AnimationClip = function(e, t, i) {
  45856. this.name = e || n.Math.generateUUID(),
  45857. this.tracks = i,
  45858. this.duration = void 0 !== t ? t : -1,
  45859. this.duration < 0 && this.resetDuration(),
  45860. this.trim(),
  45861. this.optimize()
  45862. }
  45863. ,
  45864. n.AnimationClip.prototype = {
  45865. constructor: n.AnimationClip,
  45866. resetDuration: function() {
  45867. for (var e = this.tracks, t = 0, i = 0, n = e.length; i !== n; ++i) {
  45868. var r = this.tracks[i];
  45869. t = Math.max(t, r.times[r.times.length - 1])
  45870. }
  45871. this.duration = t
  45872. },
  45873. trim: function() {
  45874. for (var e = 0; e < this.tracks.length; e++)
  45875. this.tracks[e].trim(0, this.duration);
  45876. return this
  45877. },
  45878. optimize: function() {
  45879. for (var e = 0; e < this.tracks.length; e++)
  45880. this.tracks[e].optimize();
  45881. return this
  45882. }
  45883. },
  45884. Object.assign(n.AnimationClip, {
  45885. parse: function(e) {
  45886. for (var t = [], i = e.tracks, r = 1 / (e.fps || 1), o = 0, a = i.length; o !== a; ++o)
  45887. t.push(n.KeyframeTrack.parse(i[o]).scale(r));
  45888. return new n.AnimationClip(e.name,e.duration,t)
  45889. },
  45890. toJSON: function(e) {
  45891. for (var t = [], i = e.tracks, r = {
  45892. name: e.name,
  45893. duration: e.duration,
  45894. tracks: t
  45895. }, o = 0, a = i.length; o !== a; ++o)
  45896. t.push(n.KeyframeTrack.toJSON(i[o]));
  45897. return r
  45898. },
  45899. CreateFromMorphTargetSequence: function(e, t, i) {
  45900. for (var r = t.length, o = [], a = 0; a < r; a++) {
  45901. var s = []
  45902. , l = [];
  45903. s.push((a + r - 1) % r, a, (a + 1) % r),
  45904. l.push(0, 1, 0);
  45905. var c = n.AnimationUtils.getKeyframeOrder(s);
  45906. s = n.AnimationUtils.sortedArray(s, 1, c),
  45907. l = n.AnimationUtils.sortedArray(l, 1, c),
  45908. 0 === s[0] && (s.push(r),
  45909. l.push(l[0])),
  45910. o.push(new n.NumberKeyframeTrack(".morphTargetInfluences[" + t[a].name + "]",s,l).scale(1 / i))
  45911. }
  45912. return new n.AnimationClip(e,-1,o)
  45913. },
  45914. findByName: function(e, t) {
  45915. for (var i = 0; i < e.length; i++)
  45916. if (e[i].name === t)
  45917. return e[i];
  45918. return null
  45919. },
  45920. CreateClipsFromMorphTargetSequences: function(e, t) {
  45921. for (var i = {}, r = /^([\w-]*?)([\d]+)$/, o = 0, a = e.length; o < a; o++) {
  45922. var s = e[o]
  45923. , l = s.name.match(r);
  45924. if (l && l.length > 1) {
  45925. var c = l[1]
  45926. , h = i[c];
  45927. h || (i[c] = h = []),
  45928. h.push(s)
  45929. }
  45930. }
  45931. var u = [];
  45932. for (var c in i)
  45933. u.push(n.AnimationClip.CreateFromMorphTargetSequence(c, i[c], t));
  45934. return u
  45935. },
  45936. parseAnimation: function(e, t, i) {
  45937. if (!e)
  45938. return console.error(" no animation in JSONLoader data"),
  45939. null;
  45940. for (var r = function(e, t, i, r, o) {
  45941. if (0 !== i.length) {
  45942. var a = []
  45943. , s = [];
  45944. n.AnimationUtils.flattenJSON(i, a, s, r),
  45945. 0 !== a.length && o.push(new e(t,a,s))
  45946. }
  45947. }, o = [], a = e.name || "default", s = e.length || -1, l = e.fps || 30, c = e.hierarchy || [], h = 0; h < c.length; h++) {
  45948. var u = c[h].keys;
  45949. if (u && 0 != u.length)
  45950. if (u[0].morphTargets) {
  45951. for (var d = {}, p = 0; p < u.length; p++)
  45952. if (u[p].morphTargets)
  45953. for (var f = 0; f < u[p].morphTargets.length; f++)
  45954. d[u[p].morphTargets[f]] = -1;
  45955. for (var g in d) {
  45956. for (var m = [], v = [], f = 0; f !== u[p].morphTargets.length; ++f) {
  45957. var A = u[p];
  45958. m.push(A.time),
  45959. v.push(A.morphTarget === g ? 1 : 0)
  45960. }
  45961. o.push(new n.NumberKeyframeTrack(".morphTargetInfluence[" + g + "]",m,v))
  45962. }
  45963. s = d.length * (l || 1)
  45964. } else {
  45965. var y = ".bones[" + t[h].name + "]";
  45966. r(n.VectorKeyframeTrack, y + ".position", u, "pos", o),
  45967. r(n.QuaternionKeyframeTrack, y + ".quaternion", u, "rot", o),
  45968. r(n.VectorKeyframeTrack, y + ".scale", u, "scl", o)
  45969. }
  45970. }
  45971. if (0 === o.length)
  45972. return null;
  45973. var C = new n.AnimationClip(a,s,o);
  45974. return C
  45975. }
  45976. }),
  45977. n.AnimationMixer = function(e) {
  45978. this._root = e,
  45979. this._initMemoryManager(),
  45980. this._accuIndex = 0,
  45981. this.time = 0,
  45982. this.timeScale = 1
  45983. }
  45984. ,
  45985. n.AnimationMixer.prototype = {
  45986. constructor: n.AnimationMixer,
  45987. clipAction: function(e, t) {
  45988. 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];
  45989. if (void 0 !== l) {
  45990. var c = l.actionByRoot[o];
  45991. if (void 0 !== c)
  45992. return c;
  45993. if (i = l.knownActions[0],
  45994. s = i._clip,
  45995. e !== a && e !== s)
  45996. throw new Error("Different clips with the same name detected!")
  45997. }
  45998. if (null === s)
  45999. return null;
  46000. var h = new n.AnimationMixer._Action(this,s,t);
  46001. return this._bindAction(h, i),
  46002. this._addInactiveAction(h, a, o),
  46003. h
  46004. },
  46005. existingAction: function(e, t) {
  46006. var i = t || this._root
  46007. , n = i.uuid
  46008. , r = "string" == typeof e ? e : e.name
  46009. , o = this._actionsByClip[r];
  46010. return void 0 !== o ? o.actionByRoot[n] || null : null
  46011. },
  46012. stopAllAction: function() {
  46013. var e = this._actions
  46014. , t = this._nActiveActions
  46015. , i = this._bindings
  46016. , n = this._nActiveBindings;
  46017. this._nActiveActions = 0,
  46018. this._nActiveBindings = 0;
  46019. for (var r = 0; r !== t; ++r)
  46020. e[r].reset();
  46021. for (var r = 0; r !== n; ++r)
  46022. i[r].useCount = 0;
  46023. return this
  46024. },
  46025. update: function(e) {
  46026. e *= this.timeScale;
  46027. 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) {
  46028. var s = t[a];
  46029. s.enabled && s._update(n, e, r, o)
  46030. }
  46031. for (var l = this._bindings, c = this._nActiveBindings, a = 0; a !== c; ++a)
  46032. l[a].apply(o);
  46033. return this
  46034. },
  46035. getRoot: function() {
  46036. return this._root
  46037. },
  46038. uncacheClip: function(e) {
  46039. var t = this._actions
  46040. , i = e.name
  46041. , n = this._actionsByClip
  46042. , r = n[i];
  46043. if (void 0 !== r) {
  46044. for (var o = r.knownActions, a = 0, s = o.length; a !== s; ++a) {
  46045. var l = o[a];
  46046. this._deactivateAction(l);
  46047. var c = l._cacheIndex
  46048. , h = t[t.length - 1];
  46049. l._cacheIndex = null,
  46050. l._byClipCacheIndex = null,
  46051. h._cacheIndex = c,
  46052. t[c] = h,
  46053. t.pop(),
  46054. this._removeInactiveBindingsForAction(l)
  46055. }
  46056. delete n[i]
  46057. }
  46058. },
  46059. uncacheRoot: function(e) {
  46060. var t = e.uuid
  46061. , i = this._actionsByClip;
  46062. for (var n in i) {
  46063. var r = i[n].actionByRoot
  46064. , o = r[t];
  46065. void 0 !== o && (this._deactivateAction(o),
  46066. this._removeInactiveAction(o))
  46067. }
  46068. var a = this._bindingsByRootAndName
  46069. , s = a[t];
  46070. if (void 0 !== s)
  46071. for (var l in s) {
  46072. var c = s[l];
  46073. c.restoreOriginalState(),
  46074. this._removeInactiveBinding(c)
  46075. }
  46076. },
  46077. uncacheAction: function(e, t) {
  46078. var i = this.existingAction(e, t);
  46079. null !== i && (this._deactivateAction(i),
  46080. this._removeInactiveAction(i))
  46081. }
  46082. },
  46083. n.EventDispatcher.prototype.apply(n.AnimationMixer.prototype),
  46084. n.AnimationMixer._Action = function(e, t, i) {
  46085. this._mixer = e,
  46086. this._clip = t,
  46087. this._localRoot = i || null;
  46088. for (var r = t.tracks, o = r.length, a = new Array(o), s = {
  46089. endingStart: n.ZeroCurvatureEnding,
  46090. endingEnd: n.ZeroCurvatureEnding
  46091. }, l = 0; l !== o; ++l) {
  46092. var c = r[l].createInterpolant(null);
  46093. a[l] = c,
  46094. c.settings = s
  46095. }
  46096. this._interpolantSettings = s,
  46097. this._interpolants = a,
  46098. this._propertyBindings = new Array(o),
  46099. this._cacheIndex = null,
  46100. this._byClipCacheIndex = null,
  46101. this._timeScaleInterpolant = null,
  46102. this._weightInterpolant = null,
  46103. this.loop = n.LoopRepeat,
  46104. this._loopCount = -1,
  46105. this._startTime = null,
  46106. this.time = 0,
  46107. this.timeScale = 1,
  46108. this._effectiveTimeScale = 1,
  46109. this.weight = 1,
  46110. this._effectiveWeight = 1,
  46111. this.repetitions = 1 / 0,
  46112. this.paused = !1,
  46113. this.enabled = !0,
  46114. this.clampWhenFinished = !1,
  46115. this.zeroSlopeAtStart = !0,
  46116. this.zeroSlopeAtEnd = !0
  46117. }
  46118. ,
  46119. n.AnimationMixer._Action.prototype = {
  46120. constructor: n.AnimationMixer._Action,
  46121. play: function() {
  46122. return this._mixer._activateAction(this),
  46123. this
  46124. },
  46125. stop: function() {
  46126. return this._mixer._deactivateAction(this),
  46127. this.reset()
  46128. },
  46129. reset: function() {
  46130. return this.paused = !1,
  46131. this.enabled = !0,
  46132. this.time = 0,
  46133. this._loopCount = -1,
  46134. this._startTime = null,
  46135. this.stopFading().stopWarping()
  46136. },
  46137. isRunning: function() {
  46138. this._startTime;
  46139. return this.enabled && !this.paused && 0 !== this.timeScale && null === this._startTime && this._mixer._isActiveAction(this)
  46140. },
  46141. isScheduled: function() {
  46142. return this._mixer._isActiveAction(this)
  46143. },
  46144. startAt: function(e) {
  46145. return this._startTime = e,
  46146. this
  46147. },
  46148. setLoop: function(e, t) {
  46149. return this.loop = e,
  46150. this.repetitions = t,
  46151. this
  46152. },
  46153. setEffectiveWeight: function(e) {
  46154. return this.weight = e,
  46155. this._effectiveWeight = this.enabled ? e : 0,
  46156. this.stopFading()
  46157. },
  46158. getEffectiveWeight: function() {
  46159. return this._effectiveWeight
  46160. },
  46161. fadeIn: function(e) {
  46162. return this._scheduleFading(e, 0, 1)
  46163. },
  46164. fadeOut: function(e) {
  46165. return this._scheduleFading(e, 1, 0)
  46166. },
  46167. crossFadeFrom: function(e, t, i) {
  46168. this._mixer;
  46169. if (e.fadeOut(t),
  46170. this.fadeIn(t),
  46171. i) {
  46172. var n = this._clip.duration
  46173. , r = e._clip.duration
  46174. , o = r / n
  46175. , a = n / r;
  46176. e.warp(1, o, t),
  46177. this.warp(a, 1, t)
  46178. }
  46179. return this
  46180. },
  46181. crossFadeTo: function(e, t, i) {
  46182. return e.crossFadeFrom(this, t, i)
  46183. },
  46184. stopFading: function() {
  46185. var e = this._weightInterpolant;
  46186. return null !== e && (this._weightInterpolant = null,
  46187. this._mixer._takeBackControlInterpolant(e)),
  46188. this
  46189. },
  46190. setEffectiveTimeScale: function(e) {
  46191. return this.timeScale = e,
  46192. this._effectiveTimeScale = this.paused ? 0 : e,
  46193. this.stopWarping()
  46194. },
  46195. getEffectiveTimeScale: function() {
  46196. return this._effectiveTimeScale
  46197. },
  46198. setDuration: function(e) {
  46199. return this.timeScale = this._clip.duration / e,
  46200. this.stopWarping()
  46201. },
  46202. syncWith: function(e) {
  46203. return this.time = e.time,
  46204. this.timeScale = e.timeScale,
  46205. this.stopWarping()
  46206. },
  46207. halt: function(e) {
  46208. return this.warp(this._currentTimeScale, 0, e)
  46209. },
  46210. warp: function(e, t, i) {
  46211. var n = this._mixer
  46212. , r = n.time
  46213. , o = this._timeScaleInterpolant
  46214. , a = this.timeScale;
  46215. null === o && (o = n._lendControlInterpolant(),
  46216. this._timeScaleInterpolant = o);
  46217. var s = o.parameterPositions
  46218. , l = o.sampleValues;
  46219. return s[0] = r,
  46220. s[1] = r + i,
  46221. l[0] = e / a,
  46222. l[1] = t / a,
  46223. this
  46224. },
  46225. stopWarping: function() {
  46226. var e = this._timeScaleInterpolant;
  46227. return null !== e && (this._timeScaleInterpolant = null,
  46228. this._mixer._takeBackControlInterpolant(e)),
  46229. this
  46230. },
  46231. getMixer: function() {
  46232. return this._mixer
  46233. },
  46234. getClip: function() {
  46235. return this._clip
  46236. },
  46237. getRoot: function() {
  46238. return this._localRoot || this._mixer._root
  46239. },
  46240. _update: function(e, t, i, n) {
  46241. var r = this._startTime;
  46242. if (null !== r) {
  46243. var o = (e - r) * i;
  46244. if (o < 0 || 0 === i)
  46245. return;
  46246. this._startTime = null,
  46247. t = i * o
  46248. }
  46249. t *= this._updateTimeScale(e);
  46250. var a = this._updateTime(t)
  46251. , s = this._updateWeight(e);
  46252. if (s > 0)
  46253. for (var l = this._interpolants, c = this._propertyBindings, h = 0, u = l.length; h !== u; ++h)
  46254. l[h].evaluate(a),
  46255. c[h].accumulate(n, s)
  46256. },
  46257. _updateWeight: function(e) {
  46258. var t = 0;
  46259. if (this.enabled) {
  46260. t = this.weight;
  46261. var i = this._weightInterpolant;
  46262. if (null !== i) {
  46263. var n = i.evaluate(e)[0];
  46264. t *= n,
  46265. e > i.parameterPositions[1] && (this.stopFading(),
  46266. 0 === n && (this.enabled = !1))
  46267. }
  46268. }
  46269. return this._effectiveWeight = t,
  46270. t
  46271. },
  46272. _updateTimeScale: function(e) {
  46273. var t = 0;
  46274. if (!this.paused) {
  46275. t = this.timeScale;
  46276. var i = this._timeScaleInterpolant;
  46277. if (null !== i) {
  46278. var n = i.evaluate(e)[0];
  46279. t *= n,
  46280. e > i.parameterPositions[1] && (this.stopWarping(),
  46281. 0 === t ? this.pause = !0 : this.timeScale = t)
  46282. }
  46283. }
  46284. return this._effectiveTimeScale = t,
  46285. t
  46286. },
  46287. _updateTime: function(e) {
  46288. var t = this.time + e;
  46289. if (0 === e)
  46290. return t;
  46291. var i = this._clip.duration
  46292. , r = this.loop
  46293. , o = this._loopCount
  46294. , a = !1;
  46295. switch (r) {
  46296. case n.LoopOnce:
  46297. if (o === -1 && (this.loopCount = 0,
  46298. this._setEndings(!0, !0, !1)),
  46299. t >= i)
  46300. t = i;
  46301. else {
  46302. if (!(t < 0))
  46303. break;
  46304. t = 0
  46305. }
  46306. this.clampWhenFinished ? this.pause = !0 : this.enabled = !1,
  46307. this._mixer.dispatchEvent({
  46308. type: "finished",
  46309. action: this,
  46310. direction: e < 0 ? -1 : 1
  46311. });
  46312. break;
  46313. case n.LoopPingPong:
  46314. a = !0;
  46315. case n.LoopRepeat:
  46316. if (o === -1 && (e > 0 ? (o = 0,
  46317. this._setEndings(!0, 0 === this.repetitions, a)) : this._setEndings(0 === this.repetitions, !0, a)),
  46318. t >= i || t < 0) {
  46319. var s = Math.floor(t / i);
  46320. t -= i * s,
  46321. o += Math.abs(s);
  46322. var l = this.repetitions - o;
  46323. if (l < 0) {
  46324. this.clampWhenFinished ? this.paused = !0 : this.enabled = !1,
  46325. t = e > 0 ? i : 0,
  46326. this._mixer.dispatchEvent({
  46327. type: "finished",
  46328. action: this,
  46329. direction: e > 0 ? 1 : -1
  46330. });
  46331. break
  46332. }
  46333. if (0 === l) {
  46334. var c = e < 0;
  46335. this._setEndings(c, !c, a)
  46336. } else
  46337. this._setEndings(!1, !1, a);
  46338. this._loopCount = o,
  46339. this._mixer.dispatchEvent({
  46340. type: "loop",
  46341. action: this,
  46342. loopDelta: s
  46343. })
  46344. }
  46345. if (r === n.LoopPingPong && 1 === (1 & o))
  46346. return this.time = t,
  46347. i - t
  46348. }
  46349. return this.time = t,
  46350. t
  46351. },
  46352. _setEndings: function(e, t, i) {
  46353. var r = this._interpolantSettings;
  46354. i ? (r.endingStart = n.ZeroSlopeEnding,
  46355. r.endingEnd = n.ZeroSlopeEnding) : (e ? r.endingStart = this.zeroSlopeAtStart ? n.ZeroSlopeEnding : n.ZeroCurvatureEnding : r.endingStart = n.WrapAroundEnding,
  46356. t ? r.endingEnd = this.zeroSlopeAtEnd ? n.ZeroSlopeEnding : n.ZeroCurvatureEnding : r.endingEnd = n.WrapAroundEnding)
  46357. },
  46358. _scheduleFading: function(e, t, i) {
  46359. var n = this._mixer
  46360. , r = n.time
  46361. , o = this._weightInterpolant;
  46362. null === o && (o = n._lendControlInterpolant(),
  46363. this._weightInterpolant = o);
  46364. var a = o.parameterPositions
  46365. , s = o.sampleValues;
  46366. return a[0] = r,
  46367. s[0] = t,
  46368. a[1] = r + e,
  46369. s[1] = i,
  46370. this
  46371. }
  46372. },
  46373. Object.assign(n.AnimationMixer.prototype, {
  46374. _bindAction: function(e, t) {
  46375. var i = e._localRoot || this._root
  46376. , r = e._clip.tracks
  46377. , o = r.length
  46378. , a = e._propertyBindings
  46379. , s = e._interpolants
  46380. , l = i.uuid
  46381. , c = this._bindingsByRootAndName
  46382. , h = c[l];
  46383. void 0 === h && (h = {},
  46384. c[l] = h);
  46385. for (var u = 0; u !== o; ++u) {
  46386. var d = r[u]
  46387. , p = d.name
  46388. , f = h[p];
  46389. if (void 0 !== f)
  46390. a[u] = f;
  46391. else {
  46392. if (f = a[u],
  46393. void 0 !== f) {
  46394. null === f._cacheIndex && (++f.referenceCount,
  46395. this._addInactiveBinding(f, l, p));
  46396. continue
  46397. }
  46398. var g = t && t._propertyBindings[u].binding.parsedPath;
  46399. f = new n.PropertyMixer(n.PropertyBinding.create(i, p, g),d.ValueTypeName,d.getValueSize()),
  46400. ++f.referenceCount,
  46401. this._addInactiveBinding(f, l, p),
  46402. a[u] = f
  46403. }
  46404. s[u].resultBuffer = f.buffer
  46405. }
  46406. },
  46407. _activateAction: function(e) {
  46408. if (!this._isActiveAction(e)) {
  46409. if (null === e._cacheIndex) {
  46410. var t = (e._localRoot || this._root).uuid
  46411. , i = e._clip.name
  46412. , n = this._actionsByClip[i];
  46413. this._bindAction(e, n && n.knownActions[0]),
  46414. this._addInactiveAction(e, i, t)
  46415. }
  46416. for (var r = e._propertyBindings, o = 0, a = r.length; o !== a; ++o) {
  46417. var s = r[o];
  46418. 0 === s.useCount++ && (this._lendBinding(s),
  46419. s.saveOriginalState())
  46420. }
  46421. this._lendAction(e)
  46422. }
  46423. },
  46424. _deactivateAction: function(e) {
  46425. if (this._isActiveAction(e)) {
  46426. for (var t = e._propertyBindings, i = 0, n = t.length; i !== n; ++i) {
  46427. var r = t[i];
  46428. 0 === --r.useCount && (r.restoreOriginalState(),
  46429. this._takeBackBinding(r))
  46430. }
  46431. this._takeBackAction(e)
  46432. }
  46433. },
  46434. _initMemoryManager: function() {
  46435. this._actions = [],
  46436. this._nActiveActions = 0,
  46437. this._actionsByClip = {},
  46438. this._bindings = [],
  46439. this._nActiveBindings = 0,
  46440. this._bindingsByRootAndName = {},
  46441. this._controlInterpolants = [],
  46442. this._nActiveControlInterpolants = 0;
  46443. var e = this;
  46444. this.stats = {
  46445. actions: {
  46446. get total() {
  46447. return e._actions.length
  46448. },
  46449. get inUse() {
  46450. return e._nActiveActions
  46451. }
  46452. },
  46453. bindings: {
  46454. get total() {
  46455. return e._bindings.length
  46456. },
  46457. get inUse() {
  46458. return e._nActiveBindings
  46459. }
  46460. },
  46461. controlInterpolants: {
  46462. get total() {
  46463. return e._controlInterpolants.length
  46464. },
  46465. get inUse() {
  46466. return e._nActiveControlInterpolants
  46467. }
  46468. }
  46469. }
  46470. },
  46471. _isActiveAction: function(e) {
  46472. var t = e._cacheIndex;
  46473. return null !== t && t < this._nActiveActions
  46474. },
  46475. _addInactiveAction: function(e, t, i) {
  46476. var n = this._actions
  46477. , r = this._actionsByClip
  46478. , o = r[t];
  46479. if (void 0 === o)
  46480. o = {
  46481. knownActions: [e],
  46482. actionByRoot: {}
  46483. },
  46484. e._byClipCacheIndex = 0,
  46485. r[t] = o;
  46486. else {
  46487. var a = o.knownActions;
  46488. e._byClipCacheIndex = a.length,
  46489. a.push(e)
  46490. }
  46491. e._cacheIndex = n.length,
  46492. n.push(e),
  46493. o.actionByRoot[i] = e
  46494. },
  46495. _removeInactiveAction: function(e) {
  46496. var t = this._actions
  46497. , i = t[t.length - 1]
  46498. , n = e._cacheIndex;
  46499. i._cacheIndex = n,
  46500. t[n] = i,
  46501. t.pop(),
  46502. e._cacheIndex = null;
  46503. var r = e._clip.name
  46504. , o = this._actionsByClip
  46505. , a = o[r]
  46506. , s = a.knownActions
  46507. , l = s[s.length - 1]
  46508. , c = e._byClipCacheIndex;
  46509. l._byClipCacheIndex = c,
  46510. s[c] = l,
  46511. s.pop(),
  46512. e._byClipCacheIndex = null;
  46513. var h = a.actionByRoot
  46514. , u = (t._localRoot || this._root).uuid;
  46515. delete h[u],
  46516. 0 === s.length && delete o[r],
  46517. this._removeInactiveBindingsForAction(e)
  46518. },
  46519. _removeInactiveBindingsForAction: function(e) {
  46520. for (var t = e._propertyBindings, i = 0, n = t.length; i !== n; ++i) {
  46521. var r = t[i];
  46522. 0 === --r.referenceCount && this._removeInactiveBinding(r)
  46523. }
  46524. },
  46525. _lendAction: function(e) {
  46526. var t = this._actions
  46527. , i = e._cacheIndex
  46528. , n = this._nActiveActions++
  46529. , r = t[n];
  46530. e._cacheIndex = n,
  46531. t[n] = e,
  46532. r._cacheIndex = i,
  46533. t[i] = r
  46534. },
  46535. _takeBackAction: function(e) {
  46536. var t = this._actions
  46537. , i = e._cacheIndex
  46538. , n = --this._nActiveActions
  46539. , r = t[n];
  46540. e._cacheIndex = n,
  46541. t[n] = e,
  46542. r._cacheIndex = i,
  46543. t[i] = r
  46544. },
  46545. _addInactiveBinding: function(e, t, i) {
  46546. var n = this._bindingsByRootAndName
  46547. , r = n[t]
  46548. , o = this._bindings;
  46549. void 0 === r && (r = {},
  46550. n[t] = r),
  46551. r[i] = e,
  46552. e._cacheIndex = o.length,
  46553. o.push(e)
  46554. },
  46555. _removeInactiveBinding: function(e) {
  46556. var t = this._bindings
  46557. , i = e.binding
  46558. , n = i.rootNode.uuid
  46559. , r = i.path
  46560. , o = this._bindingsByRootAndName
  46561. , a = o[n]
  46562. , s = t[t.length - 1]
  46563. , l = e._cacheIndex;
  46564. s._cacheIndex = l,
  46565. t[l] = s,
  46566. t.pop(),
  46567. delete a[r];
  46568. e: {
  46569. for (var c in a)
  46570. break e;
  46571. delete o[n]
  46572. }
  46573. },
  46574. _lendBinding: function(e) {
  46575. var t = this._bindings
  46576. , i = e._cacheIndex
  46577. , n = this._nActiveBindings++
  46578. , r = t[n];
  46579. e._cacheIndex = n,
  46580. t[n] = e,
  46581. r._cacheIndex = i,
  46582. t[i] = r
  46583. },
  46584. _takeBackBinding: function(e) {
  46585. var t = this._bindings
  46586. , i = e._cacheIndex
  46587. , n = --this._nActiveBindings
  46588. , r = t[n];
  46589. e._cacheIndex = n,
  46590. t[n] = e,
  46591. r._cacheIndex = i,
  46592. t[i] = r
  46593. },
  46594. _lendControlInterpolant: function() {
  46595. var e = this._controlInterpolants
  46596. , t = this._nActiveControlInterpolants++
  46597. , i = e[t];
  46598. return void 0 === i && (i = new n.LinearInterpolant(new Float32Array(2),new Float32Array(2),1,this._controlInterpolantsResultBuffer),
  46599. i.__cacheIndex = t,
  46600. e[t] = i),
  46601. i
  46602. },
  46603. _takeBackControlInterpolant: function(e) {
  46604. var t = this._controlInterpolants
  46605. , i = e.__cacheIndex
  46606. , n = --this._nActiveControlInterpolants
  46607. , r = t[n];
  46608. e.__cacheIndex = n,
  46609. t[n] = e,
  46610. r.__cacheIndex = i,
  46611. t[i] = r
  46612. },
  46613. _controlInterpolantsResultBuffer: new Float32Array(1)
  46614. }),
  46615. n.AnimationObjectGroup = function(e) {
  46616. this.uuid = n.Math.generateUUID(),
  46617. this._objects = Array.prototype.slice.call(arguments),
  46618. this.nCachedObjects_ = 0;
  46619. var t = {};
  46620. this._indicesByUUID = t;
  46621. for (var i = 0, r = arguments.length; i !== r; ++i)
  46622. t[arguments[i].uuid] = i;
  46623. this._paths = [],
  46624. this._parsedPaths = [],
  46625. this._bindings = [],
  46626. this._bindingsIndicesByPath = {};
  46627. var o = this;
  46628. this.stats = {
  46629. objects: {
  46630. get total() {
  46631. return o._objects.length
  46632. },
  46633. get inUse() {
  46634. return this.total - o.nCachedObjects_
  46635. }
  46636. },
  46637. get bindingsPerObject() {
  46638. return o._bindings.length
  46639. }
  46640. }
  46641. }
  46642. ,
  46643. n.AnimationObjectGroup.prototype = {
  46644. constructor: n.AnimationObjectGroup,
  46645. add: function(e) {
  46646. 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) {
  46647. var d = arguments[h]
  46648. , p = d.uuid
  46649. , f = o[p];
  46650. if (void 0 === f) {
  46651. f = i++,
  46652. o[p] = f,
  46653. t.push(d);
  46654. for (var g = 0, m = c; g !== m; ++g)
  46655. l[g].push(new n.PropertyBinding(d,a[g],s[g]))
  46656. } else if (f < r) {
  46657. var v = t[f]
  46658. , A = --r
  46659. , y = t[A];
  46660. o[y.uuid] = f,
  46661. t[f] = y,
  46662. o[p] = A,
  46663. t[A] = d;
  46664. for (var g = 0, m = c; g !== m; ++g) {
  46665. var C = l[g]
  46666. , I = C[A]
  46667. , E = C[f];
  46668. C[f] = I,
  46669. void 0 === E && (E = new n.PropertyBinding(d,a[g],s[g])),
  46670. C[A] = E
  46671. }
  46672. } else
  46673. t[f] !== v && console.error("Different objects with the same UUID detected. Clean the caches or recreate your infrastructure when reloading scenes...")
  46674. }
  46675. this.nCachedObjects_ = r
  46676. },
  46677. remove: function(e) {
  46678. for (var t = this._objects, i = (t.length,
  46679. this.nCachedObjects_), n = this._indicesByUUID, r = this._bindings, o = r.length, a = 0, s = arguments.length; a !== s; ++a) {
  46680. var l = arguments[a]
  46681. , c = l.uuid
  46682. , h = n[c];
  46683. if (void 0 !== h && h >= i) {
  46684. var u = i++
  46685. , d = t[u];
  46686. n[d.uuid] = h,
  46687. t[h] = d,
  46688. n[c] = u,
  46689. t[u] = l;
  46690. for (var p = 0, f = o; p !== f; ++p) {
  46691. var g = r[p]
  46692. , m = g[u]
  46693. , v = g[h];
  46694. g[h] = m,
  46695. g[u] = v
  46696. }
  46697. }
  46698. }
  46699. this.nCachedObjects_ = i
  46700. },
  46701. uncache: function(e) {
  46702. 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) {
  46703. var c = arguments[s]
  46704. , h = c.uuid
  46705. , u = r[h];
  46706. if (void 0 !== u)
  46707. if (delete r[h],
  46708. u < n) {
  46709. var d = --n
  46710. , p = t[d]
  46711. , f = --i
  46712. , g = t[f];
  46713. r[p.uuid] = u,
  46714. t[u] = p,
  46715. r[g.uuid] = d,
  46716. t[d] = g,
  46717. t.pop();
  46718. for (var m = 0, v = a; m !== v; ++m) {
  46719. var A = o[m]
  46720. , y = A[d]
  46721. , C = A[f];
  46722. A[u] = y,
  46723. A[d] = C,
  46724. A.pop()
  46725. }
  46726. } else {
  46727. var f = --i
  46728. , g = t[f];
  46729. r[g.uuid] = u,
  46730. t[u] = g,
  46731. t.pop();
  46732. for (var m = 0, v = a; m !== v; ++m) {
  46733. var A = o[m];
  46734. A[u] = A[f],
  46735. A.pop()
  46736. }
  46737. }
  46738. }
  46739. this.nCachedObjects_ = n
  46740. },
  46741. subscribe_: function(e, t) {
  46742. var i = this._bindingsIndicesByPath
  46743. , r = i[e]
  46744. , o = this._bindings;
  46745. if (void 0 !== r)
  46746. return o[r];
  46747. var a = this._paths
  46748. , s = this._parsedPaths
  46749. , l = this._objects
  46750. , c = l.length
  46751. , h = this.nCachedObjects_
  46752. , u = new Array(c);
  46753. r = o.length,
  46754. i[e] = r,
  46755. a.push(e),
  46756. s.push(t),
  46757. o.push(u);
  46758. for (var d = h, p = l.length; d !== p; ++d) {
  46759. var f = l[d];
  46760. u[d] = new n.PropertyBinding(f,e,t)
  46761. }
  46762. return u
  46763. },
  46764. unsubscribe_: function(e) {
  46765. var t = this._bindingsIndicesByPath
  46766. , i = t[e];
  46767. if (void 0 !== i) {
  46768. var n = this._paths
  46769. , r = this._parsedPaths
  46770. , o = this._bindings
  46771. , a = o.length - 1
  46772. , s = o[a]
  46773. , l = e[a];
  46774. t[l] = i,
  46775. o[i] = s,
  46776. o.pop(),
  46777. r[i] = r[a],
  46778. r.pop(),
  46779. n[i] = n[a],
  46780. n.pop()
  46781. }
  46782. }
  46783. },
  46784. n.AnimationUtils = {
  46785. arraySlice: function(e, t, i) {
  46786. return n.AnimationUtils.isTypedArray(e) ? new e.constructor(e.subarray(t, i)) : e.slice(t, i)
  46787. },
  46788. convertArray: function(e, t, i) {
  46789. return !e || !i && e.constructor === t ? e : "number" == typeof t.BYTES_PER_ELEMENT ? new t(e) : Array.prototype.slice.call(e)
  46790. },
  46791. isTypedArray: function(e) {
  46792. return ArrayBuffer.isView(e) && !(e instanceof DataView)
  46793. },
  46794. getKeyframeOrder: function(e) {
  46795. function t(t, i) {
  46796. return e[t] - e[i]
  46797. }
  46798. for (var i = e.length, n = new Array(i), r = 0; r !== i; ++r)
  46799. n[r] = r;
  46800. return n.sort(t),
  46801. n
  46802. },
  46803. sortedArray: function(e, t, i) {
  46804. for (var n = e.length, r = new e.constructor(n), o = 0, a = 0; a !== n; ++o)
  46805. for (var s = i[o] * t, l = 0; l !== t; ++l)
  46806. r[a++] = e[s + l];
  46807. return r
  46808. },
  46809. flattenJSON: function(e, t, i, n) {
  46810. for (var r = 1, o = e[0]; void 0 !== o && void 0 === o[n]; )
  46811. o = e[r++];
  46812. if (void 0 !== o) {
  46813. var a = o[n];
  46814. if (void 0 !== a)
  46815. if (Array.isArray(a)) {
  46816. do
  46817. a = o[n],
  46818. void 0 !== a && (t.push(o.time),
  46819. i.push.apply(i, a)),
  46820. o = e[r++];
  46821. while (void 0 !== o)
  46822. } else if (void 0 !== a.toArray) {
  46823. do
  46824. a = o[n],
  46825. void 0 !== a && (t.push(o.time),
  46826. a.toArray(i, i.length)),
  46827. o = e[r++];
  46828. while (void 0 !== o)
  46829. } else
  46830. do
  46831. a = o[n],
  46832. void 0 !== a && (t.push(o.time),
  46833. i.push(a)),
  46834. o = e[r++];
  46835. while (void 0 !== o)
  46836. }
  46837. }
  46838. },
  46839. n.KeyframeTrack = function(e, t, i, r) {
  46840. if (void 0 === e)
  46841. throw new Error("track name is undefined");
  46842. if (void 0 === t || 0 === t.length)
  46843. throw new Error("no keyframes in track named " + e);
  46844. this.name = e,
  46845. this.times = n.AnimationUtils.convertArray(t, this.TimeBufferType),
  46846. this.values = n.AnimationUtils.convertArray(i, this.ValueBufferType),
  46847. this.setInterpolation(r || this.DefaultInterpolation),
  46848. this.validate(),
  46849. this.optimize()
  46850. }
  46851. ,
  46852. n.KeyframeTrack.prototype = {
  46853. constructor: n.KeyframeTrack,
  46854. TimeBufferType: Float32Array,
  46855. ValueBufferType: Float32Array,
  46856. DefaultInterpolation: n.InterpolateLinear,
  46857. InterpolantFactoryMethodDiscrete: function(e) {
  46858. return new n.DiscreteInterpolant(this.times,this.values,this.getValueSize(),e)
  46859. },
  46860. InterpolantFactoryMethodLinear: function(e) {
  46861. return new n.LinearInterpolant(this.times,this.values,this.getValueSize(),e)
  46862. },
  46863. InterpolantFactoryMethodSmooth: function(e) {
  46864. return new n.CubicInterpolant(this.times,this.values,this.getValueSize(),e)
  46865. },
  46866. setInterpolation: function(e) {
  46867. var t = void 0;
  46868. switch (e) {
  46869. case n.InterpolateDiscrete:
  46870. t = this.InterpolantFactoryMethodDiscrete;
  46871. break;
  46872. case n.InterpolateLinear:
  46873. t = this.InterpolantFactoryMethodLinear;
  46874. break;
  46875. case n.InterpolateSmooth:
  46876. t = this.InterpolantFactoryMethodSmooth
  46877. }
  46878. if (void 0 === t) {
  46879. var i = "unsupported interpolation for " + this.ValueTypeName + " keyframe track named " + this.name;
  46880. if (void 0 === this.createInterpolant) {
  46881. if (e === this.DefaultInterpolation)
  46882. throw new Error(i);
  46883. this.setInterpolation(this.DefaultInterpolation)
  46884. }
  46885. return void console.warn(i)
  46886. }
  46887. this.createInterpolant = t
  46888. },
  46889. getInterpolation: function() {
  46890. switch (this.createInterpolant) {
  46891. case this.InterpolantFactoryMethodDiscrete:
  46892. return n.InterpolateDiscrete;
  46893. case this.InterpolantFactoryMethodLinear:
  46894. return n.InterpolateLinear;
  46895. case this.InterpolantFactoryMethodSmooth:
  46896. return n.InterpolateSmooth
  46897. }
  46898. },
  46899. getValueSize: function() {
  46900. return this.values.length / this.times.length
  46901. },
  46902. shift: function(e) {
  46903. if (0 !== e)
  46904. for (var t = this.times, i = 0, n = t.length; i !== n; ++i)
  46905. t[i] += e;
  46906. return this
  46907. },
  46908. scale: function(e) {
  46909. if (1 !== e)
  46910. for (var t = this.times, i = 0, n = t.length; i !== n; ++i)
  46911. t[i] *= e;
  46912. return this
  46913. },
  46914. trim: function(e, t) {
  46915. for (var i = this.times, r = i.length, o = 0, a = r - 1; o !== r && i[o] < e; )
  46916. ++o;
  46917. for (; a !== -1 && i[a] > t; )
  46918. --a;
  46919. if (++a,
  46920. 0 !== o || a !== r) {
  46921. o >= a && (a = Math.max(a, 1),
  46922. o = a - 1);
  46923. var s = this.getValueSize();
  46924. this.times = n.AnimationUtils.arraySlice(i, o, a),
  46925. this.values = n.AnimationUtils.arraySlice(this.values, o * s, a * s)
  46926. }
  46927. return this
  46928. },
  46929. validate: function() {
  46930. var e = !0
  46931. , t = this.getValueSize();
  46932. t - Math.floor(t) !== 0 && (console.error("invalid value size in track", this),
  46933. e = !1);
  46934. var i = this.times
  46935. , r = this.values
  46936. , o = i.length;
  46937. 0 === o && (console.error("track is empty", this),
  46938. e = !1);
  46939. for (var a = null, s = 0; s !== o; s++) {
  46940. var l = i[s];
  46941. if ("number" == typeof l && isNaN(l)) {
  46942. console.error("time is not a valid number", this, s, l),
  46943. e = !1;
  46944. break
  46945. }
  46946. if (null !== a && a > l) {
  46947. console.error("out of order keys", this, s, l, a),
  46948. e = !1;
  46949. break
  46950. }
  46951. a = l
  46952. }
  46953. if (void 0 !== r && n.AnimationUtils.isTypedArray(r))
  46954. for (var s = 0, c = r.length; s !== c; ++s) {
  46955. var h = r[s];
  46956. if (isNaN(h)) {
  46957. console.error("value is not a valid number", this, s, h),
  46958. e = !1;
  46959. break
  46960. }
  46961. }
  46962. return e
  46963. },
  46964. optimize: function() {
  46965. for (var e = this.times, t = this.values, i = this.getValueSize(), r = 1, o = 1, a = e.length - 1; o <= a; ++o) {
  46966. var s = !1
  46967. , l = e[o]
  46968. , c = e[o + 1];
  46969. if (l !== c && (1 !== o || l !== l[0]))
  46970. for (var h = o * i, u = h - i, d = h + i, p = 0; p !== i; ++p) {
  46971. var f = t[h + p];
  46972. if (f !== t[u + p] || f !== t[d + p]) {
  46973. s = !0;
  46974. break
  46975. }
  46976. }
  46977. if (s) {
  46978. if (o !== r) {
  46979. e[r] = e[o];
  46980. for (var g = o * i, m = r * i, p = 0; p !== i; ++p)
  46981. t[m + p] = t[g + p]
  46982. }
  46983. ++r
  46984. }
  46985. }
  46986. return r !== e.length && (this.times = n.AnimationUtils.arraySlice(e, 0, r),
  46987. this.values = n.AnimationUtils.arraySlice(t, 0, r * i)),
  46988. this
  46989. }
  46990. },
  46991. Object.assign(n.KeyframeTrack, {
  46992. parse: function(e) {
  46993. if (void 0 === e.type)
  46994. throw new Error("track type undefined, can not parse");
  46995. var t = n.KeyframeTrack._getTrackTypeForValueTypeName(e.type);
  46996. if (void 0 === e.times) {
  46997. console.warn("legacy JSON format detected, converting");
  46998. var i = []
  46999. , r = [];
  47000. n.AnimationUtils.flattenJSON(e.keys, i, r, "value"),
  47001. e.times = i,
  47002. e.values = r
  47003. }
  47004. return void 0 !== t.parse ? t.parse(e) : new t(e.name,e.times,e.values,e.interpolation)
  47005. },
  47006. toJSON: function(e) {
  47007. var t, i = e.constructor;
  47008. if (void 0 !== i.toJSON)
  47009. t = i.toJSON(e);
  47010. else {
  47011. t = {
  47012. name: e.name,
  47013. times: n.AnimationUtils.convertArray(e.times, Array),
  47014. values: n.AnimationUtils.convertArray(e.values, Array)
  47015. };
  47016. var r = e.getInterpolation();
  47017. r !== e.DefaultInterpolation && (t.interpolation = r)
  47018. }
  47019. return t.type = e.ValueTypeName,
  47020. t
  47021. },
  47022. _getTrackTypeForValueTypeName: function(e) {
  47023. switch (e.toLowerCase()) {
  47024. case "scalar":
  47025. case "double":
  47026. case "float":
  47027. case "number":
  47028. case "integer":
  47029. return n.NumberKeyframeTrack;
  47030. case "vector":
  47031. case "vector2":
  47032. case "vector3":
  47033. case "vector4":
  47034. return n.VectorKeyframeTrack;
  47035. case "color":
  47036. return n.ColorKeyframeTrack;
  47037. case "quaternion":
  47038. return n.QuaternionKeyframeTrack;
  47039. case "bool":
  47040. case "boolean":
  47041. return n.BooleanKeyframeTrack;
  47042. case "string":
  47043. return n.StringKeyframeTrack
  47044. }
  47045. throw new Error("Unsupported typeName: " + e)
  47046. }
  47047. }),
  47048. n.PropertyBinding = function(e, t, i) {
  47049. this.path = t,
  47050. this.parsedPath = i || n.PropertyBinding.parseTrackName(t),
  47051. this.node = n.PropertyBinding.findNode(e, this.parsedPath.nodeName) || e,
  47052. this.rootNode = e
  47053. }
  47054. ,
  47055. n.PropertyBinding.prototype = {
  47056. constructor: n.PropertyBinding,
  47057. getValue: function(e, t) {
  47058. this.bind(),
  47059. this.getValue(e, t)
  47060. },
  47061. setValue: function(e, t) {
  47062. this.bind(),
  47063. this.setValue(e, t)
  47064. },
  47065. bind: function() {
  47066. var e = this.node
  47067. , t = this.parsedPath
  47068. , i = t.objectName
  47069. , r = t.propertyName
  47070. , o = t.propertyIndex;
  47071. if (e || (e = n.PropertyBinding.findNode(this.rootNode, t.nodeName) || this.rootNode,
  47072. this.node = e),
  47073. this.getValue = this._getValue_unavailable,
  47074. this.setValue = this._setValue_unavailable,
  47075. !e)
  47076. return void console.error(" trying to update node for track: " + this.path + " but it wasn't found.");
  47077. if (i) {
  47078. var a = t.objectIndex;
  47079. switch (i) {
  47080. case "materials":
  47081. if (!e.material)
  47082. return void console.error(" can not bind to material as node does not have a material", this);
  47083. if (!e.material.materials)
  47084. return void console.error(" can not bind to material.materials as node.material does not have a materials array", this);
  47085. e = e.material.materials;
  47086. break;
  47087. case "bones":
  47088. if (!e.skeleton)
  47089. return void console.error(" can not bind to bones as node does not have a skeleton", this);
  47090. e = e.skeleton.bones;
  47091. for (var s = 0; s < e.length; s++)
  47092. if (e[s].name === a) {
  47093. a = s;
  47094. break
  47095. }
  47096. break;
  47097. default:
  47098. if (void 0 === e[i])
  47099. return void console.error(" can not bind to objectName of node, undefined", this);
  47100. e = e[i]
  47101. }
  47102. if (void 0 !== a) {
  47103. if (void 0 === e[a])
  47104. return void console.error(" trying to bind to objectIndex of objectName, but is undefined:", this, e);
  47105. e = e[a]
  47106. }
  47107. }
  47108. var l = e[r];
  47109. if (!l) {
  47110. var c = t.nodeName;
  47111. return void console.error(" trying to update property for track: " + c + "." + r + " but it wasn't found.", e)
  47112. }
  47113. var h = this.Versioning.None;
  47114. void 0 !== e.needsUpdate ? (h = this.Versioning.NeedsUpdate,
  47115. this.targetObject = e) : void 0 !== e.matrixWorldNeedsUpdate && (h = this.Versioning.MatrixWorldNeedsUpdate,
  47116. this.targetObject = e);
  47117. var u = this.BindingType.Direct;
  47118. if (void 0 !== o) {
  47119. if ("morphTargetInfluences" === r) {
  47120. if (!e.geometry)
  47121. return void console.error(" can not bind to morphTargetInfluences becasuse node does not have a geometry", this);
  47122. if (!e.geometry.morphTargets)
  47123. return void console.error(" can not bind to morphTargetInfluences becasuse node does not have a geometry.morphTargets", this);
  47124. for (var s = 0; s < this.node.geometry.morphTargets.length; s++)
  47125. if (e.geometry.morphTargets[s].name === o) {
  47126. o = s;
  47127. break
  47128. }
  47129. }
  47130. u = this.BindingType.ArrayElement,
  47131. this.resolvedProperty = l,
  47132. this.propertyIndex = o
  47133. } else
  47134. void 0 !== l.fromArray && void 0 !== l.toArray ? (u = this.BindingType.HasFromToArray,
  47135. this.resolvedProperty = l) : void 0 !== l.length ? (u = this.BindingType.EntireArray,
  47136. this.resolvedProperty = l) : this.propertyName = r;
  47137. this.getValue = this.GetterByBindingType[u],
  47138. this.setValue = this.SetterByBindingTypeAndVersioning[u][h]
  47139. },
  47140. unbind: function() {
  47141. this.node = null,
  47142. this.getValue = this._getValue_unbound,
  47143. this.setValue = this._setValue_unbound
  47144. }
  47145. },
  47146. Object.assign(n.PropertyBinding.prototype, {
  47147. _getValue_unavailable: function() {},
  47148. _setValue_unavailable: function() {},
  47149. _getValue_unbound: n.PropertyBinding.prototype.getValue,
  47150. _setValue_unbound: n.PropertyBinding.prototype.setValue,
  47151. BindingType: {
  47152. Direct: 0,
  47153. EntireArray: 1,
  47154. ArrayElement: 2,
  47155. HasFromToArray: 3
  47156. },
  47157. Versioning: {
  47158. None: 0,
  47159. NeedsUpdate: 1,
  47160. MatrixWorldNeedsUpdate: 2
  47161. },
  47162. GetterByBindingType: [function(e, t) {
  47163. e[t] = this.node[this.propertyName]
  47164. }
  47165. , function(e, t) {
  47166. for (var i = this.resolvedProperty, n = 0, r = i.length; n !== r; ++n)
  47167. e[t++] = i[n]
  47168. }
  47169. , function(e, t) {
  47170. e[t] = this.resolvedProperty[this.propertyIndex]
  47171. }
  47172. , function(e, t) {
  47173. this.resolvedProperty.toArray(e, t)
  47174. }
  47175. ],
  47176. SetterByBindingTypeAndVersioning: [[function(e, t) {
  47177. this.node[this.propertyName] = e[t]
  47178. }
  47179. , function(e, t) {
  47180. this.node[this.propertyName] = e[t],
  47181. this.targetObject.needsUpdate = !0
  47182. }
  47183. , function(e, t) {
  47184. this.node[this.propertyName] = e[t],
  47185. this.targetObject.matrixWorldNeedsUpdate = !0
  47186. }
  47187. ], [function(e, t) {
  47188. for (var i = this.resolvedProperty, n = 0, r = i.length; n !== r; ++n)
  47189. i[n] = e[t++]
  47190. }
  47191. , function(e, t) {
  47192. for (var i = this.resolvedProperty, n = 0, r = i.length; n !== r; ++n)
  47193. i[n] = e[t++];
  47194. this.targetObject.needsUpdate = !0
  47195. }
  47196. , function(e, t) {
  47197. for (var i = this.resolvedProperty, n = 0, r = i.length; n !== r; ++n)
  47198. i[n] = e[t++];
  47199. this.targetObject.matrixWorldNeedsUpdate = !0
  47200. }
  47201. ], [function(e, t) {
  47202. this.resolvedProperty[this.propertyIndex] = e[t]
  47203. }
  47204. , function(e, t) {
  47205. this.resolvedProperty[this.propertyIndex] = e[t],
  47206. this.targetObject.needsUpdate = !0
  47207. }
  47208. , function(e, t) {
  47209. this.resolvedProperty[this.propertyIndex] = e[t],
  47210. this.targetObject.matrixWorldNeedsUpdate = !0
  47211. }
  47212. ], [function(e, t) {
  47213. this.resolvedProperty.fromArray(e, t)
  47214. }
  47215. , function(e, t) {
  47216. this.resolvedProperty.fromArray(e, t),
  47217. this.targetObject.needsUpdate = !0
  47218. }
  47219. , function(e, t) {
  47220. this.resolvedProperty.fromArray(e, t),
  47221. this.targetObject.matrixWorldNeedsUpdate = !0
  47222. }
  47223. ]]
  47224. }),
  47225. n.PropertyBinding.Composite = function(e, t, i) {
  47226. var r = i || n.PropertyBinding.parseTrackName(t);
  47227. this._targetGroup = e,
  47228. this._bindings = e.subscribe_(t, r)
  47229. }
  47230. ,
  47231. n.PropertyBinding.Composite.prototype = {
  47232. constructor: n.PropertyBinding.Composite,
  47233. getValue: function(e, t) {
  47234. this.bind();
  47235. var i = this._targetGroup.nCachedObjects_
  47236. , n = this._bindings[i];
  47237. void 0 !== n && n.getValue(e, t)
  47238. },
  47239. setValue: function(e, t) {
  47240. for (var i = this._bindings, n = this._targetGroup.nCachedObjects_, r = i.length; n !== r; ++n)
  47241. i[n].setValue(e, t)
  47242. },
  47243. bind: function() {
  47244. for (var e = this._bindings, t = this._targetGroup.nCachedObjects_, i = e.length; t !== i; ++t)
  47245. e[t].bind()
  47246. },
  47247. unbind: function() {
  47248. for (var e = this._bindings, t = this._targetGroup.nCachedObjects_, i = e.length; t !== i; ++t)
  47249. e[t].unbind()
  47250. }
  47251. },
  47252. n.PropertyBinding.create = function(e, t, i) {
  47253. return e instanceof n.AnimationObjectGroup ? new n.PropertyBinding.Composite(e,t,i) : new n.PropertyBinding(e,t,i)
  47254. }
  47255. ,
  47256. n.PropertyBinding.parseTrackName = function(e) {
  47257. var t = /^(([\w]+\/)*)([\w-\d]+)?(\.([\w]+)(\[([\w\d\[\]\_.:\- ]+)\])?)?(\.([\w.]+)(\[([\w\d\[\]\_. ]+)\])?)$/
  47258. , i = t.exec(e);
  47259. if (!i)
  47260. throw new Error("cannot parse trackName at all: " + e);
  47261. i.index === t.lastIndex && t.lastIndex++;
  47262. var n = {
  47263. nodeName: i[3],
  47264. objectName: i[5],
  47265. objectIndex: i[7],
  47266. propertyName: i[9],
  47267. propertyIndex: i[11]
  47268. };
  47269. if (null === n.propertyName || 0 === n.propertyName.length)
  47270. throw new Error("can not parse propertyName from trackName: " + e);
  47271. return n
  47272. }
  47273. ,
  47274. n.PropertyBinding.findNode = function(e, t) {
  47275. if (!t || "" === t || "root" === t || "." === t || t === -1 || t === e.name || t === e.uuid)
  47276. return e;
  47277. if (e.skeleton) {
  47278. var i = function(e) {
  47279. for (var i = 0; i < e.bones.length; i++) {
  47280. var n = e.bones[i];
  47281. if (n.name === t)
  47282. return n
  47283. }
  47284. return null
  47285. }
  47286. , n = i(e.skeleton);
  47287. if (n)
  47288. return n
  47289. }
  47290. if (e.children) {
  47291. var r = function(e) {
  47292. for (var i = 0; i < e.length; i++) {
  47293. var n = e[i];
  47294. if (n.name === t || n.uuid === t)
  47295. return n;
  47296. var o = r(n.children);
  47297. if (o)
  47298. return o
  47299. }
  47300. return null
  47301. }
  47302. , o = r(e.children);
  47303. if (o)
  47304. return o
  47305. }
  47306. return null
  47307. }
  47308. ,
  47309. n.PropertyMixer = function(e, t, i) {
  47310. this.binding = e,
  47311. this.valueSize = i;
  47312. var n, r = Float64Array;
  47313. switch (t) {
  47314. case "quaternion":
  47315. n = this._slerp;
  47316. break;
  47317. case "string":
  47318. case "bool":
  47319. r = Array,
  47320. n = this._select;
  47321. break;
  47322. default:
  47323. n = this._lerp
  47324. }
  47325. this.buffer = new r(4 * i),
  47326. this._mixBufferRegion = n,
  47327. this.cumulativeWeight = 0,
  47328. this.useCount = 0,
  47329. this.referenceCount = 0
  47330. }
  47331. ,
  47332. n.PropertyMixer.prototype = {
  47333. constructor: n.PropertyMixer,
  47334. accumulate: function(e, t) {
  47335. var i = this.buffer
  47336. , n = this.valueSize
  47337. , r = e * n + n
  47338. , o = this.cumulativeWeight;
  47339. if (0 === o) {
  47340. for (var a = 0; a !== n; ++a)
  47341. i[r + a] = i[a];
  47342. o = t
  47343. } else {
  47344. o += t;
  47345. var s = t / o;
  47346. this._mixBufferRegion(i, r, 0, s, n)
  47347. }
  47348. this.cumulativeWeight = o
  47349. },
  47350. apply: function(e) {
  47351. var t = this.valueSize
  47352. , i = this.buffer
  47353. , n = e * t + t
  47354. , r = this.cumulativeWeight
  47355. , o = this.binding;
  47356. if (this.cumulativeWeight = 0,
  47357. r < 1) {
  47358. var a = 3 * t;
  47359. this._mixBufferRegion(i, n, a, 1 - r, t)
  47360. }
  47361. for (var s = t, l = t + t; s !== l; ++s)
  47362. if (i[s] !== i[s + t]) {
  47363. o.setValue(i, n);
  47364. break
  47365. }
  47366. },
  47367. saveOriginalState: function() {
  47368. var e = this.binding
  47369. , t = this.buffer
  47370. , i = this.valueSize
  47371. , n = 3 * i;
  47372. e.getValue(t, n);
  47373. for (var r = i, o = n; r !== o; ++r)
  47374. t[r] = t[n + r % i];
  47375. this.cumulativeWeight = 0
  47376. },
  47377. restoreOriginalState: function() {
  47378. var e = 3 * this.valueSize;
  47379. this.binding.setValue(this.buffer, e)
  47380. },
  47381. _select: function(e, t, i, n, r) {
  47382. if (n >= .5)
  47383. for (var o = 0; o !== r; ++o)
  47384. e[t + o] = e[i + o]
  47385. },
  47386. _slerp: function(e, t, i, r, o) {
  47387. n.Quaternion.slerpFlat(e, t, e, t, e, i, r)
  47388. },
  47389. _lerp: function(e, t, i, n, r) {
  47390. for (var o = 1 - n, a = 0; a !== r; ++a) {
  47391. var s = t + a;
  47392. e[s] = e[s] * o + e[i + a] * n
  47393. }
  47394. }
  47395. },
  47396. n.BooleanKeyframeTrack = function(e, t, i) {
  47397. n.KeyframeTrack.call(this, e, t, i)
  47398. }
  47399. ,
  47400. n.BooleanKeyframeTrack.prototype = Object.assign(Object.create(n.KeyframeTrack.prototype), {
  47401. constructor: n.BooleanKeyframeTrack,
  47402. ValueTypeName: "bool",
  47403. ValueBufferType: Array,
  47404. DefaultInterpolation: n.IntepolateDiscrete,
  47405. InterpolantFactoryMethodLinear: void 0,
  47406. InterpolantFactoryMethodSmooth: void 0
  47407. }),
  47408. n.NumberKeyframeTrack = function(e, t, i, r) {
  47409. n.KeyframeTrack.call(this, e, t, i, r)
  47410. }
  47411. ,
  47412. n.NumberKeyframeTrack.prototype = Object.assign(Object.create(n.KeyframeTrack.prototype), {
  47413. constructor: n.NumberKeyframeTrack,
  47414. ValueTypeName: "number"
  47415. }),
  47416. n.QuaternionKeyframeTrack = function(e, t, i, r) {
  47417. n.KeyframeTrack.call(this, e, t, i, r)
  47418. }
  47419. ,
  47420. n.QuaternionKeyframeTrack.prototype = Object.assign(Object.create(n.KeyframeTrack.prototype), {
  47421. constructor: n.QuaternionKeyframeTrack,
  47422. ValueTypeName: "quaternion",
  47423. DefaultInterpolation: n.InterpolateLinear,
  47424. InterpolantFactoryMethodLinear: function(e) {
  47425. return new n.QuaternionLinearInterpolant(this.times,this.values,this.getValueSize(),e)
  47426. },
  47427. InterpolantFactoryMethodSmooth: void 0
  47428. }),
  47429. n.StringKeyframeTrack = function(e, t, i, r) {
  47430. n.KeyframeTrack.call(this, e, t, i, r)
  47431. }
  47432. ,
  47433. n.StringKeyframeTrack.prototype = Object.assign(Object.create(n.KeyframeTrack.prototype), {
  47434. constructor: n.StringKeyframeTrack,
  47435. ValueTypeName: "string",
  47436. ValueBufferType: Array,
  47437. DefaultInterpolation: n.IntepolateDiscrete,
  47438. InterpolantFactoryMethodLinear: void 0,
  47439. InterpolantFactoryMethodSmooth: void 0
  47440. }),
  47441. n.VectorKeyframeTrack = function(e, t, i, r) {
  47442. n.KeyframeTrack.call(this, e, t, i, r)
  47443. }
  47444. ,
  47445. n.VectorKeyframeTrack.prototype = Object.assign(Object.create(n.KeyframeTrack.prototype), {
  47446. constructor: n.VectorKeyframeTrack,
  47447. ValueTypeName: "vector"
  47448. }),
  47449. n.Audio = function(e) {
  47450. n.Object3D.call(this),
  47451. this.type = "Audio",
  47452. this.context = e.context,
  47453. this.source = this.context.createBufferSource(),
  47454. this.source.onended = this.onEnded.bind(this),
  47455. this.gain = this.context.createGain(),
  47456. this.gain.connect(e.getInput()),
  47457. this.autoplay = !1,
  47458. this.startTime = 0,
  47459. this.playbackRate = 1,
  47460. this.isPlaying = !1,
  47461. this.hasPlaybackControl = !0,
  47462. this.sourceType = "empty",
  47463. this.filter = null
  47464. }
  47465. ,
  47466. n.Audio.prototype = Object.create(n.Object3D.prototype),
  47467. n.Audio.prototype.constructor = n.Audio,
  47468. n.Audio.prototype.getOutput = function() {
  47469. return this.gain
  47470. }
  47471. ,
  47472. n.Audio.prototype.load = function(e) {
  47473. var t = new n.AudioBuffer(this.context);
  47474. return t.load(e),
  47475. this.setBuffer(t),
  47476. this
  47477. }
  47478. ,
  47479. n.Audio.prototype.setNodeSource = function(e) {
  47480. return this.hasPlaybackControl = !1,
  47481. this.sourceType = "audioNode",
  47482. this.source = e,
  47483. this.connect(),
  47484. this
  47485. }
  47486. ,
  47487. n.Audio.prototype.setBuffer = function(e) {
  47488. var t = this;
  47489. return e.onReady(function(e) {
  47490. t.source.buffer = e,
  47491. t.sourceType = "buffer",
  47492. t.autoplay && t.play()
  47493. }),
  47494. this
  47495. }
  47496. ,
  47497. n.Audio.prototype.play = function() {
  47498. if (this.isPlaying === !0)
  47499. return void console.warn("THREE.Audio: Audio is already playing.");
  47500. if (this.hasPlaybackControl === !1)
  47501. return void console.warn("THREE.Audio: this Audio has no playback control.");
  47502. var e = this.context.createBufferSource();
  47503. e.buffer = this.source.buffer,
  47504. e.loop = this.source.loop,
  47505. e.onended = this.source.onended,
  47506. e.start(0, this.startTime),
  47507. e.playbackRate.value = this.playbackRate,
  47508. this.isPlaying = !0,
  47509. this.source = e,
  47510. this.connect()
  47511. }
  47512. ,
  47513. n.Audio.prototype.pause = function() {
  47514. return this.hasPlaybackControl === !1 ? void console.warn("THREE.Audio: this Audio has no playback control.") : (this.source.stop(),
  47515. void (this.startTime = this.context.currentTime))
  47516. }
  47517. ,
  47518. n.Audio.prototype.stop = function() {
  47519. return this.hasPlaybackControl === !1 ? void console.warn("THREE.Audio: this Audio has no playback control.") : (this.source.stop(),
  47520. void (this.startTime = 0))
  47521. }
  47522. ,
  47523. n.Audio.prototype.connect = function() {
  47524. null !== this.filter ? (this.source.connect(this.filter),
  47525. this.filter.connect(this.getOutput())) : this.source.connect(this.getOutput())
  47526. }
  47527. ,
  47528. n.Audio.prototype.disconnect = function() {
  47529. null !== this.filter ? (this.source.disconnect(this.filter),
  47530. this.filter.disconnect(this.getOutput())) : this.source.disconnect(this.getOutput())
  47531. }
  47532. ,
  47533. n.Audio.prototype.getFilter = function() {
  47534. return this.filter
  47535. }
  47536. ,
  47537. n.Audio.prototype.setFilter = function(e) {
  47538. void 0 === e && (e = null),
  47539. this.isPlaying === !0 ? (this.disconnect(),
  47540. this.filter = e,
  47541. this.connect()) : this.filter = e
  47542. }
  47543. ,
  47544. n.Audio.prototype.setPlaybackRate = function(e) {
  47545. return this.hasPlaybackControl === !1 ? void console.warn("THREE.Audio: this Audio has no playback control.") : (this.playbackRate = e,
  47546. void (this.isPlaying === !0 && (this.source.playbackRate.value = this.playbackRate)))
  47547. }
  47548. ,
  47549. n.Audio.prototype.getPlaybackRate = function() {
  47550. return this.playbackRate
  47551. }
  47552. ,
  47553. n.Audio.prototype.onEnded = function() {
  47554. this.isPlaying = !1
  47555. }
  47556. ,
  47557. n.Audio.prototype.setLoop = function(e) {
  47558. return this.hasPlaybackControl === !1 ? void console.warn("THREE.Audio: this Audio has no playback control.") : void (this.source.loop = e)
  47559. }
  47560. ,
  47561. n.Audio.prototype.getLoop = function() {
  47562. return this.hasPlaybackControl === !1 ? (console.warn("THREE.Audio: this Audio has no playback control."),
  47563. !1) : this.source.loop
  47564. }
  47565. ,
  47566. n.Audio.prototype.setVolume = function(e) {
  47567. this.gain.gain.value = e
  47568. }
  47569. ,
  47570. n.Audio.prototype.getVolume = function() {
  47571. return this.gain.gain.value
  47572. }
  47573. ,
  47574. n.AudioAnalyser = function(e, t) {
  47575. this.analyser = e.context.createAnalyser(),
  47576. this.analyser.fftSize = void 0 !== t ? t : 2048,
  47577. this.data = new Uint8Array(this.analyser.frequencyBinCount),
  47578. e.getOutput().connect(this.analyser)
  47579. }
  47580. ,
  47581. n.AudioAnalyser.prototype = {
  47582. constructor: n.AudioAnalyser,
  47583. getData: function() {
  47584. return this.analyser.getByteFrequencyData(this.data),
  47585. this.data
  47586. }
  47587. },
  47588. n.AudioBuffer = function(e) {
  47589. this.context = e,
  47590. this.ready = !1,
  47591. this.readyCallbacks = []
  47592. }
  47593. ,
  47594. n.AudioBuffer.prototype.load = function(e) {
  47595. var t = this
  47596. , i = new XMLHttpRequest;
  47597. return i.open("GET", e, !0),
  47598. i.responseType = "arraybuffer",
  47599. i.onload = function(e) {
  47600. t.context.decodeAudioData(this.response, function(e) {
  47601. t.buffer = e,
  47602. t.ready = !0;
  47603. for (var i = 0; i < t.readyCallbacks.length; i++)
  47604. t.readyCallbacks[i](t.buffer);
  47605. t.readyCallbacks = []
  47606. })
  47607. }
  47608. ,
  47609. i.send(),
  47610. this
  47611. }
  47612. ,
  47613. n.AudioBuffer.prototype.onReady = function(e) {
  47614. this.ready ? e(this.buffer) : this.readyCallbacks.push(e)
  47615. }
  47616. ,
  47617. n.PositionalAudio = function(e) {
  47618. n.Audio.call(this, e),
  47619. this.panner = this.context.createPanner(),
  47620. this.panner.connect(this.gain)
  47621. }
  47622. ,
  47623. n.PositionalAudio.prototype = Object.create(n.Audio.prototype),
  47624. n.PositionalAudio.prototype.constructor = n.PositionalAudio,
  47625. n.PositionalAudio.prototype.getOutput = function() {
  47626. return this.panner
  47627. }
  47628. ,
  47629. n.PositionalAudio.prototype.setRefDistance = function(e) {
  47630. this.panner.refDistance = e
  47631. }
  47632. ,
  47633. n.PositionalAudio.prototype.getRefDistance = function() {
  47634. return this.panner.refDistance
  47635. }
  47636. ,
  47637. n.PositionalAudio.prototype.setRolloffFactor = function(e) {
  47638. this.panner.rolloffFactor = e
  47639. }
  47640. ,
  47641. n.PositionalAudio.prototype.getRolloffFactor = function() {
  47642. return this.panner.rolloffFactor
  47643. }
  47644. ,
  47645. n.PositionalAudio.prototype.setDistanceModel = function(e) {
  47646. this.panner.distanceModel = e
  47647. }
  47648. ,
  47649. n.PositionalAudio.prototype.getDistanceModel = function() {
  47650. return this.panner.distanceModel
  47651. }
  47652. ,
  47653. n.PositionalAudio.prototype.setMaxDistance = function(e) {
  47654. this.panner.maxDistance = e
  47655. }
  47656. ,
  47657. n.PositionalAudio.prototype.getMaxDistance = function() {
  47658. return this.panner.maxDistance
  47659. }
  47660. ,
  47661. n.PositionalAudio.prototype.updateMatrixWorld = function() {
  47662. var e = new n.Vector3;
  47663. return function(t) {
  47664. n.Object3D.prototype.updateMatrixWorld.call(this, t),
  47665. e.setFromMatrixPosition(this.matrixWorld),
  47666. this.panner.setPosition(e.x, e.y, e.z)
  47667. }
  47668. }(),
  47669. n.AudioListener = function() {
  47670. n.Object3D.call(this),
  47671. this.type = "AudioListener",
  47672. this.context = new (window.AudioContext || window.webkitAudioContext),
  47673. this.gain = this.context.createGain(),
  47674. this.gain.connect(this.context.destination),
  47675. this.filter = null
  47676. }
  47677. ,
  47678. n.AudioListener.prototype = Object.create(n.Object3D.prototype),
  47679. n.AudioListener.prototype.constructor = n.AudioListener,
  47680. n.AudioListener.prototype.getInput = function() {
  47681. return this.gain
  47682. }
  47683. ,
  47684. n.AudioListener.prototype.removeFilter = function() {
  47685. null !== this.filter && (this.gain.disconnect(this.filter),
  47686. this.filter.disconnect(this.context.destination),
  47687. this.gain.connect(this.context.destination),
  47688. this.filter = null)
  47689. }
  47690. ,
  47691. n.AudioListener.prototype.setFilter = function(e) {
  47692. null !== this.filter ? (this.gain.disconnect(this.filter),
  47693. this.filter.disconnect(this.context.destination)) : this.gain.disconnect(this.context.destination),
  47694. this.filter = e,
  47695. this.gain.connect(this.filter),
  47696. this.filter.connect(this.context.destination)
  47697. }
  47698. ,
  47699. n.AudioListener.prototype.getFilter = function() {
  47700. return this.filter
  47701. }
  47702. ,
  47703. n.AudioListener.prototype.setMasterVolume = function(e) {
  47704. this.gain.gain.value = e
  47705. }
  47706. ,
  47707. n.AudioListener.prototype.getMasterVolume = function() {
  47708. return this.gain.gain.value
  47709. }
  47710. ,
  47711. n.AudioListener.prototype.updateMatrixWorld = function() {
  47712. var e = new n.Vector3
  47713. , t = new n.Quaternion
  47714. , i = new n.Vector3
  47715. , r = new n.Vector3;
  47716. return function(o) {
  47717. n.Object3D.prototype.updateMatrixWorld.call(this, o);
  47718. var a = this.context.listener
  47719. , s = this.up;
  47720. this.matrixWorld.decompose(e, t, i),
  47721. r.set(0, 0, -1).applyQuaternion(t),
  47722. a.setPosition(e.x, e.y, e.z),
  47723. a.setOrientation(r.x, r.y, r.z, s.x, s.y, s.z)
  47724. }
  47725. }(),
  47726. n.Camera = function() {
  47727. n.Object3D.call(this),
  47728. this.type = "Camera",
  47729. this.matrixWorldInverse = new n.Matrix4,
  47730. this.projectionMatrix = new n.Matrix4
  47731. }
  47732. ,
  47733. n.Camera.prototype = Object.create(n.Object3D.prototype),
  47734. n.Camera.prototype.constructor = n.Camera,
  47735. n.Camera.prototype.getWorldDirection = function() {
  47736. var e = new n.Quaternion;
  47737. return function(t) {
  47738. var i = t || new n.Vector3;
  47739. return this.getWorldQuaternion(e),
  47740. i.set(0, 0, -1).applyQuaternion(e)
  47741. }
  47742. }(),
  47743. n.Camera.prototype.lookAt = function() {
  47744. var e = new n.Matrix4;
  47745. return function(t) {
  47746. e.lookAt(this.position, t, this.up),
  47747. this.quaternion.setFromRotationMatrix(e)
  47748. }
  47749. }(),
  47750. n.Camera.prototype.clone = function() {
  47751. return (new this.constructor).copy(this)
  47752. }
  47753. ,
  47754. n.Camera.prototype.copy = function(e) {
  47755. return n.Object3D.prototype.copy.call(this, e),
  47756. this.matrixWorldInverse.copy(e.matrixWorldInverse),
  47757. this.projectionMatrix.copy(e.projectionMatrix),
  47758. this
  47759. }
  47760. ,
  47761. n.CubeCamera = function(e, t, i) {
  47762. n.Object3D.call(this),
  47763. this.type = "CubeCamera";
  47764. var r = 90
  47765. , o = 1
  47766. , a = new n.PerspectiveCamera(r,o,e,t);
  47767. a.up.set(0, -1, 0),
  47768. a.lookAt(new n.Vector3(1,0,0)),
  47769. this.add(a);
  47770. var s = new n.PerspectiveCamera(r,o,e,t);
  47771. s.up.set(0, -1, 0),
  47772. s.lookAt(new n.Vector3(-1,0,0)),
  47773. this.add(s);
  47774. var l = new n.PerspectiveCamera(r,o,e,t);
  47775. l.up.set(0, 0, 1),
  47776. l.lookAt(new n.Vector3(0,1,0)),
  47777. this.add(l);
  47778. var c = new n.PerspectiveCamera(r,o,e,t);
  47779. c.up.set(0, 0, -1),
  47780. c.lookAt(new n.Vector3(0,-1,0)),
  47781. this.add(c);
  47782. var h = new n.PerspectiveCamera(r,o,e,t);
  47783. h.up.set(0, -1, 0),
  47784. h.lookAt(new n.Vector3(0,0,1)),
  47785. this.add(h);
  47786. var u = new n.PerspectiveCamera(r,o,e,t);
  47787. u.up.set(0, -1, 0),
  47788. u.lookAt(new n.Vector3(0,0,-1)),
  47789. this.add(u);
  47790. var d = {
  47791. format: n.RGBFormat,
  47792. magFilter: n.LinearFilter,
  47793. minFilter: n.LinearFilter
  47794. };
  47795. this.renderTarget = new n.WebGLRenderTargetCube(i,i,d),
  47796. this.updateCubeMap = function(e, t) {
  47797. null === this.parent && this.updateMatrixWorld();
  47798. var i = this.renderTarget
  47799. , n = i.texture.generateMipmaps;
  47800. i.texture.generateMipmaps = !1,
  47801. i.activeCubeFace = 0,
  47802. e.render(t, a, i),
  47803. i.activeCubeFace = 1,
  47804. e.render(t, s, i),
  47805. i.activeCubeFace = 2,
  47806. e.render(t, l, i),
  47807. i.activeCubeFace = 3,
  47808. e.render(t, c, i),
  47809. i.activeCubeFace = 4,
  47810. e.render(t, h, i),
  47811. i.texture.generateMipmaps = n,
  47812. i.activeCubeFace = 5,
  47813. e.render(t, u, i),
  47814. e.setRenderTarget(null)
  47815. }
  47816. }
  47817. ,
  47818. n.CubeCamera.prototype = Object.create(n.Object3D.prototype),
  47819. n.CubeCamera.prototype.constructor = n.CubeCamera,
  47820. n.OrthographicCamera = function(e, t, i, r, o, a) {
  47821. n.Camera.call(this),
  47822. this.type = "OrthographicCamera",
  47823. this.zoom = 1,
  47824. this.left = e,
  47825. this.right = t,
  47826. this.top = i,
  47827. this.bottom = r,
  47828. this.near = void 0 !== o ? o : .1,
  47829. this.far = void 0 !== a ? a : 2e3,
  47830. this.updateProjectionMatrix()
  47831. }
  47832. ,
  47833. n.OrthographicCamera.prototype = Object.create(n.Camera.prototype),
  47834. n.OrthographicCamera.prototype.constructor = n.OrthographicCamera,
  47835. n.OrthographicCamera.prototype.updateProjectionMatrix = function() {
  47836. var e = (this.right - this.left) / (2 * this.zoom)
  47837. , t = (this.top - this.bottom) / (2 * this.zoom)
  47838. , i = (this.right + this.left) / 2
  47839. , n = (this.top + this.bottom) / 2;
  47840. this.projectionMatrix.makeOrthographic(i - e, i + e, n + t, n - t, this.near, this.far)
  47841. }
  47842. ,
  47843. n.OrthographicCamera.prototype.copy = function(e) {
  47844. return n.Camera.prototype.copy.call(this, e),
  47845. this.left = e.left,
  47846. this.right = e.right,
  47847. this.top = e.top,
  47848. this.bottom = e.bottom,
  47849. this.near = e.near,
  47850. this.far = e.far,
  47851. this.zoom = e.zoom,
  47852. this
  47853. }
  47854. ,
  47855. n.OrthographicCamera.prototype.toJSON = function(e) {
  47856. var t = n.Object3D.prototype.toJSON.call(this, e);
  47857. return t.object.zoom = this.zoom,
  47858. t.object.left = this.left,
  47859. t.object.right = this.right,
  47860. t.object.top = this.top,
  47861. t.object.bottom = this.bottom,
  47862. t.object.near = this.near,
  47863. t.object.far = this.far,
  47864. t
  47865. }
  47866. ,
  47867. n.PerspectiveCamera = function(e, t, i, r) {
  47868. n.Camera.call(this),
  47869. this.type = "PerspectiveCamera",
  47870. this.focalLength = 10,
  47871. this.zoom = 1,
  47872. this.fov = void 0 !== e ? e : 50,
  47873. this.aspect = void 0 !== t ? t : 1,
  47874. this.near = void 0 !== i ? i : .1,
  47875. this.far = void 0 !== r ? r : 2e3,
  47876. this.updateProjectionMatrix()
  47877. }
  47878. ,
  47879. n.PerspectiveCamera.prototype = Object.create(n.Camera.prototype),
  47880. n.PerspectiveCamera.prototype.constructor = n.PerspectiveCamera,
  47881. n.PerspectiveCamera.prototype.setLens = function(e, t) {
  47882. void 0 === t && (t = 24),
  47883. this.fov = 2 * n.Math.radToDeg(Math.atan(t / (2 * e))),
  47884. this.updateProjectionMatrix()
  47885. }
  47886. ,
  47887. n.PerspectiveCamera.prototype.setViewOffset = function(e, t, i, n, r, o) {
  47888. this.fullWidth = e,
  47889. this.fullHeight = t,
  47890. this.x = i,
  47891. this.y = n,
  47892. this.width = r,
  47893. this.height = o,
  47894. this.updateProjectionMatrix()
  47895. }
  47896. ,
  47897. n.PerspectiveCamera.prototype.updateProjectionMatrix = function() {
  47898. var e = n.Math.radToDeg(2 * Math.atan(Math.tan(.5 * n.Math.degToRad(this.fov)) / this.zoom));
  47899. if (this.fullWidth) {
  47900. var t = this.fullWidth / this.fullHeight
  47901. , i = Math.tan(n.Math.degToRad(.5 * e)) * this.near
  47902. , r = -i
  47903. , o = t * r
  47904. , a = t * i
  47905. , s = Math.abs(a - o)
  47906. , l = Math.abs(i - r);
  47907. 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)
  47908. } else
  47909. this.projectionMatrix.makePerspective(e, this.aspect, this.near, this.far)
  47910. }
  47911. ,
  47912. n.PerspectiveCamera.prototype.copy = function(e) {
  47913. return n.Camera.prototype.copy.call(this, e),
  47914. this.focalLength = e.focalLength,
  47915. this.zoom = e.zoom,
  47916. this.fov = e.fov,
  47917. this.aspect = e.aspect,
  47918. this.near = e.near,
  47919. this.far = e.far,
  47920. this
  47921. }
  47922. ,
  47923. n.PerspectiveCamera.prototype.toJSON = function(e) {
  47924. var t = n.Object3D.prototype.toJSON.call(this, e);
  47925. return t.object.focalLength = this.focalLength,
  47926. t.object.zoom = this.zoom,
  47927. t.object.fov = this.fov,
  47928. t.object.aspect = this.aspect,
  47929. t.object.near = this.near,
  47930. t.object.far = this.far,
  47931. t
  47932. }
  47933. ,
  47934. n.StereoCamera = function() {
  47935. this.type = "StereoCamera",
  47936. this.aspect = 1,
  47937. this.cameraL = new n.PerspectiveCamera,
  47938. this.cameraL.layers.enable(1),
  47939. this.cameraL.matrixAutoUpdate = !1,
  47940. this.cameraR = new n.PerspectiveCamera,
  47941. this.cameraR.layers.enable(2),
  47942. this.cameraR.matrixAutoUpdate = !1
  47943. }
  47944. ,
  47945. n.StereoCamera.prototype = {
  47946. constructor: n.StereoCamera,
  47947. update: function() {
  47948. var e, t, i, r, o, a = new n.Matrix4, s = new n.Matrix4;
  47949. return function(l) {
  47950. var c = e !== l.focalLength || t !== l.fov || i !== l.aspect * this.aspect || r !== l.near || o !== l.far;
  47951. if (c) {
  47952. e = l.focalLength,
  47953. t = l.fov,
  47954. i = l.aspect * this.aspect,
  47955. r = l.near,
  47956. o = l.far;
  47957. var h, u, d = l.projectionMatrix.clone(), p = .032, f = p * r / e, g = r * Math.tan(n.Math.degToRad(.5 * t));
  47958. s.elements[12] = -p,
  47959. a.elements[12] = p,
  47960. h = -g * i + f,
  47961. u = g * i + f,
  47962. d.elements[0] = 2 * r / (u - h),
  47963. d.elements[8] = (u + h) / (u - h),
  47964. this.cameraL.projectionMatrix.copy(d),
  47965. h = -g * i - f,
  47966. u = g * i - f,
  47967. d.elements[0] = 2 * r / (u - h),
  47968. d.elements[8] = (u + h) / (u - h),
  47969. this.cameraR.projectionMatrix.copy(d)
  47970. }
  47971. this.cameraL.matrixWorld.copy(l.matrixWorld).multiply(s),
  47972. this.cameraR.matrixWorld.copy(l.matrixWorld).multiply(a)
  47973. }
  47974. }()
  47975. },
  47976. n.Light = function(e, t) {
  47977. n.Object3D.call(this),
  47978. this.type = "Light",
  47979. this.color = new n.Color(e),
  47980. this.intensity = void 0 !== t ? t : 1,
  47981. this.receiveShadow = void 0
  47982. }
  47983. ,
  47984. n.Light.prototype = Object.create(n.Object3D.prototype),
  47985. n.Light.prototype.constructor = n.Light,
  47986. n.Light.prototype.copy = function(e) {
  47987. return n.Object3D.prototype.copy.call(this, e),
  47988. this.color.copy(e.color),
  47989. this.intensity = e.intensity,
  47990. this
  47991. }
  47992. ,
  47993. n.Light.prototype.toJSON = function(e) {
  47994. var t = n.Object3D.prototype.toJSON.call(this, e);
  47995. return t.object.color = this.color.getHex(),
  47996. t.object.intensity = this.intensity,
  47997. void 0 !== this.groundColor && (t.object.groundColor = this.groundColor.getHex()),
  47998. void 0 !== this.distance && (t.object.distance = this.distance),
  47999. void 0 !== this.angle && (t.object.angle = this.angle),
  48000. void 0 !== this.decay && (t.object.decay = this.decay),
  48001. void 0 !== this.penumbra && (t.object.penumbra = this.penumbra),
  48002. t
  48003. }
  48004. ,
  48005. n.LightShadow = function(e) {
  48006. this.camera = e,
  48007. this.bias = 0,
  48008. this.radius = 1,
  48009. this.mapSize = new n.Vector2(512,512),
  48010. this.map = null,
  48011. this.matrix = new n.Matrix4
  48012. }
  48013. ,
  48014. n.LightShadow.prototype = {
  48015. constructor: n.LightShadow,
  48016. copy: function(e) {
  48017. return this.camera = e.camera.clone(),
  48018. this.bias = e.bias,
  48019. this.radius = e.radius,
  48020. this.mapSize.copy(e.mapSize),
  48021. this
  48022. },
  48023. clone: function() {
  48024. return (new this.constructor).copy(this)
  48025. }
  48026. },
  48027. n.AmbientLight = function(e, t) {
  48028. n.Light.call(this, e, t),
  48029. this.type = "AmbientLight",
  48030. this.castShadow = void 0
  48031. }
  48032. ,
  48033. n.AmbientLight.prototype = Object.create(n.Light.prototype),
  48034. n.AmbientLight.prototype.constructor = n.AmbientLight,
  48035. n.DirectionalLight = function(e, t) {
  48036. n.Light.call(this, e, t),
  48037. this.type = "DirectionalLight",
  48038. this.position.set(0, 1, 0),
  48039. this.updateMatrix(),
  48040. this.target = new n.Object3D,
  48041. this.shadow = new n.LightShadow(new n.OrthographicCamera(-5,5,5,-5,.5,500))
  48042. }
  48043. ,
  48044. n.DirectionalLight.prototype = Object.create(n.Light.prototype),
  48045. n.DirectionalLight.prototype.constructor = n.DirectionalLight,
  48046. n.DirectionalLight.prototype.copy = function(e) {
  48047. return n.Light.prototype.copy.call(this, e),
  48048. this.target = e.target.clone(),
  48049. this.shadow = e.shadow.clone(),
  48050. this
  48051. }
  48052. ,
  48053. n.HemisphereLight = function(e, t, i) {
  48054. n.Light.call(this, e, i),
  48055. this.type = "HemisphereLight",
  48056. this.castShadow = void 0,
  48057. this.position.set(0, 1, 0),
  48058. this.updateMatrix(),
  48059. this.groundColor = new n.Color(t)
  48060. }
  48061. ,
  48062. n.HemisphereLight.prototype = Object.create(n.Light.prototype),
  48063. n.HemisphereLight.prototype.constructor = n.HemisphereLight,
  48064. n.HemisphereLight.prototype.copy = function(e) {
  48065. return n.Light.prototype.copy.call(this, e),
  48066. this.groundColor.copy(e.groundColor),
  48067. this
  48068. }
  48069. ,
  48070. n.PointLight = function(e, t, i, r) {
  48071. n.Light.call(this, e, t),
  48072. this.type = "PointLight",
  48073. this.distance = void 0 !== i ? i : 0,
  48074. this.decay = void 0 !== r ? r : 1,
  48075. this.shadow = new n.LightShadow(new n.PerspectiveCamera(90,1,.5,500))
  48076. }
  48077. ,
  48078. n.PointLight.prototype = Object.create(n.Light.prototype),
  48079. n.PointLight.prototype.constructor = n.PointLight,
  48080. Object.defineProperty(n.PointLight.prototype, "power", {
  48081. get: function() {
  48082. return 4 * this.intensity * Math.PI
  48083. },
  48084. set: function(e) {
  48085. this.intensity = e / (4 * Math.PI)
  48086. }
  48087. }),
  48088. n.PointLight.prototype.copy = function(e) {
  48089. return n.Light.prototype.copy.call(this, e),
  48090. this.distance = e.distance,
  48091. this.decay = e.decay,
  48092. this.shadow = e.shadow.clone(),
  48093. this
  48094. }
  48095. ,
  48096. n.SpotLight = function(e, t, i, r, o, a) {
  48097. n.Light.call(this, e, t),
  48098. this.type = "SpotLight",
  48099. this.position.set(0, 1, 0),
  48100. this.updateMatrix(),
  48101. this.target = new n.Object3D,
  48102. this.distance = void 0 !== i ? i : 0,
  48103. this.angle = void 0 !== r ? r : Math.PI / 3,
  48104. this.penumbra = void 0 !== o ? o : 0,
  48105. this.decay = void 0 !== a ? a : 1,
  48106. this.shadow = new n.LightShadow(new n.PerspectiveCamera(50,1,.5,500))
  48107. }
  48108. ,
  48109. n.SpotLight.prototype = Object.create(n.Light.prototype),
  48110. n.SpotLight.prototype.constructor = n.SpotLight,
  48111. Object.defineProperty(n.SpotLight.prototype, "power", {
  48112. get: function() {
  48113. return this.intensity * Math.PI
  48114. },
  48115. set: function(e) {
  48116. this.intensity = e / Math.PI
  48117. }
  48118. }),
  48119. n.SpotLight.prototype.copy = function(e) {
  48120. return n.Light.prototype.copy.call(this, e),
  48121. this.distance = e.distance,
  48122. this.angle = e.angle,
  48123. this.penumbra = e.penumbra,
  48124. this.decay = e.decay,
  48125. this.target = e.target.clone(),
  48126. this.shadow = e.shadow.clone(),
  48127. this
  48128. }
  48129. ,
  48130. n.Cache = {
  48131. enabled: !1,
  48132. files: {},
  48133. add: function(e, t) {
  48134. this.enabled !== !1 && (this.files[e] = t)
  48135. },
  48136. get: function(e) {
  48137. if (this.enabled !== !1)
  48138. return this.files[e]
  48139. },
  48140. remove: function(e) {
  48141. delete this.files[e]
  48142. },
  48143. clear: function() {
  48144. this.files = {}
  48145. }
  48146. },
  48147. n.Loader = function() {
  48148. this.onLoadStart = function() {}
  48149. ,
  48150. this.onLoadProgress = function() {}
  48151. ,
  48152. this.onLoadComplete = function() {}
  48153. }
  48154. ,
  48155. n.Loader.prototype = {
  48156. constructor: n.Loader,
  48157. crossOrigin: void 0,
  48158. extractUrlBase: function(e) {
  48159. var t = e.split("/");
  48160. return 1 === t.length ? "./" : (t.pop(),
  48161. t.join("/") + "/")
  48162. },
  48163. initMaterials: function(e, t, i) {
  48164. for (var n = [], r = 0; r < e.length; ++r)
  48165. n[r] = this.createMaterial(e[r], t, i);
  48166. return n
  48167. },
  48168. createMaterial: function() {
  48169. var e, t, i;
  48170. return function(r, o, a) {
  48171. function s(e, i, r, s, c) {
  48172. var h, u = o + e, d = n.Loader.Handlers.get(u);
  48173. null !== d ? h = d.load(u) : (t.setCrossOrigin(a),
  48174. h = t.load(u)),
  48175. void 0 !== i && (h.repeat.fromArray(i),
  48176. 1 !== i[0] && (h.wrapS = n.RepeatWrapping),
  48177. 1 !== i[1] && (h.wrapT = n.RepeatWrapping)),
  48178. void 0 !== r && h.offset.fromArray(r),
  48179. void 0 !== s && ("repeat" === s[0] && (h.wrapS = n.RepeatWrapping),
  48180. "mirror" === s[0] && (h.wrapS = n.MirroredRepeatWrapping),
  48181. "repeat" === s[1] && (h.wrapT = n.RepeatWrapping),
  48182. "mirror" === s[1] && (h.wrapT = n.MirroredRepeatWrapping)),
  48183. void 0 !== c && (h.anisotropy = c);
  48184. var p = n.Math.generateUUID();
  48185. return l[p] = h,
  48186. p
  48187. }
  48188. void 0 === e && (e = new n.Color),
  48189. void 0 === t && (t = new n.TextureLoader),
  48190. void 0 === i && (i = new n.MaterialLoader);
  48191. var l = {}
  48192. , c = {
  48193. uuid: n.Math.generateUUID(),
  48194. type: "MeshLambertMaterial"
  48195. };
  48196. for (var h in r) {
  48197. var u = r[h];
  48198. switch (h) {
  48199. case "DbgColor":
  48200. case "DbgIndex":
  48201. case "opticalDensity":
  48202. case "illumination":
  48203. break;
  48204. case "DbgName":
  48205. c.name = u;
  48206. break;
  48207. case "blending":
  48208. c.blending = n[u];
  48209. break;
  48210. case "colorAmbient":
  48211. case "mapAmbient":
  48212. console.warn("THREE.Loader.createMaterial:", h, "is no longer supported.");
  48213. break;
  48214. case "colorDiffuse":
  48215. c.color = e.fromArray(u).getHex();
  48216. break;
  48217. case "colorSpecular":
  48218. c.specular = e.fromArray(u).getHex();
  48219. break;
  48220. case "colorEmissive":
  48221. c.emissive = e.fromArray(u).getHex();
  48222. break;
  48223. case "specularCoef":
  48224. c.shininess = u;
  48225. break;
  48226. case "shading":
  48227. "basic" === u.toLowerCase() && (c.type = "MeshBasicMaterial"),
  48228. "phong" === u.toLowerCase() && (c.type = "MeshPhongMaterial");
  48229. break;
  48230. case "mapDiffuse":
  48231. c.map = s(u, r.mapDiffuseRepeat, r.mapDiffuseOffset, r.mapDiffuseWrap, r.mapDiffuseAnisotropy);
  48232. break;
  48233. case "mapDiffuseRepeat":
  48234. case "mapDiffuseOffset":
  48235. case "mapDiffuseWrap":
  48236. case "mapDiffuseAnisotropy":
  48237. break;
  48238. case "mapLight":
  48239. c.lightMap = s(u, r.mapLightRepeat, r.mapLightOffset, r.mapLightWrap, r.mapLightAnisotropy);
  48240. break;
  48241. case "mapLightRepeat":
  48242. case "mapLightOffset":
  48243. case "mapLightWrap":
  48244. case "mapLightAnisotropy":
  48245. break;
  48246. case "mapAO":
  48247. c.aoMap = s(u, r.mapAORepeat, r.mapAOOffset, r.mapAOWrap, r.mapAOAnisotropy);
  48248. break;
  48249. case "mapAORepeat":
  48250. case "mapAOOffset":
  48251. case "mapAOWrap":
  48252. case "mapAOAnisotropy":
  48253. break;
  48254. case "mapBump":
  48255. c.bumpMap = s(u, r.mapBumpRepeat, r.mapBumpOffset, r.mapBumpWrap, r.mapBumpAnisotropy);
  48256. break;
  48257. case "mapBumpScale":
  48258. c.bumpScale = u;
  48259. break;
  48260. case "mapBumpRepeat":
  48261. case "mapBumpOffset":
  48262. case "mapBumpWrap":
  48263. case "mapBumpAnisotropy":
  48264. break;
  48265. case "mapNormal":
  48266. c.normalMap = s(u, r.mapNormalRepeat, r.mapNormalOffset, r.mapNormalWrap, r.mapNormalAnisotropy);
  48267. break;
  48268. case "mapNormalFactor":
  48269. c.normalScale = [u, u];
  48270. break;
  48271. case "mapNormalRepeat":
  48272. case "mapNormalOffset":
  48273. case "mapNormalWrap":
  48274. case "mapNormalAnisotropy":
  48275. break;
  48276. case "mapSpecular":
  48277. c.specularMap = s(u, r.mapSpecularRepeat, r.mapSpecularOffset, r.mapSpecularWrap, r.mapSpecularAnisotropy);
  48278. break;
  48279. case "mapSpecularRepeat":
  48280. case "mapSpecularOffset":
  48281. case "mapSpecularWrap":
  48282. case "mapSpecularAnisotropy":
  48283. break;
  48284. case "mapAlpha":
  48285. c.alphaMap = s(u, r.mapAlphaRepeat, r.mapAlphaOffset, r.mapAlphaWrap, r.mapAlphaAnisotropy);
  48286. break;
  48287. case "mapAlphaRepeat":
  48288. case "mapAlphaOffset":
  48289. case "mapAlphaWrap":
  48290. case "mapAlphaAnisotropy":
  48291. break;
  48292. case "flipSided":
  48293. c.side = n.BackSide;
  48294. break;
  48295. case "doubleSided":
  48296. c.side = n.DoubleSide;
  48297. break;
  48298. case "transparency":
  48299. console.warn("THREE.Loader.createMaterial: transparency has been renamed to opacity"),
  48300. c.opacity = u;
  48301. break;
  48302. case "depthTest":
  48303. case "depthWrite":
  48304. case "colorWrite":
  48305. case "opacity":
  48306. case "reflectivity":
  48307. case "transparent":
  48308. case "visible":
  48309. case "wireframe":
  48310. c[h] = u;
  48311. break;
  48312. case "vertexColors":
  48313. u === !0 && (c.vertexColors = n.VertexColors),
  48314. "face" === u && (c.vertexColors = n.FaceColors);
  48315. break;
  48316. default:
  48317. console.error("THREE.Loader.createMaterial: Unsupported", h, u)
  48318. }
  48319. }
  48320. return "MeshBasicMaterial" === c.type && delete c.emissive,
  48321. "MeshPhongMaterial" !== c.type && delete c.specular,
  48322. c.opacity < 1 && (c.transparent = !0),
  48323. i.setTextures(l),
  48324. i.parse(c)
  48325. }
  48326. }()
  48327. },
  48328. n.Loader.Handlers = {
  48329. handlers: [],
  48330. add: function(e, t) {
  48331. this.handlers.push(e, t)
  48332. },
  48333. get: function(e) {
  48334. for (var t = this.handlers, i = 0, n = t.length; i < n; i += 2) {
  48335. var r = t[i]
  48336. , o = t[i + 1];
  48337. if (r.test(e))
  48338. return o
  48339. }
  48340. return null
  48341. }
  48342. },
  48343. n.XHRLoader = function(e) {
  48344. this.manager = void 0 !== e ? e : n.DefaultLoadingManager
  48345. }
  48346. ,
  48347. n.XHRLoader.prototype = {
  48348. constructor: n.XHRLoader,
  48349. load: function(e, t, i, r) {
  48350. void 0 !== this.path && (e = this.path + e);
  48351. var o = this
  48352. , a = n.Cache.get(e);
  48353. if (void 0 !== a)
  48354. return t && setTimeout(function() {
  48355. t(a)
  48356. }, 0),
  48357. a;
  48358. var s = new XMLHttpRequest;
  48359. return s.overrideMimeType("text/plain"),
  48360. s.open("GET", e, !0),
  48361. s.addEventListener("load", function(i) {
  48362. var a = i.target.response;
  48363. n.Cache.add(e, a),
  48364. 200 === this.status ? (t && t(a),
  48365. o.manager.itemEnd(e)) : 0 === this.status ? (console.warn("THREE.XHRLoader: HTTP Status 0 received."),
  48366. t && t(a),
  48367. o.manager.itemEnd(e)) : (r && r(i),
  48368. o.manager.itemError(e))
  48369. }, !1),
  48370. void 0 !== i && s.addEventListener("progress", function(e) {
  48371. i(e)
  48372. }, !1),
  48373. s.addEventListener("error", function(t) {
  48374. r && r(t),
  48375. o.manager.itemError(e)
  48376. }, !1),
  48377. void 0 !== this.responseType && (s.responseType = this.responseType),
  48378. void 0 !== this.withCredentials && (s.withCredentials = this.withCredentials),
  48379. s.send(null),
  48380. o.manager.itemStart(e),
  48381. s
  48382. },
  48383. setPath: function(e) {
  48384. this.path = e
  48385. },
  48386. setResponseType: function(e) {
  48387. this.responseType = e
  48388. },
  48389. setWithCredentials: function(e) {
  48390. this.withCredentials = e
  48391. }
  48392. },
  48393. n.FontLoader = function(e) {
  48394. this.manager = void 0 !== e ? e : n.DefaultLoadingManager
  48395. }
  48396. ,
  48397. n.FontLoader.prototype = {
  48398. constructor: n.FontLoader,
  48399. load: function(e, t, i, r) {
  48400. var o = new n.XHRLoader(this.manager);
  48401. o.load(e, function(e) {
  48402. t(new n.Font(JSON.parse(e.substring(65, e.length - 2))))
  48403. }, i, r)
  48404. }
  48405. },
  48406. n.ImageLoader = function(e) {
  48407. this.manager = void 0 !== e ? e : n.DefaultLoadingManager
  48408. }
  48409. ,
  48410. n.ImageLoader.prototype = {
  48411. constructor: n.ImageLoader,
  48412. load: function(e, t, i, r) {
  48413. void 0 !== this.path && (e = this.path + e);
  48414. var o = this
  48415. , a = n.Cache.get(e);
  48416. if (void 0 !== a)
  48417. return o.manager.itemStart(e),
  48418. t ? setTimeout(function() {
  48419. t(a),
  48420. o.manager.itemEnd(e)
  48421. }, 0) : o.manager.itemEnd(e),
  48422. a;
  48423. var s = document.createElement("img");
  48424. return s.addEventListener("load", function(i) {
  48425. n.Cache.add(e, this),
  48426. t && t(this),
  48427. o.manager.itemEnd(e)
  48428. }, !1),
  48429. void 0 !== i && s.addEventListener("progress", function(e) {
  48430. i(e)
  48431. }, !1),
  48432. s.addEventListener("error", function(t) {
  48433. r && r(t),
  48434. o.manager.itemError(e)
  48435. }, !1),
  48436. void 0 !== this.crossOrigin && (s.crossOrigin = this.crossOrigin),
  48437. o.manager.itemStart(e),
  48438. s.src = e,
  48439. s
  48440. },
  48441. setCrossOrigin: function(e) {
  48442. this.crossOrigin = e
  48443. },
  48444. setPath: function(e) {
  48445. this.path = e
  48446. }
  48447. },
  48448. n.JSONLoader = function(e) {
  48449. "boolean" == typeof e && (console.warn("THREE.JSONLoader: showStatus parameter has been removed from constructor."),
  48450. e = void 0),
  48451. this.manager = void 0 !== e ? e : n.DefaultLoadingManager,
  48452. this.withCredentials = !1
  48453. }
  48454. ,
  48455. n.JSONLoader.prototype = {
  48456. constructor: n.JSONLoader,
  48457. get statusDomElement() {
  48458. return void 0 === this._statusDomElement && (this._statusDomElement = document.createElement("div")),
  48459. console.warn("THREE.JSONLoader: .statusDomElement has been removed."),
  48460. this._statusDomElement
  48461. },
  48462. load: function(e, t, i, r) {
  48463. var o = this
  48464. , a = this.texturePath && "string" == typeof this.texturePath ? this.texturePath : n.Loader.prototype.extractUrlBase(e)
  48465. , s = new n.XHRLoader(this.manager);
  48466. s.setWithCredentials(this.withCredentials),
  48467. s.load(e, function(i) {
  48468. var n = JSON.parse(i)
  48469. , r = n.metadata;
  48470. if (void 0 !== r) {
  48471. var s = r.type;
  48472. if (void 0 !== s) {
  48473. if ("object" === s.toLowerCase())
  48474. return void console.error("THREE.JSONLoader: " + e + " should be loaded with THREE.ObjectLoader instead.");
  48475. if ("scene" === s.toLowerCase())
  48476. return void console.error("THREE.JSONLoader: " + e + " should be loaded with THREE.SceneLoader instead.")
  48477. }
  48478. }
  48479. var l = o.parse(n, a);
  48480. t(l.geometry, l.materials)
  48481. }, i, r)
  48482. },
  48483. setTexturePath: function(e) {
  48484. this.texturePath = e
  48485. },
  48486. parse: function(e, t) {
  48487. function i(t) {
  48488. function i(e, t) {
  48489. return e & 1 << t
  48490. }
  48491. 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;
  48492. if (void 0 !== e.uvs) {
  48493. for (r = 0; r < e.uvs.length; r++)
  48494. e.uvs[r].length && B++;
  48495. for (r = 0; r < B; r++)
  48496. s.faceVertexUvs[r] = []
  48497. }
  48498. for (l = 0,
  48499. c = L.length; l < c; )
  48500. E = new n.Vector3,
  48501. E.x = L[l++] * t,
  48502. E.y = L[l++] * t,
  48503. E.z = L[l++] * t,
  48504. s.vertices.push(E);
  48505. for (l = 0,
  48506. c = O.length; l < c; )
  48507. if (f = O[l++],
  48508. g = i(f, 0),
  48509. m = i(f, 1),
  48510. v = i(f, 3),
  48511. A = i(f, 4),
  48512. y = i(f, 5),
  48513. C = i(f, 6),
  48514. I = i(f, 7),
  48515. g) {
  48516. if (w = new n.Face3,
  48517. w.a = O[l],
  48518. w.b = O[l + 1],
  48519. w.c = O[l + 3],
  48520. _ = new n.Face3,
  48521. _.a = O[l + 1],
  48522. _.b = O[l + 2],
  48523. _.c = O[l + 3],
  48524. l += 4,
  48525. m && (p = O[l++],
  48526. w.materialIndex = p,
  48527. _.materialIndex = p),
  48528. a = s.faces.length,
  48529. v)
  48530. for (r = 0; r < B; r++)
  48531. for (S = e.uvs[r],
  48532. s.faceVertexUvs[r][a] = [],
  48533. s.faceVertexUvs[r][a + 1] = [],
  48534. o = 0; o < 4; o++)
  48535. d = O[l++],
  48536. R = S[2 * d],
  48537. P = S[2 * d + 1],
  48538. M = new n.Vector2(R,P),
  48539. 2 !== o && s.faceVertexUvs[r][a].push(M),
  48540. 0 !== o && s.faceVertexUvs[r][a + 1].push(M);
  48541. if (A && (u = 3 * O[l++],
  48542. w.normal.set(D[u++], D[u++], D[u]),
  48543. _.normal.copy(w.normal)),
  48544. y)
  48545. for (r = 0; r < 4; r++)
  48546. u = 3 * O[l++],
  48547. x = new n.Vector3(D[u++],D[u++],D[u]),
  48548. 2 !== r && w.vertexNormals.push(x),
  48549. 0 !== r && _.vertexNormals.push(x);
  48550. if (C && (h = O[l++],
  48551. T = N[h],
  48552. w.color.setHex(T),
  48553. _.color.setHex(T)),
  48554. I)
  48555. for (r = 0; r < 4; r++)
  48556. h = O[l++],
  48557. T = N[h],
  48558. 2 !== r && w.vertexColors.push(new n.Color(T)),
  48559. 0 !== r && _.vertexColors.push(new n.Color(T));
  48560. s.faces.push(w),
  48561. s.faces.push(_)
  48562. } else {
  48563. if (b = new n.Face3,
  48564. b.a = O[l++],
  48565. b.b = O[l++],
  48566. b.c = O[l++],
  48567. m && (p = O[l++],
  48568. b.materialIndex = p),
  48569. a = s.faces.length,
  48570. v)
  48571. for (r = 0; r < B; r++)
  48572. for (S = e.uvs[r],
  48573. s.faceVertexUvs[r][a] = [],
  48574. o = 0; o < 3; o++)
  48575. d = O[l++],
  48576. R = S[2 * d],
  48577. P = S[2 * d + 1],
  48578. M = new n.Vector2(R,P),
  48579. s.faceVertexUvs[r][a].push(M);
  48580. if (A && (u = 3 * O[l++],
  48581. b.normal.set(D[u++], D[u++], D[u])),
  48582. y)
  48583. for (r = 0; r < 3; r++)
  48584. u = 3 * O[l++],
  48585. x = new n.Vector3(D[u++],D[u++],D[u]),
  48586. b.vertexNormals.push(x);
  48587. if (C && (h = O[l++],
  48588. b.color.setHex(N[h])),
  48589. I)
  48590. for (r = 0; r < 3; r++)
  48591. h = O[l++],
  48592. b.vertexColors.push(new n.Color(N[h]));
  48593. s.faces.push(b)
  48594. }
  48595. }
  48596. function r() {
  48597. var t = void 0 !== e.influencesPerVertex ? e.influencesPerVertex : 2;
  48598. if (e.skinWeights)
  48599. for (var i = 0, r = e.skinWeights.length; i < r; i += t) {
  48600. var o = e.skinWeights[i]
  48601. , a = t > 1 ? e.skinWeights[i + 1] : 0
  48602. , l = t > 2 ? e.skinWeights[i + 2] : 0
  48603. , c = t > 3 ? e.skinWeights[i + 3] : 0;
  48604. s.skinWeights.push(new n.Vector4(o,a,l,c))
  48605. }
  48606. if (e.skinIndices)
  48607. for (var i = 0, r = e.skinIndices.length; i < r; i += t) {
  48608. var h = e.skinIndices[i]
  48609. , u = t > 1 ? e.skinIndices[i + 1] : 0
  48610. , d = t > 2 ? e.skinIndices[i + 2] : 0
  48611. , p = t > 3 ? e.skinIndices[i + 3] : 0;
  48612. s.skinIndices.push(new n.Vector4(h,u,d,p))
  48613. }
  48614. s.bones = e.bones,
  48615. 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.")
  48616. }
  48617. function o(t) {
  48618. if (void 0 !== e.morphTargets)
  48619. for (var i = 0, r = e.morphTargets.length; i < r; i++) {
  48620. s.morphTargets[i] = {},
  48621. s.morphTargets[i].name = e.morphTargets[i].name,
  48622. s.morphTargets[i].vertices = [];
  48623. for (var o = s.morphTargets[i].vertices, a = e.morphTargets[i].vertices, l = 0, c = a.length; l < c; l += 3) {
  48624. var h = new n.Vector3;
  48625. h.x = a[l] * t,
  48626. h.y = a[l + 1] * t,
  48627. h.z = a[l + 2] * t,
  48628. o.push(h)
  48629. }
  48630. }
  48631. if (void 0 !== e.morphColors && e.morphColors.length > 0) {
  48632. console.warn('THREE.JSONLoader: "morphColors" no longer supported. Using them as face colors.');
  48633. for (var u = s.faces, d = e.morphColors[0].colors, i = 0, r = u.length; i < r; i++)
  48634. u[i].color.fromArray(d, 3 * i)
  48635. }
  48636. }
  48637. function a() {
  48638. var t = []
  48639. , i = [];
  48640. void 0 !== e.animation && i.push(e.animation),
  48641. void 0 !== e.animations && (e.animations.length ? i = i.concat(e.animations) : i.push(e.animations));
  48642. for (var r = 0; r < i.length; r++) {
  48643. var o = n.AnimationClip.parseAnimation(i[r], s.bones);
  48644. o && t.push(o)
  48645. }
  48646. if (s.morphTargets) {
  48647. var a = n.AnimationClip.CreateClipsFromMorphTargetSequences(s.morphTargets, 10);
  48648. t = t.concat(a)
  48649. }
  48650. t.length > 0 && (s.animations = t)
  48651. }
  48652. var s = new n.Geometry
  48653. , l = void 0 !== e.scale ? 1 / e.scale : 1;
  48654. if (i(l),
  48655. r(),
  48656. o(l),
  48657. a(),
  48658. s.computeFaceNormals(),
  48659. s.computeBoundingSphere(),
  48660. void 0 === e.materials || 0 === e.materials.length)
  48661. return {
  48662. geometry: s
  48663. };
  48664. var c = n.Loader.prototype.initMaterials(e.materials, t, this.crossOrigin);
  48665. return {
  48666. geometry: s,
  48667. materials: c
  48668. }
  48669. }
  48670. },
  48671. n.LoadingManager = function(e, t, i) {
  48672. var n = this
  48673. , r = !1
  48674. , o = 0
  48675. , a = 0;
  48676. this.onStart = void 0,
  48677. this.onLoad = e,
  48678. this.onProgress = t,
  48679. this.onError = i,
  48680. this.itemStart = function(e) {
  48681. a++,
  48682. r === !1 && void 0 !== n.onStart && n.onStart(e, o, a),
  48683. r = !0
  48684. }
  48685. ,
  48686. this.itemEnd = function(e) {
  48687. o++,
  48688. void 0 !== n.onProgress && n.onProgress(e, o, a),
  48689. o === a && (r = !1,
  48690. void 0 !== n.onLoad && n.onLoad())
  48691. }
  48692. ,
  48693. this.itemError = function(e) {
  48694. void 0 !== n.onError && n.onError(e)
  48695. }
  48696. }
  48697. ,
  48698. n.DefaultLoadingManager = new n.LoadingManager,
  48699. n.BufferGeometryLoader = function(e) {
  48700. this.manager = void 0 !== e ? e : n.DefaultLoadingManager
  48701. }
  48702. ,
  48703. n.BufferGeometryLoader.prototype = {
  48704. constructor: n.BufferGeometryLoader,
  48705. load: function(e, t, i, r) {
  48706. var o = this
  48707. , a = new n.XHRLoader(o.manager);
  48708. a.load(e, function(e) {
  48709. t(o.parse(JSON.parse(e)))
  48710. }, i, r)
  48711. },
  48712. parse: function(e) {
  48713. var t = new n.BufferGeometry
  48714. , i = e.data.index
  48715. , r = {
  48716. Int8Array: Int8Array,
  48717. Uint8Array: Uint8Array,
  48718. Uint8ClampedArray: Uint8ClampedArray,
  48719. Int16Array: Int16Array,
  48720. Uint16Array: Uint16Array,
  48721. Int32Array: Int32Array,
  48722. Uint32Array: Uint32Array,
  48723. Float32Array: Float32Array,
  48724. Float64Array: Float64Array
  48725. };
  48726. if (void 0 !== i) {
  48727. var o = new r[i.type](i.array);
  48728. t.setIndex(new n.BufferAttribute(o,1))
  48729. }
  48730. var a = e.data.attributes;
  48731. for (var s in a) {
  48732. var l = a[s]
  48733. , o = new r[l.type](l.array);
  48734. t.addAttribute(s, new n.BufferAttribute(o,l.itemSize))
  48735. }
  48736. var c = e.data.groups || e.data.drawcalls || e.data.offsets;
  48737. if (void 0 !== c)
  48738. for (var h = 0, u = c.length; h !== u; ++h) {
  48739. var d = c[h];
  48740. t.addGroup(d.start, d.count, d.materialIndex)
  48741. }
  48742. var p = e.data.boundingSphere;
  48743. if (void 0 !== p) {
  48744. var f = new n.Vector3;
  48745. void 0 !== p.center && f.fromArray(p.center),
  48746. t.boundingSphere = new n.Sphere(f,p.radius)
  48747. }
  48748. return t
  48749. }
  48750. },
  48751. n.MaterialLoader = function(e) {
  48752. this.manager = void 0 !== e ? e : n.DefaultLoadingManager,
  48753. this.textures = {}
  48754. }
  48755. ,
  48756. n.MaterialLoader.prototype = {
  48757. constructor: n.MaterialLoader,
  48758. load: function(e, t, i, r) {
  48759. var o = this
  48760. , a = new n.XHRLoader(o.manager);
  48761. a.load(e, function(e) {
  48762. t(o.parse(JSON.parse(e)))
  48763. }, i, r)
  48764. },
  48765. setTextures: function(e) {
  48766. this.textures = e
  48767. },
  48768. getTexture: function(e) {
  48769. var t = this.textures;
  48770. return void 0 === t[e] && console.warn("THREE.MaterialLoader: Undefined texture", e),
  48771. t[e]
  48772. },
  48773. parse: function(e) {
  48774. var t = new n[e.type];
  48775. if (void 0 !== e.uuid && (t.uuid = e.uuid),
  48776. void 0 !== e.name && (t.name = e.name),
  48777. void 0 !== e.color && t.color.setHex(e.color),
  48778. void 0 !== e.roughness && (t.roughness = e.roughness),
  48779. void 0 !== e.metalness && (t.metalness = e.metalness),
  48780. void 0 !== e.emissive && t.emissive.setHex(e.emissive),
  48781. void 0 !== e.specular && t.specular.setHex(e.specular),
  48782. void 0 !== e.shininess && (t.shininess = e.shininess),
  48783. void 0 !== e.uniforms && (t.uniforms = e.uniforms),
  48784. void 0 !== e.vertexShader && (t.vertexShader = e.vertexShader),
  48785. void 0 !== e.fragmentShader && (t.fragmentShader = e.fragmentShader),
  48786. void 0 !== e.vertexColors && (t.vertexColors = e.vertexColors),
  48787. void 0 !== e.shading && (t.shading = e.shading),
  48788. void 0 !== e.blending && (t.blending = e.blending),
  48789. void 0 !== e.side && (t.side = e.side),
  48790. void 0 !== e.opacity && (t.opacity = e.opacity),
  48791. void 0 !== e.transparent && (t.transparent = e.transparent),
  48792. void 0 !== e.alphaTest && (t.alphaTest = e.alphaTest),
  48793. void 0 !== e.depthTest && (t.depthTest = e.depthTest),
  48794. void 0 !== e.depthWrite && (t.depthWrite = e.depthWrite),
  48795. void 0 !== e.colorWrite && (t.colorWrite = e.colorWrite),
  48796. void 0 !== e.wireframe && (t.wireframe = e.wireframe),
  48797. void 0 !== e.wireframeLinewidth && (t.wireframeLinewidth = e.wireframeLinewidth),
  48798. void 0 !== e.size && (t.size = e.size),
  48799. void 0 !== e.sizeAttenuation && (t.sizeAttenuation = e.sizeAttenuation),
  48800. void 0 !== e.map && (t.map = this.getTexture(e.map)),
  48801. void 0 !== e.alphaMap && (t.alphaMap = this.getTexture(e.alphaMap),
  48802. t.transparent = !0),
  48803. void 0 !== e.bumpMap && (t.bumpMap = this.getTexture(e.bumpMap)),
  48804. void 0 !== e.bumpScale && (t.bumpScale = e.bumpScale),
  48805. void 0 !== e.normalMap && (t.normalMap = this.getTexture(e.normalMap)),
  48806. void 0 !== e.normalScale) {
  48807. var i = e.normalScale;
  48808. Array.isArray(i) === !1 && (i = [i, i]),
  48809. t.normalScale = (new n.Vector2).fromArray(i)
  48810. }
  48811. if (void 0 !== e.displacementMap && (t.displacementMap = this.getTexture(e.displacementMap)),
  48812. void 0 !== e.displacementScale && (t.displacementScale = e.displacementScale),
  48813. void 0 !== e.displacementBias && (t.displacementBias = e.displacementBias),
  48814. void 0 !== e.roughnessMap && (t.roughnessMap = this.getTexture(e.roughnessMap)),
  48815. void 0 !== e.metalnessMap && (t.metalnessMap = this.getTexture(e.metalnessMap)),
  48816. void 0 !== e.emissiveMap && (t.emissiveMap = this.getTexture(e.emissiveMap)),
  48817. void 0 !== e.emissiveIntensity && (t.emissiveIntensity = e.emissiveIntensity),
  48818. void 0 !== e.specularMap && (t.specularMap = this.getTexture(e.specularMap)),
  48819. void 0 !== e.envMap && (t.envMap = this.getTexture(e.envMap),
  48820. t.combine = n.MultiplyOperation),
  48821. e.reflectivity && (t.reflectivity = e.reflectivity),
  48822. void 0 !== e.lightMap && (t.lightMap = this.getTexture(e.lightMap)),
  48823. void 0 !== e.lightMapIntensity && (t.lightMapIntensity = e.lightMapIntensity),
  48824. void 0 !== e.aoMap && (t.aoMap = this.getTexture(e.aoMap)),
  48825. void 0 !== e.aoMapIntensity && (t.aoMapIntensity = e.aoMapIntensity),
  48826. void 0 !== e.materials)
  48827. for (var r = 0, o = e.materials.length; r < o; r++)
  48828. t.materials.push(this.parse(e.materials[r]));
  48829. return t
  48830. }
  48831. },
  48832. n.ObjectLoader = function(e) {
  48833. this.manager = void 0 !== e ? e : n.DefaultLoadingManager,
  48834. this.texturePath = ""
  48835. }
  48836. ,
  48837. n.ObjectLoader.prototype = {
  48838. constructor: n.ObjectLoader,
  48839. load: function(e, t, i, r) {
  48840. "" === this.texturePath && (this.texturePath = e.substring(0, e.lastIndexOf("/") + 1));
  48841. var o = this
  48842. , a = new n.XHRLoader(o.manager);
  48843. a.load(e, function(e) {
  48844. o.parse(JSON.parse(e), t)
  48845. }, i, r)
  48846. },
  48847. setTexturePath: function(e) {
  48848. this.texturePath = e
  48849. },
  48850. setCrossOrigin: function(e) {
  48851. this.crossOrigin = e
  48852. },
  48853. parse: function(e, t) {
  48854. var i = this.parseGeometries(e.geometries)
  48855. , n = this.parseImages(e.images, function() {
  48856. void 0 !== t && t(a)
  48857. })
  48858. , r = this.parseTextures(e.textures, n)
  48859. , o = this.parseMaterials(e.materials, r)
  48860. , a = this.parseObject(e.object, i, o);
  48861. return e.animations && (a.animations = this.parseAnimations(e.animations)),
  48862. void 0 !== e.images && 0 !== e.images.length || void 0 !== t && t(a),
  48863. a
  48864. },
  48865. parseGeometries: function(e) {
  48866. var t = {};
  48867. if (void 0 !== e)
  48868. for (var i = new n.JSONLoader, r = new n.BufferGeometryLoader, o = 0, a = e.length; o < a; o++) {
  48869. var s, l = e[o];
  48870. switch (l.type) {
  48871. case "PlaneGeometry":
  48872. case "PlaneBufferGeometry":
  48873. s = new n[l.type](l.width,l.height,l.widthSegments,l.heightSegments);
  48874. break;
  48875. case "BoxGeometry":
  48876. case "BoxBufferGeometry":
  48877. case "CubeGeometry":
  48878. s = new n[l.type](l.width,l.height,l.depth,l.widthSegments,l.heightSegments,l.depthSegments);
  48879. break;
  48880. case "CircleGeometry":
  48881. case "CircleBufferGeometry":
  48882. s = new n[l.type](l.radius,l.segments,l.thetaStart,l.thetaLength);
  48883. break;
  48884. case "CylinderGeometry":
  48885. case "CylinderBufferGeometry":
  48886. s = new n[l.type](l.radiusTop,l.radiusBottom,l.height,l.radialSegments,l.heightSegments,l.openEnded,l.thetaStart,l.thetaLength);
  48887. break;
  48888. case "SphereGeometry":
  48889. case "SphereBufferGeometry":
  48890. s = new n[l.type](l.radius,l.widthSegments,l.heightSegments,l.phiStart,l.phiLength,l.thetaStart,l.thetaLength);
  48891. break;
  48892. case "DodecahedronGeometry":
  48893. s = new n.DodecahedronGeometry(l.radius,l.detail);
  48894. break;
  48895. case "IcosahedronGeometry":
  48896. s = new n.IcosahedronGeometry(l.radius,l.detail);
  48897. break;
  48898. case "OctahedronGeometry":
  48899. s = new n.OctahedronGeometry(l.radius,l.detail);
  48900. break;
  48901. case "TetrahedronGeometry":
  48902. s = new n.TetrahedronGeometry(l.radius,l.detail);
  48903. break;
  48904. case "RingGeometry":
  48905. case "RingBufferGeometry":
  48906. s = new n[l.type](l.innerRadius,l.outerRadius,l.thetaSegments,l.phiSegments,l.thetaStart,l.thetaLength);
  48907. break;
  48908. case "TorusGeometry":
  48909. case "TorusBufferGeometry":
  48910. s = new n[l.type](l.radius,l.tube,l.radialSegments,l.tubularSegments,l.arc);
  48911. break;
  48912. case "TorusKnotGeometry":
  48913. case "TorusKnotBufferGeometry":
  48914. s = new n[l.type](l.radius,l.tube,l.tubularSegments,l.radialSegments,l.p,l.q);
  48915. break;
  48916. case "LatheGeometry":
  48917. s = new n.LatheGeometry(l.points,l.segments,l.phiStart,l.phiLength);
  48918. break;
  48919. case "BufferGeometry":
  48920. s = r.parse(l);
  48921. break;
  48922. case "Geometry":
  48923. s = i.parse(l.data, this.texturePath).geometry;
  48924. break;
  48925. default:
  48926. console.warn('THREE.ObjectLoader: Unsupported geometry type "' + l.type + '"');
  48927. continue
  48928. }
  48929. s.uuid = l.uuid,
  48930. void 0 !== l.name && (s.name = l.name),
  48931. t[l.uuid] = s
  48932. }
  48933. return t
  48934. },
  48935. parseMaterials: function(e, t) {
  48936. var i = {};
  48937. if (void 0 !== e) {
  48938. var r = new n.MaterialLoader;
  48939. r.setTextures(t);
  48940. for (var o = 0, a = e.length; o < a; o++) {
  48941. var s = r.parse(e[o]);
  48942. i[s.uuid] = s
  48943. }
  48944. }
  48945. return i
  48946. },
  48947. parseAnimations: function(e) {
  48948. for (var t = [], i = 0; i < e.length; i++) {
  48949. var r = n.AnimationClip.parse(e[i]);
  48950. t.push(r)
  48951. }
  48952. return t
  48953. },
  48954. parseImages: function(e, t) {
  48955. function i(e) {
  48956. return r.manager.itemStart(e),
  48957. s.load(e, function() {
  48958. r.manager.itemEnd(e)
  48959. })
  48960. }
  48961. var r = this
  48962. , o = {};
  48963. if (void 0 !== e && e.length > 0) {
  48964. var a = new n.LoadingManager(t)
  48965. , s = new n.ImageLoader(a);
  48966. s.setCrossOrigin(this.crossOrigin);
  48967. for (var l = 0, c = e.length; l < c; l++) {
  48968. var h = e[l]
  48969. , u = /^(\/\/)|([a-z]+:(\/\/)?)/i.test(h.url) ? h.url : r.texturePath + h.url;
  48970. o[h.uuid] = i(u)
  48971. }
  48972. }
  48973. return o
  48974. },
  48975. parseTextures: function(e, t) {
  48976. function i(e) {
  48977. return "number" == typeof e ? e : (console.warn("THREE.ObjectLoader.parseTexture: Constant should be in numeric form.", e),
  48978. n[e])
  48979. }
  48980. var r = {};
  48981. if (void 0 !== e)
  48982. for (var o = 0, a = e.length; o < a; o++) {
  48983. var s = e[o];
  48984. void 0 === s.image && console.warn('THREE.ObjectLoader: No "image" specified for', s.uuid),
  48985. void 0 === t[s.image] && console.warn("THREE.ObjectLoader: Undefined image", s.image);
  48986. var l = new n.Texture(t[s.image]);
  48987. l.needsUpdate = !0,
  48988. l.uuid = s.uuid,
  48989. void 0 !== s.name && (l.name = s.name),
  48990. void 0 !== s.mapping && (l.mapping = i(s.mapping)),
  48991. void 0 !== s.offset && (l.offset = new n.Vector2(s.offset[0],s.offset[1])),
  48992. void 0 !== s.repeat && (l.repeat = new n.Vector2(s.repeat[0],s.repeat[1])),
  48993. void 0 !== s.minFilter && (l.minFilter = i(s.minFilter)),
  48994. void 0 !== s.magFilter && (l.magFilter = i(s.magFilter)),
  48995. void 0 !== s.anisotropy && (l.anisotropy = s.anisotropy),
  48996. Array.isArray(s.wrap) && (l.wrapS = i(s.wrap[0]),
  48997. l.wrapT = i(s.wrap[1])),
  48998. r[s.uuid] = l
  48999. }
  49000. return r
  49001. },
  49002. parseObject: function() {
  49003. var e = new n.Matrix4;
  49004. return function(t, i, r) {
  49005. function o(e) {
  49006. return void 0 === i[e] && console.warn("THREE.ObjectLoader: Undefined geometry", e),
  49007. i[e]
  49008. }
  49009. function a(e) {
  49010. if (void 0 !== e)
  49011. return void 0 === r[e] && console.warn("THREE.ObjectLoader: Undefined material", e),
  49012. r[e]
  49013. }
  49014. var s;
  49015. switch (t.type) {
  49016. case "Scene":
  49017. s = new n.Scene;
  49018. break;
  49019. case "PerspectiveCamera":
  49020. s = new n.PerspectiveCamera(t.fov,t.aspect,t.near,t.far);
  49021. break;
  49022. case "OrthographicCamera":
  49023. s = new n.OrthographicCamera(t.left,t.right,t.top,t.bottom,t.near,t.far);
  49024. break;
  49025. case "AmbientLight":
  49026. s = new n.AmbientLight(t.color,t.intensity);
  49027. break;
  49028. case "DirectionalLight":
  49029. s = new n.DirectionalLight(t.color,t.intensity);
  49030. break;
  49031. case "PointLight":
  49032. s = new n.PointLight(t.color,t.intensity,t.distance,t.decay);
  49033. break;
  49034. case "SpotLight":
  49035. s = new n.SpotLight(t.color,t.intensity,t.distance,t.angle,t.penumbra,t.decay);
  49036. break;
  49037. case "HemisphereLight":
  49038. s = new n.HemisphereLight(t.color,t.groundColor,t.intensity);
  49039. break;
  49040. case "Mesh":
  49041. var l = o(t.geometry)
  49042. , c = a(t.material);
  49043. s = l.bones && l.bones.length > 0 ? new n.SkinnedMesh(l,c) : new n.Mesh(l,c);
  49044. break;
  49045. case "LOD":
  49046. s = new n.LOD;
  49047. break;
  49048. case "Line":
  49049. s = new n.Line(o(t.geometry),a(t.material),t.mode);
  49050. break;
  49051. case "PointCloud":
  49052. case "Points":
  49053. s = new n.Points(o(t.geometry),a(t.material));
  49054. break;
  49055. case "Sprite":
  49056. s = new n.Sprite(a(t.material));
  49057. break;
  49058. case "Group":
  49059. s = new n.Group;
  49060. break;
  49061. default:
  49062. s = new n.Object3D
  49063. }
  49064. if (s.uuid = t.uuid,
  49065. void 0 !== t.name && (s.name = t.name),
  49066. void 0 !== t.matrix ? (e.fromArray(t.matrix),
  49067. e.decompose(s.position, s.quaternion, s.scale)) : (void 0 !== t.position && s.position.fromArray(t.position),
  49068. void 0 !== t.rotation && s.rotation.fromArray(t.rotation),
  49069. void 0 !== t.scale && s.scale.fromArray(t.scale)),
  49070. void 0 !== t.castShadow && (s.castShadow = t.castShadow),
  49071. void 0 !== t.receiveShadow && (s.receiveShadow = t.receiveShadow),
  49072. void 0 !== t.visible && (s.visible = t.visible),
  49073. void 0 !== t.userData && (s.userData = t.userData),
  49074. void 0 !== t.children)
  49075. for (var h in t.children)
  49076. s.add(this.parseObject(t.children[h], i, r));
  49077. if ("LOD" === t.type)
  49078. for (var u = t.levels, d = 0; d < u.length; d++) {
  49079. var p = u[d]
  49080. , h = s.getObjectByProperty("uuid", p.object);
  49081. void 0 !== h && s.addLevel(h, p.distance)
  49082. }
  49083. return s
  49084. }
  49085. }()
  49086. },
  49087. n.TextureLoader = function(e) {
  49088. this.manager = void 0 !== e ? e : n.DefaultLoadingManager
  49089. }
  49090. ,
  49091. n.TextureLoader.prototype = {
  49092. constructor: n.TextureLoader,
  49093. load: function(e, t, i, r) {
  49094. var o = new n.Texture
  49095. , a = new n.ImageLoader(this.manager);
  49096. return a.setCrossOrigin(this.crossOrigin),
  49097. a.setPath(this.path),
  49098. a.load(e, function(e) {
  49099. o.image = e,
  49100. o.needsUpdate = !0,
  49101. void 0 !== t && t(o)
  49102. }, i, r),
  49103. o
  49104. },
  49105. setCrossOrigin: function(e) {
  49106. this.crossOrigin = e
  49107. },
  49108. setPath: function(e) {
  49109. this.path = e
  49110. }
  49111. },
  49112. n.CubeTextureLoader = function(e) {
  49113. this.manager = void 0 !== e ? e : n.DefaultLoadingManager
  49114. }
  49115. ,
  49116. n.CubeTextureLoader.prototype = {
  49117. constructor: n.CubeTextureLoader,
  49118. load: function(e, t, i, r) {
  49119. function o(i) {
  49120. s.load(e[i], function(e) {
  49121. a.images[i] = e,
  49122. l++,
  49123. 6 === l && (a.needsUpdate = !0,
  49124. t && t(a))
  49125. }, void 0, r)
  49126. }
  49127. var a = new n.CubeTexture
  49128. , s = new n.ImageLoader(this.manager);
  49129. s.setCrossOrigin(this.crossOrigin),
  49130. s.setPath(this.path);
  49131. for (var l = 0, c = 0; c < e.length; ++c)
  49132. o(c);
  49133. return a
  49134. },
  49135. setCrossOrigin: function(e) {
  49136. this.crossOrigin = e
  49137. },
  49138. setPath: function(e) {
  49139. this.path = e
  49140. }
  49141. },
  49142. n.DataTextureLoader = n.BinaryTextureLoader = function(e) {
  49143. this.manager = void 0 !== e ? e : n.DefaultLoadingManager,
  49144. this._parser = null
  49145. }
  49146. ,
  49147. n.BinaryTextureLoader.prototype = {
  49148. constructor: n.BinaryTextureLoader,
  49149. load: function(e, t, i, r) {
  49150. var o = this
  49151. , a = new n.DataTexture
  49152. , s = new n.XHRLoader(this.manager);
  49153. return s.setResponseType("arraybuffer"),
  49154. s.load(e, function(e) {
  49155. var i = o._parser(e);
  49156. i && (void 0 !== i.image ? a.image = i.image : void 0 !== i.data && (a.image.width = i.width,
  49157. a.image.height = i.height,
  49158. a.image.data = i.data),
  49159. a.wrapS = void 0 !== i.wrapS ? i.wrapS : n.ClampToEdgeWrapping,
  49160. a.wrapT = void 0 !== i.wrapT ? i.wrapT : n.ClampToEdgeWrapping,
  49161. a.magFilter = void 0 !== i.magFilter ? i.magFilter : n.LinearFilter,
  49162. a.minFilter = void 0 !== i.minFilter ? i.minFilter : n.LinearMipMapLinearFilter,
  49163. a.anisotropy = void 0 !== i.anisotropy ? i.anisotropy : 1,
  49164. void 0 !== i.format && (a.format = i.format),
  49165. void 0 !== i.type && (a.type = i.type),
  49166. void 0 !== i.mipmaps && (a.mipmaps = i.mipmaps),
  49167. 1 === i.mipmapCount && (a.minFilter = n.LinearFilter),
  49168. a.needsUpdate = !0,
  49169. t && t(a, i))
  49170. }, i, r),
  49171. a
  49172. }
  49173. },
  49174. n.CompressedTextureLoader = function(e) {
  49175. this.manager = void 0 !== e ? e : n.DefaultLoadingManager,
  49176. this._parser = null
  49177. }
  49178. ;
  49179. n.CompressedTextureLoader.prototype = {
  49180. constructor: n.CompressedTextureLoader,
  49181. load: function(e, t, i, r) {
  49182. function o(o) {
  49183. c.load(e[o], function(e) {
  49184. var i = a._parser(e, !0);
  49185. s[o] = {
  49186. width: i.width,
  49187. height: i.height,
  49188. format: i.format,
  49189. mipmaps: i.mipmaps
  49190. },
  49191. h += 1,
  49192. 6 === h && (1 === i.mipmapCount && (l.minFilter = n.LinearFilter),
  49193. l.format = i.format,
  49194. l.needsUpdate = !0,
  49195. t && t(l))
  49196. }, i, r)
  49197. }
  49198. var a = this
  49199. , s = []
  49200. , l = new n.CompressedTexture;
  49201. l.image = s;
  49202. var c = new n.XHRLoader(this.manager);
  49203. if (c.setPath(this.path),
  49204. c.setResponseType("arraybuffer"),
  49205. Array.isArray(e))
  49206. for (var h = 0, u = 0, d = e.length; u < d; ++u)
  49207. o(u);
  49208. else
  49209. c.load(e, function(e) {
  49210. var i = a._parser(e, !0);
  49211. if (i.isCubemap)
  49212. for (var r = i.mipmaps.length / i.mipmapCount, o = 0; o < r; o++) {
  49213. s[o] = {
  49214. mipmaps: []
  49215. };
  49216. for (var c = 0; c < i.mipmapCount; c++)
  49217. s[o].mipmaps.push(i.mipmaps[o * i.mipmapCount + c]),
  49218. s[o].format = i.format,
  49219. s[o].width = i.width,
  49220. s[o].height = i.height
  49221. }
  49222. else
  49223. l.image.width = i.width,
  49224. l.image.height = i.height,
  49225. l.mipmaps = i.mipmaps;
  49226. 1 === i.mipmapCount && (l.minFilter = n.LinearFilter),
  49227. l.format = i.format,
  49228. l.needsUpdate = !0,
  49229. t && t(l)
  49230. }, i, r);
  49231. return l
  49232. },
  49233. setPath: function(e) {
  49234. this.path = e
  49235. }
  49236. };
  49237. n.Material = function() {
  49238. Object.defineProperty(this, "id", {
  49239. value: n.MaterialIdCount++
  49240. }),
  49241. this.uuid = n.Math.generateUUID(),
  49242. this.name = "",
  49243. this.type = "Material",
  49244. this.side = n.FrontSide,
  49245. this.opacity = 1,
  49246. this.transparent = !1,
  49247. this.blending = n.NormalBlending,
  49248. this.blendSrc = n.SrcAlphaFactor,
  49249. this.blendDst = n.OneMinusSrcAlphaFactor,
  49250. this.blendEquation = n.AddEquation,
  49251. this.blendSrcAlpha = null,
  49252. this.blendDstAlpha = null,
  49253. this.blendEquationAlpha = null,
  49254. this.depthFunc = n.LessEqualDepth,
  49255. this.depthTest = !0,
  49256. this.depthWrite = !0,
  49257. this.colorWrite = !0,
  49258. this.precision = null,
  49259. this.polygonOffset = !1,
  49260. this.polygonOffsetFactor = 0,
  49261. this.polygonOffsetUnits = 0,
  49262. this.alphaTest = 0,
  49263. this.premultipliedAlpha = !1,
  49264. this.overdraw = 0,
  49265. this.visible = !0,
  49266. this._needsUpdate = !0
  49267. }
  49268. ,
  49269. n.Material.prototype = {
  49270. constructor: n.Material,
  49271. get needsUpdate() {
  49272. return this._needsUpdate
  49273. },
  49274. set needsUpdate(e) {
  49275. e === !0 && this.update(),
  49276. this._needsUpdate = e
  49277. },
  49278. setValues: function(e) {
  49279. if (void 0 !== e)
  49280. for (var t in e) {
  49281. var i = e[t];
  49282. if (void 0 !== i) {
  49283. var r = this[t];
  49284. 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.")
  49285. } else
  49286. console.warn("THREE.Material: '" + t + "' parameter is undefined.")
  49287. }
  49288. },
  49289. toJSON: function(e) {
  49290. function t(e) {
  49291. var t = [];
  49292. for (var i in e) {
  49293. var n = e[i];
  49294. delete n.metadata,
  49295. t.push(n)
  49296. }
  49297. return t
  49298. }
  49299. var i = void 0 === e;
  49300. i && (e = {
  49301. textures: {},
  49302. images: {}
  49303. });
  49304. var r = {
  49305. metadata: {
  49306. version: 4.4,
  49307. type: "Material",
  49308. generator: "Material.toJSON"
  49309. }
  49310. };
  49311. if (r.uuid = this.uuid,
  49312. r.type = this.type,
  49313. "" !== this.name && (r.name = this.name),
  49314. this.color instanceof n.Color && (r.color = this.color.getHex()),
  49315. .5 !== this.roughness && (r.roughness = this.roughness),
  49316. .5 !== this.metalness && (r.metalness = this.metalness),
  49317. this.emissive instanceof n.Color && (r.emissive = this.emissive.getHex()),
  49318. this.specular instanceof n.Color && (r.specular = this.specular.getHex()),
  49319. void 0 !== this.shininess && (r.shininess = this.shininess),
  49320. this.map instanceof n.Texture && (r.map = this.map.toJSON(e).uuid),
  49321. this.alphaMap instanceof n.Texture && (r.alphaMap = this.alphaMap.toJSON(e).uuid),
  49322. this.lightMap instanceof n.Texture && (r.lightMap = this.lightMap.toJSON(e).uuid),
  49323. this.bumpMap instanceof n.Texture && (r.bumpMap = this.bumpMap.toJSON(e).uuid,
  49324. r.bumpScale = this.bumpScale),
  49325. this.normalMap instanceof n.Texture && (r.normalMap = this.normalMap.toJSON(e).uuid,
  49326. r.normalScale = this.normalScale.toArray()),
  49327. this.displacementMap instanceof n.Texture && (r.displacementMap = this.displacementMap.toJSON(e).uuid,
  49328. r.displacementScale = this.displacementScale,
  49329. r.displacementBias = this.displacementBias),
  49330. this.roughnessMap instanceof n.Texture && (r.roughnessMap = this.roughnessMap.toJSON(e).uuid),
  49331. this.metalnessMap instanceof n.Texture && (r.metalnessMap = this.metalnessMap.toJSON(e).uuid),
  49332. this.emissiveMap instanceof n.Texture && (r.emissiveMap = this.emissiveMap.toJSON(e).uuid),
  49333. this.specularMap instanceof n.Texture && (r.specularMap = this.specularMap.toJSON(e).uuid),
  49334. this.envMap instanceof n.Texture && (r.envMap = this.envMap.toJSON(e).uuid,
  49335. r.reflectivity = this.reflectivity),
  49336. void 0 !== this.size && (r.size = this.size),
  49337. void 0 !== this.sizeAttenuation && (r.sizeAttenuation = this.sizeAttenuation),
  49338. void 0 !== this.vertexColors && this.vertexColors !== n.NoColors && (r.vertexColors = this.vertexColors),
  49339. void 0 !== this.shading && this.shading !== n.SmoothShading && (r.shading = this.shading),
  49340. void 0 !== this.blending && this.blending !== n.NormalBlending && (r.blending = this.blending),
  49341. void 0 !== this.side && this.side !== n.FrontSide && (r.side = this.side),
  49342. this.opacity < 1 && (r.opacity = this.opacity),
  49343. this.transparent === !0 && (r.transparent = this.transparent),
  49344. this.alphaTest > 0 && (r.alphaTest = this.alphaTest),
  49345. this.premultipliedAlpha === !0 && (r.premultipliedAlpha = this.premultipliedAlpha),
  49346. this.wireframe === !0 && (r.wireframe = this.wireframe),
  49347. this.wireframeLinewidth > 1 && (r.wireframeLinewidth = this.wireframeLinewidth),
  49348. i) {
  49349. var o = t(e.textures)
  49350. , a = t(e.images);
  49351. o.length > 0 && (r.textures = o),
  49352. a.length > 0 && (r.images = a)
  49353. }
  49354. return r
  49355. },
  49356. clone: function() {
  49357. return (new this.constructor).copy(this)
  49358. },
  49359. copy: function(e) {
  49360. return this.name = e.name,
  49361. this.side = e.side,
  49362. this.opacity = e.opacity,
  49363. this.transparent = e.transparent,
  49364. this.blending = e.blending,
  49365. this.blendSrc = e.blendSrc,
  49366. this.blendDst = e.blendDst,
  49367. this.blendEquation = e.blendEquation,
  49368. this.blendSrcAlpha = e.blendSrcAlpha,
  49369. this.blendDstAlpha = e.blendDstAlpha,
  49370. this.blendEquationAlpha = e.blendEquationAlpha,
  49371. this.depthFunc = e.depthFunc,
  49372. this.depthTest = e.depthTest,
  49373. this.depthWrite = e.depthWrite,
  49374. this.colorWrite = e.colorWrite,
  49375. this.precision = e.precision,
  49376. this.polygonOffset = e.polygonOffset,
  49377. this.polygonOffsetFactor = e.polygonOffsetFactor,
  49378. this.polygonOffsetUnits = e.polygonOffsetUnits,
  49379. this.alphaTest = e.alphaTest,
  49380. this.premultipliedAlpha = e.premultipliedAlpha,
  49381. this.overdraw = e.overdraw,
  49382. this.visible = e.visible,
  49383. this
  49384. },
  49385. update: function() {
  49386. this.dispatchEvent({
  49387. type: "update"
  49388. })
  49389. },
  49390. dispose: function() {
  49391. this.dispatchEvent({
  49392. type: "dispose"
  49393. })
  49394. }
  49395. },
  49396. n.EventDispatcher.prototype.apply(n.Material.prototype),
  49397. n.MaterialIdCount = 0,
  49398. n.LineBasicMaterial = function(e) {
  49399. n.Material.call(this),
  49400. this.type = "LineBasicMaterial",
  49401. this.color = new n.Color(16777215),
  49402. this.linewidth = 1,
  49403. this.linecap = "round",
  49404. this.linejoin = "round",
  49405. this.blending = n.NormalBlending,
  49406. this.vertexColors = n.NoColors,
  49407. this.fog = !0,
  49408. this.setValues(e)
  49409. }
  49410. ,
  49411. n.LineBasicMaterial.prototype = Object.create(n.Material.prototype),
  49412. n.LineBasicMaterial.prototype.constructor = n.LineBasicMaterial,
  49413. n.LineBasicMaterial.prototype.copy = function(e) {
  49414. return n.Material.prototype.copy.call(this, e),
  49415. this.color.copy(e.color),
  49416. this.linewidth = e.linewidth,
  49417. this.linecap = e.linecap,
  49418. this.linejoin = e.linejoin,
  49419. this.vertexColors = e.vertexColors,
  49420. this.fog = e.fog,
  49421. this
  49422. }
  49423. ,
  49424. n.LineDashedMaterial = function(e) {
  49425. n.Material.call(this),
  49426. this.type = "LineDashedMaterial",
  49427. this.color = new n.Color(16777215),
  49428. this.linewidth = 1,
  49429. this.scale = 1,
  49430. this.dashSize = 3,
  49431. this.gapSize = 1,
  49432. this.blending = n.NormalBlending,
  49433. this.vertexColors = n.NoColors,
  49434. this.fog = !0,
  49435. this.setValues(e)
  49436. }
  49437. ,
  49438. n.LineDashedMaterial.prototype = Object.create(n.Material.prototype),
  49439. n.LineDashedMaterial.prototype.constructor = n.LineDashedMaterial,
  49440. n.LineDashedMaterial.prototype.copy = function(e) {
  49441. return n.Material.prototype.copy.call(this, e),
  49442. this.color.copy(e.color),
  49443. this.linewidth = e.linewidth,
  49444. this.scale = e.scale,
  49445. this.dashSize = e.dashSize,
  49446. this.gapSize = e.gapSize,
  49447. this.vertexColors = e.vertexColors,
  49448. this.fog = e.fog,
  49449. this
  49450. }
  49451. ,
  49452. n.MeshBasicMaterial = function(e) {
  49453. n.Material.call(this),
  49454. this.type = "MeshBasicMaterial",
  49455. this.color = new n.Color(16777215),
  49456. this.map = null,
  49457. this.aoMap = null,
  49458. this.aoMapIntensity = 1,
  49459. this.specularMap = null,
  49460. this.alphaMap = null,
  49461. this.envMap = null,
  49462. this.combine = n.MultiplyOperation,
  49463. this.reflectivity = 1,
  49464. this.refractionRatio = .98,
  49465. this.fog = !0,
  49466. this.shading = n.SmoothShading,
  49467. this.blending = n.NormalBlending,
  49468. this.wireframe = !1,
  49469. this.wireframeLinewidth = 1,
  49470. this.wireframeLinecap = "round",
  49471. this.wireframeLinejoin = "round",
  49472. this.vertexColors = n.NoColors,
  49473. this.skinning = !1,
  49474. this.morphTargets = !1,
  49475. this.setValues(e)
  49476. }
  49477. ,
  49478. n.MeshBasicMaterial.prototype = Object.create(n.Material.prototype),
  49479. n.MeshBasicMaterial.prototype.constructor = n.MeshBasicMaterial,
  49480. n.MeshBasicMaterial.prototype.copy = function(e) {
  49481. return n.Material.prototype.copy.call(this, e),
  49482. this.color.copy(e.color),
  49483. this.map = e.map,
  49484. this.aoMap = e.aoMap,
  49485. this.aoMapIntensity = e.aoMapIntensity,
  49486. this.specularMap = e.specularMap,
  49487. this.alphaMap = e.alphaMap,
  49488. this.envMap = e.envMap,
  49489. this.combine = e.combine,
  49490. this.reflectivity = e.reflectivity,
  49491. this.refractionRatio = e.refractionRatio,
  49492. this.fog = e.fog,
  49493. this.shading = e.shading,
  49494. this.wireframe = e.wireframe,
  49495. this.wireframeLinewidth = e.wireframeLinewidth,
  49496. this.wireframeLinecap = e.wireframeLinecap,
  49497. this.wireframeLinejoin = e.wireframeLinejoin,
  49498. this.vertexColors = e.vertexColors,
  49499. this.skinning = e.skinning,
  49500. this.morphTargets = e.morphTargets,
  49501. this
  49502. }
  49503. ,
  49504. n.MeshLambertMaterial = function(e) {
  49505. n.Material.call(this),
  49506. this.type = "MeshLambertMaterial",
  49507. this.color = new n.Color(16777215),
  49508. this.map = null,
  49509. this.lightMap = null,
  49510. this.lightMapIntensity = 1,
  49511. this.aoMap = null,
  49512. this.aoMapIntensity = 1,
  49513. this.emissive = new n.Color(0),
  49514. this.emissiveIntensity = 1,
  49515. this.emissiveMap = null,
  49516. this.specularMap = null,
  49517. this.alphaMap = null,
  49518. this.envMap = null,
  49519. this.combine = n.MultiplyOperation,
  49520. this.reflectivity = 1,
  49521. this.refractionRatio = .98,
  49522. this.fog = !0,
  49523. this.blending = n.NormalBlending,
  49524. this.wireframe = !1,
  49525. this.wireframeLinewidth = 1,
  49526. this.wireframeLinecap = "round",
  49527. this.wireframeLinejoin = "round",
  49528. this.vertexColors = n.NoColors,
  49529. this.skinning = !1,
  49530. this.morphTargets = !1,
  49531. this.morphNormals = !1,
  49532. this.setValues(e)
  49533. }
  49534. ,
  49535. n.MeshLambertMaterial.prototype = Object.create(n.Material.prototype),
  49536. n.MeshLambertMaterial.prototype.constructor = n.MeshLambertMaterial,
  49537. n.MeshLambertMaterial.prototype.copy = function(e) {
  49538. return n.Material.prototype.copy.call(this, e),
  49539. this.color.copy(e.color),
  49540. this.map = e.map,
  49541. this.lightMap = e.lightMap,
  49542. this.lightMapIntensity = e.lightMapIntensity,
  49543. this.aoMap = e.aoMap,
  49544. this.aoMapIntensity = e.aoMapIntensity,
  49545. this.emissive.copy(e.emissive),
  49546. this.emissiveMap = e.emissiveMap,
  49547. this.emissiveIntensity = e.emissiveIntensity,
  49548. this.specularMap = e.specularMap,
  49549. this.alphaMap = e.alphaMap,
  49550. this.envMap = e.envMap,
  49551. this.combine = e.combine,
  49552. this.reflectivity = e.reflectivity,
  49553. this.refractionRatio = e.refractionRatio,
  49554. this.fog = e.fog,
  49555. this.wireframe = e.wireframe,
  49556. this.wireframeLinewidth = e.wireframeLinewidth,
  49557. this.wireframeLinecap = e.wireframeLinecap,
  49558. this.wireframeLinejoin = e.wireframeLinejoin,
  49559. this.vertexColors = e.vertexColors,
  49560. this.skinning = e.skinning,
  49561. this.morphTargets = e.morphTargets,
  49562. this.morphNormals = e.morphNormals,
  49563. this
  49564. }
  49565. ,
  49566. n.MeshPhongMaterial = function(e) {
  49567. n.Material.call(this),
  49568. this.type = "MeshPhongMaterial",
  49569. this.color = new n.Color(16777215),
  49570. this.specular = new n.Color(1118481),
  49571. this.shininess = 30,
  49572. this.map = null,
  49573. this.lightMap = null,
  49574. this.lightMapIntensity = 1,
  49575. this.aoMap = null,
  49576. this.aoMapIntensity = 1,
  49577. this.emissive = new n.Color(0),
  49578. this.emissiveIntensity = 1,
  49579. this.emissiveMap = null,
  49580. this.bumpMap = null,
  49581. this.bumpScale = 1,
  49582. this.normalMap = null,
  49583. this.normalScale = new n.Vector2(1,1),
  49584. this.displacementMap = null,
  49585. this.displacementScale = 1,
  49586. this.displacementBias = 0,
  49587. this.specularMap = null,
  49588. this.alphaMap = null,
  49589. this.envMap = null,
  49590. this.combine = n.MultiplyOperation,
  49591. this.reflectivity = 1,
  49592. this.refractionRatio = .98,
  49593. this.fog = !0,
  49594. this.shading = n.SmoothShading,
  49595. this.blending = n.NormalBlending,
  49596. this.wireframe = !1,
  49597. this.wireframeLinewidth = 1,
  49598. this.wireframeLinecap = "round",
  49599. this.wireframeLinejoin = "round",
  49600. this.vertexColors = n.NoColors,
  49601. this.skinning = !1,
  49602. this.morphTargets = !1,
  49603. this.morphNormals = !1,
  49604. this.setValues(e)
  49605. }
  49606. ,
  49607. n.MeshPhongMaterial.prototype = Object.create(n.Material.prototype),
  49608. n.MeshPhongMaterial.prototype.constructor = n.MeshPhongMaterial,
  49609. n.MeshPhongMaterial.prototype.copy = function(e) {
  49610. return n.Material.prototype.copy.call(this, e),
  49611. this.color.copy(e.color),
  49612. this.specular.copy(e.specular),
  49613. this.shininess = e.shininess,
  49614. this.map = e.map,
  49615. this.lightMap = e.lightMap,
  49616. this.lightMapIntensity = e.lightMapIntensity,
  49617. this.aoMap = e.aoMap,
  49618. this.aoMapIntensity = e.aoMapIntensity,
  49619. this.emissive.copy(e.emissive),
  49620. this.emissiveMap = e.emissiveMap,
  49621. this.emissiveIntensity = e.emissiveIntensity,
  49622. this.bumpMap = e.bumpMap,
  49623. this.bumpScale = e.bumpScale,
  49624. this.normalMap = e.normalMap,
  49625. this.normalScale.copy(e.normalScale),
  49626. this.displacementMap = e.displacementMap,
  49627. this.displacementScale = e.displacementScale,
  49628. this.displacementBias = e.displacementBias,
  49629. this.specularMap = e.specularMap,
  49630. this.alphaMap = e.alphaMap,
  49631. this.envMap = e.envMap,
  49632. this.combine = e.combine,
  49633. this.reflectivity = e.reflectivity,
  49634. this.refractionRatio = e.refractionRatio,
  49635. this.fog = e.fog,
  49636. this.shading = e.shading,
  49637. this.wireframe = e.wireframe,
  49638. this.wireframeLinewidth = e.wireframeLinewidth,
  49639. this.wireframeLinecap = e.wireframeLinecap,
  49640. this.wireframeLinejoin = e.wireframeLinejoin,
  49641. this.vertexColors = e.vertexColors,
  49642. this.skinning = e.skinning,
  49643. this.morphTargets = e.morphTargets,
  49644. this.morphNormals = e.morphNormals,
  49645. this
  49646. }
  49647. ,
  49648. n.MeshStandardMaterial = function(e) {
  49649. n.Material.call(this),
  49650. this.type = "MeshStandardMaterial",
  49651. this.color = new n.Color(16777215),
  49652. this.roughness = .5,
  49653. this.metalness = .5,
  49654. this.map = null,
  49655. this.lightMap = null,
  49656. this.lightMapIntensity = 1,
  49657. this.aoMap = null,
  49658. this.aoMapIntensity = 1,
  49659. this.emissive = new n.Color(0),
  49660. this.emissiveIntensity = 1,
  49661. this.emissiveMap = null,
  49662. this.bumpMap = null,
  49663. this.bumpScale = 1,
  49664. this.normalMap = null,
  49665. this.normalScale = new n.Vector2(1,1),
  49666. this.displacementMap = null,
  49667. this.displacementScale = 1,
  49668. this.displacementBias = 0,
  49669. this.roughnessMap = null,
  49670. this.metalnessMap = null,
  49671. this.alphaMap = null,
  49672. this.envMap = null,
  49673. this.envMapIntensity = 1,
  49674. this.refractionRatio = .98,
  49675. this.fog = !0,
  49676. this.shading = n.SmoothShading,
  49677. this.blending = n.NormalBlending,
  49678. this.wireframe = !1,
  49679. this.wireframeLinewidth = 1,
  49680. this.wireframeLinecap = "round",
  49681. this.wireframeLinejoin = "round",
  49682. this.vertexColors = n.NoColors,
  49683. this.skinning = !1,
  49684. this.morphTargets = !1,
  49685. this.morphNormals = !1,
  49686. this.setValues(e)
  49687. }
  49688. ,
  49689. n.MeshStandardMaterial.prototype = Object.create(n.Material.prototype),
  49690. n.MeshStandardMaterial.prototype.constructor = n.MeshStandardMaterial,
  49691. n.MeshStandardMaterial.prototype.copy = function(e) {
  49692. return n.Material.prototype.copy.call(this, e),
  49693. this.color.copy(e.color),
  49694. this.roughness = e.roughness,
  49695. this.metalness = e.metalness,
  49696. this.map = e.map,
  49697. this.lightMap = e.lightMap,
  49698. this.lightMapIntensity = e.lightMapIntensity,
  49699. this.aoMap = e.aoMap,
  49700. this.aoMapIntensity = e.aoMapIntensity,
  49701. this.emissive.copy(e.emissive),
  49702. this.emissiveMap = e.emissiveMap,
  49703. this.emissiveIntensity = e.emissiveIntensity,
  49704. this.bumpMap = e.bumpMap,
  49705. this.bumpScale = e.bumpScale,
  49706. this.normalMap = e.normalMap,
  49707. this.normalScale.copy(e.normalScale),
  49708. this.displacementMap = e.displacementMap,
  49709. this.displacementScale = e.displacementScale,
  49710. this.displacementBias = e.displacementBias,
  49711. this.roughnessMap = e.roughnessMap,
  49712. this.metalnessMap = e.metalnessMap,
  49713. this.alphaMap = e.alphaMap,
  49714. this.envMap = e.envMap,
  49715. this.envMapIntensity = e.envMapIntensity,
  49716. this.refractionRatio = e.refractionRatio,
  49717. this.fog = e.fog,
  49718. this.shading = e.shading,
  49719. this.wireframe = e.wireframe,
  49720. this.wireframeLinewidth = e.wireframeLinewidth,
  49721. this.wireframeLinecap = e.wireframeLinecap,
  49722. this.wireframeLinejoin = e.wireframeLinejoin,
  49723. this.vertexColors = e.vertexColors,
  49724. this.skinning = e.skinning,
  49725. this.morphTargets = e.morphTargets,
  49726. this.morphNormals = e.morphNormals,
  49727. this
  49728. }
  49729. ,
  49730. n.MeshDepthMaterial = function(e) {
  49731. n.Material.call(this),
  49732. this.type = "MeshDepthMaterial",
  49733. this.morphTargets = !1,
  49734. this.wireframe = !1,
  49735. this.wireframeLinewidth = 1,
  49736. this.setValues(e)
  49737. }
  49738. ,
  49739. n.MeshDepthMaterial.prototype = Object.create(n.Material.prototype),
  49740. n.MeshDepthMaterial.prototype.constructor = n.MeshDepthMaterial,
  49741. n.MeshDepthMaterial.prototype.copy = function(e) {
  49742. return n.Material.prototype.copy.call(this, e),
  49743. this.wireframe = e.wireframe,
  49744. this.wireframeLinewidth = e.wireframeLinewidth,
  49745. this
  49746. }
  49747. ,
  49748. n.MeshNormalMaterial = function(e) {
  49749. n.Material.call(this, e),
  49750. this.type = "MeshNormalMaterial",
  49751. this.wireframe = !1,
  49752. this.wireframeLinewidth = 1,
  49753. this.morphTargets = !1,
  49754. this.setValues(e)
  49755. }
  49756. ,
  49757. n.MeshNormalMaterial.prototype = Object.create(n.Material.prototype),
  49758. n.MeshNormalMaterial.prototype.constructor = n.MeshNormalMaterial,
  49759. n.MeshNormalMaterial.prototype.copy = function(e) {
  49760. return n.Material.prototype.copy.call(this, e),
  49761. this.wireframe = e.wireframe,
  49762. this.wireframeLinewidth = e.wireframeLinewidth,
  49763. this
  49764. }
  49765. ,
  49766. n.MultiMaterial = function(e) {
  49767. this.uuid = n.Math.generateUUID(),
  49768. this.type = "MultiMaterial",
  49769. this.materials = e instanceof Array ? e : [],
  49770. this.visible = !0
  49771. }
  49772. ,
  49773. n.MultiMaterial.prototype = {
  49774. constructor: n.MultiMaterial,
  49775. toJSON: function(e) {
  49776. for (var t = {
  49777. metadata: {
  49778. version: 4.2,
  49779. type: "material",
  49780. generator: "MaterialExporter"
  49781. },
  49782. uuid: this.uuid,
  49783. type: this.type,
  49784. materials: []
  49785. }, i = this.materials, n = 0, r = i.length; n < r; n++) {
  49786. var o = i[n].toJSON(e);
  49787. delete o.metadata,
  49788. t.materials.push(o)
  49789. }
  49790. return t.visible = this.visible,
  49791. t
  49792. },
  49793. clone: function() {
  49794. for (var e = new this.constructor, t = 0; t < this.materials.length; t++)
  49795. e.materials.push(this.materials[t].clone());
  49796. return e.visible = this.visible,
  49797. e
  49798. }
  49799. },
  49800. n.PointsMaterial = function(e) {
  49801. n.Material.call(this),
  49802. this.type = "PointsMaterial",
  49803. this.color = new n.Color(16777215),
  49804. this.map = null,
  49805. this.size = 1,
  49806. this.sizeAttenuation = !0,
  49807. this.blending = n.NormalBlending,
  49808. this.vertexColors = n.NoColors,
  49809. this.fog = !0,
  49810. this.setValues(e)
  49811. }
  49812. ,
  49813. n.PointsMaterial.prototype = Object.create(n.Material.prototype),
  49814. n.PointsMaterial.prototype.constructor = n.PointsMaterial,
  49815. n.PointsMaterial.prototype.copy = function(e) {
  49816. return n.Material.prototype.copy.call(this, e),
  49817. this.color.copy(e.color),
  49818. this.map = e.map,
  49819. this.size = e.size,
  49820. this.sizeAttenuation = e.sizeAttenuation,
  49821. this.vertexColors = e.vertexColors,
  49822. this.fog = e.fog,
  49823. this
  49824. }
  49825. ,
  49826. n.ShaderMaterial = function(e) {
  49827. n.Material.call(this),
  49828. this.type = "ShaderMaterial",
  49829. this.defines = {},
  49830. this.uniforms = {},
  49831. this.vertexShader = "void main() {\n\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}",
  49832. this.fragmentShader = "void main() {\n\tgl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );\n}",
  49833. this.shading = n.SmoothShading,
  49834. this.linewidth = 1,
  49835. this.wireframe = !1,
  49836. this.wireframeLinewidth = 1,
  49837. this.fog = !1,
  49838. this.lights = !1,
  49839. this.vertexColors = n.NoColors,
  49840. this.skinning = !1,
  49841. this.morphTargets = !1,
  49842. this.morphNormals = !1,
  49843. this.extensions = {
  49844. derivatives: !1,
  49845. fragDepth: !1,
  49846. drawBuffers: !1,
  49847. shaderTextureLOD: !1
  49848. },
  49849. this.defaultAttributeValues = {
  49850. color: [1, 1, 1],
  49851. uv: [0, 0],
  49852. uv2: [0, 0]
  49853. },
  49854. this.index0AttributeName = void 0,
  49855. void 0 !== e && (void 0 !== e.attributes && console.error("THREE.ShaderMaterial: attributes should now be defined in THREE.BufferGeometry instead."),
  49856. this.setValues(e))
  49857. }
  49858. ,
  49859. n.ShaderMaterial.prototype = Object.create(n.Material.prototype),
  49860. n.ShaderMaterial.prototype.constructor = n.ShaderMaterial,
  49861. n.ShaderMaterial.prototype.copy = function(e) {
  49862. return n.Material.prototype.copy.call(this, e),
  49863. this.fragmentShader = e.fragmentShader,
  49864. this.vertexShader = e.vertexShader,
  49865. this.uniforms = n.UniformsUtils.clone(e.uniforms),
  49866. this.defines = e.defines,
  49867. this.shading = e.shading,
  49868. this.wireframe = e.wireframe,
  49869. this.wireframeLinewidth = e.wireframeLinewidth,
  49870. this.fog = e.fog,
  49871. this.lights = e.lights,
  49872. this.vertexColors = e.vertexColors,
  49873. this.skinning = e.skinning,
  49874. this.morphTargets = e.morphTargets,
  49875. this.morphNormals = e.morphNormals,
  49876. this.extensions = e.extensions,
  49877. this
  49878. }
  49879. ,
  49880. n.ShaderMaterial.prototype.toJSON = function(e) {
  49881. var t = n.Material.prototype.toJSON.call(this, e);
  49882. return t.uniforms = this.uniforms,
  49883. t.vertexShader = this.vertexShader,
  49884. t.fragmentShader = this.fragmentShader,
  49885. t
  49886. }
  49887. ,
  49888. n.RawShaderMaterial = function(e) {
  49889. n.ShaderMaterial.call(this, e),
  49890. this.type = "RawShaderMaterial"
  49891. }
  49892. ,
  49893. n.RawShaderMaterial.prototype = Object.create(n.ShaderMaterial.prototype),
  49894. n.RawShaderMaterial.prototype.constructor = n.RawShaderMaterial,
  49895. n.SpriteMaterial = function(e) {
  49896. n.Material.call(this),
  49897. this.type = "SpriteMaterial",
  49898. this.color = new n.Color(16777215),
  49899. this.map = null,
  49900. this.rotation = 0,
  49901. this.fog = !1,
  49902. this.setValues(e)
  49903. }
  49904. ,
  49905. n.SpriteMaterial.prototype = Object.create(n.Material.prototype),
  49906. n.SpriteMaterial.prototype.constructor = n.SpriteMaterial,
  49907. n.SpriteMaterial.prototype.copy = function(e) {
  49908. return n.Material.prototype.copy.call(this, e),
  49909. this.color.copy(e.color),
  49910. this.map = e.map,
  49911. this.rotation = e.rotation,
  49912. this.fog = e.fog,
  49913. this
  49914. }
  49915. ,
  49916. n.Texture = function(e, t, i, r, o, a, s, l, c) {
  49917. Object.defineProperty(this, "id", {
  49918. value: n.TextureIdCount++
  49919. }),
  49920. this.uuid = n.Math.generateUUID(),
  49921. this.name = "",
  49922. this.sourceFile = "",
  49923. this.image = void 0 !== e ? e : n.Texture.DEFAULT_IMAGE,
  49924. this.mipmaps = [],
  49925. this.mapping = void 0 !== t ? t : n.Texture.DEFAULT_MAPPING,
  49926. this.wrapS = void 0 !== i ? i : n.ClampToEdgeWrapping,
  49927. this.wrapT = void 0 !== r ? r : n.ClampToEdgeWrapping,
  49928. this.magFilter = void 0 !== o ? o : n.LinearFilter,
  49929. this.minFilter = void 0 !== a ? a : n.LinearMipMapLinearFilter,
  49930. this.anisotropy = void 0 !== c ? c : 1,
  49931. this.format = void 0 !== s ? s : n.RGBAFormat,
  49932. this.type = void 0 !== l ? l : n.UnsignedByteType,
  49933. this.offset = new n.Vector2(0,0),
  49934. this.repeat = new n.Vector2(1,1),
  49935. this.generateMipmaps = !0,
  49936. this.premultiplyAlpha = !1,
  49937. this.flipY = !0,
  49938. this.unpackAlignment = 4,
  49939. this.encoding = n.LinearEncoding,
  49940. this.version = 0,
  49941. this.onUpdate = null
  49942. }
  49943. ,
  49944. n.Texture.DEFAULT_IMAGE = void 0,
  49945. n.Texture.DEFAULT_MAPPING = n.UVMapping,
  49946. n.Texture.prototype = {
  49947. constructor: n.Texture,
  49948. set needsUpdate(e) {
  49949. e === !0 && this.version++
  49950. },
  49951. clone: function() {
  49952. return (new this.constructor).copy(this)
  49953. },
  49954. copy: function(e) {
  49955. return this.image = e.image,
  49956. this.mipmaps = e.mipmaps.slice(0),
  49957. this.mapping = e.mapping,
  49958. this.wrapS = e.wrapS,
  49959. this.wrapT = e.wrapT,
  49960. this.magFilter = e.magFilter,
  49961. this.minFilter = e.minFilter,
  49962. this.anisotropy = e.anisotropy,
  49963. this.format = e.format,
  49964. this.type = e.type,
  49965. this.offset.copy(e.offset),
  49966. this.repeat.copy(e.repeat),
  49967. this.generateMipmaps = e.generateMipmaps,
  49968. this.premultiplyAlpha = e.premultiplyAlpha,
  49969. this.flipY = e.flipY,
  49970. this.unpackAlignment = e.unpackAlignment,
  49971. this.encoding = e.encoding,
  49972. this
  49973. },
  49974. toJSON: function(e) {
  49975. function t(e) {
  49976. var t;
  49977. return void 0 !== e.toDataURL ? t = e : (t = document.createElement("canvas"),
  49978. t.width = e.width,
  49979. t.height = e.height,
  49980. t.getContext("2d").drawImage(e, 0, 0, e.width, e.height)),
  49981. t.width > 2048 || t.height > 2048 ? t.toDataURL("image/jpeg", .6) : t.toDataURL("image/png")
  49982. }
  49983. if (void 0 !== e.textures[this.uuid])
  49984. return e.textures[this.uuid];
  49985. var i = {
  49986. metadata: {
  49987. version: 4.4,
  49988. type: "Texture",
  49989. generator: "Texture.toJSON"
  49990. },
  49991. uuid: this.uuid,
  49992. name: this.name,
  49993. mapping: this.mapping,
  49994. repeat: [this.repeat.x, this.repeat.y],
  49995. offset: [this.offset.x, this.offset.y],
  49996. wrap: [this.wrapS, this.wrapT],
  49997. minFilter: this.minFilter,
  49998. magFilter: this.magFilter,
  49999. anisotropy: this.anisotropy
  50000. };
  50001. if (void 0 !== this.image) {
  50002. var r = this.image;
  50003. void 0 === r.uuid && (r.uuid = n.Math.generateUUID()),
  50004. void 0 === e.images[r.uuid] && (e.images[r.uuid] = {
  50005. uuid: r.uuid,
  50006. url: t(r)
  50007. }),
  50008. i.image = r.uuid
  50009. }
  50010. return e.textures[this.uuid] = i,
  50011. i
  50012. },
  50013. dispose: function() {
  50014. this.dispatchEvent({
  50015. type: "dispose"
  50016. })
  50017. },
  50018. transformUv: function(e) {
  50019. if (this.mapping === n.UVMapping) {
  50020. if (e.multiply(this.repeat),
  50021. e.add(this.offset),
  50022. e.x < 0 || e.x > 1)
  50023. switch (this.wrapS) {
  50024. case n.RepeatWrapping:
  50025. e.x = e.x - Math.floor(e.x);
  50026. break;
  50027. case n.ClampToEdgeWrapping:
  50028. e.x = e.x < 0 ? 0 : 1;
  50029. break;
  50030. case n.MirroredRepeatWrapping:
  50031. 1 === Math.abs(Math.floor(e.x) % 2) ? e.x = Math.ceil(e.x) - e.x : e.x = e.x - Math.floor(e.x)
  50032. }
  50033. if (e.y < 0 || e.y > 1)
  50034. switch (this.wrapT) {
  50035. case n.RepeatWrapping:
  50036. e.y = e.y - Math.floor(e.y);
  50037. break;
  50038. case n.ClampToEdgeWrapping:
  50039. e.y = e.y < 0 ? 0 : 1;
  50040. break;
  50041. case n.MirroredRepeatWrapping:
  50042. 1 === Math.abs(Math.floor(e.y) % 2) ? e.y = Math.ceil(e.y) - e.y : e.y = e.y - Math.floor(e.y)
  50043. }
  50044. this.flipY && (e.y = 1 - e.y)
  50045. }
  50046. }
  50047. },
  50048. n.EventDispatcher.prototype.apply(n.Texture.prototype),
  50049. n.TextureIdCount = 0,
  50050. n.CanvasTexture = function(e, t, i, r, o, a, s, l, c) {
  50051. n.Texture.call(this, e, t, i, r, o, a, s, l, c),
  50052. this.needsUpdate = !0
  50053. }
  50054. ,
  50055. n.CanvasTexture.prototype = Object.create(n.Texture.prototype),
  50056. n.CanvasTexture.prototype.constructor = n.CanvasTexture,
  50057. n.CubeTexture = function(e, t, i, r, o, a, s, l, c) {
  50058. e = void 0 !== e ? e : [],
  50059. t = void 0 !== t ? t : n.CubeReflectionMapping,
  50060. n.Texture.call(this, e, t, i, r, o, a, s, l, c),
  50061. this.flipY = !1
  50062. }
  50063. ,
  50064. n.CubeTexture.prototype = Object.create(n.Texture.prototype),
  50065. n.CubeTexture.prototype.constructor = n.CubeTexture,
  50066. Object.defineProperty(n.CubeTexture.prototype, "images", {
  50067. get: function() {
  50068. return this.image
  50069. },
  50070. set: function(e) {
  50071. this.image = e
  50072. }
  50073. }),
  50074. n.CompressedTexture = function(e, t, i, r, o, a, s, l, c, h, u) {
  50075. n.Texture.call(this, null, a, s, l, c, h, r, o, u),
  50076. this.image = {
  50077. width: t,
  50078. height: i
  50079. },
  50080. this.mipmaps = e,
  50081. this.flipY = !1,
  50082. this.generateMipmaps = !1
  50083. }
  50084. ,
  50085. n.CompressedTexture.prototype = Object.create(n.Texture.prototype),
  50086. n.CompressedTexture.prototype.constructor = n.CompressedTexture,
  50087. n.DataTexture = function(e, t, i, r, o, a, s, l, c, h, u) {
  50088. n.Texture.call(this, null, a, s, l, c, h, r, o, u),
  50089. this.image = {
  50090. data: e,
  50091. width: t,
  50092. height: i
  50093. },
  50094. this.magFilter = void 0 !== c ? c : n.NearestFilter,
  50095. this.minFilter = void 0 !== h ? h : n.NearestFilter,
  50096. this.flipY = !1,
  50097. this.generateMipmaps = !1
  50098. }
  50099. ,
  50100. n.DataTexture.prototype = Object.create(n.Texture.prototype),
  50101. n.DataTexture.prototype.constructor = n.DataTexture,
  50102. n.VideoTexture = function(e, t, i, r, o, a, s, l, c) {
  50103. function h() {
  50104. requestAnimationFrame(h)
  50105. if( !e.paused && e.readyState === e.HAVE_ENOUGH_DATA){//改 add !e.paused
  50106. u.needsUpdate = !0
  50107. }
  50108. }
  50109. n.Texture.call(this, e, t, i, r, o, a, s, l, c),
  50110. this.generateMipmaps = !1;
  50111. var u = this;
  50112. h()
  50113. }
  50114. ,
  50115. n.VideoTexture.prototype = Object.create(n.Texture.prototype),
  50116. n.VideoTexture.prototype.constructor = n.VideoTexture,
  50117. n.Group = function() {
  50118. n.Object3D.call(this),
  50119. this.type = "Group"
  50120. }
  50121. ,
  50122. n.Group.prototype = Object.create(n.Object3D.prototype),
  50123. n.Group.prototype.constructor = n.Group,
  50124. n.Points = function(e, t) {
  50125. n.Object3D.call(this),
  50126. this.type = "Points",
  50127. this.geometry = void 0 !== e ? e : new n.Geometry,
  50128. this.material = void 0 !== t ? t : new n.PointsMaterial({
  50129. color: 16777215 * Math.random()
  50130. })
  50131. }
  50132. ,
  50133. n.Points.prototype = Object.create(n.Object3D.prototype),
  50134. n.Points.prototype.constructor = n.Points,
  50135. n.Points.prototype.raycast = function() {
  50136. var e = new n.Matrix4
  50137. , t = new n.Ray
  50138. , i = new n.Sphere;
  50139. return function(r, o) {
  50140. function a(e, i) {
  50141. var n = t.distanceSqToPoint(e);
  50142. if (n < d) {
  50143. var a = t.closestPointToPoint(e);
  50144. a.applyMatrix4(c);
  50145. var l = r.ray.origin.distanceTo(a);
  50146. if (l < r.near || l > r.far)
  50147. return;
  50148. o.push({
  50149. distance: l,
  50150. distanceToRay: Math.sqrt(n),
  50151. point: a.clone(),
  50152. index: i,
  50153. face: null,
  50154. object: s
  50155. })
  50156. }
  50157. }
  50158. var s = this
  50159. , l = this.geometry
  50160. , c = this.matrixWorld
  50161. , h = r.params.Points.threshold;
  50162. if (null === l.boundingSphere && l.computeBoundingSphere(),
  50163. i.copy(l.boundingSphere),
  50164. i.applyMatrix4(c),
  50165. r.ray.intersectsSphere(i) !== !1) {
  50166. e.getInverse(c),
  50167. t.copy(r.ray).applyMatrix4(e);
  50168. var u = h / ((this.scale.x + this.scale.y + this.scale.z) / 3)
  50169. , d = u * u
  50170. , p = new n.Vector3;
  50171. if (l instanceof n.BufferGeometry) {
  50172. var f = l.index
  50173. , g = l.attributes
  50174. , m = g.position.array;
  50175. if (null !== f)
  50176. for (var v = f.array, A = 0, y = v.length; A < y; A++) {
  50177. var C = v[A];
  50178. p.fromArray(m, 3 * C),
  50179. a(p, C)
  50180. }
  50181. else
  50182. for (var A = 0, I = m.length / 3; A < I; A++)
  50183. p.fromArray(m, 3 * A),
  50184. a(p, A)
  50185. } else
  50186. for (var E = l.vertices, A = 0, I = E.length; A < I; A++)
  50187. a(E[A], A)
  50188. }
  50189. }
  50190. }(),
  50191. n.Points.prototype.clone = function() {
  50192. return new this.constructor(this.geometry,this.material).copy(this)
  50193. }
  50194. ,
  50195. n.Line = function(e, t, i) {
  50196. return 1 === i ? (console.warn("THREE.Line: parameter THREE.LinePieces no longer supported. Created THREE.LineSegments instead."),
  50197. new n.LineSegments(e,t)) : (n.Object3D.call(this),
  50198. this.type = "Line",
  50199. this.geometry = void 0 !== e ? e : new n.Geometry,
  50200. void (this.material = void 0 !== t ? t : new n.LineBasicMaterial({
  50201. color: 16777215 * Math.random()
  50202. })))
  50203. }
  50204. ,
  50205. n.Line.prototype = Object.create(n.Object3D.prototype),
  50206. n.Line.prototype.constructor = n.Line,
  50207. n.Line.prototype.raycast = function() {
  50208. var e = new n.Matrix4
  50209. , t = new n.Ray
  50210. , i = new n.Sphere;
  50211. return function(r, o) {
  50212. var a = r.linePrecision
  50213. , s = a * a
  50214. , l = this.geometry
  50215. , c = this.matrixWorld;
  50216. if (null === l.boundingSphere && l.computeBoundingSphere(),
  50217. i.copy(l.boundingSphere),
  50218. i.applyMatrix4(c),
  50219. r.ray.intersectsSphere(i) !== !1) {
  50220. e.getInverse(c),
  50221. t.copy(r.ray).applyMatrix4(e);
  50222. var h = new n.Vector3
  50223. , u = new n.Vector3
  50224. , d = new n.Vector3
  50225. , p = new n.Vector3
  50226. , f = this instanceof n.LineSegments ? 2 : 1;
  50227. if (l instanceof n.BufferGeometry) {
  50228. var g = l.index
  50229. , m = l.attributes
  50230. , v = m.position.array;
  50231. if (null !== g)
  50232. for (var A = g.array, y = 0, C = A.length - 1; y < C; y += f) {
  50233. var I = A[y]
  50234. , E = A[y + 1];
  50235. h.fromArray(v, 3 * I),
  50236. u.fromArray(v, 3 * E);
  50237. var b = t.distanceSqToSegment(h, u, p, d);
  50238. if (!(b > s)) {
  50239. p.applyMatrix4(this.matrixWorld);
  50240. var w = r.ray.origin.distanceTo(p);
  50241. w < r.near || w > r.far || o.push({
  50242. distance: w,
  50243. point: d.clone().applyMatrix4(this.matrixWorld),
  50244. index: y,
  50245. face: null,
  50246. faceIndex: null,
  50247. object: this
  50248. })
  50249. }
  50250. }
  50251. else
  50252. for (var y = 0, C = v.length / 3 - 1; y < C; y += f) {
  50253. h.fromArray(v, 3 * y),
  50254. u.fromArray(v, 3 * y + 3);
  50255. var b = t.distanceSqToSegment(h, u, p, d);
  50256. if (!(b > s)) {
  50257. p.applyMatrix4(this.matrixWorld);
  50258. var w = r.ray.origin.distanceTo(p);
  50259. w < r.near || w > r.far || o.push({
  50260. distance: w,
  50261. point: d.clone().applyMatrix4(this.matrixWorld),
  50262. index: y,
  50263. face: null,
  50264. faceIndex: null,
  50265. object: this
  50266. })
  50267. }
  50268. }
  50269. } else if (l instanceof n.Geometry)
  50270. for (var _ = l.vertices, T = _.length, y = 0; y < T - 1; y += f) {
  50271. var b = t.distanceSqToSegment(_[y], _[y + 1], p, d);
  50272. if (!(b > s)) {
  50273. p.applyMatrix4(this.matrixWorld);
  50274. var w = r.ray.origin.distanceTo(p);
  50275. w < r.near || w > r.far || o.push({
  50276. distance: w,
  50277. point: d.clone().applyMatrix4(this.matrixWorld),
  50278. index: y,
  50279. face: null,
  50280. faceIndex: null,
  50281. object: this
  50282. })
  50283. }
  50284. }
  50285. }
  50286. }
  50287. }(),
  50288. n.Line.prototype.clone = function() {
  50289. return new this.constructor(this.geometry,this.material).copy(this)
  50290. }
  50291. ,
  50292. n.LineStrip = 0,
  50293. n.LinePieces = 1,
  50294. n.LineSegments = function(e, t) {
  50295. n.Line.call(this, e, t),
  50296. this.type = "LineSegments"
  50297. }
  50298. ,
  50299. n.LineSegments.prototype = Object.create(n.Line.prototype),
  50300. n.LineSegments.prototype.constructor = n.LineSegments,
  50301. n.Mesh = function(e, t) {
  50302. n.Object3D.call(this),
  50303. this.type = "Mesh",
  50304. this.geometry = void 0 !== e ? e : new n.Geometry,
  50305. this.material = void 0 !== t ? t : new n.MeshBasicMaterial({
  50306. color: 16777215 * Math.random()
  50307. }),
  50308. this.drawMode = n.TrianglesDrawMode,
  50309. this.updateMorphTargets()
  50310. }
  50311. ,
  50312. n.Mesh.prototype = Object.create(n.Object3D.prototype),
  50313. n.Mesh.prototype.constructor = n.Mesh,
  50314. n.Mesh.prototype.setDrawMode = function(e) {
  50315. this.drawMode = e
  50316. }
  50317. ,
  50318. n.Mesh.prototype.updateMorphTargets = function() {
  50319. if (void 0 !== this.geometry.morphTargets && this.geometry.morphTargets.length > 0) {
  50320. this.morphTargetBase = -1,
  50321. this.morphTargetInfluences = [],
  50322. this.morphTargetDictionary = {};
  50323. for (var e = 0, t = this.geometry.morphTargets.length; e < t; e++)
  50324. this.morphTargetInfluences.push(0),
  50325. this.morphTargetDictionary[this.geometry.morphTargets[e].name] = e
  50326. }
  50327. }
  50328. ,
  50329. n.Mesh.prototype.getMorphTargetIndexByName = function(e) {
  50330. return void 0 !== this.morphTargetDictionary[e] ? this.morphTargetDictionary[e] : (console.warn("THREE.Mesh.getMorphTargetIndexByName: morph target " + e + " does not exist. Returning 0."),
  50331. 0)
  50332. }
  50333. ,
  50334. n.Mesh.prototype.raycast = function() {
  50335. function e(e, t, i, r, o, a, s) {
  50336. return n.Triangle.barycoordFromPoint(e, t, i, r, m),
  50337. o.multiplyScalar(m.x),
  50338. a.multiplyScalar(m.y),
  50339. s.multiplyScalar(m.z),
  50340. o.add(a).add(s),
  50341. o.clone()
  50342. }
  50343. function t(e, t, i, r, o, a, s) {
  50344. var l, c = e.material;
  50345. if (l = c.side === n.BackSide ? i.intersectTriangle(a, o, r, !0, s) : i.intersectTriangle(r, o, a, c.side !== n.DoubleSide, s),
  50346. null === l)
  50347. return null;
  50348. A.copy(s),
  50349. A.applyMatrix4(e.matrixWorld);
  50350. var h = t.ray.origin.distanceTo(A);
  50351. return h < t.near || h > t.far ? null : {
  50352. distance: h,
  50353. point: A.clone(),
  50354. object: e
  50355. }
  50356. }
  50357. function i(i, r, o, a, h, u, d, m) {
  50358. s.fromArray(a, 3 * u),
  50359. l.fromArray(a, 3 * d),
  50360. c.fromArray(a, 3 * m);
  50361. var A = t(i, r, o, s, l, c, v);
  50362. return A && (h && (p.fromArray(h, 2 * u),
  50363. f.fromArray(h, 2 * d),
  50364. g.fromArray(h, 2 * m),
  50365. A.uv = e(v, s, l, c, p, f, g)),
  50366. A.face = new n.Face3(u,d,m,n.Triangle.normal(s, l, c)),
  50367. A.faceIndex = u),
  50368. A
  50369. }
  50370. var r = new n.Matrix4
  50371. , o = new n.Ray
  50372. , a = new n.Sphere
  50373. , s = new n.Vector3
  50374. , l = new n.Vector3
  50375. , c = new n.Vector3
  50376. , h = new n.Vector3
  50377. , u = new n.Vector3
  50378. , d = new n.Vector3
  50379. , p = new n.Vector2
  50380. , f = new n.Vector2
  50381. , g = new n.Vector2
  50382. , m = new n.Vector3
  50383. , v = new n.Vector3
  50384. , A = new n.Vector3;
  50385. return function(m, A) {
  50386. var y = this.geometry
  50387. , C = this.material
  50388. , I = this.matrixWorld;
  50389. if (void 0 !== C && (null === y.boundingSphere && y.computeBoundingSphere(),
  50390. a.copy(y.boundingSphere),
  50391. a.applyMatrix4(I),
  50392. m.ray.intersectsSphere(a) !== !1 && (r.getInverse(I),
  50393. o.copy(m.ray).applyMatrix4(r),
  50394. null === y.boundingBox || o.intersectsBox(y.boundingBox) !== !1))) {
  50395. var E, b;
  50396. if (y instanceof n.BufferGeometry) {
  50397. var w, _, T, x = y.index, S = y.attributes, M = S.position.array;
  50398. if (void 0 !== S.uv && (E = S.uv.array),
  50399. null !== x)
  50400. for (var R = x.array, P = 0, O = R.length; P < O; P += 3)
  50401. w = R[P],
  50402. _ = R[P + 1],
  50403. T = R[P + 2],
  50404. b = i(this, m, o, M, E, w, _, T),
  50405. b && (b.faceIndex = Math.floor(P / 3),
  50406. A.push(b));
  50407. else
  50408. for (var P = 0, O = M.length; P < O; P += 9)
  50409. w = P / 3,
  50410. _ = w + 1,
  50411. T = w + 2,
  50412. b = i(this, m, o, M, E, w, _, T),
  50413. b && (b.index = w,
  50414. A.push(b))
  50415. } else if (y instanceof n.Geometry) {
  50416. 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];
  50417. k.length > 0 && (E = k);
  50418. for (var H = 0, G = U.length; H < G; H++) {
  50419. var z = U[H]
  50420. , W = B === !0 ? F[z.materialIndex] : C;
  50421. if (void 0 !== W) {
  50422. if (L = V[z.a],
  50423. D = V[z.b],
  50424. N = V[z.c],
  50425. W.morphTargets === !0) {
  50426. var j = y.morphTargets
  50427. , Y = this.morphTargetInfluences;
  50428. s.set(0, 0, 0),
  50429. l.set(0, 0, 0),
  50430. c.set(0, 0, 0);
  50431. for (var X = 0, Z = j.length; X < Z; X++) {
  50432. var q = Y[X];
  50433. if (0 !== q) {
  50434. var K = j[X].vertices;
  50435. s.addScaledVector(h.subVectors(K[z.a], L), q),
  50436. l.addScaledVector(u.subVectors(K[z.b], D), q),
  50437. c.addScaledVector(d.subVectors(K[z.c], N), q)
  50438. }
  50439. }
  50440. s.add(L),
  50441. l.add(D),
  50442. c.add(N),
  50443. L = s,
  50444. D = l,
  50445. N = c
  50446. }
  50447. if (b = t(this, m, o, L, D, N, v)) {
  50448. if (E) {
  50449. var Q = E[H];
  50450. p.copy(Q[0]),
  50451. f.copy(Q[1]),
  50452. g.copy(Q[2]),
  50453. b.uv = e(v, L, D, N, p, f, g)
  50454. }
  50455. b.face = z,
  50456. b.faceIndex = H,
  50457. A.push(b)
  50458. }
  50459. }
  50460. }
  50461. }
  50462. }
  50463. }
  50464. }(),
  50465. n.Mesh.prototype.clone = function() {
  50466. return new this.constructor(this.geometry,this.material).copy(this)
  50467. }
  50468. ,
  50469. n.Bone = function(e) {
  50470. n.Object3D.call(this),
  50471. this.type = "Bone",
  50472. this.skin = e
  50473. }
  50474. ,
  50475. n.Bone.prototype = Object.create(n.Object3D.prototype),
  50476. n.Bone.prototype.constructor = n.Bone,
  50477. n.Bone.prototype.copy = function(e) {
  50478. return n.Object3D.prototype.copy.call(this, e),
  50479. this.skin = e.skin,
  50480. this
  50481. }
  50482. ,
  50483. n.Skeleton = function(e, t, i) {
  50484. if (this.useVertexTexture = void 0 === i || i,
  50485. this.identityMatrix = new n.Matrix4,
  50486. e = e || [],
  50487. this.bones = e.slice(0),
  50488. this.useVertexTexture) {
  50489. var r = Math.sqrt(4 * this.bones.length);
  50490. r = n.Math.nextPowerOfTwo(Math.ceil(r)),
  50491. r = Math.max(r, 4),
  50492. this.boneTextureWidth = r,
  50493. this.boneTextureHeight = r,
  50494. this.boneMatrices = new Float32Array(this.boneTextureWidth * this.boneTextureHeight * 4),
  50495. this.boneTexture = new n.DataTexture(this.boneMatrices,this.boneTextureWidth,this.boneTextureHeight,n.RGBAFormat,n.FloatType)
  50496. } else
  50497. this.boneMatrices = new Float32Array(16 * this.bones.length);
  50498. if (void 0 === t)
  50499. this.calculateInverses();
  50500. else if (this.bones.length === t.length)
  50501. this.boneInverses = t.slice(0);
  50502. else {
  50503. console.warn("THREE.Skeleton bonInverses is the wrong length."),
  50504. this.boneInverses = [];
  50505. for (var o = 0, a = this.bones.length; o < a; o++)
  50506. this.boneInverses.push(new n.Matrix4)
  50507. }
  50508. }
  50509. ,
  50510. n.Skeleton.prototype.calculateInverses = function() {
  50511. this.boneInverses = [];
  50512. for (var e = 0, t = this.bones.length; e < t; e++) {
  50513. var i = new n.Matrix4;
  50514. this.bones[e] && i.getInverse(this.bones[e].matrixWorld),
  50515. this.boneInverses.push(i)
  50516. }
  50517. }
  50518. ,
  50519. n.Skeleton.prototype.pose = function() {
  50520. for (var e, t = 0, i = this.bones.length; t < i; t++)
  50521. e = this.bones[t],
  50522. e && e.matrixWorld.getInverse(this.boneInverses[t]);
  50523. for (var t = 0, i = this.bones.length; t < i; t++)
  50524. e = this.bones[t],
  50525. e && (e.parent ? (e.matrix.getInverse(e.parent.matrixWorld),
  50526. e.matrix.multiply(e.matrixWorld)) : e.matrix.copy(e.matrixWorld),
  50527. e.matrix.decompose(e.position, e.quaternion, e.scale));
  50528. }
  50529. ,
  50530. n.Skeleton.prototype.update = function() {
  50531. var e = new n.Matrix4;
  50532. return function() {
  50533. for (var t = 0, i = this.bones.length; t < i; t++) {
  50534. var n = this.bones[t] ? this.bones[t].matrixWorld : this.identityMatrix;
  50535. e.multiplyMatrices(n, this.boneInverses[t]),
  50536. e.flattenToArrayOffset(this.boneMatrices, 16 * t)
  50537. }
  50538. this.useVertexTexture && (this.boneTexture.needsUpdate = !0)
  50539. }
  50540. }(),
  50541. n.Skeleton.prototype.clone = function() {
  50542. return new n.Skeleton(this.bones,this.boneInverses,this.useVertexTexture)
  50543. }
  50544. ,
  50545. n.SkinnedMesh = function(e, t, i) {
  50546. n.Mesh.call(this, e, t),
  50547. this.type = "SkinnedMesh",
  50548. this.bindMode = "attached",
  50549. this.bindMatrix = new n.Matrix4,
  50550. this.bindMatrixInverse = new n.Matrix4;
  50551. var r = [];
  50552. if (this.geometry && void 0 !== this.geometry.bones) {
  50553. for (var o, a, s = 0, l = this.geometry.bones.length; s < l; ++s)
  50554. a = this.geometry.bones[s],
  50555. o = new n.Bone(this),
  50556. r.push(o),
  50557. o.name = a.name,
  50558. o.position.fromArray(a.pos),
  50559. o.quaternion.fromArray(a.rotq),
  50560. void 0 !== a.scl && o.scale.fromArray(a.scl);
  50561. for (var s = 0, l = this.geometry.bones.length; s < l; ++s)
  50562. a = this.geometry.bones[s],
  50563. a.parent !== -1 && null !== a.parent ? r[a.parent].add(r[s]) : this.add(r[s])
  50564. }
  50565. this.normalizeSkinWeights(),
  50566. this.updateMatrixWorld(!0),
  50567. this.bind(new n.Skeleton(r,void 0,i), this.matrixWorld)
  50568. }
  50569. ,
  50570. n.SkinnedMesh.prototype = Object.create(n.Mesh.prototype),
  50571. n.SkinnedMesh.prototype.constructor = n.SkinnedMesh,
  50572. n.SkinnedMesh.prototype.bind = function(e, t) {
  50573. this.skeleton = e,
  50574. void 0 === t && (this.updateMatrixWorld(!0),
  50575. this.skeleton.calculateInverses(),
  50576. t = this.matrixWorld),
  50577. this.bindMatrix.copy(t),
  50578. this.bindMatrixInverse.getInverse(t)
  50579. }
  50580. ,
  50581. n.SkinnedMesh.prototype.pose = function() {
  50582. this.skeleton.pose()
  50583. }
  50584. ,
  50585. n.SkinnedMesh.prototype.normalizeSkinWeights = function() {
  50586. if (this.geometry instanceof n.Geometry)
  50587. for (var e = 0; e < this.geometry.skinWeights.length; e++) {
  50588. var t = this.geometry.skinWeights[e]
  50589. , i = 1 / t.lengthManhattan();
  50590. i !== 1 / 0 ? t.multiplyScalar(i) : t.set(1, 0, 0, 0)
  50591. }
  50592. else if (this.geometry instanceof n.BufferGeometry)
  50593. for (var r = new n.Vector4, o = this.geometry.attributes.skinWeight, e = 0; e < o.count; e++) {
  50594. r.x = o.getX(e),
  50595. r.y = o.getY(e),
  50596. r.z = o.getZ(e),
  50597. r.w = o.getW(e);
  50598. var i = 1 / r.lengthManhattan();
  50599. i !== 1 / 0 ? r.multiplyScalar(i) : r.set(1, 0, 0, 0),
  50600. o.setXYZW(e, r.x, r.y, r.z, r.w)
  50601. }
  50602. }
  50603. ,
  50604. n.SkinnedMesh.prototype.updateMatrixWorld = function(e) {
  50605. n.Mesh.prototype.updateMatrixWorld.call(this, !0),
  50606. "attached" === this.bindMode ? this.bindMatrixInverse.getInverse(this.matrixWorld) : "detached" === this.bindMode ? this.bindMatrixInverse.getInverse(this.bindMatrix) : console.warn("THREE.SkinnedMesh unrecognized bindMode: " + this.bindMode)
  50607. }
  50608. ,
  50609. n.SkinnedMesh.prototype.clone = function() {
  50610. return new this.constructor(this.geometry,this.material,this.useVertexTexture).copy(this)
  50611. }
  50612. ,
  50613. n.LOD = function() {
  50614. n.Object3D.call(this),
  50615. this.type = "LOD",
  50616. Object.defineProperties(this, {
  50617. levels: {
  50618. enumerable: !0,
  50619. value: []
  50620. },
  50621. objects: {
  50622. get: function() {
  50623. return console.warn("THREE.LOD: .objects has been renamed to .levels."),
  50624. this.levels
  50625. }
  50626. }
  50627. })
  50628. }
  50629. ,
  50630. n.LOD.prototype = Object.create(n.Object3D.prototype),
  50631. n.LOD.prototype.constructor = n.LOD,
  50632. n.LOD.prototype.addLevel = function(e, t) {
  50633. void 0 === t && (t = 0),
  50634. t = Math.abs(t);
  50635. for (var i = this.levels, n = 0; n < i.length && !(t < i[n].distance); n++)
  50636. ;
  50637. i.splice(n, 0, {
  50638. distance: t,
  50639. object: e
  50640. }),
  50641. this.add(e)
  50642. }
  50643. ,
  50644. n.LOD.prototype.getObjectForDistance = function(e) {
  50645. for (var t = this.levels, i = 1, n = t.length; i < n && !(e < t[i].distance); i++)
  50646. ;
  50647. return t[i - 1].object
  50648. }
  50649. ,
  50650. n.LOD.prototype.raycast = function() {
  50651. var e = new n.Vector3;
  50652. return function(t, i) {
  50653. e.setFromMatrixPosition(this.matrixWorld);
  50654. var n = t.ray.origin.distanceTo(e);
  50655. this.getObjectForDistance(n).raycast(t, i)
  50656. }
  50657. }(),
  50658. n.LOD.prototype.update = function() {
  50659. var e = new n.Vector3
  50660. , t = new n.Vector3;
  50661. return function(i) {
  50662. var n = this.levels;
  50663. if (n.length > 1) {
  50664. e.setFromMatrixPosition(i.matrixWorld),
  50665. t.setFromMatrixPosition(this.matrixWorld);
  50666. var r = e.distanceTo(t);
  50667. n[0].object.visible = !0;
  50668. for (var o = 1, a = n.length; o < a && r >= n[o].distance; o++)
  50669. n[o - 1].object.visible = !1,
  50670. n[o].object.visible = !0;
  50671. for (; o < a; o++)
  50672. n[o].object.visible = !1
  50673. }
  50674. }
  50675. }(),
  50676. n.LOD.prototype.copy = function(e) {
  50677. n.Object3D.prototype.copy.call(this, e, !1);
  50678. for (var t = e.levels, i = 0, r = t.length; i < r; i++) {
  50679. var o = t[i];
  50680. this.addLevel(o.object.clone(), o.distance)
  50681. }
  50682. return this
  50683. }
  50684. ,
  50685. n.LOD.prototype.toJSON = function(e) {
  50686. var t = n.Object3D.prototype.toJSON.call(this, e);
  50687. t.object.levels = [];
  50688. for (var i = this.levels, r = 0, o = i.length; r < o; r++) {
  50689. var a = i[r];
  50690. t.object.levels.push({
  50691. object: a.object.uuid,
  50692. distance: a.distance
  50693. })
  50694. }
  50695. return t
  50696. }
  50697. ,
  50698. n.Sprite = function() {
  50699. var e = new Uint16Array([0, 1, 2, 0, 2, 3])
  50700. , t = new Float32Array([-.5, -.5, 0, .5, -.5, 0, .5, .5, 0, -.5, .5, 0])
  50701. , i = new Float32Array([0, 0, 1, 0, 1, 1, 0, 1])
  50702. , r = new n.BufferGeometry;
  50703. return r.setIndex(new n.BufferAttribute(e,1)),
  50704. r.addAttribute("position", new n.BufferAttribute(t,3)),
  50705. r.addAttribute("uv", new n.BufferAttribute(i,2)),
  50706. function(e) {
  50707. n.Object3D.call(this),
  50708. this.type = "Sprite",
  50709. this.geometry = r,
  50710. this.material = void 0 !== e ? e : new n.SpriteMaterial
  50711. }
  50712. }(),
  50713. n.Sprite.prototype = Object.create(n.Object3D.prototype),
  50714. n.Sprite.prototype.constructor = n.Sprite,
  50715. n.Sprite.prototype.raycast = function() {
  50716. var e = new n.Vector3;
  50717. return function(t, i) {
  50718. e.setFromMatrixPosition(this.matrixWorld);
  50719. var n = t.ray.distanceSqToPoint(e)
  50720. , r = this.scale.x * this.scale.y;
  50721. n > r || i.push({
  50722. distance: Math.sqrt(n),
  50723. point: this.position,
  50724. face: null,
  50725. object: this
  50726. })
  50727. }
  50728. }(),
  50729. n.Sprite.prototype.clone = function() {
  50730. return new this.constructor(this.material).copy(this)
  50731. }
  50732. ,
  50733. n.Particle = n.Sprite,
  50734. n.LensFlare = function(e, t, i, r, o) {
  50735. n.Object3D.call(this),
  50736. this.lensFlares = [],
  50737. this.positionScreen = new n.Vector3,
  50738. this.customUpdateCallback = void 0,
  50739. void 0 !== e && this.add(e, t, i, r, o)
  50740. }
  50741. ,
  50742. n.LensFlare.prototype = Object.create(n.Object3D.prototype),
  50743. n.LensFlare.prototype.constructor = n.LensFlare,
  50744. n.LensFlare.prototype.add = function(e, t, i, r, o, a) {
  50745. void 0 === t && (t = -1),
  50746. void 0 === i && (i = 0),
  50747. void 0 === a && (a = 1),
  50748. void 0 === o && (o = new n.Color(16777215)),
  50749. void 0 === r && (r = n.NormalBlending),
  50750. i = Math.min(i, Math.max(0, i)),
  50751. this.lensFlares.push({
  50752. texture: e,
  50753. size: t,
  50754. distance: i,
  50755. x: 0,
  50756. y: 0,
  50757. z: 0,
  50758. scale: 1,
  50759. rotation: 0,
  50760. opacity: a,
  50761. color: o,
  50762. blending: r
  50763. })
  50764. }
  50765. ,
  50766. n.LensFlare.prototype.updateLensFlares = function() {
  50767. var e, t, i = this.lensFlares.length, n = 2 * -this.positionScreen.x, r = 2 * -this.positionScreen.y;
  50768. for (e = 0; e < i; e++)
  50769. t = this.lensFlares[e],
  50770. t.x = this.positionScreen.x + n * t.distance,
  50771. t.y = this.positionScreen.y + r * t.distance,
  50772. t.wantedRotation = t.x * Math.PI * .25,
  50773. t.rotation += .25 * (t.wantedRotation - t.rotation)
  50774. }
  50775. ,
  50776. n.LensFlare.prototype.copy = function(e) {
  50777. n.Object3D.prototype.copy.call(this, e),
  50778. this.positionScreen.copy(e.positionScreen),
  50779. this.customUpdateCallback = e.customUpdateCallback;
  50780. for (var t = 0, i = e.lensFlares.length; t < i; t++)
  50781. this.lensFlares.push(e.lensFlares[t]);
  50782. return this
  50783. }
  50784. ,
  50785. n.Scene = function() {
  50786. n.Object3D.call(this),
  50787. this.type = "Scene",
  50788. this.fog = null,
  50789. this.overrideMaterial = null,
  50790. this.autoUpdate = !0
  50791. }
  50792. ,
  50793. n.Scene.prototype = Object.create(n.Object3D.prototype),
  50794. n.Scene.prototype.constructor = n.Scene,
  50795. n.Scene.prototype.copy = function(e, t) {
  50796. return n.Object3D.prototype.copy.call(this, e, t),
  50797. null !== e.fog && (this.fog = e.fog.clone()),
  50798. null !== e.overrideMaterial && (this.overrideMaterial = e.overrideMaterial.clone()),
  50799. this.autoUpdate = e.autoUpdate,
  50800. this.matrixAutoUpdate = e.matrixAutoUpdate,
  50801. this
  50802. }
  50803. ,
  50804. n.Fog = function(e, t, i) {
  50805. this.name = "",
  50806. this.color = new n.Color(e),
  50807. this.near = void 0 !== t ? t : 1,
  50808. this.far = void 0 !== i ? i : 1e3
  50809. }
  50810. ,
  50811. n.Fog.prototype.clone = function() {
  50812. return new n.Fog(this.color.getHex(),this.near,this.far)
  50813. }
  50814. ,
  50815. n.FogExp2 = function(e, t) {
  50816. this.name = "",
  50817. this.color = new n.Color(e),
  50818. this.density = void 0 !== t ? t : 25e-5
  50819. }
  50820. ,
  50821. n.FogExp2.prototype.clone = function() {
  50822. return new n.FogExp2(this.color.getHex(),this.density)
  50823. }
  50824. ,
  50825. n.ShaderChunk = {},
  50826. n.ShaderChunk.alphamap_fragment = "#ifdef USE_ALPHAMAP\n\tdiffuseColor.a *= texture2D( alphaMap, vUv ).g;\n#endif\n",
  50827. n.ShaderChunk.alphamap_pars_fragment = "#ifdef USE_ALPHAMAP\n\tuniform sampler2D alphaMap;\n#endif\n",
  50828. n.ShaderChunk.alphatest_fragment = "#ifdef ALPHATEST\n\tif ( diffuseColor.a < ALPHATEST ) discard;\n#endif\n",
  50829. 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",
  50830. n.ShaderChunk.aomap_pars_fragment = "#ifdef USE_AOMAP\n\tuniform sampler2D aoMap;\n\tuniform float aoMapIntensity;\n#endif",
  50831. n.ShaderChunk.begin_vertex = "\nvec3 transformed = vec3( position );\n",
  50832. n.ShaderChunk.beginnormal_vertex = "\nvec3 objectNormal = vec3( normal );\n",
  50833. 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",
  50834. 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",
  50835. n.ShaderChunk.color_fragment = "#ifdef USE_COLOR\n\tdiffuseColor.rgb *= vColor;\n#endif",
  50836. n.ShaderChunk.color_pars_fragment = "#ifdef USE_COLOR\n\tvarying vec3 vColor;\n#endif\n",
  50837. n.ShaderChunk.color_pars_vertex = "#ifdef USE_COLOR\n\tvarying vec3 vColor;\n#endif",
  50838. n.ShaderChunk.color_vertex = "#ifdef USE_COLOR\n\tvColor.xyz = color.xyz;\n#endif",
  50839. 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",
  50840. 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",
  50841. n.ShaderChunk.defaultnormal_vertex = "#ifdef FLIP_SIDED\n\tobjectNormal = -objectNormal;\n#endif\nvec3 transformedNormal = normalMatrix * objectNormal;\n",
  50842. n.ShaderChunk.displacementmap_vertex = "#ifdef USE_DISPLACEMENTMAP\n\ttransformed += normal * ( texture2D( displacementMap, uv ).x * displacementScale + displacementBias );\n#endif\n",
  50843. n.ShaderChunk.displacementmap_pars_vertex = "#ifdef USE_DISPLACEMENTMAP\n\tuniform sampler2D displacementMap;\n\tuniform float displacementScale;\n\tuniform float displacementBias;\n#endif\n",
  50844. 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",
  50845. n.ShaderChunk.emissivemap_pars_fragment = "#ifdef USE_EMISSIVEMAP\n\tuniform sampler2D emissiveMap;\n#endif\n",
  50846. 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",
  50847. n.ShaderChunk.encodings_fragment = " gl_FragColor = linearToOutputTexel( gl_FragColor );\n",
  50848. 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",
  50849. 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",
  50850. 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",
  50851. 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",
  50852. 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",
  50853. 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",
  50854. n.ShaderChunk.lightmap_fragment = "#ifdef USE_LIGHTMAP\n\treflectedLight.indirectDiffuse += PI * texture2D( lightMap, vUv2 ).xyz * lightMapIntensity;\n#endif\n",
  50855. n.ShaderChunk.lightmap_pars_fragment = "#ifdef USE_LIGHTMAP\n\tuniform sampler2D lightMap;\n\tuniform float lightMapIntensity;\n#endif",
  50856. 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",
  50857. 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",
  50858. n.ShaderChunk.lights_phong_fragment = "BlinnPhongMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;\nmaterial.specularColor = specular;\nmaterial.specularShininess = shininess;\nmaterial.specularStrength = specularStrength;\n",
  50859. 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",
  50860. n.ShaderChunk.lights_phong_pars_vertex = "#ifdef USE_ENVMAP\n\tvarying vec3 vWorldPosition;\n#endif\n",
  50861. n.ShaderChunk.lights_phong_vertex = "#ifdef USE_ENVMAP\n\tvWorldPosition = worldPosition.xyz;\n#endif\n",
  50862. 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",
  50863. 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",
  50864. 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",
  50865. n.ShaderChunk.logdepthbuf_fragment = "#if defined(USE_LOGDEPTHBUF) && defined(USE_LOGDEPTHBUF_EXT)\n\tgl_FragDepthEXT = log2(vFragDepth) * logDepthBufFC * 0.5;\n#endif",
  50866. 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",
  50867. 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",
  50868. 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",
  50869. n.ShaderChunk.map_fragment = "#ifdef USE_MAP\n\tvec4 texelColor = texture2D( map, vUv );\n\ttexelColor = mapTexelToLinear( texelColor );\n\tdiffuseColor *= texelColor;\n#endif\n",
  50870. n.ShaderChunk.map_pars_fragment = "#ifdef USE_MAP\n\tuniform sampler2D map;\n#endif\n",
  50871. 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",
  50872. n.ShaderChunk.map_particle_pars_fragment = "#ifdef USE_MAP\n\tuniform vec4 offsetRepeat;\n\tuniform sampler2D map;\n#endif\n",
  50873. n.ShaderChunk.metalnessmap_fragment = "float metalnessFactor = metalness;\n#ifdef USE_METALNESSMAP\n\tvec4 texelMetalness = texture2D( metalnessMap, vUv );\n\tmetalnessFactor *= texelMetalness.r;\n#endif\n",
  50874. n.ShaderChunk.metalnessmap_pars_fragment = "#ifdef USE_METALNESSMAP\n\tuniform sampler2D metalnessMap;\n#endif",
  50875. 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",
  50876. 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";
  50877. 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";
  50878. 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",
  50879. 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",
  50880. n.ShaderChunk.premultiplied_alpha_fragment = "#ifdef PREMULTIPLIED_ALPHA\n\tgl_FragColor.rgb *= gl_FragColor.a;\n#endif\n",
  50881. 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",
  50882. n.ShaderChunk.roughnessmap_fragment = "float roughnessFactor = roughness;\n#ifdef USE_ROUGHNESSMAP\n\tvec4 texelRoughness = texture2D( roughnessMap, vUv );\n\troughnessFactor *= texelRoughness.r;\n#endif\n",
  50883. n.ShaderChunk.roughnessmap_pars_fragment = "#ifdef USE_ROUGHNESSMAP\n\tuniform sampler2D roughnessMap;\n#endif",
  50884. 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",
  50885. 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",
  50886. 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",
  50887. 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",
  50888. 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",
  50889. 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",
  50890. 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",
  50891. 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",
  50892. 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",
  50893. n.ShaderChunk.specularmap_pars_fragment = "#ifdef USE_SPECULARMAP\n\tuniform sampler2D specularMap;\n#endif",
  50894. n.ShaderChunk.tonemapping_fragment = "#if defined( TONE_MAPPING )\n gl_FragColor.rgb = toneMapping( gl_FragColor.rgb );\n#endif\n",
  50895. 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",
  50896. n.ShaderChunk.uv2_pars_fragment = "#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tvarying vec2 vUv2;\n#endif",
  50897. n.ShaderChunk.uv2_pars_vertex = "#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tattribute vec2 uv2;\n\tvarying vec2 vUv2;\n#endif",
  50898. n.ShaderChunk.uv2_vertex = "#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tvUv2 = uv2;\n#endif",
  50899. 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",
  50900. 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",
  50901. 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",
  50902. 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",
  50903. n.UniformsUtils = {
  50904. merge: function(e) {
  50905. for (var t = {}, i = 0; i < e.length; i++) {
  50906. var n = this.clone(e[i]);
  50907. for (var r in n)
  50908. t[r] = n[r]
  50909. }
  50910. return t
  50911. },
  50912. clone: function(e) {
  50913. var t = {};
  50914. for (var i in e) {
  50915. t[i] = {};
  50916. for (var r in e[i]) {
  50917. var o = e[i][r];
  50918. 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
  50919. }
  50920. }
  50921. return t
  50922. }
  50923. },
  50924. n.UniformsLib = {
  50925. common: {
  50926. diffuse: {
  50927. type: "c",
  50928. value: new n.Color(15658734)
  50929. },
  50930. opacity: {
  50931. type: "f",
  50932. value: 1
  50933. },
  50934. map: {
  50935. type: "t",
  50936. value: null
  50937. },
  50938. offsetRepeat: {
  50939. type: "v4",
  50940. value: new n.Vector4(0,0,1,1)
  50941. },
  50942. specularMap: {
  50943. type: "t",
  50944. value: null
  50945. },
  50946. alphaMap: {
  50947. type: "t",
  50948. value: null
  50949. },
  50950. envMap: {
  50951. type: "t",
  50952. value: null
  50953. },
  50954. flipEnvMap: {
  50955. type: "f",
  50956. value: -1
  50957. },
  50958. reflectivity: {
  50959. type: "f",
  50960. value: 1
  50961. },
  50962. refractionRatio: {
  50963. type: "f",
  50964. value: .98
  50965. }
  50966. },
  50967. aomap: {
  50968. aoMap: {
  50969. type: "t",
  50970. value: null
  50971. },
  50972. aoMapIntensity: {
  50973. type: "f",
  50974. value: 1
  50975. }
  50976. },
  50977. lightmap: {
  50978. lightMap: {
  50979. type: "t",
  50980. value: null
  50981. },
  50982. lightMapIntensity: {
  50983. type: "f",
  50984. value: 1
  50985. }
  50986. },
  50987. emissivemap: {
  50988. emissiveMap: {
  50989. type: "t",
  50990. value: null
  50991. }
  50992. },
  50993. bumpmap: {
  50994. bumpMap: {
  50995. type: "t",
  50996. value: null
  50997. },
  50998. bumpScale: {
  50999. type: "f",
  51000. value: 1
  51001. }
  51002. },
  51003. normalmap: {
  51004. normalMap: {
  51005. type: "t",
  51006. value: null
  51007. },
  51008. normalScale: {
  51009. type: "v2",
  51010. value: new n.Vector2(1,1)
  51011. }
  51012. },
  51013. displacementmap: {
  51014. displacementMap: {
  51015. type: "t",
  51016. value: null
  51017. },
  51018. displacementScale: {
  51019. type: "f",
  51020. value: 1
  51021. },
  51022. displacementBias: {
  51023. type: "f",
  51024. value: 0
  51025. }
  51026. },
  51027. roughnessmap: {
  51028. roughnessMap: {
  51029. type: "t",
  51030. value: null
  51031. }
  51032. },
  51033. metalnessmap: {
  51034. metalnessMap: {
  51035. type: "t",
  51036. value: null
  51037. }
  51038. },
  51039. fog: {
  51040. fogDensity: {
  51041. type: "f",
  51042. value: 25e-5
  51043. },
  51044. fogNear: {
  51045. type: "f",
  51046. value: 1
  51047. },
  51048. fogFar: {
  51049. type: "f",
  51050. value: 2e3
  51051. },
  51052. fogColor: {
  51053. type: "c",
  51054. value: new n.Color(16777215)
  51055. }
  51056. },
  51057. lights: {
  51058. ambientLightColor: {
  51059. type: "fv",
  51060. value: []
  51061. },
  51062. directionalLights: {
  51063. type: "sa",
  51064. value: [],
  51065. properties: {
  51066. direction: {
  51067. type: "v3"
  51068. },
  51069. color: {
  51070. type: "c"
  51071. },
  51072. shadow: {
  51073. type: "i"
  51074. },
  51075. shadowBias: {
  51076. type: "f"
  51077. },
  51078. shadowRadius: {
  51079. type: "f"
  51080. },
  51081. shadowMapSize: {
  51082. type: "v2"
  51083. }
  51084. }
  51085. },
  51086. directionalShadowMap: {
  51087. type: "tv",
  51088. value: []
  51089. },
  51090. directionalShadowMatrix: {
  51091. type: "m4v",
  51092. value: []
  51093. },
  51094. spotLights: {
  51095. type: "sa",
  51096. value: [],
  51097. properties: {
  51098. color: {
  51099. type: "c"
  51100. },
  51101. position: {
  51102. type: "v3"
  51103. },
  51104. direction: {
  51105. type: "v3"
  51106. },
  51107. distance: {
  51108. type: "f"
  51109. },
  51110. coneCos: {
  51111. type: "f"
  51112. },
  51113. penumbraCos: {
  51114. type: "f"
  51115. },
  51116. decay: {
  51117. type: "f"
  51118. },
  51119. shadow: {
  51120. type: "i"
  51121. },
  51122. shadowBias: {
  51123. type: "f"
  51124. },
  51125. shadowRadius: {
  51126. type: "f"
  51127. },
  51128. shadowMapSize: {
  51129. type: "v2"
  51130. }
  51131. }
  51132. },
  51133. spotShadowMap: {
  51134. type: "tv",
  51135. value: []
  51136. },
  51137. spotShadowMatrix: {
  51138. type: "m4v",
  51139. value: []
  51140. },
  51141. pointLights: {
  51142. type: "sa",
  51143. value: [],
  51144. properties: {
  51145. color: {
  51146. type: "c"
  51147. },
  51148. position: {
  51149. type: "v3"
  51150. },
  51151. decay: {
  51152. type: "f"
  51153. },
  51154. distance: {
  51155. type: "f"
  51156. },
  51157. shadow: {
  51158. type: "i"
  51159. },
  51160. shadowBias: {
  51161. type: "f"
  51162. },
  51163. shadowRadius: {
  51164. type: "f"
  51165. },
  51166. shadowMapSize: {
  51167. type: "v2"
  51168. }
  51169. }
  51170. },
  51171. pointShadowMap: {
  51172. type: "tv",
  51173. value: []
  51174. },
  51175. pointShadowMatrix: {
  51176. type: "m4v",
  51177. value: []
  51178. },
  51179. hemisphereLights: {
  51180. type: "sa",
  51181. value: [],
  51182. properties: {
  51183. direction: {
  51184. type: "v3"
  51185. },
  51186. skyColor: {
  51187. type: "c"
  51188. },
  51189. groundColor: {
  51190. type: "c"
  51191. }
  51192. }
  51193. }
  51194. },
  51195. points: {
  51196. diffuse: {
  51197. type: "c",
  51198. value: new n.Color(15658734)
  51199. },
  51200. opacity: {
  51201. type: "f",
  51202. value: 1
  51203. },
  51204. size: {
  51205. type: "f",
  51206. value: 1
  51207. },
  51208. scale: {
  51209. type: "f",
  51210. value: 1
  51211. },
  51212. map: {
  51213. type: "t",
  51214. value: null
  51215. },
  51216. offsetRepeat: {
  51217. type: "v4",
  51218. value: new n.Vector4(0,0,1,1)
  51219. }
  51220. }
  51221. },
  51222. 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",
  51223. 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",
  51224. 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",
  51225. 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",
  51226. 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",
  51227. 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",
  51228. 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",
  51229. 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",
  51230. 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",
  51231. 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",
  51232. 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",
  51233. 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",
  51234. 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",
  51235. 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",
  51236. 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",
  51237. 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",
  51238. 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",
  51239. 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",
  51240. 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",
  51241. 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",
  51242. 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",
  51243. 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",
  51244. 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",
  51245. 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",
  51246. n.ShaderLib = {
  51247. basic: {
  51248. uniforms: n.UniformsUtils.merge([n.UniformsLib.common, n.UniformsLib.aomap, n.UniformsLib.fog]),
  51249. vertexShader: n.ShaderChunk.meshbasic_vert,
  51250. fragmentShader: n.ShaderChunk.meshbasic_frag
  51251. },
  51252. lambert: {
  51253. uniforms: n.UniformsUtils.merge([n.UniformsLib.common, n.UniformsLib.aomap, n.UniformsLib.lightmap, n.UniformsLib.emissivemap, n.UniformsLib.fog, n.UniformsLib.lights, {
  51254. emissive: {
  51255. type: "c",
  51256. value: new n.Color(0)
  51257. }
  51258. }]),
  51259. vertexShader: n.ShaderChunk.meshlambert_vert,
  51260. fragmentShader: n.ShaderChunk.meshlambert_frag
  51261. },
  51262. phong: {
  51263. 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, {
  51264. emissive: {
  51265. type: "c",
  51266. value: new n.Color(0)
  51267. },
  51268. specular: {
  51269. type: "c",
  51270. value: new n.Color(1118481)
  51271. },
  51272. shininess: {
  51273. type: "f",
  51274. value: 30
  51275. }
  51276. }]),
  51277. vertexShader: n.ShaderChunk.meshphong_vert,
  51278. fragmentShader: n.ShaderChunk.meshphong_frag
  51279. },
  51280. standard: {
  51281. 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, {
  51282. emissive: {
  51283. type: "c",
  51284. value: new n.Color(0)
  51285. },
  51286. roughness: {
  51287. type: "f",
  51288. value: .5
  51289. },
  51290. metalness: {
  51291. type: "f",
  51292. value: 0
  51293. },
  51294. envMapIntensity: {
  51295. type: "f",
  51296. value: 1
  51297. }
  51298. }]),
  51299. vertexShader: n.ShaderChunk.meshstandard_vert,
  51300. fragmentShader: n.ShaderChunk.meshstandard_frag
  51301. },
  51302. points: {
  51303. uniforms: n.UniformsUtils.merge([n.UniformsLib.points, n.UniformsLib.fog]),
  51304. vertexShader: n.ShaderChunk.points_vert,
  51305. fragmentShader: n.ShaderChunk.points_frag
  51306. },
  51307. dashed: {
  51308. uniforms: n.UniformsUtils.merge([n.UniformsLib.common, n.UniformsLib.fog, {
  51309. scale: {
  51310. type: "f",
  51311. value: 1
  51312. },
  51313. dashSize: {
  51314. type: "f",
  51315. value: 1
  51316. },
  51317. totalSize: {
  51318. type: "f",
  51319. value: 2
  51320. }
  51321. }]),
  51322. vertexShader: n.ShaderChunk.linedashed_vert,
  51323. fragmentShader: n.ShaderChunk.linedashed_frag
  51324. },
  51325. depth: {
  51326. uniforms: {
  51327. mNear: {
  51328. type: "f",
  51329. value: 1
  51330. },
  51331. mFar: {
  51332. type: "f",
  51333. value: 2e3
  51334. },
  51335. opacity: {
  51336. type: "f",
  51337. value: 1
  51338. }
  51339. },
  51340. vertexShader: n.ShaderChunk.depth_vert,
  51341. fragmentShader: n.ShaderChunk.depth_frag
  51342. },
  51343. normal: {
  51344. uniforms: {
  51345. opacity: {
  51346. type: "f",
  51347. value: 1
  51348. }
  51349. },
  51350. vertexShader: n.ShaderChunk.normal_vert,
  51351. fragmentShader: n.ShaderChunk.normal_frag
  51352. },
  51353. cube: {
  51354. uniforms: {
  51355. tCube: {
  51356. type: "t",
  51357. value: null
  51358. },
  51359. tFlip: {
  51360. type: "f",
  51361. value: -1
  51362. }
  51363. },
  51364. vertexShader: n.ShaderChunk.cube_vert,
  51365. fragmentShader: n.ShaderChunk.cube_frag
  51366. },
  51367. equirect: {
  51368. uniforms: {
  51369. tEquirect: {
  51370. type: "t",
  51371. value: null
  51372. },
  51373. tFlip: {
  51374. type: "f",
  51375. value: -1
  51376. }
  51377. },
  51378. vertexShader: n.ShaderChunk.equirect_vert,
  51379. fragmentShader: n.ShaderChunk.equirect_frag
  51380. },
  51381. depthRGBA: {
  51382. uniforms: {},
  51383. vertexShader: n.ShaderChunk.depthRGBA_vert,
  51384. fragmentShader: n.ShaderChunk.depthRGBA_frag
  51385. },
  51386. distanceRGBA: {
  51387. uniforms: {
  51388. lightPos: {
  51389. type: "v3",
  51390. value: new n.Vector3(0,0,0)
  51391. }
  51392. },
  51393. vertexShader: n.ShaderChunk.distanceRGBA_vert,
  51394. fragmentShader: n.ShaderChunk.distanceRGBA_frag
  51395. }
  51396. },
  51397. n.WebGLRenderer = function(e) {
  51398. function t() {
  51399. return null === ye ? Oe : 1
  51400. }
  51401. function i(e, t, i, n) {
  51402. se === !0 && (e *= n,
  51403. t *= n,
  51404. i *= n),
  51405. Ye.clearColor(e, t, i, n)
  51406. }
  51407. function r() {
  51408. Ye.init(),
  51409. Ye.scissor(we.copy(Le).multiplyScalar(Oe)),
  51410. Ye.viewport(Te.copy(Ne).multiplyScalar(Oe)),
  51411. i(Se.r, Se.g, Se.b, Me)
  51412. }
  51413. function o() {
  51414. Ae = null,
  51415. be = null,
  51416. Ee = "",
  51417. Ie = -1,
  51418. Ye.reset()
  51419. }
  51420. function a(e) {
  51421. e.preventDefault(),
  51422. o(),
  51423. r(),
  51424. Xe.clear()
  51425. }
  51426. function s(e) {
  51427. var t = e.target;
  51428. t.removeEventListener("dispose", s),
  51429. h(t),
  51430. ke.textures--
  51431. }
  51432. function l(e) {
  51433. var t = e.target;
  51434. t.removeEventListener("dispose", l),
  51435. u(t),
  51436. ke.textures--
  51437. }
  51438. function c(e) {
  51439. var t = e.target;
  51440. t.removeEventListener("dispose", c),
  51441. d(t)
  51442. }
  51443. function h(e) {
  51444. var t = Xe.get(e);
  51445. if (e.image && t.__image__webglTextureCube)
  51446. Ge.deleteTexture(t.__image__webglTextureCube);
  51447. else {
  51448. if (void 0 === t.__webglInit)
  51449. return;
  51450. Ge.deleteTexture(t.__webglTexture)
  51451. }
  51452. Xe.delete(e)
  51453. }
  51454. function u(e) {
  51455. var t = Xe.get(e)
  51456. , i = Xe.get(e.texture);
  51457. if (e && void 0 !== i.__webglTexture) {
  51458. if (Ge.deleteTexture(i.__webglTexture),
  51459. e instanceof n.WebGLRenderTargetCube)
  51460. for (var r = 0; r < 6; r++)
  51461. Ge.deleteFramebuffer(t.__webglFramebuffer[r]),
  51462. Ge.deleteRenderbuffer(t.__webglDepthbuffer[r]);
  51463. else
  51464. Ge.deleteFramebuffer(t.__webglFramebuffer),
  51465. Ge.deleteRenderbuffer(t.__webglDepthbuffer);
  51466. Xe.delete(e.texture),
  51467. Xe.delete(e)
  51468. }
  51469. }
  51470. function d(e) {
  51471. p(e),
  51472. Xe.delete(e)
  51473. }
  51474. function p(e) {
  51475. var t = Xe.get(e).program;
  51476. e.program = void 0,
  51477. void 0 !== t && qe.releaseProgram(t)
  51478. }
  51479. function f(e, t, i, r) {
  51480. var o;
  51481. if (i instanceof n.InstancedBufferGeometry && (o = We.get("ANGLE_instanced_arrays"),
  51482. null === o))
  51483. return void console.error("THREE.WebGLRenderer.setupVertexAttributes: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");
  51484. void 0 === r && (r = 0),
  51485. Ye.initAttributes();
  51486. var a = i.attributes
  51487. , s = t.getAttributes()
  51488. , l = e.defaultAttributeValues;
  51489. for (var c in s) {
  51490. var h = s[c];
  51491. if (h >= 0) {
  51492. var u = a[c];
  51493. if (void 0 !== u) {
  51494. var d = u.itemSize
  51495. , p = Ze.getAttributeBuffer(u);
  51496. if (u instanceof n.InterleavedBufferAttribute) {
  51497. var f = u.data
  51498. , g = f.stride
  51499. , m = u.offset;
  51500. f instanceof n.InstancedInterleavedBuffer ? (Ye.enableAttributeAndDivisor(h, f.meshPerAttribute, o),
  51501. void 0 === i.maxInstancedCount && (i.maxInstancedCount = f.meshPerAttribute * f.count)) : Ye.enableAttribute(h),
  51502. Ge.bindBuffer(Ge.ARRAY_BUFFER, p),
  51503. Ge.vertexAttribPointer(h, d, Ge.FLOAT, !1, g * f.array.BYTES_PER_ELEMENT, (r * g + m) * f.array.BYTES_PER_ELEMENT)
  51504. } else
  51505. u instanceof n.InstancedBufferAttribute ? (Ye.enableAttributeAndDivisor(h, u.meshPerAttribute, o),
  51506. void 0 === i.maxInstancedCount && (i.maxInstancedCount = u.meshPerAttribute * u.count)) : Ye.enableAttribute(h),
  51507. Ge.bindBuffer(Ge.ARRAY_BUFFER, p),
  51508. Ge.vertexAttribPointer(h, d, Ge.FLOAT, !1, 0, r * d * 4)
  51509. } else if (void 0 !== l) {
  51510. var v = l[c];
  51511. if (void 0 !== v)
  51512. switch (v.length) {
  51513. case 2:
  51514. Ge.vertexAttrib2fv(h, v);
  51515. break;
  51516. case 3:
  51517. Ge.vertexAttrib3fv(h, v);
  51518. break;
  51519. case 4:
  51520. Ge.vertexAttrib4fv(h, v);
  51521. break;
  51522. default:
  51523. Ge.vertexAttrib1fv(h, v)
  51524. }
  51525. }
  51526. }
  51527. }
  51528. Ye.disableUnusedAttributes()
  51529. }
  51530. function g(e, t) {
  51531. return Math.abs(t[0]) - Math.abs(e[0])
  51532. }
  51533. function m(e, t) {
  51534. 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
  51535. }
  51536. function v(e, t) {
  51537. 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
  51538. }
  51539. function A(e, t, i, n, r) {
  51540. var o, a;
  51541. i.transparent ? (o = de,
  51542. a = ++pe) : (o = he,
  51543. a = ++ue);
  51544. var s = o[a];
  51545. void 0 !== s ? (s.id = e.id,
  51546. s.object = e,
  51547. s.geometry = t,
  51548. s.material = i,
  51549. s.z = Ve.z,
  51550. s.group = r) : (s = {
  51551. id: e.id,
  51552. object: e,
  51553. geometry: t,
  51554. material: i,
  51555. z: Ve.z,
  51556. group: r
  51557. },
  51558. o.push(s))
  51559. }
  51560. function y(e, t) {
  51561. if (e.visible !== !1) {
  51562. if (e.layers.test(t.layers))
  51563. if (e instanceof n.Light)
  51564. ce.push(e);
  51565. else if (e instanceof n.Sprite)
  51566. e.frustumCulled !== !1 && Be.intersectsObject(e) !== !0 || ge.push(e);
  51567. else if (e instanceof n.LensFlare)
  51568. me.push(e);
  51569. else if (e instanceof n.ImmediateRenderObject)
  51570. ve.sortObjects === !0 && (Ve.setFromMatrixPosition(e.matrixWorld),
  51571. Ve.applyProjection(Fe)),
  51572. A(e, null, e.material, Ve.z, null);
  51573. else if ((e instanceof n.Mesh || e instanceof n.Line || e instanceof n.Points) && (e instanceof n.SkinnedMesh && e.skeleton.update(),
  51574. e.frustumCulled === !1 || Be.intersectsObject(e) === !0)) {
  51575. var i = e.material;
  51576. if (i.visible === !0) {
  51577. ve.sortObjects === !0 && (Ve.setFromMatrixPosition(e.matrixWorld),
  51578. Ve.applyProjection(Fe));
  51579. var r = Ze.update(e);
  51580. if (i instanceof n.MultiMaterial)
  51581. for (var o = r.groups, a = i.materials, s = 0, l = o.length; s < l; s++) {
  51582. var c = o[s]
  51583. , h = a[c.materialIndex];
  51584. h.visible === !0 && A(e, r, h, Ve.z, c)
  51585. }
  51586. else
  51587. A(e, r, i, Ve.z, null)
  51588. }
  51589. }
  51590. for (var u = e.children, s = 0, l = u.length; s < l; s++)
  51591. y(u[s], t)
  51592. }
  51593. }
  51594. function C(e, t, i, r) {
  51595. for (var o = 0, a = e.length; o < a; o++) {
  51596. var s = e[o]
  51597. , l = s.object
  51598. , c = s.geometry
  51599. , h = void 0 === r ? s.material : r
  51600. , u = s.group;
  51601. if (l.modelViewMatrix.multiplyMatrices(t.matrixWorldInverse, l.matrixWorld),
  51602. l.normalMatrix.getNormalMatrix(l.modelViewMatrix),
  51603. l instanceof n.ImmediateRenderObject) {
  51604. E(h);
  51605. var d = w(t, i, h, l);
  51606. Ee = "",
  51607. l.render(function(e) {
  51608. ve.renderBufferImmediate(e, d, h)
  51609. })
  51610. } else
  51611. ve.renderBufferDirect(t, i, c, h, l, u)
  51612. }
  51613. }
  51614. function I(e, t, i) {
  51615. var r = Xe.get(e)
  51616. , o = qe.getParameters(e, Ue, t, i)
  51617. , a = qe.getProgramCode(e, o)
  51618. , s = r.program
  51619. , l = !0;
  51620. if (void 0 === s)
  51621. e.addEventListener("dispose", c);
  51622. else if (s.code !== a)
  51623. p(e);
  51624. else {
  51625. if (void 0 !== o.shaderID)
  51626. return;
  51627. l = !1
  51628. }
  51629. if (l) {
  51630. if (o.shaderID) {
  51631. var h = n.ShaderLib[o.shaderID];
  51632. r.__webglShader = {
  51633. name: e.type,
  51634. uniforms: n.UniformsUtils.clone(h.uniforms),
  51635. vertexShader: h.vertexShader,
  51636. fragmentShader: h.fragmentShader
  51637. }
  51638. } else
  51639. r.__webglShader = {
  51640. name: e.type,
  51641. uniforms: e.uniforms,
  51642. vertexShader: e.vertexShader,
  51643. fragmentShader: e.fragmentShader
  51644. };
  51645. e.__webglShader = r.__webglShader,
  51646. s = qe.acquireProgram(e, o, a),
  51647. r.program = s,
  51648. e.program = s
  51649. }
  51650. var u = s.getAttributes();
  51651. if (e.morphTargets) {
  51652. e.numSupportedMorphTargets = 0;
  51653. for (var d = 0; d < ve.maxMorphTargets; d++)
  51654. u["morphTarget" + d] >= 0 && e.numSupportedMorphTargets++
  51655. }
  51656. if (e.morphNormals) {
  51657. e.numSupportedMorphNormals = 0;
  51658. for (var d = 0; d < ve.maxMorphNormals; d++)
  51659. u["morphNormal" + d] >= 0 && e.numSupportedMorphNormals++
  51660. }
  51661. r.uniformsList = [];
  51662. var f = r.__webglShader.uniforms
  51663. , g = r.program.getUniforms();
  51664. for (var m in f) {
  51665. var v = g[m];
  51666. v && r.uniformsList.push([r.__webglShader.uniforms[m], v])
  51667. }
  51668. (e instanceof n.MeshPhongMaterial || e instanceof n.MeshLambertMaterial || e instanceof n.MeshStandardMaterial || e.lights) && (r.lightsHash = Ue.hash,
  51669. f.ambientLightColor.value = Ue.ambient,
  51670. f.directionalLights.value = Ue.directional,
  51671. f.spotLights.value = Ue.spot,
  51672. f.pointLights.value = Ue.point,
  51673. f.hemisphereLights.value = Ue.hemi,
  51674. f.directionalShadowMap.value = Ue.directionalShadowMap,
  51675. f.directionalShadowMatrix.value = Ue.directionalShadowMatrix,
  51676. f.spotShadowMap.value = Ue.spotShadowMap,
  51677. f.spotShadowMatrix.value = Ue.spotShadowMatrix,
  51678. f.pointShadowMap.value = Ue.pointShadowMap,
  51679. f.pointShadowMatrix.value = Ue.pointShadowMatrix),
  51680. r.hasDynamicUniforms = !1;
  51681. for (var A = 0, y = r.uniformsList.length; A < y; A++) {
  51682. var C = r.uniformsList[A][0];
  51683. if (C.dynamic === !0) {
  51684. r.hasDynamicUniforms = !0;
  51685. break
  51686. }
  51687. }
  51688. }
  51689. function E(e) {
  51690. b(e),
  51691. 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),
  51692. Ye.setDepthFunc(e.depthFunc),
  51693. Ye.setDepthTest(e.depthTest),
  51694. Ye.setDepthWrite(e.depthWrite),
  51695. Ye.setColorWrite(e.colorWrite),
  51696. Ye.setPolygonOffset(e.polygonOffset, e.polygonOffsetFactor, e.polygonOffsetUnits)
  51697. }
  51698. function b(e) {
  51699. e.side !== n.DoubleSide ? Ye.enable(Ge.CULL_FACE) : Ye.disable(Ge.CULL_FACE),
  51700. Ye.setFlipSided(e.side === n.BackSide)
  51701. }
  51702. function w(e, t, i, r) {
  51703. xe = 0;
  51704. var o = Xe.get(i);
  51705. void 0 === o.program && (i.needsUpdate = !0),
  51706. void 0 !== o.lightsHash && o.lightsHash !== Ue.hash && (i.needsUpdate = !0),
  51707. i.needsUpdate && (I(i, t, r),
  51708. i.needsUpdate = !1);
  51709. var a = !1
  51710. , s = !1
  51711. , l = !1
  51712. , c = o.program
  51713. , h = c.getUniforms()
  51714. , u = o.__webglShader.uniforms;
  51715. if (c.id !== Ae && (Ge.useProgram(c.program),
  51716. Ae = c.id,
  51717. a = !0,
  51718. s = !0,
  51719. l = !0),
  51720. i.id !== Ie && (Ie = i.id,
  51721. s = !0),
  51722. (a || e !== be) && (Ge.uniformMatrix4fv(h.projectionMatrix, !1, e.projectionMatrix.elements),
  51723. je.logarithmicDepthBuffer && Ge.uniform1f(h.logDepthBufFC, 2 / (Math.log(e.far + 1) / Math.LN2)),
  51724. e !== be && (be = e,
  51725. s = !0,
  51726. l = !0),
  51727. (i instanceof n.ShaderMaterial || i instanceof n.MeshPhongMaterial || i instanceof n.MeshStandardMaterial || i.envMap) && void 0 !== h.cameraPosition && (Ve.setFromMatrixPosition(e.matrixWorld),
  51728. Ge.uniform3f(h.cameraPosition, Ve.x, Ve.y, Ve.z)),
  51729. (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),
  51730. void 0 !== h.toneMappingExposure && Ge.uniform1f(h.toneMappingExposure, ve.toneMappingExposure),
  51731. void 0 !== h.toneMappingWhitePoint && Ge.uniform1f(h.toneMappingWhitePoint, ve.toneMappingWhitePoint)),
  51732. i.skinning)
  51733. if (r.bindMatrix && void 0 !== h.bindMatrix && Ge.uniformMatrix4fv(h.bindMatrix, !1, r.bindMatrix.elements),
  51734. r.bindMatrixInverse && void 0 !== h.bindMatrixInverse && Ge.uniformMatrix4fv(h.bindMatrixInverse, !1, r.bindMatrixInverse.elements),
  51735. je.floatVertexTextures && r.skeleton && r.skeleton.useVertexTexture) {
  51736. if (void 0 !== h.boneTexture) {
  51737. var d = B();
  51738. Ge.uniform1i(h.boneTexture, d),
  51739. ve.setTexture(r.skeleton.boneTexture, d)
  51740. }
  51741. void 0 !== h.boneTextureWidth && Ge.uniform1i(h.boneTextureWidth, r.skeleton.boneTextureWidth),
  51742. void 0 !== h.boneTextureHeight && Ge.uniform1i(h.boneTextureHeight, r.skeleton.boneTextureHeight)
  51743. } else
  51744. r.skeleton && r.skeleton.boneMatrices && void 0 !== h.boneGlobalMatrices && Ge.uniformMatrix4fv(h.boneGlobalMatrices, !1, r.skeleton.boneMatrices);
  51745. return s && ((i instanceof n.MeshPhongMaterial || i instanceof n.MeshLambertMaterial || i instanceof n.MeshStandardMaterial || i.lights) && D(u, l),
  51746. t && i.fog && R(u, t),
  51747. (i instanceof n.MeshBasicMaterial || i instanceof n.MeshLambertMaterial || i instanceof n.MeshPhongMaterial || i instanceof n.MeshStandardMaterial) && T(u, i),
  51748. i instanceof n.LineBasicMaterial ? x(u, i) : i instanceof n.LineDashedMaterial ? (x(u, i),
  51749. 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,
  51750. u.mFar.value = e.far,
  51751. u.opacity.value = i.opacity) : i instanceof n.MeshNormalMaterial && (u.opacity.value = i.opacity),
  51752. V(o.uniformsList)),
  51753. N(h, r),
  51754. void 0 !== h.modelMatrix && Ge.uniformMatrix4fv(h.modelMatrix, !1, r.matrixWorld.elements),
  51755. o.hasDynamicUniforms === !0 && _(o.uniformsList, r, e),
  51756. c
  51757. }
  51758. function _(e, t, i) {
  51759. for (var n = [], r = 0, o = e.length; r < o; r++) {
  51760. var a = e[r][0]
  51761. , s = a.onUpdateCallback;
  51762. void 0 !== s && (s.bind(a)(t, i),
  51763. n.push(e[r]))
  51764. }
  51765. V(n)
  51766. }
  51767. function T(e, t) {
  51768. e.opacity.value = t.opacity,
  51769. e.diffuse.value = t.color,
  51770. t.emissive && e.emissive.value.copy(t.emissive).multiplyScalar(t.emissiveIntensity),
  51771. e.map.value = t.map,
  51772. e.specularMap.value = t.specularMap,
  51773. e.alphaMap.value = t.alphaMap,
  51774. t.aoMap && (e.aoMap.value = t.aoMap,
  51775. e.aoMapIntensity.value = t.aoMapIntensity);
  51776. var i;
  51777. 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),
  51778. void 0 !== i) {
  51779. i instanceof n.WebGLRenderTarget && (i = i.texture);
  51780. var r = i.offset
  51781. , o = i.repeat;
  51782. e.offsetRepeat.value.set(r.x, r.y, o.x, o.y)
  51783. }
  51784. e.envMap.value = t.envMap,
  51785. e.flipEnvMap.value = t.envMap instanceof n.WebGLRenderTargetCube ? 1 : -1,
  51786. e.reflectivity.value = t.reflectivity,
  51787. e.refractionRatio.value = t.refractionRatio
  51788. }
  51789. function x(e, t) {
  51790. e.diffuse.value = t.color,
  51791. e.opacity.value = t.opacity
  51792. }
  51793. function S(e, t) {
  51794. e.dashSize.value = t.dashSize,
  51795. e.totalSize.value = t.dashSize + t.gapSize,
  51796. e.scale.value = t.scale
  51797. }
  51798. function M(e, t) {
  51799. if (e.diffuse.value = t.color,
  51800. e.opacity.value = t.opacity,
  51801. e.size.value = t.size * Oe,
  51802. e.scale.value = te.clientHeight / 2,
  51803. e.map.value = t.map,
  51804. null !== t.map) {
  51805. var i = t.map.offset
  51806. , n = t.map.repeat;
  51807. e.offsetRepeat.value.set(i.x, i.y, n.x, n.y)
  51808. }
  51809. }
  51810. function R(e, t) {
  51811. e.fogColor.value = t.color,
  51812. t instanceof n.Fog ? (e.fogNear.value = t.near,
  51813. e.fogFar.value = t.far) : t instanceof n.FogExp2 && (e.fogDensity.value = t.density)
  51814. }
  51815. function P(e, t) {
  51816. t.lightMap && (e.lightMap.value = t.lightMap,
  51817. e.lightMapIntensity.value = t.lightMapIntensity),
  51818. t.emissiveMap && (e.emissiveMap.value = t.emissiveMap)
  51819. }
  51820. function O(e, t) {
  51821. e.specular.value = t.specular,
  51822. e.shininess.value = Math.max(t.shininess, 1e-4),
  51823. t.lightMap && (e.lightMap.value = t.lightMap,
  51824. e.lightMapIntensity.value = t.lightMapIntensity),
  51825. t.emissiveMap && (e.emissiveMap.value = t.emissiveMap),
  51826. t.bumpMap && (e.bumpMap.value = t.bumpMap,
  51827. e.bumpScale.value = t.bumpScale),
  51828. t.normalMap && (e.normalMap.value = t.normalMap,
  51829. e.normalScale.value.copy(t.normalScale)),
  51830. t.displacementMap && (e.displacementMap.value = t.displacementMap,
  51831. e.displacementScale.value = t.displacementScale,
  51832. e.displacementBias.value = t.displacementBias)
  51833. }
  51834. function L(e, t) {
  51835. e.roughness.value = t.roughness,
  51836. e.metalness.value = t.metalness,
  51837. t.roughnessMap && (e.roughnessMap.value = t.roughnessMap),
  51838. t.metalnessMap && (e.metalnessMap.value = t.metalnessMap),
  51839. t.lightMap && (e.lightMap.value = t.lightMap,
  51840. e.lightMapIntensity.value = t.lightMapIntensity),
  51841. t.emissiveMap && (e.emissiveMap.value = t.emissiveMap),
  51842. t.bumpMap && (e.bumpMap.value = t.bumpMap,
  51843. e.bumpScale.value = t.bumpScale),
  51844. t.normalMap && (e.normalMap.value = t.normalMap,
  51845. e.normalScale.value.copy(t.normalScale)),
  51846. t.displacementMap && (e.displacementMap.value = t.displacementMap,
  51847. e.displacementScale.value = t.displacementScale,
  51848. e.displacementBias.value = t.displacementBias),
  51849. t.envMap && (e.envMapIntensity.value = t.envMapIntensity)
  51850. }
  51851. function D(e, t) {
  51852. e.ambientLightColor.needsUpdate = t,
  51853. e.directionalLights.needsUpdate = t,
  51854. e.pointLights.needsUpdate = t,
  51855. e.spotLights.needsUpdate = t,
  51856. e.hemisphereLights.needsUpdate = t
  51857. }
  51858. function N(e, t) {
  51859. Ge.uniformMatrix4fv(e.modelViewMatrix, !1, t.modelViewMatrix.elements),
  51860. e.normalMatrix && Ge.uniformMatrix3fv(e.normalMatrix, !1, t.normalMatrix.elements)
  51861. }
  51862. function B() {
  51863. var e = xe;
  51864. return e >= je.maxTextures && console.warn("WebGLRenderer: trying to use " + e + " texture units while this GPU supports only " + je.maxTextures),
  51865. xe += 1,
  51866. e
  51867. }
  51868. function F(e, t, i, r) {
  51869. var o, a;
  51870. if ("1i" === t)
  51871. Ge.uniform1i(i, r);
  51872. else if ("1f" === t)
  51873. Ge.uniform1f(i, r);
  51874. else if ("2f" === t)
  51875. Ge.uniform2f(i, r[0], r[1]);
  51876. else if ("3f" === t)
  51877. Ge.uniform3f(i, r[0], r[1], r[2]);
  51878. else if ("4f" === t)
  51879. Ge.uniform4f(i, r[0], r[1], r[2], r[3]);
  51880. else if ("1iv" === t)
  51881. Ge.uniform1iv(i, r);
  51882. else if ("3iv" === t)
  51883. Ge.uniform3iv(i, r);
  51884. else if ("1fv" === t)
  51885. Ge.uniform1fv(i, r);
  51886. else if ("2fv" === t)
  51887. Ge.uniform2fv(i, r);
  51888. else if ("3fv" === t)
  51889. Ge.uniform3fv(i, r);
  51890. else if ("4fv" === t)
  51891. Ge.uniform4fv(i, r);
  51892. else if ("Matrix2fv" === t)
  51893. Ge.uniformMatrix2fv(i, !1, r);
  51894. else if ("Matrix3fv" === t)
  51895. Ge.uniformMatrix3fv(i, !1, r);
  51896. else if ("Matrix4fv" === t)
  51897. Ge.uniformMatrix4fv(i, !1, r);
  51898. else if ("i" === t)
  51899. Ge.uniform1i(i, r);
  51900. else if ("f" === t)
  51901. Ge.uniform1f(i, r);
  51902. else if ("v2" === t)
  51903. Ge.uniform2f(i, r.x, r.y);
  51904. else if ("v3" === t)
  51905. Ge.uniform3f(i, r.x, r.y, r.z);
  51906. else if ("v4" === t)
  51907. Ge.uniform4f(i, r.x, r.y, r.z, r.w);
  51908. else if ("c" === t)
  51909. Ge.uniform3f(i, r.r, r.g, r.b);
  51910. else if ("s" === t) {
  51911. var s = e.properties;
  51912. for (var l in s) {
  51913. var c = s[l]
  51914. , h = i[l]
  51915. , u = r[l];
  51916. F(c, c.type, h, u)
  51917. }
  51918. } else if ("sa" === t)
  51919. for (var s = e.properties, d = 0, p = r.length; d < p; d++)
  51920. for (var l in s) {
  51921. var c = s[l]
  51922. , h = i[d][l]
  51923. , u = r[d][l];
  51924. F(c, c.type, h, u)
  51925. }
  51926. else if ("iv1" === t)
  51927. Ge.uniform1iv(i, r);
  51928. else if ("iv" === t)
  51929. Ge.uniform3iv(i, r);
  51930. else if ("fv1" === t)
  51931. Ge.uniform1fv(i, r);
  51932. else if ("fv" === t)
  51933. Ge.uniform3fv(i, r);
  51934. else if ("v2v" === t) {
  51935. void 0 === e._array && (e._array = new Float32Array(2 * r.length));
  51936. for (var d = 0, f = 0, g = r.length; d < g; d++,
  51937. f += 2)
  51938. e._array[f + 0] = r[d].x,
  51939. e._array[f + 1] = r[d].y;
  51940. Ge.uniform2fv(i, e._array)
  51941. } else if ("v3v" === t) {
  51942. void 0 === e._array && (e._array = new Float32Array(3 * r.length));
  51943. for (var d = 0, m = 0, g = r.length; d < g; d++,
  51944. m += 3)
  51945. e._array[m + 0] = r[d].x,
  51946. e._array[m + 1] = r[d].y,
  51947. e._array[m + 2] = r[d].z;
  51948. Ge.uniform3fv(i, e._array)
  51949. } else if ("v4v" === t) {
  51950. void 0 === e._array && (e._array = new Float32Array(4 * r.length));
  51951. for (var d = 0, v = 0, g = r.length; d < g; d++,
  51952. v += 4)
  51953. e._array[v + 0] = r[d].x,
  51954. e._array[v + 1] = r[d].y,
  51955. e._array[v + 2] = r[d].z,
  51956. e._array[v + 3] = r[d].w;
  51957. Ge.uniform4fv(i, e._array)
  51958. } else if ("m2" === t)
  51959. Ge.uniformMatrix2fv(i, !1, r.elements);
  51960. else if ("m3" === t)
  51961. Ge.uniformMatrix3fv(i, !1, r.elements);
  51962. else if ("m3v" === t) {
  51963. void 0 === e._array && (e._array = new Float32Array(9 * r.length));
  51964. for (var d = 0, g = r.length; d < g; d++)
  51965. r[d].flattenToArrayOffset(e._array, 9 * d);
  51966. Ge.uniformMatrix3fv(i, !1, e._array)
  51967. } else if ("m4" === t)
  51968. Ge.uniformMatrix4fv(i, !1, r.elements);
  51969. else if ("m4v" === t) {
  51970. void 0 === e._array && (e._array = new Float32Array(16 * r.length));
  51971. for (var d = 0, g = r.length; d < g; d++)
  51972. r[d].flattenToArrayOffset(e._array, 16 * d);
  51973. Ge.uniformMatrix4fv(i, !1, e._array)
  51974. } else if ("t" === t) {
  51975. if (o = r,
  51976. a = B(),
  51977. Ge.uniform1i(i, a),
  51978. !o)
  51979. return;
  51980. 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)
  51981. } else if ("tv" === t) {
  51982. void 0 === e._array && (e._array = []);
  51983. for (var d = 0, g = e.value.length; d < g; d++)
  51984. e._array[d] = B();
  51985. Ge.uniform1iv(i, e._array);
  51986. for (var d = 0, g = e.value.length; d < g; d++)
  51987. o = e.value[d],
  51988. a = e._array[d],
  51989. 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))
  51990. } else
  51991. console.warn("THREE.WebGLRenderer: Unknown uniform type: " + t)
  51992. }
  51993. function V(e) {
  51994. for (var t = 0, i = e.length; t < i; t++) {
  51995. var n = e[t][0];
  51996. if (n.needsUpdate !== !1) {
  51997. var r = n.type
  51998. , o = e[t][1]
  51999. , a = n.value;
  52000. F(n, r, o, a)
  52001. }
  52002. }
  52003. }
  52004. function U(e, t) {
  52005. 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;
  52006. for (Ue.shadowsPointLight = 0,
  52007. i = 0,
  52008. r = e.length; i < r; i++)
  52009. if (o = e[i],
  52010. a = o.color,
  52011. s = o.intensity,
  52012. l = o.distance,
  52013. o instanceof n.AmbientLight)
  52014. c += a.r * s,
  52015. h += a.g * s,
  52016. u += a.b * s;
  52017. else if (o instanceof n.DirectionalLight) {
  52018. var A = Ke.get(o);
  52019. A.color.copy(o.color).multiplyScalar(o.intensity),
  52020. A.direction.setFromMatrixPosition(o.matrixWorld),
  52021. Ve.setFromMatrixPosition(o.target.matrixWorld),
  52022. A.direction.sub(Ve),
  52023. A.direction.transformDirection(d),
  52024. A.shadow = o.castShadow,
  52025. o.castShadow && (A.shadowBias = o.shadow.bias,
  52026. A.shadowRadius = o.shadow.radius,
  52027. A.shadowMapSize = o.shadow.mapSize,
  52028. Ue.shadows[v++] = o),
  52029. Ue.directionalShadowMap[p] = o.shadow.map,
  52030. Ue.directionalShadowMatrix[p] = o.shadow.matrix,
  52031. Ue.directional[p++] = A
  52032. } else if (o instanceof n.SpotLight) {
  52033. var A = Ke.get(o);
  52034. A.position.setFromMatrixPosition(o.matrixWorld),
  52035. A.position.applyMatrix4(d),
  52036. A.color.copy(a).multiplyScalar(s),
  52037. A.distance = l,
  52038. A.direction.setFromMatrixPosition(o.matrixWorld),
  52039. Ve.setFromMatrixPosition(o.target.matrixWorld),
  52040. A.direction.sub(Ve),
  52041. A.direction.transformDirection(d),
  52042. A.coneCos = Math.cos(o.angle),
  52043. A.penumbraCos = Math.cos(o.angle * (1 - o.penumbra)),
  52044. A.decay = 0 === o.distance ? 0 : o.decay,
  52045. A.shadow = o.castShadow,
  52046. o.castShadow && (A.shadowBias = o.shadow.bias,
  52047. A.shadowRadius = o.shadow.radius,
  52048. A.shadowMapSize = o.shadow.mapSize,
  52049. Ue.shadows[v++] = o),
  52050. Ue.spotShadowMap[g] = o.shadow.map,
  52051. Ue.spotShadowMatrix[g] = o.shadow.matrix,
  52052. Ue.spot[g++] = A
  52053. } else if (o instanceof n.PointLight) {
  52054. var A = Ke.get(o);
  52055. A.position.setFromMatrixPosition(o.matrixWorld),
  52056. A.position.applyMatrix4(d),
  52057. A.color.copy(o.color).multiplyScalar(o.intensity),
  52058. A.distance = o.distance,
  52059. A.decay = 0 === o.distance ? 0 : o.decay,
  52060. A.shadow = o.castShadow,
  52061. o.castShadow && (A.shadowBias = o.shadow.bias,
  52062. A.shadowRadius = o.shadow.radius,
  52063. A.shadowMapSize = o.shadow.mapSize,
  52064. Ue.shadows[v++] = o),
  52065. Ue.pointShadowMap[f] = o.shadow.map,
  52066. void 0 === Ue.pointShadowMatrix[f] && (Ue.pointShadowMatrix[f] = new n.Matrix4),
  52067. Ve.setFromMatrixPosition(o.matrixWorld).negate(),
  52068. Ue.pointShadowMatrix[f].identity().setPosition(Ve),
  52069. Ue.point[f++] = A
  52070. } else if (o instanceof n.HemisphereLight) {
  52071. var A = Ke.get(o);
  52072. A.direction.setFromMatrixPosition(o.matrixWorld),
  52073. A.direction.transformDirection(d),
  52074. A.direction.normalize(),
  52075. A.skyColor.copy(o.color).multiplyScalar(s),
  52076. A.groundColor.copy(o.groundColor).multiplyScalar(s),
  52077. Ue.hemi[m++] = A
  52078. }
  52079. Ue.ambient[0] = c,
  52080. Ue.ambient[1] = h,
  52081. Ue.ambient[2] = u,
  52082. Ue.directional.length = p,
  52083. Ue.spot.length = g,
  52084. Ue.point.length = f,
  52085. Ue.hemi.length = m,
  52086. Ue.shadows.length = v,
  52087. Ue.hash = p + "," + f + "," + g + "," + m + "," + v
  52088. }
  52089. function k(e, t, i) {
  52090. var r;
  52091. if (i ? (Ge.texParameteri(e, Ge.TEXTURE_WRAP_S, ee(t.wrapS)),
  52092. Ge.texParameteri(e, Ge.TEXTURE_WRAP_T, ee(t.wrapT)),
  52093. Ge.texParameteri(e, Ge.TEXTURE_MAG_FILTER, ee(t.magFilter)),
  52094. Ge.texParameteri(e, Ge.TEXTURE_MIN_FILTER, ee(t.minFilter))) : (Ge.texParameteri(e, Ge.TEXTURE_WRAP_S, Ge.CLAMP_TO_EDGE),
  52095. Ge.texParameteri(e, Ge.TEXTURE_WRAP_T, Ge.CLAMP_TO_EDGE),
  52096. 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),
  52097. Ge.texParameteri(e, Ge.TEXTURE_MAG_FILTER, $(t.magFilter)),
  52098. Ge.texParameteri(e, Ge.TEXTURE_MIN_FILTER, $(t.minFilter)),
  52099. 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)),
  52100. r = We.get("EXT_texture_filter_anisotropic")) {
  52101. if (t.type === n.FloatType && null === We.get("OES_texture_float_linear"))
  52102. return;
  52103. if (t.type === n.HalfFloatType && null === We.get("OES_texture_half_float_linear"))
  52104. return;
  52105. (t.anisotropy > 1 || Xe.get(t).__currentAnisotropy) && (Ge.texParameterf(e, r.TEXTURE_MAX_ANISOTROPY_EXT, Math.min(t.anisotropy, ve.getMaxAnisotropy())),
  52106. Xe.get(t).__currentAnisotropy = t.anisotropy)
  52107. }
  52108. }
  52109. function H(e, t, i) {
  52110. void 0 === e.__webglInit && (e.__webglInit = !0,
  52111. t.addEventListener("dispose", s),
  52112. e.__webglTexture = Ge.createTexture(),
  52113. ke.textures++),
  52114. Ye.activeTexture(Ge.TEXTURE0 + i),
  52115. Ye.bindTexture(Ge.TEXTURE_2D, e.__webglTexture),
  52116. Ge.pixelStorei(Ge.UNPACK_FLIP_Y_WEBGL, t.flipY),
  52117. Ge.pixelStorei(Ge.UNPACK_PREMULTIPLY_ALPHA_WEBGL, t.premultiplyAlpha),
  52118. Ge.pixelStorei(Ge.UNPACK_ALIGNMENT, t.unpackAlignment);
  52119. var r = G(t.image, je.maxTextureSize);
  52120. W(t) && z(r) === !1 && (r = j(r));
  52121. var o = z(r)
  52122. , a = ee(t.format)
  52123. , l = ee(t.type);
  52124. k(Ge.TEXTURE_2D, t, o);
  52125. var c, h = t.mipmaps;
  52126. if (t instanceof n.DataTexture)
  52127. if (h.length > 0 && o) {
  52128. for (var u = 0, d = h.length; u < d; u++)
  52129. c = h[u],
  52130. Ye.texImage2D(Ge.TEXTURE_2D, u, a, c.width, c.height, 0, a, l, c.data);
  52131. t.generateMipmaps = !1
  52132. } else
  52133. Ye.texImage2D(Ge.TEXTURE_2D, 0, a, r.width, r.height, 0, a, l, r.data);
  52134. else if (t instanceof n.CompressedTexture)
  52135. for (var u = 0, d = h.length; u < d; u++)
  52136. c = h[u],
  52137. 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);
  52138. else if (h.length > 0 && o) {
  52139. for (var u = 0, d = h.length; u < d; u++)
  52140. c = h[u],
  52141. Ye.texImage2D(Ge.TEXTURE_2D, u, a, a, l, c);
  52142. t.generateMipmaps = !1
  52143. } else
  52144. Ye.texImage2D(Ge.TEXTURE_2D, 0, a, a, l, r);
  52145. t.generateMipmaps && o && Ge.generateMipmap(Ge.TEXTURE_2D),
  52146. e.__version = t.version,
  52147. t.onUpdate && t.onUpdate(t)
  52148. }
  52149. function G(e, t) {
  52150. if (e.width > t || e.height > t) {
  52151. var i = t / Math.max(e.width, e.height)
  52152. , n = document.createElement("canvas");
  52153. n.width = Math.floor(e.width * i),
  52154. n.height = Math.floor(e.height * i);
  52155. var r = n.getContext("2d");
  52156. return r.drawImage(e, 0, 0, e.width, e.height, 0, 0, n.width, n.height),
  52157. console.warn("THREE.WebGLRenderer: image is too big (" + e.width + "x" + e.height + "). Resized to " + n.width + "x" + n.height, e),
  52158. n
  52159. }
  52160. return e
  52161. }
  52162. function z(e) {
  52163. return n.Math.isPowerOfTwo(e.width) && n.Math.isPowerOfTwo(e.height)
  52164. }
  52165. function W(e) {
  52166. return e.wrapS !== n.ClampToEdgeWrapping || e.wrapT !== n.ClampToEdgeWrapping || e.minFilter !== n.NearestFilter && e.minFilter !== n.LinearFilter
  52167. }
  52168. function j(e) {
  52169. if (e instanceof HTMLImageElement || e instanceof HTMLCanvasElement) {
  52170. var t = document.createElement("canvas");
  52171. t.width = n.Math.nearestPowerOfTwo(e.width),
  52172. t.height = n.Math.nearestPowerOfTwo(e.height);
  52173. var i = t.getContext("2d");
  52174. return i.drawImage(e, 0, 0, t.width, t.height),
  52175. console.warn("THREE.WebGLRenderer: image is not power of two (" + e.width + "x" + e.height + "). Resized to " + t.width + "x" + t.height, e),
  52176. t
  52177. }
  52178. return e
  52179. }
  52180. function Y(e, t) {
  52181. var i = Xe.get(e);
  52182. if (6 === e.image.length)
  52183. if (e.version > 0 && i.__version !== e.version) {
  52184. i.__image__webglTextureCube || (e.addEventListener("dispose", s),
  52185. i.__image__webglTextureCube = Ge.createTexture(),
  52186. ke.textures++),
  52187. Ye.activeTexture(Ge.TEXTURE0 + t),
  52188. Ye.bindTexture(Ge.TEXTURE_CUBE_MAP, i.__image__webglTextureCube),
  52189. Ge.pixelStorei(Ge.UNPACK_FLIP_Y_WEBGL, e.flipY);
  52190. for (var r = e instanceof n.CompressedTexture, o = e.image[0]instanceof n.DataTexture, a = [], l = 0; l < 6; l++)
  52191. !ve.autoScaleCubemaps || r || o ? a[l] = o ? e.image[l].image : e.image[l] : a[l] = G(e.image[l], je.maxCubemapSize);
  52192. var c = a[0]
  52193. , h = z(c)
  52194. , u = ee(e.format)
  52195. , d = ee(e.type);
  52196. k(Ge.TEXTURE_CUBE_MAP, e, h);
  52197. for (var l = 0; l < 6; l++)
  52198. if (r)
  52199. for (var p, f = a[l].mipmaps, g = 0, m = f.length; g < m; g++)
  52200. p = f[g],
  52201. 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);
  52202. else
  52203. 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]);
  52204. e.generateMipmaps && h && Ge.generateMipmap(Ge.TEXTURE_CUBE_MAP),
  52205. i.__version = e.version,
  52206. e.onUpdate && e.onUpdate(e)
  52207. } else
  52208. Ye.activeTexture(Ge.TEXTURE0 + t),
  52209. Ye.bindTexture(Ge.TEXTURE_CUBE_MAP, i.__image__webglTextureCube)
  52210. }
  52211. function X(e, t) {
  52212. Ye.activeTexture(Ge.TEXTURE0 + t),
  52213. Ye.bindTexture(Ge.TEXTURE_CUBE_MAP, Xe.get(e).__webglTexture)
  52214. }
  52215. function Z(e, t, i, n) {
  52216. var r = ee(t.texture.format)
  52217. , o = ee(t.texture.type);
  52218. Ye.texImage2D(n, 0, r, t.width, t.height, 0, r, o, null),
  52219. Ge.bindFramebuffer(Ge.FRAMEBUFFER, e),
  52220. Ge.framebufferTexture2D(Ge.FRAMEBUFFER, i, n, Xe.get(t.texture).__webglTexture, 0),
  52221. Ge.bindFramebuffer(Ge.FRAMEBUFFER, null)
  52222. }
  52223. function q(e, t) {
  52224. Ge.bindRenderbuffer(Ge.RENDERBUFFER, e),
  52225. t.depthBuffer && !t.stencilBuffer ? (Ge.renderbufferStorage(Ge.RENDERBUFFER, Ge.DEPTH_COMPONENT16, t.width, t.height),
  52226. 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),
  52227. Ge.framebufferRenderbuffer(Ge.FRAMEBUFFER, Ge.DEPTH_STENCIL_ATTACHMENT, Ge.RENDERBUFFER, e)) : Ge.renderbufferStorage(Ge.RENDERBUFFER, Ge.RGBA4, t.width, t.height),
  52228. Ge.bindRenderbuffer(Ge.RENDERBUFFER, null)
  52229. }
  52230. function K(e) {
  52231. var t = Xe.get(e)
  52232. , i = e instanceof n.WebGLRenderTargetCube;
  52233. if (i) {
  52234. t.__webglDepthbuffer = [];
  52235. for (var r = 0; r < 6; r++)
  52236. Ge.bindFramebuffer(Ge.FRAMEBUFFER, t.__webglFramebuffer[r]),
  52237. t.__webglDepthbuffer[r] = Ge.createRenderbuffer(),
  52238. q(t.__webglDepthbuffer[r], e)
  52239. } else
  52240. Ge.bindFramebuffer(Ge.FRAMEBUFFER, t.__webglFramebuffer),
  52241. t.__webglDepthbuffer = Ge.createRenderbuffer(),
  52242. q(t.__webglDepthbuffer, e);
  52243. Ge.bindFramebuffer(Ge.FRAMEBUFFER, null)
  52244. }
  52245. function Q(e) {
  52246. var t = Xe.get(e)
  52247. , i = Xe.get(e.texture);
  52248. e.addEventListener("dispose", l),
  52249. i.__webglTexture = Ge.createTexture(),
  52250. ke.textures++;
  52251. var r = e instanceof n.WebGLRenderTargetCube
  52252. , o = n.Math.isPowerOfTwo(e.width) && n.Math.isPowerOfTwo(e.height);
  52253. if (r) {
  52254. t.__webglFramebuffer = [];
  52255. for (var a = 0; a < 6; a++)
  52256. t.__webglFramebuffer[a] = Ge.createFramebuffer()
  52257. } else
  52258. t.__webglFramebuffer = Ge.createFramebuffer();
  52259. if (r) {
  52260. Ye.bindTexture(Ge.TEXTURE_CUBE_MAP, i.__webglTexture),
  52261. k(Ge.TEXTURE_CUBE_MAP, e.texture, o);
  52262. for (var a = 0; a < 6; a++)
  52263. Z(t.__webglFramebuffer[a], e, Ge.COLOR_ATTACHMENT0, Ge.TEXTURE_CUBE_MAP_POSITIVE_X + a);
  52264. e.texture.generateMipmaps && o && Ge.generateMipmap(Ge.TEXTURE_CUBE_MAP),
  52265. Ye.bindTexture(Ge.TEXTURE_CUBE_MAP, null)
  52266. } else
  52267. Ye.bindTexture(Ge.TEXTURE_2D, i.__webglTexture),
  52268. k(Ge.TEXTURE_2D, e.texture, o),
  52269. Z(t.__webglFramebuffer, e, Ge.COLOR_ATTACHMENT0, Ge.TEXTURE_2D),
  52270. e.texture.generateMipmaps && o && Ge.generateMipmap(Ge.TEXTURE_2D),
  52271. Ye.bindTexture(Ge.TEXTURE_2D, null);
  52272. e.depthBuffer && K(e)
  52273. }
  52274. function J(e) {
  52275. var t = e instanceof n.WebGLRenderTargetCube ? Ge.TEXTURE_CUBE_MAP : Ge.TEXTURE_2D
  52276. , i = Xe.get(e.texture).__webglTexture;
  52277. Ye.bindTexture(t, i),
  52278. Ge.generateMipmap(t),
  52279. Ye.bindTexture(t, null)
  52280. }
  52281. function $(e) {
  52282. return e === n.NearestFilter || e === n.NearestMipMapNearestFilter || e === n.NearestMipMapLinearFilter ? Ge.NEAREST : Ge.LINEAR
  52283. }
  52284. function ee(e) {
  52285. var t;
  52286. if (e === n.RepeatWrapping)
  52287. return Ge.REPEAT;
  52288. if (e === n.ClampToEdgeWrapping)
  52289. return Ge.CLAMP_TO_EDGE;
  52290. if (e === n.MirroredRepeatWrapping)
  52291. return Ge.MIRRORED_REPEAT;
  52292. if (e === n.NearestFilter)
  52293. return Ge.NEAREST;
  52294. if (e === n.NearestMipMapNearestFilter)
  52295. return Ge.NEAREST_MIPMAP_NEAREST;
  52296. if (e === n.NearestMipMapLinearFilter)
  52297. return Ge.NEAREST_MIPMAP_LINEAR;
  52298. if (e === n.LinearFilter)
  52299. return Ge.LINEAR;
  52300. if (e === n.LinearMipMapNearestFilter)
  52301. return Ge.LINEAR_MIPMAP_NEAREST;
  52302. if (e === n.LinearMipMapLinearFilter)
  52303. return Ge.LINEAR_MIPMAP_LINEAR;
  52304. if (e === n.UnsignedByteType)
  52305. return Ge.UNSIGNED_BYTE;
  52306. if (e === n.UnsignedShort4444Type)
  52307. return Ge.UNSIGNED_SHORT_4_4_4_4;
  52308. if (e === n.UnsignedShort5551Type)
  52309. return Ge.UNSIGNED_SHORT_5_5_5_1;
  52310. if (e === n.UnsignedShort565Type)
  52311. return Ge.UNSIGNED_SHORT_5_6_5;
  52312. if (e === n.ByteType)
  52313. return Ge.BYTE;
  52314. if (e === n.ShortType)
  52315. return Ge.SHORT;
  52316. if (e === n.UnsignedShortType)
  52317. return Ge.UNSIGNED_SHORT;
  52318. if (e === n.IntType)
  52319. return Ge.INT;
  52320. if (e === n.UnsignedIntType)
  52321. return Ge.UNSIGNED_INT;
  52322. if (e === n.FloatType)
  52323. return Ge.FLOAT;
  52324. if (t = We.get("OES_texture_half_float"),
  52325. null !== t && e === n.HalfFloatType)
  52326. return t.HALF_FLOAT_OES;
  52327. if (e === n.AlphaFormat)
  52328. return Ge.ALPHA;
  52329. if (e === n.RGBFormat)
  52330. return Ge.RGB;
  52331. if (e === n.RGBAFormat)
  52332. return Ge.RGBA;
  52333. if (e === n.LuminanceFormat)
  52334. return Ge.LUMINANCE;
  52335. if (e === n.LuminanceAlphaFormat)
  52336. return Ge.LUMINANCE_ALPHA;
  52337. if (e === n.AddEquation)
  52338. return Ge.FUNC_ADD;
  52339. if (e === n.SubtractEquation)
  52340. return Ge.FUNC_SUBTRACT;
  52341. if (e === n.ReverseSubtractEquation)
  52342. return Ge.FUNC_REVERSE_SUBTRACT;
  52343. if (e === n.ZeroFactor)
  52344. return Ge.ZERO;
  52345. if (e === n.OneFactor)
  52346. return Ge.ONE;
  52347. if (e === n.SrcColorFactor)
  52348. return Ge.SRC_COLOR;
  52349. if (e === n.OneMinusSrcColorFactor)
  52350. return Ge.ONE_MINUS_SRC_COLOR;
  52351. if (e === n.SrcAlphaFactor)
  52352. return Ge.SRC_ALPHA;
  52353. if (e === n.OneMinusSrcAlphaFactor)
  52354. return Ge.ONE_MINUS_SRC_ALPHA;
  52355. if (e === n.DstAlphaFactor)
  52356. return Ge.DST_ALPHA;
  52357. if (e === n.OneMinusDstAlphaFactor)
  52358. return Ge.ONE_MINUS_DST_ALPHA;
  52359. if (e === n.DstColorFactor)
  52360. return Ge.DST_COLOR;
  52361. if (e === n.OneMinusDstColorFactor)
  52362. return Ge.ONE_MINUS_DST_COLOR;
  52363. if (e === n.SrcAlphaSaturateFactor)
  52364. return Ge.SRC_ALPHA_SATURATE;
  52365. if (t = We.get("WEBGL_compressed_texture_s3tc"),
  52366. null !== t) {
  52367. if (e === n.RGB_S3TC_DXT1_Format)
  52368. return t.COMPRESSED_RGB_S3TC_DXT1_EXT;
  52369. if (e === n.RGBA_S3TC_DXT1_Format)
  52370. return t.COMPRESSED_RGBA_S3TC_DXT1_EXT;
  52371. if (e === n.RGBA_S3TC_DXT3_Format)
  52372. return t.COMPRESSED_RGBA_S3TC_DXT3_EXT;
  52373. if (e === n.RGBA_S3TC_DXT5_Format)
  52374. return t.COMPRESSED_RGBA_S3TC_DXT5_EXT
  52375. }
  52376. if (t = We.get("WEBGL_compressed_texture_pvrtc"),
  52377. null !== t) {
  52378. if (e === n.RGB_PVRTC_4BPPV1_Format)
  52379. return t.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;
  52380. if (e === n.RGB_PVRTC_2BPPV1_Format)
  52381. return t.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;
  52382. if (e === n.RGBA_PVRTC_4BPPV1_Format)
  52383. return t.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;
  52384. if (e === n.RGBA_PVRTC_2BPPV1_Format)
  52385. return t.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG
  52386. }
  52387. if (t = We.get("WEBGL_compressed_texture_etc1"),
  52388. null !== t && e === n.RGB_ETC1_Format)
  52389. return t.COMPRESSED_RGB_ETC1_WEBGL;
  52390. if (t = We.get("EXT_blend_minmax"),
  52391. null !== t) {
  52392. if (e === n.MinEquation)
  52393. return t.MIN_EXT;
  52394. if (e === n.MaxEquation)
  52395. return t.MAX_EXT
  52396. }
  52397. return 0
  52398. }
  52399. console.log("THREE.WebGLRenderer", n.REVISION),
  52400. e = e || {};
  52401. var te = void 0 !== e.canvas ? e.canvas : document.createElement("canvas")
  52402. , ie = void 0 !== e.context ? e.context : null
  52403. , ne = void 0 !== e.alpha && e.alpha
  52404. , re = void 0 === e.depth || e.depth
  52405. , oe = void 0 === e.stencil || e.stencil
  52406. , ae = void 0 !== e.antialias && e.antialias
  52407. , se = void 0 === e.premultipliedAlpha || e.premultipliedAlpha
  52408. , le = void 0 !== e.preserveDrawingBuffer && e.preserveDrawingBuffer
  52409. , ce = []
  52410. , he = []
  52411. , ue = -1
  52412. , de = []
  52413. , pe = -1
  52414. , fe = new Float32Array(8)
  52415. , ge = []
  52416. , me = [];
  52417. this.domElement = te,
  52418. this.context = null,
  52419. this.autoClear = !0,
  52420. this.autoClearColor = !0,
  52421. this.autoClearDepth = !0,
  52422. this.autoClearStencil = !0,
  52423. this.sortObjects = !0,
  52424. this.gammaFactor = 2,
  52425. this.gammaInput = !1,
  52426. this.gammaOutput = !1,
  52427. this.physicallyCorrectLights = !1,
  52428. this.toneMapping = n.LinearToneMapping,
  52429. this.toneMappingExposure = 1,
  52430. this.toneMappingWhitePoint = 1,
  52431. this.maxMorphTargets = 8,
  52432. this.maxMorphNormals = 4,
  52433. this.autoScaleCubemaps = !0;
  52434. var ve = this
  52435. , Ae = null
  52436. , ye = null
  52437. , Ce = null
  52438. , Ie = -1
  52439. , Ee = ""
  52440. , be = null
  52441. , we = new n.Vector4
  52442. , _e = null
  52443. , Te = new n.Vector4
  52444. , xe = 0
  52445. , Se = new n.Color(0)
  52446. , Me = 0
  52447. , Re = te.width
  52448. , Pe = te.height
  52449. , Oe = 1
  52450. , Le = new n.Vector4(0,0,Re,Pe)
  52451. , De = !1
  52452. , Ne = new n.Vector4(0,0,Re,Pe)
  52453. , Be = new n.Frustum
  52454. , Fe = new n.Matrix4
  52455. , Ve = new n.Vector3
  52456. , Ue = {
  52457. hash: "",
  52458. ambient: [0, 0, 0],
  52459. directional: [],
  52460. directionalShadowMap: [],
  52461. directionalShadowMatrix: [],
  52462. spot: [],
  52463. spotShadowMap: [],
  52464. spotShadowMatrix: [],
  52465. point: [],
  52466. pointShadowMap: [],
  52467. pointShadowMatrix: [],
  52468. hemi: [],
  52469. shadows: [],
  52470. shadowsPointLight: 0
  52471. }
  52472. , ke = {
  52473. geometries: 0,
  52474. textures: 0
  52475. }
  52476. , He = {
  52477. calls: 0,
  52478. vertices: 0,
  52479. faces: 0,
  52480. points: 0
  52481. };
  52482. this.info = {
  52483. render: He,
  52484. memory: ke,
  52485. programs: null
  52486. };
  52487. var Ge;
  52488. try {
  52489. var ze = {
  52490. alpha: ne,
  52491. depth: re,
  52492. stencil: oe,
  52493. antialias: ae,
  52494. premultipliedAlpha: se,
  52495. preserveDrawingBuffer: le
  52496. };
  52497. if (Ge = ie || te.getContext("webgl", ze) || te.getContext("experimental-webgl", ze),
  52498. null === Ge)
  52499. throw null !== te.getContext("webgl") ? "Error creating WebGL context with your selected attributes." : "Error creating WebGL context.";
  52500. void 0 === Ge.getShaderPrecisionFormat && (Ge.getShaderPrecisionFormat = function() {
  52501. return {
  52502. rangeMin: 1,
  52503. rangeMax: 1,
  52504. precision: 1
  52505. }
  52506. }
  52507. ),
  52508. te.addEventListener("webglcontextlost", a, !1)
  52509. } catch (e) {
  52510. console.error("THREE.WebGLRenderer: " + e)
  52511. }
  52512. var We = new n.WebGLExtensions(Ge);
  52513. We.get("OES_texture_float"),
  52514. We.get("OES_texture_float_linear"),
  52515. We.get("OES_texture_half_float"),
  52516. We.get("OES_texture_half_float_linear"),
  52517. We.get("OES_standard_derivatives"),
  52518. We.get("ANGLE_instanced_arrays"),
  52519. We.get("OES_element_index_uint") && (n.BufferGeometry.MaxIndex = 4294967296);
  52520. var je = new n.WebGLCapabilities(Ge,We,e)
  52521. , Ye = new n.WebGLState(Ge,We,ee)
  52522. , Xe = new n.WebGLProperties
  52523. , Ze = new n.WebGLObjects(Ge,Xe,this.info)
  52524. , qe = new n.WebGLPrograms(this,je)
  52525. , Ke = new n.WebGLLights;
  52526. this.info.programs = qe.programs;
  52527. var Qe = new n.WebGLBufferRenderer(Ge,We,He)
  52528. , Je = new n.WebGLIndexedBufferRenderer(Ge,We,He);
  52529. r(),
  52530. this.context = Ge,
  52531. this.capabilities = je,
  52532. this.extensions = We,
  52533. this.properties = Xe,
  52534. this.state = Ye;
  52535. var $e = new n.WebGLShadowMap(this,Ue,Ze);
  52536. this.shadowMap = $e;
  52537. var et = new n.SpritePlugin(this,ge)
  52538. , tt = new n.LensFlarePlugin(this,me);
  52539. this.getContext = function() {
  52540. return Ge
  52541. }
  52542. ,
  52543. this.getContextAttributes = function() {
  52544. return Ge.getContextAttributes()
  52545. }
  52546. ,
  52547. this.forceContextLoss = function() {
  52548. We.get("WEBGL_lose_context").loseContext()
  52549. }
  52550. ,
  52551. this.getMaxAnisotropy = function() {
  52552. var e;
  52553. return function() {
  52554. if (void 0 !== e)
  52555. return e;
  52556. var t = We.get("EXT_texture_filter_anisotropic");
  52557. return e = null !== t ? Ge.getParameter(t.MAX_TEXTURE_MAX_ANISOTROPY_EXT) : 0
  52558. }
  52559. }(),
  52560. this.getPrecision = function() {
  52561. return je.precision
  52562. }
  52563. ,
  52564. this.getPixelRatio = function() {
  52565. return Oe
  52566. }
  52567. ,
  52568. this.setPixelRatio = function(e) {
  52569. void 0 !== e && (Oe = e,
  52570. this.setSize(Ne.z, Ne.w, !1))
  52571. }
  52572. ,
  52573. this.getSize = function() {
  52574. return {
  52575. width: Re,
  52576. height: Pe
  52577. }
  52578. }
  52579. ,
  52580. this.setSize = function(e, t, i, devicePixelRatio) {
  52581. if(devicePixelRatio != void 0) Oe = devicePixelRatio; //xzw add 改分辨率 始终保持清晰
  52582. Re = e,
  52583. Pe = t,
  52584. te.width = e * Oe,
  52585. te.height = t * Oe,
  52586. i !== !1 && (te.style.width = e + "px",
  52587. te.style.height = t + "px"),
  52588. this.setViewport(0, 0, e, t)
  52589. }
  52590. ,
  52591. this.setViewport = function(e, t, i, n) {
  52592. Ye.viewport(Ne.set(e, t, i, n))
  52593. }
  52594. ,
  52595. this.setScissor = function(e, t, i, n) {
  52596. Ye.scissor(Le.set(e, t, i, n))
  52597. }
  52598. ,
  52599. this.setScissorTest = function(e) {
  52600. Ye.setScissorTest(De = e)
  52601. }
  52602. ,
  52603. this.getClearColor = function() {
  52604. return Se
  52605. }
  52606. ,
  52607. this.setClearColor = function(e, t) {
  52608. Se.set(e),
  52609. Me = void 0 !== t ? t : 1,
  52610. i(Se.r, Se.g, Se.b, Me)
  52611. }
  52612. ,
  52613. this.getClearAlpha = function() {
  52614. return Me
  52615. }
  52616. ,
  52617. this.setClearAlpha = function(e) {
  52618. Me = e,
  52619. i(Se.r, Se.g, Se.b, Me)
  52620. }
  52621. ,
  52622. this.clear = function(e, t, i) {
  52623. var n = 0;
  52624. (void 0 === e || e) && (n |= Ge.COLOR_BUFFER_BIT),
  52625. (void 0 === t || t) && (n |= Ge.DEPTH_BUFFER_BIT),
  52626. (void 0 === i || i) && (n |= Ge.STENCIL_BUFFER_BIT),
  52627. Ge.clear(n)
  52628. }
  52629. ,
  52630. this.clearColor = function() {
  52631. this.clear(!0, !1, !1)
  52632. }
  52633. ,
  52634. this.clearDepth = function() {
  52635. this.clear(!1, !0, !1)
  52636. }
  52637. ,
  52638. this.clearStencil = function() {
  52639. this.clear(!1, !1, !0)
  52640. }
  52641. ,
  52642. this.clearTarget = function(e, t, i, n) {
  52643. this.setRenderTarget(e),
  52644. this.clear(t, i, n)
  52645. }
  52646. ,
  52647. this.resetGLState = o,
  52648. this.dispose = function() {
  52649. te.removeEventListener("webglcontextlost", a, !1)
  52650. }
  52651. ,
  52652. this.renderBufferImmediate = function(e, t, i) {
  52653. Ye.initAttributes();
  52654. var r = Xe.get(e);
  52655. e.hasPositions && !r.position && (r.position = Ge.createBuffer()),
  52656. e.hasNormals && !r.normal && (r.normal = Ge.createBuffer()),
  52657. e.hasUvs && !r.uv && (r.uv = Ge.createBuffer()),
  52658. e.hasColors && !r.color && (r.color = Ge.createBuffer());
  52659. var o = t.getAttributes();
  52660. if (e.hasPositions && (Ge.bindBuffer(Ge.ARRAY_BUFFER, r.position),
  52661. Ge.bufferData(Ge.ARRAY_BUFFER, e.positionArray, Ge.DYNAMIC_DRAW),
  52662. Ye.enableAttribute(o.position),
  52663. Ge.vertexAttribPointer(o.position, 3, Ge.FLOAT, !1, 0, 0)),
  52664. e.hasNormals) {
  52665. if (Ge.bindBuffer(Ge.ARRAY_BUFFER, r.normal),
  52666. "MeshPhongMaterial" !== i.type && "MeshStandardMaterial" !== i.type && i.shading === n.FlatShading)
  52667. for (var a = 0, s = 3 * e.count; a < s; a += 9) {
  52668. var l = e.normalArray
  52669. , c = (l[a + 0] + l[a + 3] + l[a + 6]) / 3
  52670. , h = (l[a + 1] + l[a + 4] + l[a + 7]) / 3
  52671. , u = (l[a + 2] + l[a + 5] + l[a + 8]) / 3;
  52672. l[a + 0] = c,
  52673. l[a + 1] = h,
  52674. l[a + 2] = u,
  52675. l[a + 3] = c,
  52676. l[a + 4] = h,
  52677. l[a + 5] = u,
  52678. l[a + 6] = c,
  52679. l[a + 7] = h,
  52680. l[a + 8] = u
  52681. }
  52682. Ge.bufferData(Ge.ARRAY_BUFFER, e.normalArray, Ge.DYNAMIC_DRAW),
  52683. Ye.enableAttribute(o.normal),
  52684. Ge.vertexAttribPointer(o.normal, 3, Ge.FLOAT, !1, 0, 0)
  52685. }
  52686. e.hasUvs && i.map && (Ge.bindBuffer(Ge.ARRAY_BUFFER, r.uv),
  52687. Ge.bufferData(Ge.ARRAY_BUFFER, e.uvArray, Ge.DYNAMIC_DRAW),
  52688. Ye.enableAttribute(o.uv),
  52689. Ge.vertexAttribPointer(o.uv, 2, Ge.FLOAT, !1, 0, 0)),
  52690. e.hasColors && i.vertexColors !== n.NoColors && (Ge.bindBuffer(Ge.ARRAY_BUFFER, r.color),
  52691. Ge.bufferData(Ge.ARRAY_BUFFER, e.colorArray, Ge.DYNAMIC_DRAW),
  52692. Ye.enableAttribute(o.color),
  52693. Ge.vertexAttribPointer(o.color, 3, Ge.FLOAT, !1, 0, 0)),
  52694. Ye.disableUnusedAttributes(),
  52695. Ge.drawArrays(Ge.TRIANGLES, 0, e.count),
  52696. e.count = 0
  52697. }
  52698. ,
  52699. this.renderBufferDirect = function(e, i, r, o, a, s) {
  52700. E(o);
  52701. var l = w(e, i, o, a)
  52702. , c = !1
  52703. , h = r.id + "_" + l.id + "_" + o.wireframe;
  52704. h !== Ee && (Ee = h,
  52705. c = !0);
  52706. var u = a.morphTargetInfluences;
  52707. if (void 0 !== u) {
  52708. for (var d = [], p = 0, m = u.length; p < m; p++) {
  52709. var v = u[p];
  52710. d.push([v, p])
  52711. }
  52712. d.sort(g),
  52713. d.length > 8 && (d.length = 8);
  52714. for (var A = r.morphAttributes, p = 0, m = d.length; p < m; p++) {
  52715. var v = d[p];
  52716. if (fe[p] = v[0],
  52717. 0 !== v[0]) {
  52718. var y = v[1];
  52719. o.morphTargets === !0 && A.position && r.addAttribute("morphTarget" + p, A.position[y]),
  52720. o.morphNormals === !0 && A.normal && r.addAttribute("morphNormal" + p, A.normal[y])
  52721. } else
  52722. o.morphTargets === !0 && r.removeAttribute("morphTarget" + p),
  52723. o.morphNormals === !0 && r.removeAttribute("morphNormal" + p)
  52724. }
  52725. var C = l.getUniforms();
  52726. null !== C.morphTargetInfluences && Ge.uniform1fv(C.morphTargetInfluences, fe),
  52727. c = !0
  52728. }
  52729. var y = r.index
  52730. , I = r.attributes.position;
  52731. o.wireframe === !0 && (y = Ze.getWireframeAttribute(r));
  52732. var b;
  52733. null !== y ? (b = Je,
  52734. b.setIndex(y)) : b = Qe,
  52735. c && (f(o, l, r),
  52736. null !== y && Ge.bindBuffer(Ge.ELEMENT_ARRAY_BUFFER, Ze.getAttributeBuffer(y)));
  52737. var _ = 0
  52738. , T = 1 / 0;
  52739. null !== y ? T = y.count : void 0 !== I && (T = I.count);
  52740. var x = r.drawRange.start
  52741. , S = r.drawRange.count
  52742. , M = null !== s ? s.start : 0
  52743. , R = null !== s ? s.count : 1 / 0
  52744. , P = Math.max(_, x, M)
  52745. , O = Math.min(_ + T, x + S, M + R) - 1
  52746. , L = Math.max(0, O - P + 1);
  52747. if (a instanceof n.Mesh)
  52748. if (o.wireframe === !0)
  52749. Ye.setLineWidth(o.wireframeLinewidth * t()),
  52750. b.setMode(Ge.LINES);
  52751. else
  52752. switch (a.drawMode) {
  52753. case n.TrianglesDrawMode:
  52754. b.setMode(Ge.TRIANGLES);
  52755. break;
  52756. case n.TriangleStripDrawMode:
  52757. b.setMode(Ge.TRIANGLE_STRIP);
  52758. break;
  52759. case n.TriangleFanDrawMode:
  52760. b.setMode(Ge.TRIANGLE_FAN)
  52761. }
  52762. else if (a instanceof n.Line) {
  52763. var D = o.linewidth;
  52764. void 0 === D && (D = 1),
  52765. Ye.setLineWidth(D * t()),
  52766. a instanceof n.LineSegments ? b.setMode(Ge.LINES) : b.setMode(Ge.LINE_STRIP)
  52767. } else
  52768. a instanceof n.Points && b.setMode(Ge.POINTS);
  52769. r instanceof n.InstancedBufferGeometry ? r.maxInstancedCount > 0 && b.renderInstances(r, P, L) : b.render(P, L)
  52770. }
  52771. ,
  52772. this.render = function(e, t, i, r) {
  52773. if (t instanceof n.Camera == !1)
  52774. return void console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");
  52775. var o = e.fog;
  52776. if (Ee = "",
  52777. Ie = -1,
  52778. be = null,
  52779. e.autoUpdate === !0 && e.updateMatrixWorld(),
  52780. null === t.parent && t.updateMatrixWorld(),
  52781. t.matrixWorldInverse.getInverse(t.matrixWorld),
  52782. Fe.multiplyMatrices(t.projectionMatrix, t.matrixWorldInverse),
  52783. Be.setFromMatrix(Fe),
  52784. ce.length = 0,
  52785. ue = -1,
  52786. pe = -1,
  52787. ge.length = 0,
  52788. me.length = 0,
  52789. y(e, t),
  52790. he.length = ue + 1,
  52791. de.length = pe + 1,
  52792. ve.sortObjects === !0 && (he.sort(m),
  52793. de.sort(v)),
  52794. U(ce, t),
  52795. $e.render(e, t),
  52796. He.calls = 0,
  52797. He.vertices = 0,
  52798. He.faces = 0,
  52799. He.points = 0,
  52800. void 0 === i && (i = null),
  52801. this.setRenderTarget(i),
  52802. (this.autoClear || r) && this.clear(this.autoClearColor, this.autoClearDepth, this.autoClearStencil),
  52803. e.overrideMaterial) {
  52804. var a = e.overrideMaterial;
  52805. C(he, t, o, a),
  52806. C(de, t, o, a)
  52807. } else
  52808. Ye.setBlending(n.NoBlending),
  52809. C(he, t, o),
  52810. C(de, t, o);
  52811. if (et.render(e, t),
  52812. tt.render(e, t, Te),
  52813. i) {
  52814. var s = i.texture;
  52815. s.generateMipmaps && z(i) && s.minFilter !== n.NearestFilter && s.minFilter !== n.LinearFilter && J(i)
  52816. }
  52817. Ye.setDepthTest(!0),
  52818. Ye.setDepthWrite(!0),
  52819. Ye.setColorWrite(!0)
  52820. }
  52821. ,
  52822. this.setFaceCulling = function(e, t) {
  52823. e === n.CullFaceNone ? Ye.disable(Ge.CULL_FACE) : (t === n.FrontFaceDirectionCW ? Ge.frontFace(Ge.CW) : Ge.frontFace(Ge.CCW),
  52824. e === n.CullFaceBack ? Ge.cullFace(Ge.BACK) : e === n.CullFaceFront ? Ge.cullFace(Ge.FRONT) : Ge.cullFace(Ge.FRONT_AND_BACK),
  52825. Ye.enable(Ge.CULL_FACE))
  52826. }
  52827. ,
  52828. this.setTexture = function(e, t) {
  52829. var i = Xe.get(e);
  52830. if (e.version > 0 && i.__version !== e.version) {
  52831. var n = e.image;
  52832. 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)
  52833. }
  52834. Ye.activeTexture(Ge.TEXTURE0 + t),
  52835. Ye.bindTexture(Ge.TEXTURE_2D, i.__webglTexture)
  52836. }
  52837. ,
  52838. this.getCurrentRenderTarget = function() {
  52839. return ye
  52840. }
  52841. ,
  52842. this.setRenderTargetFramebuffer = function ( renderTarget, defaultFramebuffer ) {//add
  52843. const renderTargetProperties = Xe.get( renderTarget );
  52844. renderTargetProperties.__webglFramebuffer = defaultFramebuffer;
  52845. renderTargetProperties.__useDefaultFramebuffer = defaultFramebuffer === undefined;
  52846. },
  52847. this.setFramebuffer = function ( value ) {//add
  52848. if ( Ce !== value && ye === null ) Ge.bindFramebuffer( 36160, value );
  52849. Ce = value;
  52850. },
  52851. this.setRenderTarget = function(e) {
  52852. ye = e,
  52853. e && void 0 === Xe.get(e).__webglFramebuffer && Q(e);
  52854. var t, i = e instanceof n.WebGLRenderTargetCube;
  52855. if (e) {
  52856. var r = Xe.get(e);
  52857. t = i ? r.__webglFramebuffer[e.activeCubeFace] : r.__webglFramebuffer,
  52858. we.copy(e.scissor),
  52859. _e = e.scissorTest,
  52860. Te.copy(e.viewport)
  52861. } else
  52862. t = null,
  52863. we.copy(Le).multiplyScalar(Oe),
  52864. _e = De,
  52865. Te.copy(Ne).multiplyScalar(Oe);
  52866. if (Ce !== t && (Ge.bindFramebuffer(Ge.FRAMEBUFFER, t),
  52867. Ce = t),
  52868. Ye.scissor(we),
  52869. Ye.setScissorTest(_e),
  52870. Ye.viewport(Te),
  52871. i) {
  52872. var o = Xe.get(e.texture);
  52873. Ge.framebufferTexture2D(Ge.FRAMEBUFFER, Ge.COLOR_ATTACHMENT0, Ge.TEXTURE_CUBE_MAP_POSITIVE_X + e.activeCubeFace, o.__webglTexture, e.activeMipMapLevel)
  52874. }
  52875. }
  52876. ,
  52877. this.readRenderTargetPixels = function(e, t, i, r, o, a) {
  52878. if (e instanceof n.WebGLRenderTarget == !1)
  52879. return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");
  52880. var s = Xe.get(e).__webglFramebuffer;
  52881. if (s) {
  52882. var l = !1;
  52883. s !== Ce && (Ge.bindFramebuffer(Ge.FRAMEBUFFER, s),
  52884. l = !0);
  52885. try {
  52886. var c = e.texture;
  52887. if (c.format !== n.RGBAFormat && ee(c.format) !== Ge.getParameter(Ge.IMPLEMENTATION_COLOR_READ_FORMAT))
  52888. return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");
  52889. 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")))
  52890. return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");
  52891. 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.")
  52892. } finally {
  52893. l && Ge.bindFramebuffer(Ge.FRAMEBUFFER, Ce)
  52894. }
  52895. }
  52896. }
  52897. }
  52898. ,
  52899. n.WebGLRenderTarget = function(e, t, i) {
  52900. this.uuid = n.Math.generateUUID(),
  52901. this.width = e,
  52902. this.height = t,
  52903. this.scissor = new n.Vector4(0,0,e,t),
  52904. this.scissorTest = !1,
  52905. this.viewport = new n.Vector4(0,0,e,t),
  52906. i = i || {},
  52907. void 0 === i.minFilter && (i.minFilter = n.LinearFilter),
  52908. this.texture = new n.Texture(void 0,void 0,i.wrapS,i.wrapT,i.magFilter,i.minFilter,i.format,i.type,i.anisotropy),
  52909. this.depthBuffer = void 0 === i.depthBuffer || i.depthBuffer,
  52910. this.stencilBuffer = void 0 === i.stencilBuffer || i.stencilBuffer
  52911. }
  52912. ,
  52913. n.WebGLRenderTarget.prototype = {
  52914. constructor: n.WebGLRenderTarget,
  52915. setSize: function(e, t) {
  52916. this.width === e && this.height === t || (this.width = e,
  52917. this.height = t,
  52918. this.dispose()),
  52919. this.viewport.set(0, 0, e, t),
  52920. this.scissor.set(0, 0, e, t)
  52921. },
  52922. clone: function() {
  52923. return (new this.constructor).copy(this)
  52924. },
  52925. copy: function(e) {
  52926. return this.width = e.width,
  52927. this.height = e.height,
  52928. this.viewport.copy(e.viewport),
  52929. this.texture = e.texture.clone(),
  52930. this.depthBuffer = e.depthBuffer,
  52931. this.stencilBuffer = e.stencilBuffer,
  52932. this
  52933. },
  52934. dispose: function() {
  52935. this.dispatchEvent({
  52936. type: "dispose"
  52937. })
  52938. }
  52939. },
  52940. n.EventDispatcher.prototype.apply(n.WebGLRenderTarget.prototype),
  52941. n.WebGLRenderTargetCube = function(e, t, i) {
  52942. n.WebGLRenderTarget.call(this, e, t, i),
  52943. this.activeCubeFace = 0,
  52944. this.activeMipMapLevel = 0
  52945. }
  52946. ,
  52947. n.WebGLRenderTargetCube.prototype = Object.create(n.WebGLRenderTarget.prototype),
  52948. n.WebGLRenderTargetCube.prototype.constructor = n.WebGLRenderTargetCube,
  52949. n.WebGLBufferRenderer = function(e, t, i) {
  52950. function r(e) {
  52951. s = e
  52952. }
  52953. function o(t, n) {
  52954. e.drawArrays(s, t, n),
  52955. i.calls++,
  52956. i.vertices += n,
  52957. s === e.TRIANGLES && (i.faces += n / 3)
  52958. }
  52959. function a(r) {
  52960. var o = t.get("ANGLE_instanced_arrays");
  52961. if (null === o)
  52962. return void console.error("THREE.WebGLBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");
  52963. var a = r.attributes.position
  52964. , l = 0;
  52965. a instanceof n.InterleavedBufferAttribute ? (l = a.data.count,
  52966. o.drawArraysInstancedANGLE(s, 0, l, r.maxInstancedCount)) : (l = a.count,
  52967. o.drawArraysInstancedANGLE(s, 0, l, r.maxInstancedCount)),
  52968. i.calls++,
  52969. i.vertices += l * r.maxInstancedCount,
  52970. s === e.TRIANGLES && (i.faces += r.maxInstancedCount * l / 3)
  52971. }
  52972. var s;
  52973. this.setMode = r,
  52974. this.render = o,
  52975. this.renderInstances = a
  52976. }
  52977. ,
  52978. n.WebGLIndexedBufferRenderer = function(e, t, i) {
  52979. function n(e) {
  52980. s = e
  52981. }
  52982. function r(i) {
  52983. i.array instanceof Uint32Array && t.get("OES_element_index_uint") ? (l = e.UNSIGNED_INT,
  52984. c = 4) : (l = e.UNSIGNED_SHORT,
  52985. c = 2)
  52986. }
  52987. function o(t, n) {
  52988. e.drawElements(s, n, l, t * c),
  52989. i.calls++,
  52990. i.vertices += n,
  52991. s === e.TRIANGLES && (i.faces += n / 3)
  52992. }
  52993. function a(n, r, o) {
  52994. var a = t.get("ANGLE_instanced_arrays");
  52995. 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),
  52996. i.calls++,
  52997. i.vertices += o * n.maxInstancedCount,
  52998. void (s === e.TRIANGLES && (i.faces += n.maxInstancedCount * o / 3)))
  52999. }
  53000. var s, l, c;
  53001. this.setMode = n,
  53002. this.setIndex = r,
  53003. this.render = o,
  53004. this.renderInstances = a
  53005. }
  53006. ,
  53007. n.WebGLExtensions = function(e) {
  53008. var t = {};
  53009. this.get = function(i) {
  53010. if (void 0 !== t[i])
  53011. return t[i];
  53012. var n;
  53013. switch (i) {
  53014. case "EXT_texture_filter_anisotropic":
  53015. n = e.getExtension("EXT_texture_filter_anisotropic") || e.getExtension("MOZ_EXT_texture_filter_anisotropic") || e.getExtension("WEBKIT_EXT_texture_filter_anisotropic");
  53016. break;
  53017. case "WEBGL_compressed_texture_s3tc":
  53018. n = e.getExtension("WEBGL_compressed_texture_s3tc") || e.getExtension("MOZ_WEBGL_compressed_texture_s3tc") || e.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc");
  53019. break;
  53020. case "WEBGL_compressed_texture_pvrtc":
  53021. n = e.getExtension("WEBGL_compressed_texture_pvrtc") || e.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc");
  53022. break;
  53023. case "WEBGL_compressed_texture_etc1":
  53024. n = e.getExtension("WEBGL_compressed_texture_etc1");
  53025. break;
  53026. default:
  53027. n = e.getExtension(i)
  53028. }
  53029. return null === n && console.warn("THREE.WebGLRenderer: " + i + " extension not supported."),
  53030. t[i] = n,
  53031. n
  53032. }
  53033. }
  53034. ,
  53035. n.WebGLCapabilities = function(e, t, i) {
  53036. function n(t) {
  53037. if ("highp" === t) {
  53038. if (e.getShaderPrecisionFormat(e.VERTEX_SHADER, e.HIGH_FLOAT).precision > 0 && e.getShaderPrecisionFormat(e.FRAGMENT_SHADER, e.HIGH_FLOAT).precision > 0)
  53039. return "highp";
  53040. t = "mediump"
  53041. }
  53042. 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"
  53043. }
  53044. this.getMaxPrecision = n,
  53045. this.precision = void 0 !== i.precision ? i.precision : "highp",
  53046. this.logarithmicDepthBuffer = void 0 !== i.logarithmicDepthBuffer && i.logarithmicDepthBuffer,
  53047. this.maxTextures = e.getParameter(e.MAX_TEXTURE_IMAGE_UNITS),
  53048. this.maxVertexTextures = e.getParameter(e.MAX_VERTEX_TEXTURE_IMAGE_UNITS),
  53049. this.maxTextureSize = e.getParameter(e.MAX_TEXTURE_SIZE),
  53050. this.maxCubemapSize = e.getParameter(e.MAX_CUBE_MAP_TEXTURE_SIZE),
  53051. this.maxAttributes = e.getParameter(e.MAX_VERTEX_ATTRIBS),
  53052. this.maxVertexUniforms = e.getParameter(e.MAX_VERTEX_UNIFORM_VECTORS),
  53053. this.maxVaryings = e.getParameter(e.MAX_VARYING_VECTORS),
  53054. this.maxFragmentUniforms = e.getParameter(e.MAX_FRAGMENT_UNIFORM_VECTORS),
  53055. this.vertexTextures = this.maxVertexTextures > 0,
  53056. this.floatFragmentTextures = !!t.get("OES_texture_float"),
  53057. this.floatVertexTextures = this.vertexTextures && this.floatFragmentTextures;
  53058. var r = n(this.precision);
  53059. r !== this.precision && (console.warn("THREE.WebGLRenderer:", this.precision, "not supported, using", r, "instead."),
  53060. this.precision = r),
  53061. this.logarithmicDepthBuffer && (this.logarithmicDepthBuffer = !!t.get("EXT_frag_depth"))
  53062. }
  53063. ,
  53064. n.WebGLGeometries = function(e, t, i) {
  53065. function r(e) {
  53066. var t = e.geometry;
  53067. if (void 0 !== h[t.id])
  53068. return h[t.id];
  53069. t.addEventListener("dispose", o);
  53070. var r;
  53071. return t instanceof n.BufferGeometry ? r = t : t instanceof n.Geometry && (void 0 === t._bufferGeometry && (t._bufferGeometry = (new n.BufferGeometry).setFromObject(e)),
  53072. r = t._bufferGeometry),
  53073. h[t.id] = r,
  53074. i.memory.geometries++,
  53075. r
  53076. }
  53077. function o(e) {
  53078. var n = e.target
  53079. , r = h[n.id];
  53080. null !== r.index && s(r.index),
  53081. l(r.attributes),
  53082. n.removeEventListener("dispose", o),
  53083. delete h[n.id];
  53084. var a = t.get(n);
  53085. a.wireframe && s(a.wireframe),
  53086. t.delete(n);
  53087. var c = t.get(r);
  53088. c.wireframe && s(c.wireframe),
  53089. t.delete(r),
  53090. i.memory.geometries--
  53091. }
  53092. function a(e) {
  53093. return e instanceof n.InterleavedBufferAttribute ? t.get(e.data).__webglBuffer : t.get(e).__webglBuffer
  53094. }
  53095. function s(t) {
  53096. var i = a(t);
  53097. void 0 !== i && (e.deleteBuffer(i),
  53098. c(t))
  53099. }
  53100. function l(e) {
  53101. for (var t in e)
  53102. s(e[t])
  53103. }
  53104. function c(e) {
  53105. e instanceof n.InterleavedBufferAttribute ? t.delete(e.data) : t.delete(e)
  53106. }
  53107. var h = {};
  53108. this.get = r
  53109. }
  53110. ,
  53111. n.WebGLLights = function() {
  53112. var e = {};
  53113. this.get = function(t) {
  53114. if (void 0 !== e[t.id])
  53115. return e[t.id];
  53116. var i;
  53117. switch (t.type) {
  53118. case "DirectionalLight":
  53119. i = {
  53120. direction: new n.Vector3,
  53121. color: new n.Color,
  53122. shadow: !1,
  53123. shadowBias: 0,
  53124. shadowRadius: 1,
  53125. shadowMapSize: new n.Vector2
  53126. };
  53127. break;
  53128. case "SpotLight":
  53129. i = {
  53130. position: new n.Vector3,
  53131. direction: new n.Vector3,
  53132. color: new n.Color,
  53133. distance: 0,
  53134. coneCos: 0,
  53135. penumbraCos: 0,
  53136. decay: 0,
  53137. shadow: !1,
  53138. shadowBias: 0,
  53139. shadowRadius: 1,
  53140. shadowMapSize: new n.Vector2
  53141. };
  53142. break;
  53143. case "PointLight":
  53144. i = {
  53145. position: new n.Vector3,
  53146. color: new n.Color,
  53147. distance: 0,
  53148. decay: 0,
  53149. shadow: !1,
  53150. shadowBias: 0,
  53151. shadowRadius: 1,
  53152. shadowMapSize: new n.Vector2
  53153. };
  53154. break;
  53155. case "HemisphereLight":
  53156. i = {
  53157. direction: new n.Vector3,
  53158. skyColor: new n.Color,
  53159. groundColor: new n.Color
  53160. }
  53161. }
  53162. return e[t.id] = i,
  53163. i
  53164. }
  53165. }
  53166. ,
  53167. n.WebGLObjects = function(e, t, i) {
  53168. function r(t) {
  53169. var i = u.get(t);
  53170. t.geometry instanceof n.Geometry && i.updateFromObject(t);
  53171. var r = i.index
  53172. , a = i.attributes;
  53173. null !== r && o(r, e.ELEMENT_ARRAY_BUFFER);
  53174. for (var s in a)
  53175. o(a[s], e.ARRAY_BUFFER);
  53176. var l = i.morphAttributes;
  53177. for (var s in l)
  53178. for (var c = l[s], h = 0, d = c.length; h < d; h++)
  53179. o(c[h], e.ARRAY_BUFFER);
  53180. return i
  53181. }
  53182. function o(e, i) {
  53183. var r = e instanceof n.InterleavedBufferAttribute ? e.data : e
  53184. , o = t.get(r);
  53185. void 0 === o.__webglBuffer ? a(o, r, i) : o.version !== r.version && s(o, r, i)
  53186. }
  53187. function a(t, i, n) {
  53188. t.__webglBuffer = e.createBuffer(),
  53189. e.bindBuffer(n, t.__webglBuffer);
  53190. var r = i.dynamic ? e.DYNAMIC_DRAW : e.STATIC_DRAW;
  53191. e.bufferData(n, i.array, r),
  53192. t.version = i.version
  53193. }
  53194. function s(t, i, n) {
  53195. e.bindBuffer(n, t.__webglBuffer),
  53196. 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)),
  53197. i.updateRange.count = 0),
  53198. t.version = i.version
  53199. }
  53200. function l(e) {
  53201. return e instanceof n.InterleavedBufferAttribute ? t.get(e.data).__webglBuffer : t.get(e).__webglBuffer
  53202. }
  53203. function c(i) {
  53204. var r = t.get(i);
  53205. if (void 0 !== r.wireframe)
  53206. return r.wireframe;
  53207. var a = []
  53208. , s = i.index
  53209. , l = i.attributes
  53210. , c = l.position;
  53211. if (null !== s)
  53212. for (var u = {}, d = s.array, p = 0, f = d.length; p < f; p += 3) {
  53213. var g = d[p + 0]
  53214. , m = d[p + 1]
  53215. , v = d[p + 2];
  53216. h(u, g, m) && a.push(g, m),
  53217. h(u, m, v) && a.push(m, v),
  53218. h(u, v, g) && a.push(v, g)
  53219. }
  53220. else
  53221. for (var d = l.position.array, p = 0, f = d.length / 3 - 1; p < f; p += 3) {
  53222. var g = p + 0
  53223. , m = p + 1
  53224. , v = p + 2;
  53225. a.push(g, m, m, v, v, g)
  53226. }
  53227. var A = c.count > 65535 ? Uint32Array : Uint16Array
  53228. , y = new n.BufferAttribute(new A(a),1);
  53229. return o(y, e.ELEMENT_ARRAY_BUFFER),
  53230. r.wireframe = y,
  53231. y
  53232. }
  53233. function h(e, t, i) {
  53234. if (t > i) {
  53235. var n = t;
  53236. t = i,
  53237. i = n
  53238. }
  53239. var r = e[t];
  53240. return void 0 === r ? (e[t] = [i],
  53241. !0) : r.indexOf(i) === -1 && (r.push(i),
  53242. !0)
  53243. }
  53244. var u = new n.WebGLGeometries(e,t,i);
  53245. this.getAttributeBuffer = l,
  53246. this.getWireframeAttribute = c,
  53247. this.update = r
  53248. }
  53249. ,
  53250. n.WebGLProgram = function() {
  53251. function e(e) {
  53252. switch (e) {
  53253. case n.LinearEncoding:
  53254. return ["Linear", "( value )"];
  53255. case n.sRGBEncoding:
  53256. return ["sRGB", "( value )"];
  53257. case n.RGBEEncoding:
  53258. return ["RGBE", "( value )"];
  53259. case n.RGBM7Encoding:
  53260. return ["RGBM", "( value, 7.0 )"];
  53261. case n.RGBM16Encoding:
  53262. return ["RGBM", "( value, 16.0 )"];
  53263. case n.RGBDEncoding:
  53264. return ["RGBD", "( value, 256.0 )"];
  53265. case n.GammaEncoding:
  53266. return ["Gamma", "( value, float( GAMMA_FACTOR ) )"];
  53267. default:
  53268. throw new Error("unsupported encoding: " + e)
  53269. }
  53270. }
  53271. function t(t, i) {
  53272. var n = e(i);
  53273. return "vec4 " + t + "( vec4 value ) { return " + n[0] + "ToLinear" + n[1] + "; }"
  53274. }
  53275. function i(t, i) {
  53276. var n = e(i);
  53277. return "vec4 " + t + "( vec4 value ) { return LinearTo" + n[0] + n[1] + "; }"
  53278. }
  53279. function r(e, t) {
  53280. var i;
  53281. switch (t) {
  53282. case n.LinearToneMapping:
  53283. i = "Linear";
  53284. break;
  53285. case n.ReinhardToneMapping:
  53286. i = "Reinhard";
  53287. break;
  53288. case n.Uncharted2ToneMapping:
  53289. i = "Uncharted2";
  53290. break;
  53291. case n.CineonToneMapping:
  53292. i = "OptimizedCineon";
  53293. break;
  53294. default:
  53295. throw new Error("unsupported toneMapping: " + t)
  53296. }
  53297. return "vec3 " + e + "( vec3 color ) { return " + i + "ToneMapping( color ); }"
  53298. }
  53299. function o(e, t, i) {
  53300. e = e || {};
  53301. 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" : ""];
  53302. return n.filter(c).join("\n")
  53303. }
  53304. function a(e) {
  53305. var t = [];
  53306. for (var i in e) {
  53307. var n = e[i];
  53308. n !== !1 && t.push("#define " + i + " " + n)
  53309. }
  53310. return t.join("\n")
  53311. }
  53312. function s(e, t, i) {
  53313. for (var n = {}, r = e.getProgramParameter(t, e.ACTIVE_UNIFORMS), o = 0; o < r; o++) {
  53314. var a = e.getActiveUniform(t, o)
  53315. , s = a.name
  53316. , l = e.getUniformLocation(t, s)
  53317. , c = f.exec(s);
  53318. if (c) {
  53319. var h = c[1]
  53320. , u = c[2]
  53321. , d = n[h];
  53322. d || (d = n[h] = {}),
  53323. d[u] = l
  53324. } else if (c = g.exec(s)) {
  53325. var p = c[1]
  53326. , v = c[2]
  53327. , A = c[3]
  53328. , y = n[p];
  53329. y || (y = n[p] = []);
  53330. var C = y[v];
  53331. C || (C = y[v] = {}),
  53332. C[A] = l
  53333. } else if (c = m.exec(s)) {
  53334. var p = c[1];
  53335. n[p] = l
  53336. } else
  53337. n[s] = l
  53338. }
  53339. return n
  53340. }
  53341. function l(e, t, i) {
  53342. for (var n = {}, r = e.getProgramParameter(t, e.ACTIVE_ATTRIBUTES), o = 0; o < r; o++) {
  53343. var a = e.getActiveAttrib(t, o)
  53344. , s = a.name;
  53345. n[s] = e.getAttribLocation(t, s)
  53346. }
  53347. return n
  53348. }
  53349. function c(e) {
  53350. return "" !== e
  53351. }
  53352. function h(e, t) {
  53353. 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)
  53354. }
  53355. function u(e) {
  53356. function t(e, t) {
  53357. var i = n.ShaderChunk[t];
  53358. if (void 0 === i)
  53359. throw new Error("Can not resolve #include <" + t + ">");
  53360. return u(i)
  53361. }
  53362. var i = /#include +<([\w\d.]+)>/g;
  53363. return e.replace(i, t)
  53364. }
  53365. function d(e) {
  53366. function t(e, t, i, n) {
  53367. for (var r = "", o = parseInt(t); o < parseInt(i); o++)
  53368. r += n.replace(/\[ i \]/g, "[ " + o + " ]");
  53369. return r
  53370. }
  53371. var i = /for \( int i \= (\d+)\; i < (\d+)\; i \+\+ \) \{([\s\S]+?)(?=\})\}/g;
  53372. return e.replace(i, t)
  53373. }
  53374. var p = 0
  53375. , f = /^([\w\d_]+)\.([\w\d_]+)$/
  53376. , g = /^([\w\d_]+)\[(\d+)\]\.([\w\d_]+)$/
  53377. , m = /^([\w\d_]+)\[0\]$/;
  53378. return function(e, f, g, m) {
  53379. var v = e.context
  53380. , A = g.extensions
  53381. , y = g.defines
  53382. , C = g.__webglShader.vertexShader
  53383. , I = g.__webglShader.fragmentShader
  53384. , E = "SHADOWMAP_TYPE_BASIC";
  53385. m.shadowMapType === n.PCFShadowMap ? E = "SHADOWMAP_TYPE_PCF" : m.shadowMapType === n.PCFSoftShadowMap && (E = "SHADOWMAP_TYPE_PCF_SOFT");
  53386. var b = "ENVMAP_TYPE_CUBE"
  53387. , w = "ENVMAP_MODE_REFLECTION"
  53388. , _ = "ENVMAP_BLENDING_MULTIPLY";
  53389. if (m.envMap) {
  53390. switch (g.envMap.mapping) {
  53391. case n.CubeReflectionMapping:
  53392. case n.CubeRefractionMapping:
  53393. b = "ENVMAP_TYPE_CUBE";
  53394. break;
  53395. case n.CubeUVReflectionMapping:
  53396. case n.CubeUVRefractionMapping:
  53397. b = "ENVMAP_TYPE_CUBE_UV";
  53398. break;
  53399. case n.EquirectangularReflectionMapping:
  53400. case n.EquirectangularRefractionMapping:
  53401. b = "ENVMAP_TYPE_EQUIREC";
  53402. break;
  53403. case n.SphericalReflectionMapping:
  53404. b = "ENVMAP_TYPE_SPHERE"
  53405. }
  53406. switch (g.envMap.mapping) {
  53407. case n.CubeRefractionMapping:
  53408. case n.EquirectangularRefractionMapping:
  53409. w = "ENVMAP_MODE_REFRACTION"
  53410. }
  53411. switch (g.combine) {
  53412. case n.MultiplyOperation:
  53413. _ = "ENVMAP_BLENDING_MULTIPLY";
  53414. break;
  53415. case n.MixOperation:
  53416. _ = "ENVMAP_BLENDING_MIX";
  53417. break;
  53418. case n.AddOperation:
  53419. _ = "ENVMAP_BLENDING_ADD"
  53420. }
  53421. }
  53422. var T, x, S = e.gammaFactor > 0 ? e.gammaFactor : 1, M = o(A, m, e.extensions), R = a(y), P = v.createProgram();
  53423. g instanceof n.RawShaderMaterial ? (T = "",
  53424. 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"),
  53425. 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")),
  53426. C = u(C, m),
  53427. C = h(C, m),
  53428. I = u(I, m),
  53429. I = h(I, m),
  53430. g instanceof n.ShaderMaterial == !1 && (C = d(C),
  53431. I = d(I));
  53432. var O = T + C
  53433. , L = x + I
  53434. , D = n.WebGLShader(v, v.VERTEX_SHADER, O)
  53435. , N = n.WebGLShader(v, v.FRAGMENT_SHADER, L);
  53436. v.attachShader(P, D),
  53437. v.attachShader(P, N),
  53438. void 0 !== g.index0AttributeName ? v.bindAttribLocation(P, 0, g.index0AttributeName) : m.morphTargets === !0 && v.bindAttribLocation(P, 0, "position"),
  53439. v.linkProgram(P);
  53440. var B = v.getProgramInfoLog(P)
  53441. , F = v.getShaderInfoLog(D)
  53442. , V = v.getShaderInfoLog(N)
  53443. , U = !0
  53444. , k = !0;
  53445. v.getProgramParameter(P, v.LINK_STATUS) === !1 ? (U = !1,
  53446. 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),
  53447. k && (this.diagnostics = {
  53448. runnable: U,
  53449. material: g,
  53450. programLog: B,
  53451. vertexShader: {
  53452. log: F,
  53453. prefix: T
  53454. },
  53455. fragmentShader: {
  53456. log: V,
  53457. prefix: x
  53458. }
  53459. }),
  53460. v.deleteShader(D),
  53461. v.deleteShader(N);
  53462. var H;
  53463. this.getUniforms = function() {
  53464. return void 0 === H && (H = s(v, P)),
  53465. H
  53466. }
  53467. ;
  53468. var G;
  53469. return this.getAttributes = function() {
  53470. return void 0 === G && (G = l(v, P)),
  53471. G
  53472. }
  53473. ,
  53474. this.destroy = function() {
  53475. v.deleteProgram(P),
  53476. this.program = void 0
  53477. }
  53478. ,
  53479. Object.defineProperties(this, {
  53480. uniforms: {
  53481. get: function() {
  53482. return console.warn("THREE.WebGLProgram: .uniforms is now .getUniforms()."),
  53483. this.getUniforms()
  53484. }
  53485. },
  53486. attributes: {
  53487. get: function() {
  53488. return console.warn("THREE.WebGLProgram: .attributes is now .getAttributes()."),
  53489. this.getAttributes()
  53490. }
  53491. }
  53492. }),
  53493. this.id = p++,
  53494. this.code = f,
  53495. this.usedTimes = 1,
  53496. this.program = P,
  53497. this.vertexShader = D,
  53498. this.fragmentShader = N,
  53499. this
  53500. }
  53501. }(),
  53502. n.WebGLPrograms = function(e, t) {
  53503. function i(e) {
  53504. if (t.floatVertexTextures && e && e.skeleton && e.skeleton.useVertexTexture)
  53505. return 1024;
  53506. var i = t.maxVertexUniforms
  53507. , r = Math.floor((i - 20) / 4)
  53508. , o = r;
  53509. return void 0 !== e && e instanceof n.SkinnedMesh && (o = Math.min(e.skeleton.bones.length, o),
  53510. 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)")),
  53511. o
  53512. }
  53513. function r(e, t) {
  53514. var i;
  53515. return e ? e instanceof n.Texture ? i = e.encoding : e instanceof n.WebGLRenderTarget && (i = e.texture.encoding) : i = n.LinearEncoding,
  53516. i === n.LinearEncoding && t && (i = n.GammaEncoding),
  53517. i
  53518. }
  53519. var o = []
  53520. , a = {
  53521. MeshDepthMaterial: "depth",
  53522. MeshNormalMaterial: "normal",
  53523. MeshBasicMaterial: "basic",
  53524. MeshLambertMaterial: "lambert",
  53525. MeshPhongMaterial: "phong",
  53526. MeshStandardMaterial: "standard",
  53527. LineBasicMaterial: "basic",
  53528. LineDashedMaterial: "dashed",
  53529. PointsMaterial: "points"
  53530. }
  53531. , 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"];
  53532. this.getParameters = function(o, s, l, c) {
  53533. var h = a[o.type]
  53534. , u = i(c)
  53535. , d = e.getPrecision();
  53536. null !== o.precision && (d = t.getMaxPrecision(o.precision),
  53537. d !== o.precision && console.warn("THREE.WebGLProgram.getParameters:", o.precision, "not supported, using", d, "instead."));
  53538. var p = {
  53539. shaderID: h,
  53540. precision: d,
  53541. supportsVertexTextures: t.vertexTextures,
  53542. outputEncoding: r(e.getCurrentRenderTarget(), e.gammaOutput),
  53543. map: !!o.map,
  53544. mapEncoding: r(o.map, e.gammaInput),
  53545. envMap: !!o.envMap,
  53546. envMapMode: o.envMap && o.envMap.mapping,
  53547. envMapEncoding: r(o.envMap, e.gammaInput),
  53548. envMapCubeUV: !!o.envMap && (o.envMap.mapping === n.CubeUVReflectionMapping || o.envMap.mapping === n.CubeUVRefractionMapping),
  53549. lightMap: !!o.lightMap,
  53550. aoMap: !!o.aoMap,
  53551. emissiveMap: !!o.emissiveMap,
  53552. emissiveMapEncoding: r(o.emissiveMap, e.gammaInput),
  53553. bumpMap: !!o.bumpMap,
  53554. normalMap: !!o.normalMap,
  53555. displacementMap: !!o.displacementMap,
  53556. roughnessMap: !!o.roughnessMap,
  53557. metalnessMap: !!o.metalnessMap,
  53558. specularMap: !!o.specularMap,
  53559. alphaMap: !!o.alphaMap,
  53560. combine: o.combine,
  53561. vertexColors: o.vertexColors,
  53562. fog: l,
  53563. useFog: o.fog,
  53564. fogExp: l instanceof n.FogExp2,
  53565. flatShading: o.shading === n.FlatShading,
  53566. sizeAttenuation: o.sizeAttenuation,
  53567. logarithmicDepthBuffer: t.logarithmicDepthBuffer,
  53568. skinning: o.skinning,
  53569. maxBones: u,
  53570. useVertexTexture: t.floatVertexTextures && c && c.skeleton && c.skeleton.useVertexTexture,
  53571. morphTargets: o.morphTargets,
  53572. morphNormals: o.morphNormals,
  53573. maxMorphTargets: e.maxMorphTargets,
  53574. maxMorphNormals: e.maxMorphNormals,
  53575. numDirLights: s.directional.length,
  53576. numPointLights: s.point.length,
  53577. numSpotLights: s.spot.length,
  53578. numHemiLights: s.hemi.length,
  53579. pointLightShadows: s.shadowsPointLight,
  53580. shadowMapEnabled: e.shadowMap.enabled && c.receiveShadow && s.shadows.length > 0,
  53581. shadowMapType: e.shadowMap.type,
  53582. toneMapping: e.toneMapping,
  53583. physicallyCorrectLights: e.physicallyCorrectLights,
  53584. premultipliedAlpha: o.premultipliedAlpha,
  53585. alphaTest: o.alphaTest,
  53586. doubleSided: o.side === n.DoubleSide,
  53587. flipSided: o.side === n.BackSide
  53588. };
  53589. return p
  53590. }
  53591. ,
  53592. this.getProgramCode = function(e, t) {
  53593. var i = [];
  53594. if (t.shaderID ? i.push(t.shaderID) : (i.push(e.fragmentShader),
  53595. i.push(e.vertexShader)),
  53596. void 0 !== e.defines)
  53597. for (var n in e.defines)
  53598. i.push(n),
  53599. i.push(e.defines[n]);
  53600. for (var r = 0; r < s.length; r++) {
  53601. var o = s[r];
  53602. i.push(o),
  53603. i.push(t[o])
  53604. }
  53605. return i.join()
  53606. }
  53607. ,
  53608. this.acquireProgram = function(t, i, r) {
  53609. for (var a, s = 0, l = o.length; s < l; s++) {
  53610. var c = o[s];
  53611. if (c.code === r) {
  53612. a = c,
  53613. ++a.usedTimes;
  53614. break
  53615. }
  53616. }
  53617. return void 0 === a && (a = new n.WebGLProgram(e,r,t,i),
  53618. o.push(a)),
  53619. a
  53620. }
  53621. ,
  53622. this.releaseProgram = function(e) {
  53623. if (0 === --e.usedTimes) {
  53624. var t = o.indexOf(e);
  53625. o[t] = o[o.length - 1],
  53626. o.pop(),
  53627. e.destroy()
  53628. }
  53629. }
  53630. ,
  53631. this.programs = o
  53632. }
  53633. ,
  53634. n.WebGLProperties = function() {
  53635. var e = {};
  53636. this.get = function(t) {
  53637. var i = t.uuid
  53638. , n = e[i];
  53639. return void 0 === n && (n = {},
  53640. e[i] = n),
  53641. n
  53642. }
  53643. ,
  53644. this.delete = function(t) {
  53645. delete e[t.uuid]
  53646. }
  53647. ,
  53648. this.clear = function() {
  53649. e = {}
  53650. }
  53651. }
  53652. ,
  53653. n.WebGLShader = function() {
  53654. function e(e) {
  53655. for (var t = e.split("\n"), i = 0; i < t.length; i++)
  53656. t[i] = i + 1 + ": " + t[i];
  53657. return t.join("\n")
  53658. }
  53659. return function(t, i, n) {
  53660. var r = t.createShader(i);
  53661. return t.shaderSource(r, n),
  53662. t.compileShader(r),
  53663. t.getShaderParameter(r, t.COMPILE_STATUS) === !1 && console.error("THREE.WebGLShader: Shader couldn't compile."),
  53664. "" !== t.getShaderInfoLog(r) && console.warn("THREE.WebGLShader: gl.getShaderInfoLog()", i === t.VERTEX_SHADER ? "vertex" : "fragment", t.getShaderInfoLog(r), e(n)),
  53665. r
  53666. }
  53667. }(),
  53668. n.WebGLShadowMap = function(e, t, i) {
  53669. function r(e, t, i, r) {
  53670. var o = e.geometry
  53671. , a = null
  53672. , s = v
  53673. , l = e.customDepthMaterial;
  53674. if (i && (s = A,
  53675. l = e.customDistanceMaterial),
  53676. l)
  53677. a = l;
  53678. else {
  53679. var c = void 0 !== o.morphTargets && o.morphTargets.length > 0 && t.morphTargets
  53680. , h = e instanceof n.SkinnedMesh && t.skinning
  53681. , u = 0;
  53682. c && (u |= f),
  53683. h && (u |= g),
  53684. a = s[u]
  53685. }
  53686. return a.visible = t.visible,
  53687. a.wireframe = t.wireframe,
  53688. a.wireframeLinewidth = t.wireframeLinewidth,
  53689. i && void 0 !== a.uniforms.lightPos && a.uniforms.lightPos.value.copy(r),
  53690. a
  53691. }
  53692. function o(e, t, i) {
  53693. if (e.visible !== !1) {
  53694. 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)) {
  53695. var r = e.material;
  53696. r.visible === !0 && (e.modelViewMatrix.multiplyMatrices(i.matrixWorldInverse, e.matrixWorld),
  53697. p.push(e))
  53698. }
  53699. for (var a = e.children, s = 0, c = a.length; s < c; s++)
  53700. o(a[s], t, i)
  53701. }
  53702. }
  53703. 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) {
  53704. var x = 0 !== (T & f)
  53705. , S = 0 !== (T & g)
  53706. , M = new n.ShaderMaterial({
  53707. uniforms: b,
  53708. vertexShader: E.vertexShader,
  53709. fragmentShader: E.fragmentShader,
  53710. morphTargets: x,
  53711. skinning: S
  53712. });
  53713. v[T] = M;
  53714. var R = new n.ShaderMaterial({
  53715. defines: {
  53716. USE_SHADOWMAP: ""
  53717. },
  53718. uniforms: _,
  53719. vertexShader: w.vertexShader,
  53720. fragmentShader: w.fragmentShader,
  53721. morphTargets: x,
  53722. skinning: S
  53723. });
  53724. A[T] = R
  53725. }
  53726. var P = this;
  53727. this.enabled = !1,
  53728. this.autoUpdate = !0,
  53729. this.needsUpdate = !1,
  53730. this.type = n.PCFShadowMap,
  53731. this.cullFace = n.CullFaceFront,
  53732. this.render = function(f, g) {
  53733. var m, v, A = t.shadows;
  53734. if (0 !== A.length && P.enabled !== !1 && (P.autoUpdate !== !1 || P.needsUpdate !== !1)) {
  53735. s.clearColor(1, 1, 1, 1),
  53736. s.disable(a.BLEND),
  53737. s.enable(a.CULL_FACE),
  53738. a.frontFace(a.CCW),
  53739. a.cullFace(P.cullFace === n.CullFaceFront ? a.FRONT : a.BACK),
  53740. s.setDepthTest(!0),
  53741. s.setScissorTest(!1);
  53742. for (var E = 0, b = A.length; E < b; E++) {
  53743. var w = A[E]
  53744. , _ = w.shadow
  53745. , T = _.camera;
  53746. if (h.copy(_.mapSize),
  53747. w instanceof n.PointLight) {
  53748. m = 6,
  53749. v = !0;
  53750. var x = h.x
  53751. , S = h.y;
  53752. I[0].set(2 * x, S, x, S),
  53753. I[1].set(0, S, x, S),
  53754. I[2].set(3 * x, S, x, S),
  53755. I[3].set(x, S, x, S),
  53756. I[4].set(3 * x, 0, x, S),
  53757. I[5].set(x, 0, x, S),
  53758. h.x *= 4,
  53759. h.y *= 2
  53760. } else
  53761. m = 1,
  53762. v = !1;
  53763. if (null === _.map) {
  53764. var M = {
  53765. minFilter: n.NearestFilter,
  53766. magFilter: n.NearestFilter,
  53767. format: n.RGBAFormat
  53768. };
  53769. _.map = new n.WebGLRenderTarget(h.x,h.y,M),
  53770. w instanceof n.SpotLight && (T.aspect = h.x / h.y),
  53771. T.updateProjectionMatrix()
  53772. }
  53773. var R = _.map
  53774. , O = _.matrix;
  53775. d.setFromMatrixPosition(w.matrixWorld),
  53776. T.position.copy(d),
  53777. e.setRenderTarget(R),
  53778. e.clear();
  53779. for (var L = 0; L < m; L++) {
  53780. if (v) {
  53781. u.copy(T.position),
  53782. u.add(y[L]),
  53783. T.up.copy(C[L]),
  53784. T.lookAt(u);
  53785. var D = I[L];
  53786. s.viewport(D)
  53787. } else
  53788. u.setFromMatrixPosition(w.target.matrixWorld),
  53789. T.lookAt(u);
  53790. T.updateMatrixWorld(),
  53791. T.matrixWorldInverse.getInverse(T.matrixWorld),
  53792. O.set(.5, 0, 0, .5, 0, .5, 0, .5, 0, 0, .5, .5, 0, 0, 0, 1),
  53793. O.multiply(T.projectionMatrix),
  53794. O.multiply(T.matrixWorldInverse),
  53795. c.multiplyMatrices(T.projectionMatrix, T.matrixWorldInverse),
  53796. l.setFromMatrix(c),
  53797. p.length = 0,
  53798. o(f, g, T);
  53799. for (var N = 0, B = p.length; N < B; N++) {
  53800. var F = p[N]
  53801. , V = i.update(F)
  53802. , U = F.material;
  53803. if (U instanceof n.MultiMaterial)
  53804. for (var k = V.groups, H = U.materials, G = 0, z = k.length; G < z; G++) {
  53805. var W = k[G]
  53806. , j = H[W.materialIndex];
  53807. if (j.visible === !0) {
  53808. var Y = r(F, j, v, d);
  53809. e.renderBufferDirect(T, null, V, Y, F, W)
  53810. }
  53811. }
  53812. else {
  53813. var Y = r(F, U, v, d);
  53814. e.renderBufferDirect(T, null, V, Y, F, null)
  53815. }
  53816. }
  53817. }
  53818. }
  53819. var X = e.getClearColor()
  53820. , Z = e.getClearAlpha();
  53821. e.setClearColor(X, Z),
  53822. s.enable(a.BLEND),
  53823. P.cullFace === n.CullFaceFront && a.cullFace(a.BACK),
  53824. P.needsUpdate = !1
  53825. }
  53826. }
  53827. }
  53828. ,
  53829. n.WebGLState = function(e, t, i) {
  53830. var r = this
  53831. , o = new n.Vector4
  53832. , a = new Uint8Array(16)
  53833. , s = new Uint8Array(16)
  53834. , l = new Uint8Array(16)
  53835. , c = {}
  53836. , h = null
  53837. , u = null
  53838. , d = null
  53839. , p = null
  53840. , f = null
  53841. , g = null
  53842. , m = null
  53843. , v = null
  53844. , A = !1
  53845. , y = null
  53846. , C = null
  53847. , I = null
  53848. , E = null
  53849. , b = null
  53850. , w = null
  53851. , _ = null
  53852. , T = null
  53853. , x = null
  53854. , S = null
  53855. , M = null
  53856. , R = null
  53857. , P = null
  53858. , O = null
  53859. , L = null
  53860. , D = e.getParameter(e.MAX_TEXTURE_IMAGE_UNITS)
  53861. , N = void 0
  53862. , B = {}
  53863. , F = new n.Vector4
  53864. , V = null
  53865. , U = null
  53866. , k = new n.Vector4
  53867. , H = new n.Vector4
  53868. , G = e.createTexture();
  53869. e.bindTexture(e.TEXTURE_2D, G),
  53870. e.texParameteri(e.TEXTURE_2D, e.TEXTURE_MIN_FILTER, e.LINEAR),
  53871. e.texImage2D(e.TEXTURE_2D, 0, e.RGB, 1, 1, 0, e.RGB, e.UNSIGNED_BYTE, new Uint8Array(3)),
  53872. this.init = function() {
  53873. this.clearColor(0, 0, 0, 1),
  53874. this.clearDepth(1),
  53875. this.clearStencil(0),
  53876. this.enable(e.DEPTH_TEST),
  53877. e.depthFunc(e.LEQUAL),
  53878. e.frontFace(e.CCW),
  53879. e.cullFace(e.BACK),
  53880. this.enable(e.CULL_FACE),
  53881. this.enable(e.BLEND),
  53882. e.blendEquation(e.FUNC_ADD),
  53883. e.blendFunc(e.SRC_ALPHA, e.ONE_MINUS_SRC_ALPHA)
  53884. }
  53885. ,
  53886. this.initAttributes = function() {
  53887. for (var e = 0, t = a.length; e < t; e++)
  53888. a[e] = 0
  53889. }
  53890. ,
  53891. this.enableAttribute = function(i) {
  53892. if (a[i] = 1,
  53893. 0 === s[i] && (e.enableVertexAttribArray(i),
  53894. s[i] = 1),
  53895. 0 !== l[i]) {
  53896. var n = t.get("ANGLE_instanced_arrays");
  53897. n.vertexAttribDivisorANGLE(i, 0),
  53898. l[i] = 0
  53899. }
  53900. }
  53901. ,
  53902. this.enableAttributeAndDivisor = function(t, i, n) {
  53903. a[t] = 1,
  53904. 0 === s[t] && (e.enableVertexAttribArray(t),
  53905. s[t] = 1),
  53906. l[t] !== i && (n.vertexAttribDivisorANGLE(t, i),
  53907. l[t] = i)
  53908. }
  53909. ,
  53910. this.disableUnusedAttributes = function() {
  53911. for (var t = 0, i = s.length; t < i; t++)
  53912. s[t] !== a[t] && (e.disableVertexAttribArray(t),
  53913. s[t] = 0)
  53914. }
  53915. ,
  53916. this.enable = function(t) {
  53917. c[t] !== !0 && (e.enable(t),
  53918. c[t] = !0)
  53919. }
  53920. ,
  53921. this.disable = function(t) {
  53922. c[t] !== !1 && (e.disable(t),
  53923. c[t] = !1)
  53924. }
  53925. ,
  53926. this.getCompressedTextureFormats = function() {
  53927. if (null === h && (h = [],
  53928. t.get("WEBGL_compressed_texture_pvrtc") || t.get("WEBGL_compressed_texture_s3tc") || t.get("WEBGL_compressed_texture_etc1")))
  53929. for (var i = e.getParameter(e.COMPRESSED_TEXTURE_FORMATS), n = 0; n < i.length; n++)
  53930. h.push(i[n]);
  53931. return h
  53932. }
  53933. ,
  53934. this.setBlending = function(t, r, o, a, s, l, c, h) {
  53935. t === n.NoBlending ? this.disable(e.BLEND) : this.enable(e.BLEND),
  53936. t === u && h === A || (t === n.AdditiveBlending ? h ? (e.blendEquationSeparate(e.FUNC_ADD, e.FUNC_ADD),
  53937. e.blendFuncSeparate(e.ONE, e.ONE, e.ONE, e.ONE)) : (e.blendEquation(e.FUNC_ADD),
  53938. e.blendFunc(e.SRC_ALPHA, e.ONE)) : t === n.SubtractiveBlending ? h ? (e.blendEquationSeparate(e.FUNC_ADD, e.FUNC_ADD),
  53939. e.blendFuncSeparate(e.ZERO, e.ZERO, e.ONE_MINUS_SRC_COLOR, e.ONE_MINUS_SRC_ALPHA)) : (e.blendEquation(e.FUNC_ADD),
  53940. e.blendFunc(e.ZERO, e.ONE_MINUS_SRC_COLOR)) : t === n.MultiplyBlending ? h ? (e.blendEquationSeparate(e.FUNC_ADD, e.FUNC_ADD),
  53941. e.blendFuncSeparate(e.ZERO, e.ZERO, e.SRC_COLOR, e.SRC_ALPHA)) : (e.blendEquation(e.FUNC_ADD),
  53942. e.blendFunc(e.ZERO, e.SRC_COLOR)) : h ? (e.blendEquationSeparate(e.FUNC_ADD, e.FUNC_ADD),
  53943. e.blendFuncSeparate(e.ONE, e.ONE_MINUS_SRC_ALPHA, e.ONE, e.ONE_MINUS_SRC_ALPHA)) : (e.blendEquationSeparate(e.FUNC_ADD, e.FUNC_ADD),
  53944. e.blendFuncSeparate(e.SRC_ALPHA, e.ONE_MINUS_SRC_ALPHA, e.ONE, e.ONE_MINUS_SRC_ALPHA)),
  53945. u = t,
  53946. A = h),
  53947. t === n.CustomBlending ? (s = s || r,
  53948. l = l || o,
  53949. c = c || a,
  53950. r === d && s === g || (e.blendEquationSeparate(i(r), i(s)),
  53951. d = r,
  53952. g = s),
  53953. o === p && a === f && l === m && c === v || (e.blendFuncSeparate(i(o), i(a), i(l), i(c)),
  53954. p = o,
  53955. f = a,
  53956. m = l,
  53957. v = c)) : (d = null,
  53958. p = null,
  53959. f = null,
  53960. g = null,
  53961. m = null,
  53962. v = null)
  53963. }
  53964. ,
  53965. this.setDepthFunc = function(t) {
  53966. if (y !== t) {
  53967. if (t)
  53968. switch (t) {
  53969. case n.NeverDepth:
  53970. e.depthFunc(e.NEVER);
  53971. break;
  53972. case n.AlwaysDepth:
  53973. e.depthFunc(e.ALWAYS);
  53974. break;
  53975. case n.LessDepth:
  53976. e.depthFunc(e.LESS);
  53977. break;
  53978. case n.LessEqualDepth:
  53979. e.depthFunc(e.LEQUAL);
  53980. break;
  53981. case n.EqualDepth:
  53982. e.depthFunc(e.EQUAL);
  53983. break;
  53984. case n.GreaterEqualDepth:
  53985. e.depthFunc(e.GEQUAL);
  53986. break;
  53987. case n.GreaterDepth:
  53988. e.depthFunc(e.GREATER);
  53989. break;
  53990. case n.NotEqualDepth:
  53991. e.depthFunc(e.NOTEQUAL);
  53992. break;
  53993. default:
  53994. e.depthFunc(e.LEQUAL)
  53995. }
  53996. else
  53997. e.depthFunc(e.LEQUAL);
  53998. y = t
  53999. }
  54000. }
  54001. ,
  54002. this.setDepthTest = function(t) {
  54003. t ? this.enable(e.DEPTH_TEST) : this.disable(e.DEPTH_TEST)
  54004. }
  54005. ,
  54006. this.setDepthWrite = function(t) {
  54007. C !== t && (e.depthMask(t),
  54008. C = t)
  54009. }
  54010. ,
  54011. this.setColorWrite = function(t) {
  54012. I !== t && (e.colorMask(t, t, t, t),
  54013. I = t)
  54014. }
  54015. ,
  54016. this.setStencilFunc = function(t, i, n) {
  54017. b === t && w === i && _ === n || (e.stencilFunc(t, i, n),
  54018. b = t,
  54019. w = i,
  54020. _ = n)
  54021. }
  54022. ,
  54023. this.setStencilOp = function(t, i, n) {
  54024. T === t && x === i && S === n || (e.stencilOp(t, i, n),
  54025. T = t,
  54026. x = i,
  54027. S = n)
  54028. }
  54029. ,
  54030. this.setStencilTest = function(t) {
  54031. t ? this.enable(e.STENCIL_TEST) : this.disable(e.STENCIL_TEST)
  54032. }
  54033. ,
  54034. this.setStencilWrite = function(t) {
  54035. E !== t && (e.stencilMask(t),
  54036. E = t)
  54037. }
  54038. ,
  54039. this.setFlipSided = function(t) {
  54040. M !== t && (t ? e.frontFace(e.CW) : e.frontFace(e.CCW),
  54041. M = t)
  54042. }
  54043. ,
  54044. this.setLineWidth = function(t) {
  54045. t !== R && (e.lineWidth(t),
  54046. R = t)
  54047. }
  54048. ,
  54049. this.setPolygonOffset = function(t, i, n) {
  54050. t ? this.enable(e.POLYGON_OFFSET_FILL) : this.disable(e.POLYGON_OFFSET_FILL),
  54051. !t || P === i && O === n || (e.polygonOffset(i, n),
  54052. P = i,
  54053. O = n)
  54054. }
  54055. ,
  54056. this.getScissorTest = function() {
  54057. return L
  54058. }
  54059. ,
  54060. this.setScissorTest = function(t) {
  54061. L = t,
  54062. t ? this.enable(e.SCISSOR_TEST) : this.disable(e.SCISSOR_TEST)
  54063. }
  54064. ,
  54065. this.activeTexture = function(t) {
  54066. void 0 === t && (t = e.TEXTURE0 + D - 1),
  54067. N !== t && (e.activeTexture(t),
  54068. N = t)
  54069. }
  54070. ,
  54071. this.bindTexture = function(t, i) {
  54072. void 0 === N && r.activeTexture();
  54073. var n = B[N];
  54074. void 0 === n && (n = {
  54075. type: void 0,
  54076. texture: void 0
  54077. },
  54078. B[N] = n),
  54079. n.type === t && n.texture === i || (e.bindTexture(t, i || G),
  54080. n.type = t,
  54081. n.texture = i)
  54082. }
  54083. ,
  54084. this.compressedTexImage2D = function() {
  54085. try {
  54086. e.compressedTexImage2D.apply(e, arguments)
  54087. } catch (e) {
  54088. console.error(e)
  54089. }
  54090. }
  54091. ,
  54092. this.texImage2D = function() {
  54093. try {
  54094. e.texImage2D.apply(e, arguments)
  54095. } catch (e) {
  54096. console.error(e)
  54097. }
  54098. }
  54099. ,
  54100. this.clearColor = function(t, i, n, r) {
  54101. o.set(t, i, n, r),
  54102. F.equals(o) === !1 && (e.clearColor(t, i, n, r),
  54103. F.copy(o))
  54104. }
  54105. ,
  54106. this.clearDepth = function(t) {
  54107. V !== t && (e.clearDepth(t),
  54108. V = t)
  54109. }
  54110. ,
  54111. this.clearStencil = function(t) {
  54112. U !== t && (e.clearStencil(t),
  54113. U = t)
  54114. }
  54115. ,
  54116. this.scissor = function(t) {
  54117. k.equals(t) === !1 && (e.scissor(t.x, t.y, t.z, t.w),
  54118. k.copy(t))
  54119. }
  54120. ,
  54121. this.viewport = function(t) {
  54122. H.equals(t) === !1 && (e.viewport(t.x, t.y, t.z, t.w),
  54123. H.copy(t))
  54124. }
  54125. ,
  54126. this.reset = function() {
  54127. for (var t = 0; t < s.length; t++)
  54128. 1 === s[t] && (e.disableVertexAttribArray(t),
  54129. s[t] = 0);
  54130. c = {},
  54131. h = null,
  54132. N = void 0,
  54133. B = {},
  54134. u = null,
  54135. I = null,
  54136. C = null,
  54137. E = null,
  54138. M = null
  54139. }
  54140. }
  54141. ,
  54142. n.LensFlarePlugin = function(e, t) {
  54143. function i() {
  54144. var e = new Float32Array([-1, -1, 0, 0, 1, -1, 1, 0, 1, 1, 1, 1, -1, 1, 0, 1])
  54145. , t = new Uint16Array([0, 1, 2, 0, 2, 3]);
  54146. o = p.createBuffer(),
  54147. a = p.createBuffer(),
  54148. p.bindBuffer(p.ARRAY_BUFFER, o),
  54149. p.bufferData(p.ARRAY_BUFFER, e, p.STATIC_DRAW),
  54150. p.bindBuffer(p.ELEMENT_ARRAY_BUFFER, a),
  54151. p.bufferData(p.ELEMENT_ARRAY_BUFFER, t, p.STATIC_DRAW),
  54152. u = p.createTexture(),
  54153. d = p.createTexture(),
  54154. f.bindTexture(p.TEXTURE_2D, u),
  54155. p.texImage2D(p.TEXTURE_2D, 0, p.RGB, 16, 16, 0, p.RGB, p.UNSIGNED_BYTE, null),
  54156. p.texParameteri(p.TEXTURE_2D, p.TEXTURE_WRAP_S, p.CLAMP_TO_EDGE),
  54157. p.texParameteri(p.TEXTURE_2D, p.TEXTURE_WRAP_T, p.CLAMP_TO_EDGE),
  54158. p.texParameteri(p.TEXTURE_2D, p.TEXTURE_MAG_FILTER, p.NEAREST),
  54159. p.texParameteri(p.TEXTURE_2D, p.TEXTURE_MIN_FILTER, p.NEAREST),
  54160. f.bindTexture(p.TEXTURE_2D, d),
  54161. p.texImage2D(p.TEXTURE_2D, 0, p.RGBA, 16, 16, 0, p.RGBA, p.UNSIGNED_BYTE, null),
  54162. p.texParameteri(p.TEXTURE_2D, p.TEXTURE_WRAP_S, p.CLAMP_TO_EDGE),
  54163. p.texParameteri(p.TEXTURE_2D, p.TEXTURE_WRAP_T, p.CLAMP_TO_EDGE),
  54164. p.texParameteri(p.TEXTURE_2D, p.TEXTURE_MAG_FILTER, p.NEAREST),
  54165. p.texParameteri(p.TEXTURE_2D, p.TEXTURE_MIN_FILTER, p.NEAREST),
  54166. h = p.getParameter(p.MAX_VERTEX_TEXTURE_IMAGE_UNITS) > 0;
  54167. var i;
  54168. i = h ? {
  54169. 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"),
  54170. 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")
  54171. } : {
  54172. 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"),
  54173. 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")
  54174. },
  54175. s = r(i),
  54176. l = {
  54177. vertex: p.getAttribLocation(s, "position"),
  54178. uv: p.getAttribLocation(s, "uv")
  54179. },
  54180. c = {
  54181. renderType: p.getUniformLocation(s, "renderType"),
  54182. map: p.getUniformLocation(s, "map"),
  54183. occlusionMap: p.getUniformLocation(s, "occlusionMap"),
  54184. opacity: p.getUniformLocation(s, "opacity"),
  54185. color: p.getUniformLocation(s, "color"),
  54186. scale: p.getUniformLocation(s, "scale"),
  54187. rotation: p.getUniformLocation(s, "rotation"),
  54188. screenPosition: p.getUniformLocation(s, "screenPosition")
  54189. }
  54190. }
  54191. function r(t) {
  54192. var i = p.createProgram()
  54193. , n = p.createShader(p.FRAGMENT_SHADER)
  54194. , r = p.createShader(p.VERTEX_SHADER)
  54195. , o = "precision " + e.getPrecision() + " float;\n";
  54196. return p.shaderSource(n, o + t.fragmentShader),
  54197. p.shaderSource(r, o + t.vertexShader),
  54198. p.compileShader(n),
  54199. p.compileShader(r),
  54200. p.attachShader(i, n),
  54201. p.attachShader(i, r),
  54202. p.linkProgram(i),
  54203. i
  54204. }
  54205. var o, a, s, l, c, h, u, d, p = e.context, f = e.state;
  54206. this.render = function(r, g, m) {
  54207. if (0 !== t.length) {
  54208. var v = new n.Vector3
  54209. , A = m.w / m.z
  54210. , y = .5 * m.z
  54211. , C = .5 * m.w
  54212. , I = 16 / m.w
  54213. , E = new n.Vector2(I * A,I)
  54214. , b = new n.Vector3(1,1,0)
  54215. , w = new n.Vector2(1,1);
  54216. void 0 === s && i(),
  54217. p.useProgram(s),
  54218. f.initAttributes(),
  54219. f.enableAttribute(l.vertex),
  54220. f.enableAttribute(l.uv),
  54221. f.disableUnusedAttributes(),
  54222. p.uniform1i(c.occlusionMap, 0),
  54223. p.uniform1i(c.map, 1),
  54224. p.bindBuffer(p.ARRAY_BUFFER, o),
  54225. p.vertexAttribPointer(l.vertex, 2, p.FLOAT, !1, 16, 0),
  54226. p.vertexAttribPointer(l.uv, 2, p.FLOAT, !1, 16, 8),
  54227. p.bindBuffer(p.ELEMENT_ARRAY_BUFFER, a),
  54228. f.disable(p.CULL_FACE),
  54229. f.setDepthWrite(!1);
  54230. for (var _ = 0, T = t.length; _ < T; _++) {
  54231. I = 16 / m.w,
  54232. E.set(I * A, I);
  54233. var x = t[_];
  54234. if (v.set(x.matrixWorld.elements[12], x.matrixWorld.elements[13], x.matrixWorld.elements[14]),
  54235. v.applyMatrix4(g.matrixWorldInverse),
  54236. v.applyProjection(g.projectionMatrix),
  54237. b.copy(v),
  54238. w.x = b.x * y + y,
  54239. w.y = b.y * C + C,
  54240. h || w.x > 0 && w.x < m.z && w.y > 0 && w.y < m.w) {
  54241. f.activeTexture(p.TEXTURE0),
  54242. f.bindTexture(p.TEXTURE_2D, null),
  54243. f.activeTexture(p.TEXTURE1),
  54244. f.bindTexture(p.TEXTURE_2D, u),
  54245. p.copyTexImage2D(p.TEXTURE_2D, 0, p.RGB, m.x + w.x - 8, m.y + w.y - 8, 16, 16, 0),
  54246. p.uniform1i(c.renderType, 0),
  54247. p.uniform2f(c.scale, E.x, E.y),
  54248. p.uniform3f(c.screenPosition, b.x, b.y, b.z),
  54249. f.disable(p.BLEND),
  54250. f.enable(p.DEPTH_TEST),
  54251. p.drawElements(p.TRIANGLES, 6, p.UNSIGNED_SHORT, 0),
  54252. f.activeTexture(p.TEXTURE0),
  54253. f.bindTexture(p.TEXTURE_2D, d),
  54254. p.copyTexImage2D(p.TEXTURE_2D, 0, p.RGBA, m.x + w.x - 8, m.y + w.y - 8, 16, 16, 0),
  54255. p.uniform1i(c.renderType, 1),
  54256. f.disable(p.DEPTH_TEST),
  54257. f.activeTexture(p.TEXTURE1),
  54258. f.bindTexture(p.TEXTURE_2D, u),
  54259. p.drawElements(p.TRIANGLES, 6, p.UNSIGNED_SHORT, 0),
  54260. x.positionScreen.copy(b),
  54261. x.customUpdateCallback ? x.customUpdateCallback(x) : x.updateLensFlares(),
  54262. p.uniform1i(c.renderType, 2),
  54263. f.enable(p.BLEND);
  54264. for (var S = 0, M = x.lensFlares.length; S < M; S++) {
  54265. var R = x.lensFlares[S];
  54266. R.opacity > .001 && R.scale > .001 && (b.x = R.x,
  54267. b.y = R.y,
  54268. b.z = R.z,
  54269. I = R.size * R.scale / m.w,
  54270. E.x = I * A,
  54271. E.y = I,
  54272. p.uniform3f(c.screenPosition, b.x, b.y, b.z),
  54273. p.uniform2f(c.scale, E.x, E.y),
  54274. p.uniform1f(c.rotation, R.rotation),
  54275. p.uniform1f(c.opacity, R.opacity),
  54276. p.uniform3f(c.color, R.color.r, R.color.g, R.color.b),
  54277. f.setBlending(R.blending, R.blendEquation, R.blendSrc, R.blendDst),
  54278. e.setTexture(R.texture, 1),
  54279. p.drawElements(p.TRIANGLES, 6, p.UNSIGNED_SHORT, 0))
  54280. }
  54281. }
  54282. }
  54283. f.enable(p.CULL_FACE),
  54284. f.enable(p.DEPTH_TEST),
  54285. f.setDepthWrite(!0),
  54286. e.resetGLState()
  54287. }
  54288. }
  54289. }
  54290. ,
  54291. n.SpritePlugin = function(e, t) {
  54292. function i() {
  54293. var e = new Float32Array([-.5, -.5, 0, 0, .5, -.5, 1, 0, .5, .5, 1, 1, -.5, .5, 0, 1])
  54294. , t = new Uint16Array([0, 1, 2, 0, 2, 3]);
  54295. a = d.createBuffer(),
  54296. s = d.createBuffer(),
  54297. d.bindBuffer(d.ARRAY_BUFFER, a),
  54298. d.bufferData(d.ARRAY_BUFFER, e, d.STATIC_DRAW),
  54299. d.bindBuffer(d.ELEMENT_ARRAY_BUFFER, s),
  54300. d.bufferData(d.ELEMENT_ARRAY_BUFFER, t, d.STATIC_DRAW),
  54301. l = r(),
  54302. c = {
  54303. position: d.getAttribLocation(l, "position"),
  54304. uv: d.getAttribLocation(l, "uv")
  54305. },
  54306. h = {
  54307. uvOffset: d.getUniformLocation(l, "uvOffset"),
  54308. uvScale: d.getUniformLocation(l, "uvScale"),
  54309. rotation: d.getUniformLocation(l, "rotation"),
  54310. scale: d.getUniformLocation(l, "scale"),
  54311. color: d.getUniformLocation(l, "color"),
  54312. map: d.getUniformLocation(l, "map"),
  54313. opacity: d.getUniformLocation(l, "opacity"),
  54314. modelViewMatrix: d.getUniformLocation(l, "modelViewMatrix"),
  54315. projectionMatrix: d.getUniformLocation(l, "projectionMatrix"),
  54316. fogType: d.getUniformLocation(l, "fogType"),
  54317. fogDensity: d.getUniformLocation(l, "fogDensity"),
  54318. fogNear: d.getUniformLocation(l, "fogNear"),
  54319. fogFar: d.getUniformLocation(l, "fogFar"),
  54320. fogColor: d.getUniformLocation(l, "fogColor"),
  54321. alphaTest: d.getUniformLocation(l, "alphaTest")
  54322. };
  54323. var i = document.createElement("canvas");
  54324. i.width = 8,
  54325. i.height = 8;
  54326. var o = i.getContext("2d");
  54327. o.fillStyle = "white",
  54328. o.fillRect(0, 0, 8, 8),
  54329. u = new n.Texture(i),
  54330. u.needsUpdate = !0
  54331. }
  54332. function r() {
  54333. var t = d.createProgram()
  54334. , i = d.createShader(d.VERTEX_SHADER)
  54335. , n = d.createShader(d.FRAGMENT_SHADER);
  54336. 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")),
  54337. 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")),
  54338. d.compileShader(i),
  54339. d.compileShader(n),
  54340. d.attachShader(t, i),
  54341. d.attachShader(t, n),
  54342. d.linkProgram(t),
  54343. t
  54344. }
  54345. function o(e, t) {
  54346. return e.renderOrder !== t.renderOrder ? e.renderOrder - t.renderOrder : e.z !== t.z ? t.z - e.z : t.id - e.id
  54347. }
  54348. 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;
  54349. this.render = function(r, v) {
  54350. if (0 !== t.length) {
  54351. void 0 === l && i(),
  54352. d.useProgram(l),
  54353. p.initAttributes(),
  54354. p.enableAttribute(c.position),
  54355. p.enableAttribute(c.uv),
  54356. p.disableUnusedAttributes(),
  54357. p.disable(d.CULL_FACE),
  54358. p.enable(d.BLEND),
  54359. d.bindBuffer(d.ARRAY_BUFFER, a),
  54360. d.vertexAttribPointer(c.position, 2, d.FLOAT, !1, 16, 0),
  54361. d.vertexAttribPointer(c.uv, 2, d.FLOAT, !1, 16, 8),
  54362. d.bindBuffer(d.ELEMENT_ARRAY_BUFFER, s),
  54363. d.uniformMatrix4fv(h.projectionMatrix, !1, v.projectionMatrix.elements),
  54364. p.activeTexture(d.TEXTURE0),
  54365. d.uniform1i(h.map, 0);
  54366. var A = 0
  54367. , y = 0
  54368. , C = r.fog;
  54369. C ? (d.uniform3f(h.fogColor, C.color.r, C.color.g, C.color.b),
  54370. C instanceof n.Fog ? (d.uniform1f(h.fogNear, C.near),
  54371. d.uniform1f(h.fogFar, C.far),
  54372. d.uniform1i(h.fogType, 1),
  54373. A = 1,
  54374. y = 1) : C instanceof n.FogExp2 && (d.uniform1f(h.fogDensity, C.density),
  54375. d.uniform1i(h.fogType, 2),
  54376. A = 2,
  54377. y = 2)) : (d.uniform1i(h.fogType, 0),
  54378. A = 0,
  54379. y = 0);
  54380. for (var I = 0, E = t.length; I < E; I++) {
  54381. var b = t[I];
  54382. b.modelViewMatrix.multiplyMatrices(v.matrixWorldInverse, b.matrixWorld),
  54383. b.z = -b.modelViewMatrix.elements[14]
  54384. }
  54385. t.sort(o);
  54386. for (var w = [], I = 0, E = t.length; I < E; I++) {
  54387. var b = t[I]
  54388. , _ = b.material;
  54389. d.uniform1f(h.alphaTest, _.alphaTest),
  54390. d.uniformMatrix4fv(h.modelViewMatrix, !1, b.modelViewMatrix.elements),
  54391. b.matrixWorld.decompose(f, g, m),
  54392. w[0] = m.x,
  54393. w[1] = m.y;
  54394. var T = 0;
  54395. r.fog && _.fog && (T = y),
  54396. A !== T && (d.uniform1i(h.fogType, T),
  54397. A = T),
  54398. null !== _.map ? (d.uniform2f(h.uvOffset, _.map.offset.x, _.map.offset.y),
  54399. d.uniform2f(h.uvScale, _.map.repeat.x, _.map.repeat.y)) : (d.uniform2f(h.uvOffset, 0, 0),
  54400. d.uniform2f(h.uvScale, 1, 1)),
  54401. d.uniform1f(h.opacity, _.opacity),
  54402. d.uniform3f(h.color, _.color.r, _.color.g, _.color.b),
  54403. d.uniform1f(h.rotation, _.rotation),
  54404. d.uniform2fv(h.scale, w),
  54405. p.setBlending(_.blending, _.blendEquation, _.blendSrc, _.blendDst),
  54406. p.setDepthTest(_.depthTest),
  54407. p.setDepthWrite(_.depthWrite),
  54408. _.map && _.map.image && _.map.image.width ? e.setTexture(_.map, 0) : e.setTexture(u, 0),
  54409. d.drawElements(d.TRIANGLES, 6, d.UNSIGNED_SHORT, 0)
  54410. }
  54411. p.enable(d.CULL_FACE),
  54412. e.resetGLState()
  54413. }
  54414. }
  54415. }
  54416. ,
  54417. Object.defineProperties(n.Box2.prototype, {
  54418. empty: {
  54419. value: function() {
  54420. return console.warn("THREE.Box2: .empty() has been renamed to .isEmpty()."),
  54421. this.isEmpty()
  54422. }
  54423. },
  54424. isIntersectionBox: {
  54425. value: function(e) {
  54426. return console.warn("THREE.Box2: .isIntersectionBox() has been renamed to .intersectsBox()."),
  54427. this.intersectsBox(e)
  54428. }
  54429. }
  54430. }),
  54431. Object.defineProperties(n.Box3.prototype, {
  54432. empty: {
  54433. value: function() {
  54434. return console.warn("THREE.Box3: .empty() has been renamed to .isEmpty()."),
  54435. this.isEmpty()
  54436. }
  54437. },
  54438. isIntersectionBox: {
  54439. value: function(e) {
  54440. return console.warn("THREE.Box3: .isIntersectionBox() has been renamed to .intersectsBox()."),
  54441. this.intersectsBox(e)
  54442. }
  54443. },
  54444. isIntersectionSphere: {
  54445. value: function(e) {
  54446. return console.warn("THREE.Box3: .isIntersectionSphere() has been renamed to .intersectsSphere()."),
  54447. this.intersectsSphere(e)
  54448. }
  54449. }
  54450. }),
  54451. Object.defineProperties(n.Matrix3.prototype, {
  54452. multiplyVector3: {
  54453. value: function(e) {
  54454. return console.warn("THREE.Matrix3: .multiplyVector3() has been removed. Use vector.applyMatrix3( matrix ) instead."),
  54455. e.applyMatrix3(this)
  54456. }
  54457. },
  54458. multiplyVector3Array: {
  54459. value: function(e) {
  54460. return console.warn("THREE.Matrix3: .multiplyVector3Array() has been renamed. Use matrix.applyToVector3Array( array ) instead."),
  54461. this.applyToVector3Array(e)
  54462. }
  54463. }
  54464. }),
  54465. Object.defineProperties(n.Matrix4.prototype, {
  54466. extractPosition: {
  54467. value: function(e) {
  54468. return console.warn("THREE.Matrix4: .extractPosition() has been renamed to .copyPosition()."),
  54469. this.copyPosition(e)
  54470. }
  54471. },
  54472. setRotationFromQuaternion: {
  54473. value: function(e) {
  54474. return console.warn("THREE.Matrix4: .setRotationFromQuaternion() has been renamed to .makeRotationFromQuaternion()."),
  54475. this.makeRotationFromQuaternion(e)
  54476. }
  54477. },
  54478. multiplyVector3: {
  54479. value: function(e) {
  54480. return console.warn("THREE.Matrix4: .multiplyVector3() has been removed. Use vector.applyMatrix4( matrix ) or vector.applyProjection( matrix ) instead."),
  54481. e.applyProjection(this)
  54482. }
  54483. },
  54484. multiplyVector4: {
  54485. value: function(e) {
  54486. return console.warn("THREE.Matrix4: .multiplyVector4() has been removed. Use vector.applyMatrix4( matrix ) instead."),
  54487. e.applyMatrix4(this)
  54488. }
  54489. },
  54490. multiplyVector3Array: {
  54491. value: function(e) {
  54492. return console.warn("THREE.Matrix4: .multiplyVector3Array() has been renamed. Use matrix.applyToVector3Array( array ) instead."),
  54493. this.applyToVector3Array(e)
  54494. }
  54495. },
  54496. rotateAxis: {
  54497. value: function(e) {
  54498. console.warn("THREE.Matrix4: .rotateAxis() has been removed. Use Vector3.transformDirection( matrix ) instead."),
  54499. e.transformDirection(this)
  54500. }
  54501. },
  54502. crossVector: {
  54503. value: function(e) {
  54504. return console.warn("THREE.Matrix4: .crossVector() has been removed. Use vector.applyMatrix4( matrix ) instead."),
  54505. e.applyMatrix4(this)
  54506. }
  54507. },
  54508. translate: {
  54509. value: function(e) {
  54510. console.error("THREE.Matrix4: .translate() has been removed.")
  54511. }
  54512. },
  54513. rotateX: {
  54514. value: function(e) {
  54515. console.error("THREE.Matrix4: .rotateX() has been removed.")
  54516. }
  54517. },
  54518. rotateY: {
  54519. value: function(e) {
  54520. console.error("THREE.Matrix4: .rotateY() has been removed.")
  54521. }
  54522. },
  54523. rotateZ: {
  54524. value: function(e) {
  54525. console.error("THREE.Matrix4: .rotateZ() has been removed.")
  54526. }
  54527. },
  54528. rotateByAxis: {
  54529. value: function(e, t) {
  54530. console.error("THREE.Matrix4: .rotateByAxis() has been removed.")
  54531. }
  54532. }
  54533. }),
  54534. Object.defineProperties(n.Plane.prototype, {
  54535. isIntersectionLine: {
  54536. value: function(e) {
  54537. return console.warn("THREE.Plane: .isIntersectionLine() has been renamed to .intersectsLine()."),
  54538. this.intersectsLine(e)
  54539. }
  54540. }
  54541. }),
  54542. Object.defineProperties(n.Quaternion.prototype, {
  54543. multiplyVector3: {
  54544. value: function(e) {
  54545. return console.warn("THREE.Quaternion: .multiplyVector3() has been removed. Use is now vector.applyQuaternion( quaternion ) instead."),
  54546. e.applyQuaternion(this)
  54547. }
  54548. }
  54549. }),
  54550. Object.defineProperties(n.Ray.prototype, {
  54551. isIntersectionBox: {
  54552. value: function(e) {
  54553. return console.warn("THREE.Ray: .isIntersectionBox() has been renamed to .intersectsBox()."),
  54554. this.intersectsBox(e)
  54555. }
  54556. },
  54557. isIntersectionPlane: {
  54558. value: function(e) {
  54559. return console.warn("THREE.Ray: .isIntersectionPlane() has been renamed to .intersectsPlane()."),
  54560. this.intersectsPlane(e)
  54561. }
  54562. },
  54563. isIntersectionSphere: {
  54564. value: function(e) {
  54565. return console.warn("THREE.Ray: .isIntersectionSphere() has been renamed to .intersectsSphere()."),
  54566. this.intersectsSphere(e)
  54567. }
  54568. }
  54569. }),
  54570. Object.defineProperties(n.Vector3.prototype, {
  54571. setEulerFromRotationMatrix: {
  54572. value: function() {
  54573. console.error("THREE.Vector3: .setEulerFromRotationMatrix() has been removed. Use Euler.setFromRotationMatrix() instead.")
  54574. }
  54575. },
  54576. setEulerFromQuaternion: {
  54577. value: function() {
  54578. console.error("THREE.Vector3: .setEulerFromQuaternion() has been removed. Use Euler.setFromQuaternion() instead.")
  54579. }
  54580. },
  54581. getPositionFromMatrix: {
  54582. value: function(e) {
  54583. return console.warn("THREE.Vector3: .getPositionFromMatrix() has been renamed to .setFromMatrixPosition()."),
  54584. this.setFromMatrixPosition(e)
  54585. }
  54586. },
  54587. getScaleFromMatrix: {
  54588. value: function(e) {
  54589. return console.warn("THREE.Vector3: .getScaleFromMatrix() has been renamed to .setFromMatrixScale()."),
  54590. this.setFromMatrixScale(e)
  54591. }
  54592. },
  54593. getColumnFromMatrix: {
  54594. value: function(e, t) {
  54595. return console.warn("THREE.Vector3: .getColumnFromMatrix() has been renamed to .setFromMatrixColumn()."),
  54596. this.setFromMatrixColumn(e, t)
  54597. }
  54598. }
  54599. }),
  54600. n.Face4 = function(e, t, i, r, o, a, s) {
  54601. return console.warn("THREE.Face4 has been removed. A THREE.Face3 will be created instead."),
  54602. new n.Face3(e,t,i,o,a,s)
  54603. }
  54604. ,
  54605. n.Vertex = function(e, t, i) {
  54606. return console.warn("THREE.Vertex has been removed. Use THREE.Vector3 instead."),
  54607. new n.Vector3(e,t,i)
  54608. }
  54609. ,
  54610. Object.defineProperties(n.Object3D.prototype, {
  54611. eulerOrder: {
  54612. get: function() {
  54613. return console.warn("THREE.Object3D: .eulerOrder is now .rotation.order."),
  54614. this.rotation.order
  54615. },
  54616. set: function(e) {
  54617. console.warn("THREE.Object3D: .eulerOrder is now .rotation.order."),
  54618. this.rotation.order = e
  54619. }
  54620. },
  54621. getChildByName: {
  54622. value: function(e) {
  54623. return console.warn("THREE.Object3D: .getChildByName() has been renamed to .getObjectByName()."),
  54624. this.getObjectByName(e)
  54625. }
  54626. },
  54627. renderDepth: {
  54628. set: function(e) {
  54629. console.warn("THREE.Object3D: .renderDepth has been removed. Use .renderOrder, instead.")
  54630. }
  54631. },
  54632. translate: {
  54633. value: function(e, t) {
  54634. return console.warn("THREE.Object3D: .translate() has been removed. Use .translateOnAxis( axis, distance ) instead."),
  54635. this.translateOnAxis(t, e)
  54636. }
  54637. },
  54638. useQuaternion: {
  54639. get: function() {
  54640. console.warn("THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.")
  54641. },
  54642. set: function(e) {
  54643. console.warn("THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.")
  54644. }
  54645. }
  54646. }),
  54647. Object.defineProperties(n, {
  54648. PointCloud: {
  54649. value: function(e, t) {
  54650. return console.warn("THREE.PointCloud has been renamed to THREE.Points."),
  54651. new n.Points(e,t)
  54652. }
  54653. },
  54654. ParticleSystem: {
  54655. value: function(e, t) {
  54656. return console.warn("THREE.ParticleSystem has been renamed to THREE.Points."),
  54657. new n.Points(e,t)
  54658. }
  54659. }
  54660. }),
  54661. Object.defineProperties(n.Light.prototype, {
  54662. onlyShadow: {
  54663. set: function(e) {
  54664. console.warn("THREE.Light: .onlyShadow has been removed.")
  54665. }
  54666. },
  54667. shadowCameraFov: {
  54668. set: function(e) {
  54669. console.warn("THREE.Light: .shadowCameraFov is now .shadow.camera.fov."),
  54670. this.shadow.camera.fov = e
  54671. }
  54672. },
  54673. shadowCameraLeft: {
  54674. set: function(e) {
  54675. console.warn("THREE.Light: .shadowCameraLeft is now .shadow.camera.left."),
  54676. this.shadow.camera.left = e
  54677. }
  54678. },
  54679. shadowCameraRight: {
  54680. set: function(e) {
  54681. console.warn("THREE.Light: .shadowCameraRight is now .shadow.camera.right."),
  54682. this.shadow.camera.right = e
  54683. }
  54684. },
  54685. shadowCameraTop: {
  54686. set: function(e) {
  54687. console.warn("THREE.Light: .shadowCameraTop is now .shadow.camera.top."),
  54688. this.shadow.camera.top = e
  54689. }
  54690. },
  54691. shadowCameraBottom: {
  54692. set: function(e) {
  54693. console.warn("THREE.Light: .shadowCameraBottom is now .shadow.camera.bottom."),
  54694. this.shadow.camera.bottom = e
  54695. }
  54696. },
  54697. shadowCameraNear: {
  54698. set: function(e) {
  54699. console.warn("THREE.Light: .shadowCameraNear is now .shadow.camera.near."),
  54700. this.shadow.camera.near = e
  54701. }
  54702. },
  54703. shadowCameraFar: {
  54704. set: function(e) {
  54705. console.warn("THREE.Light: .shadowCameraFar is now .shadow.camera.far."),
  54706. this.shadow.camera.far = e
  54707. }
  54708. },
  54709. shadowCameraVisible: {
  54710. set: function(e) {
  54711. console.warn("THREE.Light: .shadowCameraVisible has been removed. Use new THREE.CameraHelper( light.shadow.camera ) instead.")
  54712. }
  54713. },
  54714. shadowBias: {
  54715. set: function(e) {
  54716. console.warn("THREE.Light: .shadowBias is now .shadow.bias."),
  54717. this.shadow.bias = e
  54718. }
  54719. },
  54720. shadowDarkness: {
  54721. set: function(e) {
  54722. console.warn("THREE.Light: .shadowDarkness has been removed.")
  54723. }
  54724. },
  54725. shadowMapWidth: {
  54726. set: function(e) {
  54727. console.warn("THREE.Light: .shadowMapWidth is now .shadow.mapSize.width."),
  54728. this.shadow.mapSize.width = e
  54729. }
  54730. },
  54731. shadowMapHeight: {
  54732. set: function(e) {
  54733. console.warn("THREE.Light: .shadowMapHeight is now .shadow.mapSize.height."),
  54734. this.shadow.mapSize.height = e
  54735. }
  54736. }
  54737. }),
  54738. Object.defineProperties(n.BufferAttribute.prototype, {
  54739. length: {
  54740. get: function() {
  54741. return console.warn("THREE.BufferAttribute: .length has been deprecated. Please use .count."),
  54742. this.array.length
  54743. }
  54744. }
  54745. }),
  54746. Object.defineProperties(n.BufferGeometry.prototype, {
  54747. drawcalls: {
  54748. get: function() {
  54749. return console.error("THREE.BufferGeometry: .drawcalls has been renamed to .groups."),
  54750. this.groups
  54751. }
  54752. },
  54753. offsets: {
  54754. get: function() {
  54755. return console.warn("THREE.BufferGeometry: .offsets has been renamed to .groups."),
  54756. this.groups
  54757. }
  54758. },
  54759. addIndex: {
  54760. value: function(e) {
  54761. console.warn("THREE.BufferGeometry: .addIndex() has been renamed to .setIndex()."),
  54762. this.setIndex(e)
  54763. }
  54764. },
  54765. addDrawCall: {
  54766. value: function(e, t, i) {
  54767. void 0 !== i && console.warn("THREE.BufferGeometry: .addDrawCall() no longer supports indexOffset."),
  54768. console.warn("THREE.BufferGeometry: .addDrawCall() is now .addGroup()."),
  54769. this.addGroup(e, t)
  54770. }
  54771. },
  54772. clearDrawCalls: {
  54773. value: function() {
  54774. console.warn("THREE.BufferGeometry: .clearDrawCalls() is now .clearGroups()."),
  54775. this.clearGroups()
  54776. }
  54777. },
  54778. computeTangents: {
  54779. value: function() {
  54780. console.warn("THREE.BufferGeometry: .computeTangents() has been removed.")
  54781. }
  54782. },
  54783. computeOffsets: {
  54784. value: function() {
  54785. console.warn("THREE.BufferGeometry: .computeOffsets() has been removed.")
  54786. }
  54787. }
  54788. }),
  54789. Object.defineProperties(n.Material.prototype, {
  54790. wrapAround: {
  54791. get: function() {
  54792. console.warn("THREE." + this.type + ": .wrapAround has been removed.")
  54793. },
  54794. set: function(e) {
  54795. console.warn("THREE." + this.type + ": .wrapAround has been removed.")
  54796. }
  54797. },
  54798. wrapRGB: {
  54799. get: function() {
  54800. return console.warn("THREE." + this.type + ": .wrapRGB has been removed."),
  54801. new n.Color
  54802. }
  54803. }
  54804. }),
  54805. Object.defineProperties(n, {
  54806. PointCloudMaterial: {
  54807. value: function(e) {
  54808. return console.warn("THREE.PointCloudMaterial has been renamed to THREE.PointsMaterial."),
  54809. new n.PointsMaterial(e)
  54810. }
  54811. },
  54812. ParticleBasicMaterial: {
  54813. value: function(e) {
  54814. return console.warn("THREE.ParticleBasicMaterial has been renamed to THREE.PointsMaterial."),
  54815. new n.PointsMaterial(e)
  54816. }
  54817. },
  54818. ParticleSystemMaterial: {
  54819. value: function(e) {
  54820. return console.warn("THREE.ParticleSystemMaterial has been renamed to THREE.PointsMaterial."),
  54821. new n.PointsMaterial(e)
  54822. }
  54823. }
  54824. }),
  54825. Object.defineProperties(n.MeshPhongMaterial.prototype, {
  54826. metal: {
  54827. get: function() {
  54828. return console.warn("THREE.MeshPhongMaterial: .metal has been removed. Use THREE.MeshStandardMaterial instead."),
  54829. !1
  54830. },
  54831. set: function(e) {
  54832. console.warn("THREE.MeshPhongMaterial: .metal has been removed. Use THREE.MeshStandardMaterial instead")
  54833. }
  54834. }
  54835. }),
  54836. Object.defineProperties(n.ShaderMaterial.prototype, {
  54837. derivatives: {
  54838. get: function() {
  54839. return console.warn("THREE.ShaderMaterial: .derivatives has been moved to .extensions.derivatives."),
  54840. this.extensions.derivatives
  54841. },
  54842. set: function(e) {
  54843. console.warn("THREE. ShaderMaterial: .derivatives has been moved to .extensions.derivatives."),
  54844. this.extensions.derivatives = e
  54845. }
  54846. }
  54847. }),
  54848. Object.defineProperties(n.WebGLRenderer.prototype, {
  54849. supportsFloatTextures: {
  54850. value: function() {
  54851. return console.warn("THREE.WebGLRenderer: .supportsFloatTextures() is now .extensions.get( 'OES_texture_float' )."),
  54852. this.extensions.get("OES_texture_float")
  54853. }
  54854. },
  54855. supportsHalfFloatTextures: {
  54856. value: function() {
  54857. return console.warn("THREE.WebGLRenderer: .supportsHalfFloatTextures() is now .extensions.get( 'OES_texture_half_float' )."),
  54858. this.extensions.get("OES_texture_half_float")
  54859. }
  54860. },
  54861. supportsStandardDerivatives: {
  54862. value: function() {
  54863. return console.warn("THREE.WebGLRenderer: .supportsStandardDerivatives() is now .extensions.get( 'OES_standard_derivatives' )."),
  54864. this.extensions.get("OES_standard_derivatives")
  54865. }
  54866. },
  54867. supportsCompressedTextureS3TC: {
  54868. value: function() {
  54869. return console.warn("THREE.WebGLRenderer: .supportsCompressedTextureS3TC() is now .extensions.get( 'WEBGL_compressed_texture_s3tc' )."),
  54870. this.extensions.get("WEBGL_compressed_texture_s3tc")
  54871. }
  54872. },
  54873. supportsCompressedTexturePVRTC: {
  54874. value: function() {
  54875. return console.warn("THREE.WebGLRenderer: .supportsCompressedTexturePVRTC() is now .extensions.get( 'WEBGL_compressed_texture_pvrtc' )."),
  54876. this.extensions.get("WEBGL_compressed_texture_pvrtc")
  54877. }
  54878. },
  54879. supportsBlendMinMax: {
  54880. value: function() {
  54881. return console.warn("THREE.WebGLRenderer: .supportsBlendMinMax() is now .extensions.get( 'EXT_blend_minmax' )."),
  54882. this.extensions.get("EXT_blend_minmax")
  54883. }
  54884. },
  54885. supportsVertexTextures: {
  54886. value: function() {
  54887. return this.capabilities.vertexTextures
  54888. }
  54889. },
  54890. supportsInstancedArrays: {
  54891. value: function() {
  54892. return console.warn("THREE.WebGLRenderer: .supportsInstancedArrays() is now .extensions.get( 'ANGLE_instanced_arrays' )."),
  54893. this.extensions.get("ANGLE_instanced_arrays")
  54894. }
  54895. },
  54896. enableScissorTest: {
  54897. value: function(e) {
  54898. console.warn("THREE.WebGLRenderer: .enableScissorTest() is now .setScissorTest()."),
  54899. this.setScissorTest(e)
  54900. }
  54901. },
  54902. initMaterial: {
  54903. value: function() {
  54904. console.warn("THREE.WebGLRenderer: .initMaterial() has been removed.")
  54905. }
  54906. },
  54907. addPrePlugin: {
  54908. value: function() {
  54909. console.warn("THREE.WebGLRenderer: .addPrePlugin() has been removed.")
  54910. }
  54911. },
  54912. addPostPlugin: {
  54913. value: function() {
  54914. console.warn("THREE.WebGLRenderer: .addPostPlugin() has been removed.")
  54915. }
  54916. },
  54917. updateShadowMap: {
  54918. value: function() {
  54919. console.warn("THREE.WebGLRenderer: .updateShadowMap() has been removed.")
  54920. }
  54921. },
  54922. shadowMapEnabled: {
  54923. get: function() {
  54924. return this.shadowMap.enabled
  54925. },
  54926. set: function(e) {
  54927. console.warn("THREE.WebGLRenderer: .shadowMapEnabled is now .shadowMap.enabled."),
  54928. this.shadowMap.enabled = e
  54929. }
  54930. },
  54931. shadowMapType: {
  54932. get: function() {
  54933. return this.shadowMap.type
  54934. },
  54935. set: function(e) {
  54936. console.warn("THREE.WebGLRenderer: .shadowMapType is now .shadowMap.type."),
  54937. this.shadowMap.type = e
  54938. }
  54939. },
  54940. shadowMapCullFace: {
  54941. get: function() {
  54942. return this.shadowMap.cullFace
  54943. },
  54944. set: function(e) {
  54945. console.warn("THREE.WebGLRenderer: .shadowMapCullFace is now .shadowMap.cullFace."),
  54946. this.shadowMap.cullFace = e
  54947. }
  54948. }
  54949. }),
  54950. Object.defineProperties(n.WebGLRenderTarget.prototype, {
  54951. wrapS: {
  54952. get: function() {
  54953. return console.warn("THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS."),
  54954. this.texture.wrapS
  54955. },
  54956. set: function(e) {
  54957. console.warn("THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS."),
  54958. this.texture.wrapS = e
  54959. }
  54960. },
  54961. wrapT: {
  54962. get: function() {
  54963. return console.warn("THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT."),
  54964. this.texture.wrapT
  54965. },
  54966. set: function(e) {
  54967. console.warn("THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT."),
  54968. this.texture.wrapT = e
  54969. }
  54970. },
  54971. magFilter: {
  54972. get: function() {
  54973. return console.warn("THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter."),
  54974. this.texture.magFilter
  54975. },
  54976. set: function(e) {
  54977. console.warn("THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter."),
  54978. this.texture.magFilter = e
  54979. }
  54980. },
  54981. minFilter: {
  54982. get: function() {
  54983. return console.warn("THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter."),
  54984. this.texture.minFilter
  54985. },
  54986. set: function(e) {
  54987. console.warn("THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter."),
  54988. this.texture.minFilter = e
  54989. }
  54990. },
  54991. anisotropy: {
  54992. get: function() {
  54993. return console.warn("THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy."),
  54994. this.texture.anisotropy
  54995. },
  54996. set: function(e) {
  54997. console.warn("THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy."),
  54998. this.texture.anisotropy = e
  54999. }
  55000. },
  55001. offset: {
  55002. get: function() {
  55003. return console.warn("THREE.WebGLRenderTarget: .offset is now .texture.offset."),
  55004. this.texture.offset
  55005. },
  55006. set: function(e) {
  55007. console.warn("THREE.WebGLRenderTarget: .offset is now .texture.offset."),
  55008. this.texture.offset = e
  55009. }
  55010. },
  55011. repeat: {
  55012. get: function() {
  55013. return console.warn("THREE.WebGLRenderTarget: .repeat is now .texture.repeat."),
  55014. this.texture.repeat
  55015. },
  55016. set: function(e) {
  55017. console.warn("THREE.WebGLRenderTarget: .repeat is now .texture.repeat."),
  55018. this.texture.repeat = e
  55019. }
  55020. },
  55021. format: {
  55022. get: function() {
  55023. return console.warn("THREE.WebGLRenderTarget: .format is now .texture.format."),
  55024. this.texture.format
  55025. },
  55026. set: function(e) {
  55027. console.warn("THREE.WebGLRenderTarget: .format is now .texture.format."),
  55028. this.texture.format = e
  55029. }
  55030. },
  55031. type: {
  55032. get: function() {
  55033. return console.warn("THREE.WebGLRenderTarget: .type is now .texture.type."),
  55034. this.texture.type
  55035. },
  55036. set: function(e) {
  55037. console.warn("THREE.WebGLRenderTarget: .type is now .texture.type."),
  55038. this.texture.type = e
  55039. }
  55040. },
  55041. generateMipmaps: {
  55042. get: function() {
  55043. return console.warn("THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps."),
  55044. this.texture.generateMipmaps
  55045. },
  55046. set: function(e) {
  55047. console.warn("THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps."),
  55048. this.texture.generateMipmaps = e
  55049. }
  55050. }
  55051. }),
  55052. n.GeometryUtils = {
  55053. merge: function(e, t, i) {
  55054. console.warn("THREE.GeometryUtils: .merge() has been moved to Geometry. Use geometry.merge( geometry2, matrix, materialIndexOffset ) instead.");
  55055. var r;
  55056. t instanceof n.Mesh && (t.matrixAutoUpdate && t.updateMatrix(),
  55057. r = t.matrix,
  55058. t = t.geometry),
  55059. e.merge(t, r, i)
  55060. },
  55061. center: function(e) {
  55062. return console.warn("THREE.GeometryUtils: .center() has been moved to Geometry. Use geometry.center() instead."),
  55063. e.center()
  55064. }
  55065. },
  55066. n.ImageUtils = {
  55067. crossOrigin: void 0,
  55068. loadTexture: function(e, t, i, r) {
  55069. console.warn("THREE.ImageUtils.loadTexture has been deprecated. Use THREE.TextureLoader() instead.");
  55070. var o = new n.TextureLoader;
  55071. o.setCrossOrigin(this.crossOrigin);
  55072. var a = o.load(e, i, void 0, r);
  55073. return t && (a.mapping = t),
  55074. a
  55075. },
  55076. loadTextureCube: function(e, t, i, r) {
  55077. console.warn("THREE.ImageUtils.loadTextureCube has been deprecated. Use THREE.CubeTextureLoader() instead.");
  55078. var o = new n.CubeTextureLoader;
  55079. o.setCrossOrigin(this.crossOrigin);
  55080. var a = o.load(e, i, void 0, r);
  55081. return t && (a.mapping = t),
  55082. a
  55083. },
  55084. loadCompressedTexture: function() {
  55085. console.error("THREE.ImageUtils.loadCompressedTexture has been removed. Use THREE.DDSLoader instead.")
  55086. },
  55087. loadCompressedTextureCube: function() {
  55088. console.error("THREE.ImageUtils.loadCompressedTextureCube has been removed. Use THREE.DDSLoader instead.")
  55089. }
  55090. },
  55091. n.Projector = function() {
  55092. console.error("THREE.Projector has been moved to /examples/js/renderers/Projector.js."),
  55093. this.projectVector = function(e, t) {
  55094. console.warn("THREE.Projector: .projectVector() is now vector.project()."),
  55095. e.project(t)
  55096. }
  55097. ,
  55098. this.unprojectVector = function(e, t) {
  55099. console.warn("THREE.Projector: .unprojectVector() is now vector.unproject()."),
  55100. e.unproject(t)
  55101. }
  55102. ,
  55103. this.pickingRay = function(e, t) {
  55104. console.error("THREE.Projector: .pickingRay() is now raycaster.setFromCamera().")
  55105. }
  55106. }
  55107. ,
  55108. n.CanvasRenderer = function() {
  55109. console.error("THREE.CanvasRenderer has been moved to /examples/js/renderers/CanvasRenderer.js"),
  55110. this.domElement = document.createElement("canvas"),
  55111. this.clear = function() {}
  55112. ,
  55113. this.render = function() {}
  55114. ,
  55115. this.setClearColor = function() {}
  55116. ,
  55117. this.setSize = function() {}
  55118. }
  55119. ,
  55120. n.MeshFaceMaterial = n.MultiMaterial,
  55121. n.CurveUtils = {
  55122. tangentQuadraticBezier: function(e, t, i, n) {
  55123. return 2 * (1 - e) * (i - t) + 2 * e * (n - i)
  55124. },
  55125. tangentCubicBezier: function(e, t, i, n, r) {
  55126. 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
  55127. },
  55128. tangentSpline: function(e, t, i, n, r) {
  55129. var o = 6 * e * e - 6 * e
  55130. , a = 3 * e * e - 4 * e + 1
  55131. , s = -6 * e * e + 6 * e
  55132. , l = 3 * e * e - 2 * e;
  55133. return o + a + s + l
  55134. },
  55135. interpolate: function(e, t, i, n, r) {
  55136. var o = .5 * (i - e)
  55137. , a = .5 * (n - t)
  55138. , s = r * r
  55139. , l = r * s;
  55140. return (2 * t - 2 * i + o + a) * l + (-3 * t + 3 * i - 2 * o - a) * s + o * r + t
  55141. }
  55142. },
  55143. n.SceneUtils = {
  55144. createMultiMaterialObject: function(e, t) {
  55145. for (var i = new n.Group, r = 0, o = t.length; r < o; r++)
  55146. i.add(new n.Mesh(e,t[r]));
  55147. return i
  55148. },
  55149. detach: function(e, t, i) {
  55150. e.applyMatrix(t.matrixWorld),
  55151. t.remove(e),
  55152. i.add(e)
  55153. },
  55154. attach: function(e, t, i) {
  55155. var r = new n.Matrix4;
  55156. r.getInverse(i.matrixWorld),
  55157. e.applyMatrix(r),
  55158. t.remove(e),
  55159. i.add(e)
  55160. }
  55161. },
  55162. n.ShapeUtils = {
  55163. area: function(e) {
  55164. for (var t = e.length, i = 0, n = t - 1, r = 0; r < t; n = r++)
  55165. i += e[n].x * e[r].y - e[r].x * e[n].y;
  55166. return .5 * i
  55167. },
  55168. triangulate: function() {
  55169. function e(e, t, i, n, r, o) {
  55170. var a, s, l, c, h, u, d, p, f;
  55171. if (s = e[o[t]].x,
  55172. l = e[o[t]].y,
  55173. c = e[o[i]].x,
  55174. h = e[o[i]].y,
  55175. u = e[o[n]].x,
  55176. d = e[o[n]].y,
  55177. Number.EPSILON > (c - s) * (d - l) - (h - l) * (u - s))
  55178. return !1;
  55179. var g, m, v, A, y, C, I, E, b, w, _, T, x, S, M;
  55180. for (g = u - c,
  55181. m = d - h,
  55182. v = s - u,
  55183. A = l - d,
  55184. y = c - s,
  55185. C = h - l,
  55186. a = 0; a < r; a++)
  55187. if (p = e[o[a]].x,
  55188. f = e[o[a]].y,
  55189. !(p === s && f === l || p === c && f === h || p === u && f === d) && (I = p - s,
  55190. E = f - l,
  55191. b = p - c,
  55192. w = f - h,
  55193. _ = p - u,
  55194. T = f - d,
  55195. M = g * w - m * b,
  55196. x = y * E - C * I,
  55197. S = v * T - A * _,
  55198. M >= -Number.EPSILON && S >= -Number.EPSILON && x >= -Number.EPSILON))
  55199. return !1;
  55200. return !0
  55201. }
  55202. return function(t, i) {
  55203. var r = t.length;
  55204. if (r < 3)
  55205. return null;
  55206. var o, a, s, l = [], c = [], h = [];
  55207. if (n.ShapeUtils.area(t) > 0)
  55208. for (a = 0; a < r; a++)
  55209. c[a] = a;
  55210. else
  55211. for (a = 0; a < r; a++)
  55212. c[a] = r - 1 - a;
  55213. var u = r
  55214. , d = 2 * u;
  55215. for (a = u - 1; u > 2; ) {
  55216. if (d-- <= 0)
  55217. return console.warn("THREE.ShapeUtils: Unable to triangulate polygon! in triangulate()"),
  55218. i ? h : l;
  55219. if (o = a,
  55220. u <= o && (o = 0),
  55221. a = o + 1,
  55222. u <= a && (a = 0),
  55223. s = a + 1,
  55224. u <= s && (s = 0),
  55225. e(t, o, a, s, u, c)) {
  55226. var p, f, g, m, v;
  55227. for (p = c[o],
  55228. f = c[a],
  55229. g = c[s],
  55230. l.push([t[p], t[f], t[g]]),
  55231. h.push([c[o], c[a], c[s]]),
  55232. m = a,
  55233. v = a + 1; v < u; m++,
  55234. v++)
  55235. c[m] = c[v];
  55236. u--,
  55237. d = 2 * u
  55238. }
  55239. }
  55240. return i ? h : l
  55241. }
  55242. }(),
  55243. triangulateShape: function(e, t) {
  55244. function i(e, t, i) {
  55245. 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
  55246. }
  55247. function r(e, t, n, r, o) {
  55248. var a = t.x - e.x
  55249. , s = t.y - e.y
  55250. , l = r.x - n.x
  55251. , c = r.y - n.y
  55252. , h = e.x - n.x
  55253. , u = e.y - n.y
  55254. , d = s * l - a * c
  55255. , p = s * h - a * u;
  55256. if (Math.abs(d) > Number.EPSILON) {
  55257. var f;
  55258. if (d > 0) {
  55259. if (p < 0 || p > d)
  55260. return [];
  55261. if (f = c * h - l * u,
  55262. f < 0 || f > d)
  55263. return []
  55264. } else {
  55265. if (p > 0 || p < d)
  55266. return [];
  55267. if (f = c * h - l * u,
  55268. f > 0 || f < d)
  55269. return []
  55270. }
  55271. if (0 === f)
  55272. return !o || 0 !== p && p !== d ? [e] : [];
  55273. if (f === d)
  55274. return !o || 0 !== p && p !== d ? [t] : [];
  55275. if (0 === p)
  55276. return [n];
  55277. if (p === d)
  55278. return [r];
  55279. var g = f / d;
  55280. return [{
  55281. x: e.x + g * a,
  55282. y: e.y + g * s
  55283. }]
  55284. }
  55285. if (0 !== p || c * h !== l * u)
  55286. return [];
  55287. var m = 0 === a && 0 === s
  55288. , v = 0 === l && 0 === c;
  55289. if (m && v)
  55290. return e.x !== n.x || e.y !== n.y ? [] : [e];
  55291. if (m)
  55292. return i(n, r, e) ? [e] : [];
  55293. if (v)
  55294. return i(e, t, n) ? [n] : [];
  55295. var A, y, C, I, E, b, w, _;
  55296. return 0 !== a ? (e.x < t.x ? (A = e,
  55297. C = e.x,
  55298. y = t,
  55299. I = t.x) : (A = t,
  55300. C = t.x,
  55301. y = e,
  55302. I = e.x),
  55303. n.x < r.x ? (E = n,
  55304. w = n.x,
  55305. b = r,
  55306. _ = r.x) : (E = r,
  55307. w = r.x,
  55308. b = n,
  55309. _ = n.x)) : (e.y < t.y ? (A = e,
  55310. C = e.y,
  55311. y = t,
  55312. I = t.y) : (A = t,
  55313. C = t.y,
  55314. y = e,
  55315. I = e.y),
  55316. n.y < r.y ? (E = n,
  55317. w = n.y,
  55318. b = r,
  55319. _ = r.y) : (E = r,
  55320. w = r.y,
  55321. b = n,
  55322. _ = n.y)),
  55323. C <= w ? I < w ? [] : I === w ? o ? [] : [E] : I <= _ ? [E, y] : [E, b] : C > _ ? [] : C === _ ? o ? [] : [A] : I <= _ ? [A, y] : [A, b]
  55324. }
  55325. function o(e, t, i, n) {
  55326. var r = t.x - e.x
  55327. , o = t.y - e.y
  55328. , a = i.x - e.x
  55329. , s = i.y - e.y
  55330. , l = n.x - e.x
  55331. , c = n.y - e.y
  55332. , h = r * s - o * a
  55333. , u = r * c - o * l;
  55334. if (Math.abs(h) > Number.EPSILON) {
  55335. var d = l * s - c * a;
  55336. return h > 0 ? u >= 0 && d >= 0 : u >= 0 || d >= 0
  55337. }
  55338. return u > 0
  55339. }
  55340. function a(e, t) {
  55341. function i(e, t) {
  55342. var i = A.length - 1
  55343. , n = e - 1;
  55344. n < 0 && (n = i);
  55345. var r = e + 1;
  55346. r > i && (r = 0);
  55347. var a = o(A[e], A[n], A[r], s[t]);
  55348. if (!a)
  55349. return !1;
  55350. var l = s.length - 1
  55351. , c = t - 1;
  55352. c < 0 && (c = l);
  55353. var h = t + 1;
  55354. return h > l && (h = 0),
  55355. a = o(s[t], s[c], s[h], A[e]),
  55356. !!a
  55357. }
  55358. function n(e, t) {
  55359. var i, n, o;
  55360. for (i = 0; i < A.length; i++)
  55361. if (n = i + 1,
  55362. n %= A.length,
  55363. o = r(e, t, A[i], A[n], !0),
  55364. o.length > 0)
  55365. return !0;
  55366. return !1
  55367. }
  55368. function a(e, i) {
  55369. var n, o, a, s, l;
  55370. for (n = 0; n < y.length; n++)
  55371. for (o = t[y[n]],
  55372. a = 0; a < o.length; a++)
  55373. if (s = a + 1,
  55374. s %= o.length,
  55375. l = r(e, i, o[a], o[s], !0),
  55376. l.length > 0)
  55377. return !0;
  55378. return !1
  55379. }
  55380. 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++)
  55381. y.push(I);
  55382. for (var b = 0, w = 2 * y.length; y.length > 0; ) {
  55383. if (w--,
  55384. w < 0) {
  55385. console.log("Infinite Loop! Holes left:" + y.length + ", Probably Hole outside Shape!");
  55386. break
  55387. }
  55388. for (c = b; c < A.length; c++) {
  55389. h = A[c],
  55390. l = -1;
  55391. for (var I = 0; I < y.length; I++)
  55392. if (d = y[I],
  55393. p = h.x + ":" + h.y + ":" + d,
  55394. void 0 === C[p]) {
  55395. s = t[d];
  55396. for (var _ = 0; _ < s.length; _++)
  55397. if (u = s[_],
  55398. i(c, _) && !n(h, u) && !a(h, u)) {
  55399. l = _,
  55400. y.splice(I, 1),
  55401. f = A.slice(0, c + 1),
  55402. g = A.slice(c),
  55403. m = s.slice(l),
  55404. v = s.slice(0, l + 1),
  55405. A = f.concat(m).concat(v).concat(g),
  55406. b = c;
  55407. break
  55408. }
  55409. if (l >= 0)
  55410. break;
  55411. C[p] = !0
  55412. }
  55413. if (l >= 0)
  55414. break
  55415. }
  55416. }
  55417. return A
  55418. }
  55419. for (var s, l, c, h, u, d, p = {}, f = e.concat(), g = 0, m = t.length; g < m; g++)
  55420. Array.prototype.push.apply(f, t[g]);
  55421. for (s = 0,
  55422. l = f.length; s < l; s++)
  55423. u = f[s].x + ":" + f[s].y,
  55424. void 0 !== p[u] && console.warn("THREE.Shape: Duplicate point", u),
  55425. p[u] = s;
  55426. var v = a(e, t)
  55427. , A = n.ShapeUtils.triangulate(v, !1);
  55428. for (s = 0,
  55429. l = A.length; s < l; s++)
  55430. for (h = A[s],
  55431. c = 0; c < 3; c++)
  55432. u = h[c].x + ":" + h[c].y,
  55433. d = p[u],
  55434. void 0 !== d && (h[c] = d);
  55435. return A.concat()
  55436. },
  55437. isClockWise: function(e) {
  55438. return n.ShapeUtils.area(e) < 0
  55439. },
  55440. b2: function() {
  55441. function e(e, t) {
  55442. var i = 1 - e;
  55443. return i * i * t
  55444. }
  55445. function t(e, t) {
  55446. return 2 * (1 - e) * e * t
  55447. }
  55448. function i(e, t) {
  55449. return e * e * t
  55450. }
  55451. return function(n, r, o, a) {
  55452. return e(n, r) + t(n, o) + i(n, a)
  55453. }
  55454. }(),
  55455. b3: function() {
  55456. function e(e, t) {
  55457. var i = 1 - e;
  55458. return i * i * i * t
  55459. }
  55460. function t(e, t) {
  55461. var i = 1 - e;
  55462. return 3 * i * i * e * t
  55463. }
  55464. function i(e, t) {
  55465. var i = 1 - e;
  55466. return 3 * i * e * e * t
  55467. }
  55468. function n(e, t) {
  55469. return e * e * e * t
  55470. }
  55471. return function(r, o, a, s, l) {
  55472. return e(r, o) + t(r, a) + i(r, s) + n(r, l)
  55473. }
  55474. }()
  55475. },
  55476. n.Curve = function() {}
  55477. ,
  55478. n.Curve.prototype = {
  55479. constructor: n.Curve,
  55480. getPoint: function(e) {
  55481. return console.warn("THREE.Curve: Warning, getPoint() not implemented!"),
  55482. null
  55483. },
  55484. getPointAt: function(e) {
  55485. var t = this.getUtoTmapping(e);
  55486. return this.getPoint(t)
  55487. },
  55488. getPoints: function(e) {
  55489. e || (e = 5);
  55490. var t, i = [];
  55491. for (t = 0; t <= e; t++)
  55492. i.push(this.getPoint(t / e));
  55493. return i
  55494. },
  55495. getSpacedPoints: function(e) {
  55496. e || (e = 5);
  55497. var t, i = [];
  55498. for (t = 0; t <= e; t++)
  55499. i.push(this.getPointAt(t / e));
  55500. return i
  55501. },
  55502. getLength: function() {
  55503. var e = this.getLengths();
  55504. return e[e.length - 1]
  55505. },
  55506. getLengths: function(e) {
  55507. if (e || (e = this.__arcLengthDivisions ? this.__arcLengthDivisions : 200),
  55508. this.cacheArcLengths && this.cacheArcLengths.length === e + 1 && !this.needsUpdate)
  55509. return this.cacheArcLengths;
  55510. this.needsUpdate = !1;
  55511. var t, i, n = [], r = this.getPoint(0), o = 0;
  55512. for (n.push(0),
  55513. i = 1; i <= e; i++)
  55514. t = this.getPoint(i / e),
  55515. o += t.distanceTo(r),
  55516. n.push(o),
  55517. r = t;
  55518. return this.cacheArcLengths = n,
  55519. n
  55520. },
  55521. updateArcLengths: function() {
  55522. this.needsUpdate = !0,
  55523. this.getLengths()
  55524. },
  55525. getUtoTmapping: function(e, t) {
  55526. var i, n = this.getLengths(), r = 0, o = n.length;
  55527. i = t ? t : e * n[o - 1];
  55528. for (var a, s = 0, l = o - 1; s <= l; )
  55529. if (r = Math.floor(s + (l - s) / 2),
  55530. a = n[r] - i,
  55531. a < 0)
  55532. s = r + 1;
  55533. else {
  55534. if (!(a > 0)) {
  55535. l = r;
  55536. break
  55537. }
  55538. l = r - 1
  55539. }
  55540. if (r = l,
  55541. n[r] === i) {
  55542. var c = r / (o - 1);
  55543. return c
  55544. }
  55545. var h = n[r]
  55546. , u = n[r + 1]
  55547. , d = u - h
  55548. , p = (i - h) / d
  55549. , c = (r + p) / (o - 1);
  55550. return c
  55551. },
  55552. getTangent: function(e) {
  55553. var t = 1e-4
  55554. , i = e - t
  55555. , n = e + t;
  55556. i < 0 && (i = 0),
  55557. n > 1 && (n = 1);
  55558. var r = this.getPoint(i)
  55559. , o = this.getPoint(n)
  55560. , a = o.clone().sub(r);
  55561. return a.normalize()
  55562. },
  55563. getTangentAt: function(e) {
  55564. var t = this.getUtoTmapping(e);
  55565. return this.getTangent(t)
  55566. }
  55567. },
  55568. n.Curve.create = function(e, t) {
  55569. return e.prototype = Object.create(n.Curve.prototype),
  55570. e.prototype.constructor = e,
  55571. e.prototype.getPoint = t,
  55572. e
  55573. }
  55574. ,
  55575. n.CurvePath = function() {
  55576. this.curves = [],
  55577. this.autoClose = !1
  55578. }
  55579. ,
  55580. n.CurvePath.prototype = Object.create(n.Curve.prototype),
  55581. n.CurvePath.prototype.constructor = n.CurvePath,
  55582. n.CurvePath.prototype.add = function(e) {
  55583. this.curves.push(e)
  55584. }
  55585. ,
  55586. n.CurvePath.prototype.closePath = function() {
  55587. var e = this.curves[0].getPoint(0)
  55588. , t = this.curves[this.curves.length - 1].getPoint(1);
  55589. e.equals(t) || this.curves.push(new n.LineCurve(t,e))
  55590. }
  55591. ,
  55592. n.CurvePath.prototype.getPoint = function(e) {
  55593. for (var t = e * this.getLength(), i = this.getCurveLengths(), n = 0; n < i.length; ) {
  55594. if (i[n] >= t) {
  55595. var r = i[n] - t
  55596. , o = this.curves[n]
  55597. , a = 1 - r / o.getLength();
  55598. return o.getPointAt(a)
  55599. }
  55600. n++
  55601. }
  55602. return null
  55603. }
  55604. ,
  55605. n.CurvePath.prototype.getLength = function() {
  55606. var e = this.getCurveLengths();
  55607. return e[e.length - 1]
  55608. }
  55609. ,
  55610. n.CurvePath.prototype.getCurveLengths = function() {
  55611. if (this.cacheLengths && this.cacheLengths.length === this.curves.length)
  55612. return this.cacheLengths;
  55613. for (var e = [], t = 0, i = 0, n = this.curves.length; i < n; i++)
  55614. t += this.curves[i].getLength(),
  55615. e.push(t);
  55616. return this.cacheLengths = e,
  55617. e
  55618. }
  55619. ,
  55620. n.CurvePath.prototype.createPointsGeometry = function(e) {
  55621. var t = this.getPoints(e);
  55622. return this.createGeometry(t)
  55623. }
  55624. ,
  55625. n.CurvePath.prototype.createSpacedPointsGeometry = function(e) {
  55626. var t = this.getSpacedPoints(e);
  55627. return this.createGeometry(t)
  55628. }
  55629. ,
  55630. n.CurvePath.prototype.createGeometry = function(e) {
  55631. for (var t = new n.Geometry, i = 0, r = e.length; i < r; i++) {
  55632. var o = e[i];
  55633. t.vertices.push(new n.Vector3(o.x,o.y,o.z || 0))
  55634. }
  55635. return t
  55636. }
  55637. ,
  55638. n.Font = function(e) {
  55639. this.data = e
  55640. }
  55641. ,
  55642. n.Font.prototype = {
  55643. constructor: n.Font,
  55644. generateShapes: function(e, t, i) {
  55645. function r(e) {
  55646. for (var i = String(e).split(""), n = t / a.resolution, r = 0, s = [], l = 0; l < i.length; l++) {
  55647. var c = o(i[l], n, r);
  55648. r += c.offset,
  55649. s.push(c.path)
  55650. }
  55651. return s
  55652. }
  55653. function o(e, t, r) {
  55654. var o = a.glyphs[e] || a.glyphs["?"];
  55655. if (o) {
  55656. 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;
  55657. if (o.o)
  55658. for (var E = o._cachedOutline || (o._cachedOutline = o.o.split(" ")), b = 0, w = E.length; b < w; ) {
  55659. var _ = E[b++];
  55660. switch (_) {
  55661. case "m":
  55662. s = E[b++] * t + r,
  55663. l = E[b++] * t,
  55664. A.moveTo(s, l);
  55665. break;
  55666. case "l":
  55667. s = E[b++] * t + r,
  55668. l = E[b++] * t,
  55669. A.lineTo(s, l);
  55670. break;
  55671. case "q":
  55672. if (c = E[b++] * t + r,
  55673. h = E[b++] * t,
  55674. p = E[b++] * t + r,
  55675. f = E[b++] * t,
  55676. A.quadraticCurveTo(p, f, c, h),
  55677. v = y[y.length - 1]) {
  55678. u = v.x,
  55679. d = v.y;
  55680. for (var T = 1; T <= i; T++) {
  55681. var x = T / i;
  55682. C(x, u, p, c),
  55683. C(x, d, f, h)
  55684. }
  55685. }
  55686. break;
  55687. case "b":
  55688. if (c = E[b++] * t + r,
  55689. h = E[b++] * t,
  55690. p = E[b++] * t + r,
  55691. f = E[b++] * t,
  55692. g = E[b++] * t + r,
  55693. m = E[b++] * t,
  55694. A.bezierCurveTo(p, f, g, m, c, h),
  55695. v = y[y.length - 1]) {
  55696. u = v.x,
  55697. d = v.y;
  55698. for (var T = 1; T <= i; T++) {
  55699. var x = T / i;
  55700. I(x, u, p, g, c),
  55701. I(x, d, f, m, h)
  55702. }
  55703. }
  55704. }
  55705. }
  55706. return {
  55707. offset: o.ha * t,
  55708. path: A
  55709. }
  55710. }
  55711. }
  55712. void 0 === t && (t = 100),
  55713. void 0 === i && (i = 4);
  55714. for (var a = this.data, s = r(e), l = [], c = 0, h = s.length; c < h; c++)
  55715. Array.prototype.push.apply(l, s[c].toShapes());
  55716. return l
  55717. }
  55718. },
  55719. n.Path = function(e) {
  55720. n.CurvePath.call(this),
  55721. this.actions = [],
  55722. e && this.fromPoints(e)
  55723. }
  55724. ,
  55725. n.Path.prototype = Object.create(n.CurvePath.prototype),
  55726. n.Path.prototype.constructor = n.Path,
  55727. n.Path.prototype.fromPoints = function(e) {
  55728. this.moveTo(e[0].x, e[0].y);
  55729. for (var t = 1, i = e.length; t < i; t++)
  55730. this.lineTo(e[t].x, e[t].y)
  55731. }
  55732. ,
  55733. n.Path.prototype.moveTo = function(e, t) {
  55734. this.actions.push({
  55735. action: "moveTo",
  55736. args: [e, t]
  55737. })
  55738. }
  55739. ,
  55740. n.Path.prototype.lineTo = function(e, t) {
  55741. var i = this.actions[this.actions.length - 1].args
  55742. , r = i[i.length - 2]
  55743. , o = i[i.length - 1]
  55744. , a = new n.LineCurve(new n.Vector2(r,o),new n.Vector2(e,t));
  55745. this.curves.push(a),
  55746. this.actions.push({
  55747. action: "lineTo",
  55748. args: [e, t]
  55749. })
  55750. }
  55751. ,
  55752. n.Path.prototype.quadraticCurveTo = function(e, t, i, r) {
  55753. var o = this.actions[this.actions.length - 1].args
  55754. , a = o[o.length - 2]
  55755. , s = o[o.length - 1]
  55756. , l = new n.QuadraticBezierCurve(new n.Vector2(a,s),new n.Vector2(e,t),new n.Vector2(i,r));
  55757. this.curves.push(l),
  55758. this.actions.push({
  55759. action: "quadraticCurveTo",
  55760. args: [e, t, i, r]
  55761. })
  55762. }
  55763. ,
  55764. n.Path.prototype.bezierCurveTo = function(e, t, i, r, o, a) {
  55765. var s = this.actions[this.actions.length - 1].args
  55766. , l = s[s.length - 2]
  55767. , c = s[s.length - 1]
  55768. , h = new n.CubicBezierCurve(new n.Vector2(l,c),new n.Vector2(e,t),new n.Vector2(i,r),new n.Vector2(o,a));
  55769. this.curves.push(h),
  55770. this.actions.push({
  55771. action: "bezierCurveTo",
  55772. args: [e, t, i, r, o, a]
  55773. })
  55774. }
  55775. ,
  55776. n.Path.prototype.splineThru = function(e) {
  55777. var t = Array.prototype.slice.call(arguments)
  55778. , i = this.actions[this.actions.length - 1].args
  55779. , r = i[i.length - 2]
  55780. , o = i[i.length - 1]
  55781. , a = [new n.Vector2(r,o)];
  55782. Array.prototype.push.apply(a, e);
  55783. var s = new n.SplineCurve(a);
  55784. this.curves.push(s),
  55785. this.actions.push({
  55786. action: "splineThru",
  55787. args: t
  55788. })
  55789. }
  55790. ,
  55791. n.Path.prototype.arc = function(e, t, i, n, r, o) {
  55792. var a = this.actions[this.actions.length - 1].args
  55793. , s = a[a.length - 2]
  55794. , l = a[a.length - 1];
  55795. this.absarc(e + s, t + l, i, n, r, o)
  55796. }
  55797. ,
  55798. n.Path.prototype.absarc = function(e, t, i, n, r, o) {
  55799. this.absellipse(e, t, i, i, n, r, o)
  55800. }
  55801. ,
  55802. n.Path.prototype.ellipse = function(e, t, i, n, r, o, a, s) {
  55803. var l = this.actions[this.actions.length - 1].args
  55804. , c = l[l.length - 2]
  55805. , h = l[l.length - 1];
  55806. this.absellipse(e + c, t + h, i, n, r, o, a, s)
  55807. }
  55808. ,
  55809. n.Path.prototype.absellipse = function(e, t, i, r, o, a, s, l) {
  55810. var c = [e, t, i, r, o, a, s, l || 0]
  55811. , h = new n.EllipseCurve(e,t,i,r,o,a,s,l);
  55812. this.curves.push(h);
  55813. var u = h.getPoint(1);
  55814. c.push(u.x),
  55815. c.push(u.y),
  55816. this.actions.push({
  55817. action: "ellipse",
  55818. args: c
  55819. })
  55820. }
  55821. ,
  55822. n.Path.prototype.getSpacedPoints = function(e) {
  55823. e || (e = 40);
  55824. for (var t = [], i = 0; i < e; i++)
  55825. t.push(this.getPoint(i / e));
  55826. return this.autoClose && t.push(t[0]),
  55827. t
  55828. }
  55829. ,
  55830. n.Path.prototype.getPoints = function(e) {
  55831. e = e || 12;
  55832. 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++) {
  55833. var A = this.actions[m]
  55834. , y = A.action
  55835. , C = A.args;
  55836. switch (y) {
  55837. case "moveTo":
  55838. g.push(new n.Vector2(C[0],C[1]));
  55839. break;
  55840. case "lineTo":
  55841. g.push(new n.Vector2(C[0],C[1]));
  55842. break;
  55843. case "quadraticCurveTo":
  55844. t = C[2],
  55845. i = C[3],
  55846. a = C[0],
  55847. s = C[1],
  55848. g.length > 0 ? (h = g[g.length - 1],
  55849. l = h.x,
  55850. c = h.y) : (h = this.actions[m - 1].args,
  55851. l = h[h.length - 2],
  55852. c = h[h.length - 1]);
  55853. for (var I = 1; I <= e; I++) {
  55854. var E = I / e;
  55855. u = p(E, l, a, t),
  55856. d = p(E, c, s, i),
  55857. g.push(new n.Vector2(u,d))
  55858. }
  55859. break;
  55860. case "bezierCurveTo":
  55861. t = C[4],
  55862. i = C[5],
  55863. a = C[0],
  55864. s = C[1],
  55865. r = C[2],
  55866. o = C[3],
  55867. g.length > 0 ? (h = g[g.length - 1],
  55868. l = h.x,
  55869. c = h.y) : (h = this.actions[m - 1].args,
  55870. l = h[h.length - 2],
  55871. c = h[h.length - 1]);
  55872. for (var I = 1; I <= e; I++) {
  55873. var E = I / e;
  55874. u = f(E, l, a, r, t),
  55875. d = f(E, c, s, o, i),
  55876. g.push(new n.Vector2(u,d))
  55877. }
  55878. break;
  55879. case "splineThru":
  55880. h = this.actions[m - 1].args;
  55881. var b = new n.Vector2(h[h.length - 2],h[h.length - 1])
  55882. , w = [b]
  55883. , _ = e * C[0].length;
  55884. w = w.concat(C[0]);
  55885. for (var T = new n.SplineCurve(w), I = 1; I <= _; I++)
  55886. g.push(T.getPointAt(I / _));
  55887. break;
  55888. case "arc":
  55889. 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++) {
  55890. var E = I / N;
  55891. L || (E = 1 - E),
  55892. x = P + E * D,
  55893. u = S + R * Math.cos(x),
  55894. d = M + R * Math.sin(x),
  55895. g.push(new n.Vector2(u,d))
  55896. }
  55897. break;
  55898. case "ellipse":
  55899. 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;
  55900. 0 !== k && (B = Math.cos(k),
  55901. F = Math.sin(k));
  55902. for (var I = 1; I <= N; I++) {
  55903. var E = I / N;
  55904. if (L || (E = 1 - E),
  55905. x = P + E * D,
  55906. u = S + V * Math.cos(x),
  55907. d = M + U * Math.sin(x),
  55908. 0 !== k) {
  55909. var H = u
  55910. , G = d;
  55911. u = (H - S) * B - (G - M) * F + S,
  55912. d = (H - S) * F + (G - M) * B + M
  55913. }
  55914. g.push(new n.Vector2(u,d))
  55915. }
  55916. }
  55917. }
  55918. var z = g[g.length - 1];
  55919. 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),
  55920. this.autoClose && g.push(g[0]),
  55921. g
  55922. }
  55923. ,
  55924. n.Path.prototype.toShapes = function(e, t) {
  55925. function i(e) {
  55926. for (var t = [], i = new n.Path, r = 0, o = e.length; r < o; r++) {
  55927. var a = e[r]
  55928. , s = a.args
  55929. , l = a.action;
  55930. "moveTo" === l && 0 !== i.actions.length && (t.push(i),
  55931. i = new n.Path),
  55932. i[l].apply(i, s)
  55933. }
  55934. return 0 !== i.actions.length && t.push(i),
  55935. t
  55936. }
  55937. function r(e) {
  55938. for (var t = [], i = 0, r = e.length; i < r; i++) {
  55939. var o = e[i]
  55940. , a = new n.Shape;
  55941. a.actions = o.actions,
  55942. a.curves = o.curves,
  55943. t.push(a)
  55944. }
  55945. return t
  55946. }
  55947. function o(e, t) {
  55948. for (var i = t.length, n = !1, r = i - 1, o = 0; o < i; r = o++) {
  55949. var a = t[r]
  55950. , s = t[o]
  55951. , l = s.x - a.x
  55952. , c = s.y - a.y;
  55953. if (Math.abs(c) > Number.EPSILON) {
  55954. if (c < 0 && (a = t[o],
  55955. l = -l,
  55956. s = t[r],
  55957. c = -c),
  55958. e.y < a.y || e.y > s.y)
  55959. continue;
  55960. if (e.y === a.y) {
  55961. if (e.x === a.x)
  55962. return !0
  55963. } else {
  55964. var h = c * (e.x - a.x) - l * (e.y - a.y);
  55965. if (0 === h)
  55966. return !0;
  55967. if (h < 0)
  55968. continue;
  55969. n = !n
  55970. }
  55971. } else {
  55972. if (e.y !== a.y)
  55973. continue;
  55974. if (s.x <= e.x && e.x <= a.x || a.x <= e.x && e.x <= s.x)
  55975. return !0
  55976. }
  55977. }
  55978. return n
  55979. }
  55980. var a = n.ShapeUtils.isClockWise
  55981. , s = i(this.actions);
  55982. if (0 === s.length)
  55983. return [];
  55984. if (t === !0)
  55985. return r(s);
  55986. var l, c, h, u = [];
  55987. if (1 === s.length)
  55988. return c = s[0],
  55989. h = new n.Shape,
  55990. h.actions = c.actions,
  55991. h.curves = c.curves,
  55992. u.push(h),
  55993. u;
  55994. var d = !a(s[0].getPoints());
  55995. d = e ? !d : d;
  55996. var p, f = [], g = [], m = [], v = 0;
  55997. g[v] = void 0,
  55998. m[v] = [];
  55999. for (var A = 0, y = s.length; A < y; A++)
  56000. c = s[A],
  56001. p = c.getPoints(),
  56002. l = a(p),
  56003. l = e ? !l : l,
  56004. l ? (!d && g[v] && v++,
  56005. g[v] = {
  56006. s: new n.Shape,
  56007. p: p
  56008. },
  56009. g[v].s.actions = c.actions,
  56010. g[v].s.curves = c.curves,
  56011. d && v++,
  56012. m[v] = []) : m[v].push({
  56013. h: c,
  56014. p: p[0]
  56015. });
  56016. if (!g[0])
  56017. return r(s);
  56018. if (g.length > 1) {
  56019. for (var C = !1, I = [], E = 0, b = g.length; E < b; E++)
  56020. f[E] = [];
  56021. for (var E = 0, b = g.length; E < b; E++)
  56022. for (var w = m[E], _ = 0; _ < w.length; _++) {
  56023. for (var T = w[_], x = !0, S = 0; S < g.length; S++)
  56024. o(T.p, g[S].p) && (E !== S && I.push({
  56025. froms: E,
  56026. tos: S,
  56027. hole: _
  56028. }),
  56029. x ? (x = !1,
  56030. f[S].push(T)) : C = !0);
  56031. x && f[E].push(T)
  56032. }
  56033. I.length > 0 && (C || (m = f))
  56034. }
  56035. for (var M, A = 0, R = g.length; A < R; A++) {
  56036. h = g[A].s,
  56037. u.push(h),
  56038. M = m[A];
  56039. for (var P = 0, O = M.length; P < O; P++)
  56040. h.holes.push(M[P].h)
  56041. }
  56042. return u
  56043. }
  56044. ,
  56045. n.Shape = function() {
  56046. n.Path.apply(this, arguments),
  56047. this.holes = []
  56048. }
  56049. ,
  56050. n.Shape.prototype = Object.create(n.Path.prototype),
  56051. n.Shape.prototype.constructor = n.Shape,
  56052. n.Shape.prototype.extrude = function(e) {
  56053. return new n.ExtrudeGeometry(this,e)
  56054. }
  56055. ,
  56056. n.Shape.prototype.makeGeometry = function(e) {
  56057. return new n.ShapeGeometry(this,e)
  56058. }
  56059. ,
  56060. n.Shape.prototype.getPointsHoles = function(e) {
  56061. for (var t = [], i = 0, n = this.holes.length; i < n; i++)
  56062. t[i] = this.holes[i].getPoints(e);
  56063. return t
  56064. }
  56065. ,
  56066. n.Shape.prototype.extractAllPoints = function(e) {
  56067. return {
  56068. shape: this.getPoints(e),
  56069. holes: this.getPointsHoles(e)
  56070. }
  56071. }
  56072. ,
  56073. n.Shape.prototype.extractPoints = function(e) {
  56074. return this.extractAllPoints(e)
  56075. }
  56076. ,
  56077. n.LineCurve = function(e, t) {
  56078. this.v1 = e,
  56079. this.v2 = t
  56080. }
  56081. ,
  56082. n.LineCurve.prototype = Object.create(n.Curve.prototype),
  56083. n.LineCurve.prototype.constructor = n.LineCurve,
  56084. n.LineCurve.prototype.getPoint = function(e) {
  56085. var t = this.v2.clone().sub(this.v1);
  56086. return t.multiplyScalar(e).add(this.v1),
  56087. t
  56088. }
  56089. ,
  56090. n.LineCurve.prototype.getPointAt = function(e) {
  56091. return this.getPoint(e)
  56092. }
  56093. ,
  56094. n.LineCurve.prototype.getTangent = function(e) {
  56095. var t = this.v2.clone().sub(this.v1);
  56096. return t.normalize()
  56097. }
  56098. ,
  56099. n.QuadraticBezierCurve = function(e, t, i) {
  56100. this.v0 = e,
  56101. this.v1 = t,
  56102. this.v2 = i
  56103. }
  56104. ,
  56105. n.QuadraticBezierCurve.prototype = Object.create(n.Curve.prototype),
  56106. n.QuadraticBezierCurve.prototype.constructor = n.QuadraticBezierCurve,
  56107. n.QuadraticBezierCurve.prototype.getPoint = function(e) {
  56108. var t = n.ShapeUtils.b2;
  56109. 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))
  56110. }
  56111. ,
  56112. n.QuadraticBezierCurve.prototype.getTangent = function(e) {
  56113. var t = n.CurveUtils.tangentQuadraticBezier;
  56114. 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()
  56115. }
  56116. ,
  56117. n.CubicBezierCurve = function(e, t, i, n) {
  56118. this.v0 = e,
  56119. this.v1 = t,
  56120. this.v2 = i,
  56121. this.v3 = n
  56122. }
  56123. ,
  56124. n.CubicBezierCurve.prototype = Object.create(n.Curve.prototype),
  56125. n.CubicBezierCurve.prototype.constructor = n.CubicBezierCurve,
  56126. n.CubicBezierCurve.prototype.getPoint = function(e) {
  56127. var t = n.ShapeUtils.b3;
  56128. 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))
  56129. }
  56130. ,
  56131. n.CubicBezierCurve.prototype.getTangent = function(e) {
  56132. var t = n.CurveUtils.tangentCubicBezier;
  56133. 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()
  56134. }
  56135. ,
  56136. n.SplineCurve = function(e) {
  56137. this.points = void 0 == e ? [] : e
  56138. }
  56139. ,
  56140. n.SplineCurve.prototype = Object.create(n.Curve.prototype),
  56141. n.SplineCurve.prototype.constructor = n.SplineCurve,
  56142. n.SplineCurve.prototype.getPoint = function(e) {
  56143. var t = this.points
  56144. , i = (t.length - 1) * e
  56145. , r = Math.floor(i)
  56146. , o = i - r
  56147. , a = t[0 === r ? r : r - 1]
  56148. , s = t[r]
  56149. , l = t[r > t.length - 2 ? t.length - 1 : r + 1]
  56150. , c = t[r > t.length - 3 ? t.length - 1 : r + 2]
  56151. , h = n.CurveUtils.interpolate;
  56152. return new n.Vector2(h(a.x, s.x, l.x, c.x, o),h(a.y, s.y, l.y, c.y, o))
  56153. }
  56154. ,
  56155. n.EllipseCurve = function(e, t, i, n, r, o, a, s) {
  56156. this.aX = e,
  56157. this.aY = t,
  56158. this.xRadius = i,
  56159. this.yRadius = n,
  56160. this.aStartAngle = r,
  56161. this.aEndAngle = o,
  56162. this.aClockwise = a,
  56163. this.aRotation = s || 0
  56164. }
  56165. ,
  56166. n.EllipseCurve.prototype = Object.create(n.Curve.prototype),
  56167. n.EllipseCurve.prototype.constructor = n.EllipseCurve,
  56168. n.EllipseCurve.prototype.getPoint = function(e) {
  56169. var t = this.aEndAngle - this.aStartAngle;
  56170. t < 0 && (t += 2 * Math.PI),
  56171. t > 2 * Math.PI && (t -= 2 * Math.PI);
  56172. var i;
  56173. i = this.aClockwise === !0 ? this.aEndAngle + (1 - e) * (2 * Math.PI - t) : this.aStartAngle + e * t;
  56174. var r = this.aX + this.xRadius * Math.cos(i)
  56175. , o = this.aY + this.yRadius * Math.sin(i);
  56176. if (0 !== this.aRotation) {
  56177. var a = Math.cos(this.aRotation)
  56178. , s = Math.sin(this.aRotation)
  56179. , l = r
  56180. , c = o;
  56181. r = (l - this.aX) * a - (c - this.aY) * s + this.aX,
  56182. o = (l - this.aX) * s + (c - this.aY) * a + this.aY
  56183. }
  56184. return new n.Vector2(r,o)
  56185. }
  56186. ,
  56187. n.ArcCurve = function(e, t, i, r, o, a) {
  56188. n.EllipseCurve.call(this, e, t, i, i, r, o, a)
  56189. }
  56190. ,
  56191. n.ArcCurve.prototype = Object.create(n.EllipseCurve.prototype),
  56192. n.ArcCurve.prototype.constructor = n.ArcCurve,
  56193. n.LineCurve3 = n.Curve.create(function(e, t) {
  56194. this.v1 = e,
  56195. this.v2 = t
  56196. }, function(e) {
  56197. var t = new n.Vector3;
  56198. return t.subVectors(this.v2, this.v1),
  56199. t.multiplyScalar(e),
  56200. t.add(this.v1),
  56201. t
  56202. }),
  56203. n.QuadraticBezierCurve3 = n.Curve.create(function(e, t, i) {
  56204. this.v0 = e,
  56205. this.v1 = t,
  56206. this.v2 = i
  56207. }, function(e) {
  56208. var t = n.ShapeUtils.b2;
  56209. 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))
  56210. }),
  56211. n.CubicBezierCurve3 = n.Curve.create(function(e, t, i, n) {
  56212. this.v0 = e,
  56213. this.v1 = t,
  56214. this.v2 = i,
  56215. this.v3 = n
  56216. }, function(e) {
  56217. var t = n.ShapeUtils.b3;
  56218. 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))
  56219. }),
  56220. n.SplineCurve3 = n.Curve.create(function(e) {
  56221. console.warn("THREE.SplineCurve3 will be deprecated. Please use THREE.CatmullRomCurve3"),
  56222. this.points = void 0 == e ? [] : e
  56223. }, function(e) {
  56224. var t = this.points
  56225. , i = (t.length - 1) * e
  56226. , r = Math.floor(i)
  56227. , o = i - r
  56228. , a = t[0 == r ? r : r - 1]
  56229. , s = t[r]
  56230. , l = t[r > t.length - 2 ? t.length - 1 : r + 1]
  56231. , c = t[r > t.length - 3 ? t.length - 1 : r + 2]
  56232. , h = n.CurveUtils.interpolate;
  56233. 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))
  56234. }),
  56235. n.CatmullRomCurve3 = function() {
  56236. function e() {}
  56237. var t = new n.Vector3
  56238. , i = new e
  56239. , r = new e
  56240. , o = new e;
  56241. return e.prototype.init = function(e, t, i, n) {
  56242. this.c0 = e,
  56243. this.c1 = i,
  56244. this.c2 = -3 * e + 3 * t - 2 * i - n,
  56245. this.c3 = 2 * e - 2 * t + i + n
  56246. }
  56247. ,
  56248. e.prototype.initNonuniformCatmullRom = function(e, t, i, n, r, o, a) {
  56249. var s = (t - e) / r - (i - e) / (r + o) + (i - t) / o
  56250. , l = (i - t) / o - (n - t) / (o + a) + (n - i) / a;
  56251. s *= o,
  56252. l *= o,
  56253. this.init(t, i, s, l)
  56254. }
  56255. ,
  56256. e.prototype.initCatmullRom = function(e, t, i, n, r) {
  56257. this.init(t, i, r * (i - e), r * (n - t))
  56258. }
  56259. ,
  56260. e.prototype.calc = function(e) {
  56261. var t = e * e
  56262. , i = t * e;
  56263. return this.c0 + this.c1 * e + this.c2 * t + this.c3 * i
  56264. }
  56265. ,
  56266. n.Curve.create(function(e) {
  56267. this.points = e || [],
  56268. this.closed = !1
  56269. }, function(e) {
  56270. var a, s, l, c, h = this.points;
  56271. c = h.length,
  56272. c < 2 && console.log("duh, you need at least 2 points"),
  56273. a = (c - (this.closed ? 0 : 1)) * e,
  56274. s = Math.floor(a),
  56275. l = a - s,
  56276. this.closed ? s += s > 0 ? 0 : (Math.floor(Math.abs(s) / h.length) + 1) * h.length : 0 === l && s === c - 1 && (s = c - 2,
  56277. l = 1);
  56278. var u, d, p, f;
  56279. if (this.closed || s > 0 ? u = h[(s - 1) % c] : (t.subVectors(h[0], h[1]).add(h[0]),
  56280. u = t),
  56281. d = h[s % c],
  56282. p = h[(s + 1) % c],
  56283. this.closed || s + 2 < c ? f = h[(s + 2) % c] : (t.subVectors(h[c - 1], h[c - 2]).add(h[c - 1]),
  56284. f = t),
  56285. void 0 === this.type || "centripetal" === this.type || "chordal" === this.type) {
  56286. var g = "chordal" === this.type ? .5 : .25
  56287. , m = Math.pow(u.distanceToSquared(d), g)
  56288. , v = Math.pow(d.distanceToSquared(p), g)
  56289. , A = Math.pow(p.distanceToSquared(f), g);
  56290. v < 1e-4 && (v = 1),
  56291. m < 1e-4 && (m = v),
  56292. A < 1e-4 && (A = v),
  56293. i.initNonuniformCatmullRom(u.x, d.x, p.x, f.x, m, v, A),
  56294. r.initNonuniformCatmullRom(u.y, d.y, p.y, f.y, m, v, A),
  56295. o.initNonuniformCatmullRom(u.z, d.z, p.z, f.z, m, v, A)
  56296. } else if ("catmullrom" === this.type) {
  56297. var y = void 0 !== this.tension ? this.tension : .5;
  56298. i.initCatmullRom(u.x, d.x, p.x, f.x, y),
  56299. r.initCatmullRom(u.y, d.y, p.y, f.y, y),
  56300. o.initCatmullRom(u.z, d.z, p.z, f.z, y)
  56301. }
  56302. var C = new n.Vector3(i.calc(l),r.calc(l),o.calc(l));
  56303. return C
  56304. })
  56305. }(),
  56306. n.ClosedSplineCurve3 = function(e) {
  56307. console.warn("THREE.ClosedSplineCurve3 has been deprecated. Please use THREE.CatmullRomCurve3."),
  56308. n.CatmullRomCurve3.call(this, e),
  56309. this.type = "catmullrom",
  56310. this.closed = !0
  56311. }
  56312. ,
  56313. n.ClosedSplineCurve3.prototype = Object.create(n.CatmullRomCurve3.prototype),
  56314. n.BoxGeometry = function(e, t, i, r, o, a) {
  56315. n.Geometry.call(this),
  56316. this.type = "BoxGeometry",
  56317. this.parameters = {
  56318. width: e,
  56319. height: t,
  56320. depth: i,
  56321. widthSegments: r,
  56322. heightSegments: o,
  56323. depthSegments: a
  56324. },
  56325. this.fromBufferGeometry(new n.BoxBufferGeometry(e,t,i,r,o,a)),
  56326. this.mergeVertices()
  56327. }
  56328. ,
  56329. n.BoxGeometry.prototype = Object.create(n.Geometry.prototype),
  56330. n.BoxGeometry.prototype.constructor = n.BoxGeometry,
  56331. n.CubeGeometry = n.BoxGeometry,
  56332. n.BoxBufferGeometry = function(e, t, i, r, o, a) {
  56333. function s(e, t, i) {
  56334. var n = 0;
  56335. return n += e * t * 2,
  56336. n += e * i * 2,
  56337. n += i * t * 2,
  56338. 4 * n
  56339. }
  56340. function l(e, t, i, r, o, a, s, l, h, u, I) {
  56341. 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++)
  56342. for (var L = O * b - _, D = 0; D < x; D++) {
  56343. var N = D * E - w;
  56344. P[e] = N * r,
  56345. P[t] = L * o,
  56346. P[i] = T,
  56347. p[m] = P.x,
  56348. p[m + 1] = P.y,
  56349. p[m + 2] = P.z,
  56350. P[e] = 0,
  56351. P[t] = 0,
  56352. P[i] = l > 0 ? 1 : -1,
  56353. f[m] = P.x,
  56354. f[m + 1] = P.y,
  56355. f[m + 2] = P.z,
  56356. g[v] = D / h,
  56357. g[v + 1] = 1 - O / u,
  56358. m += 3,
  56359. v += 2,
  56360. M += 1
  56361. }
  56362. for (O = 0; O < u; O++)
  56363. for (D = 0; D < h; D++) {
  56364. var B = y + D + x * O
  56365. , F = y + D + x * (O + 1)
  56366. , V = y + (D + 1) + x * (O + 1)
  56367. , U = y + (D + 1) + x * O;
  56368. d[A] = B,
  56369. d[A + 1] = F,
  56370. d[A + 2] = U,
  56371. d[A + 3] = F,
  56372. d[A + 4] = V,
  56373. d[A + 5] = U,
  56374. A += 6,
  56375. R += 6
  56376. }
  56377. c.addGroup(C, R, I),
  56378. C += R,
  56379. y += M
  56380. }
  56381. n.BufferGeometry.call(this),
  56382. this.type = "BoxBufferGeometry",
  56383. this.parameters = {
  56384. width: e,
  56385. height: t,
  56386. depth: i,
  56387. widthSegments: r,
  56388. heightSegments: o,
  56389. depthSegments: a
  56390. };
  56391. var c = this;
  56392. r = Math.floor(r) || 1,
  56393. o = Math.floor(o) || 1,
  56394. a = Math.floor(a) || 1;
  56395. var h = s(r, o, a)
  56396. , u = h / 4 * 6
  56397. , d = new (u > 65535 ? Uint32Array : Uint16Array)(u)
  56398. , p = new Float32Array(3 * h)
  56399. , f = new Float32Array(3 * h)
  56400. , g = new Float32Array(2 * h)
  56401. , m = 0
  56402. , v = 0
  56403. , A = 0
  56404. , y = 0
  56405. , C = 0;
  56406. l("z", "y", "x", -1, -1, i, t, e, a, o, 0),
  56407. l("z", "y", "x", 1, -1, i, t, -e, a, o, 1),
  56408. l("x", "z", "y", 1, 1, e, i, t, r, a, 2),
  56409. l("x", "z", "y", 1, -1, e, i, -t, r, a, 3),
  56410. l("x", "y", "z", 1, -1, e, t, i, r, o, 4),
  56411. l("x", "y", "z", -1, -1, e, t, -i, r, o, 5),
  56412. this.setIndex(new n.BufferAttribute(d,1)),
  56413. this.addAttribute("position", new n.BufferAttribute(p,3)),
  56414. this.addAttribute("normal", new n.BufferAttribute(f,3)),
  56415. this.addAttribute("uv", new n.BufferAttribute(g,2))
  56416. }
  56417. ,
  56418. n.BoxBufferGeometry.prototype = Object.create(n.BufferGeometry.prototype),
  56419. n.BoxBufferGeometry.prototype.constructor = n.BoxBufferGeometry,
  56420. n.CircleGeometry = function(e, t, i, r) {
  56421. n.Geometry.call(this),
  56422. this.type = "CircleGeometry",
  56423. this.parameters = {
  56424. radius: e,
  56425. segments: t,
  56426. thetaStart: i,
  56427. thetaLength: r
  56428. },
  56429. this.fromBufferGeometry(new n.CircleBufferGeometry(e,t,i,r))
  56430. }
  56431. ,
  56432. n.CircleGeometry.prototype = Object.create(n.Geometry.prototype),
  56433. n.CircleGeometry.prototype.constructor = n.CircleGeometry,
  56434. n.CircleBufferGeometry = function(e, t, i, r) {
  56435. n.BufferGeometry.call(this),
  56436. this.type = "CircleBufferGeometry",
  56437. this.parameters = {
  56438. radius: e,
  56439. segments: t,
  56440. thetaStart: i,
  56441. thetaLength: r
  56442. },
  56443. e = e || 50,
  56444. t = void 0 !== t ? Math.max(3, t) : 8,
  56445. i = void 0 !== i ? i : 0,
  56446. r = void 0 !== r ? r : 2 * Math.PI;
  56447. var o = t + 2
  56448. , a = new Float32Array(3 * o)
  56449. , s = new Float32Array(3 * o)
  56450. , l = new Float32Array(2 * o);
  56451. s[2] = 1,
  56452. l[0] = .5,
  56453. l[1] = .5;
  56454. for (var c = 0, h = 3, u = 2; c <= t; c++,
  56455. h += 3,
  56456. u += 2) {
  56457. var d = i + c / t * r;
  56458. a[h] = e * Math.cos(d),
  56459. a[h + 1] = e * Math.sin(d),
  56460. s[h + 2] = 1,
  56461. l[u] = (a[h] / e + 1) / 2,
  56462. l[u + 1] = (a[h + 1] / e + 1) / 2
  56463. }
  56464. for (var p = [], h = 1; h <= t; h++)
  56465. p.push(h, h + 1, 0);
  56466. this.setIndex(new n.BufferAttribute(new Uint16Array(p),1)),
  56467. this.addAttribute("position", new n.BufferAttribute(a,3)),
  56468. this.addAttribute("normal", new n.BufferAttribute(s,3)),
  56469. this.addAttribute("uv", new n.BufferAttribute(l,2)),
  56470. this.boundingSphere = new n.Sphere(new n.Vector3,e)
  56471. }
  56472. ,
  56473. n.CircleBufferGeometry.prototype = Object.create(n.BufferGeometry.prototype),
  56474. n.CircleBufferGeometry.prototype.constructor = n.CircleBufferGeometry,
  56475. n.CylinderBufferGeometry = function(e, t, i, r, o, a, s, l) {
  56476. function c() {
  56477. var e = (r + 1) * (o + 1);
  56478. return a === !1 && (e += 2 * (r + 1) + 2 * r),
  56479. e
  56480. }
  56481. function h() {
  56482. var e = r * o * 2 * 3;
  56483. return a === !1 && (e += 2 * r * 3),
  56484. e
  56485. }
  56486. function u() {
  56487. var a, c, h = new n.Vector3, u = new n.Vector3, d = (t - e) / i;
  56488. for (c = 0; c <= o; c++) {
  56489. var p = []
  56490. , f = c / o
  56491. , b = f * (t - e) + e;
  56492. for (a = 0; a <= r; a++) {
  56493. var w = a / r;
  56494. u.x = b * Math.sin(w * l + s),
  56495. u.y = -f * i + E,
  56496. u.z = b * Math.cos(w * l + s),
  56497. m.setXYZ(y, u.x, u.y, u.z),
  56498. h.copy(u),
  56499. (0 === e && 0 === c || 0 === t && c === o) && (h.x = Math.sin(w * l + s),
  56500. h.z = Math.cos(w * l + s)),
  56501. h.setY(Math.sqrt(h.x * h.x + h.z * h.z) * d).normalize(),
  56502. v.setXYZ(y, h.x, h.y, h.z),
  56503. A.setXY(y, w, 1 - f),
  56504. p.push(y),
  56505. y++
  56506. }
  56507. I.push(p)
  56508. }
  56509. for (a = 0; a < r; a++)
  56510. for (c = 0; c < o; c++) {
  56511. var _ = I[c][a]
  56512. , T = I[c + 1][a]
  56513. , x = I[c + 1][a + 1]
  56514. , S = I[c][a + 1];
  56515. g.setX(C, _),
  56516. C++,
  56517. g.setX(C, T),
  56518. C++,
  56519. g.setX(C, S),
  56520. C++,
  56521. g.setX(C, T),
  56522. C++,
  56523. g.setX(C, x),
  56524. C++,
  56525. g.setX(C, S),
  56526. C++
  56527. }
  56528. }
  56529. function d(i) {
  56530. var o, a, c, h = new n.Vector2, u = new n.Vector3, d = i === !0 ? e : t, p = i === !0 ? 1 : -1;
  56531. for (a = y,
  56532. o = 1; o <= r; o++)
  56533. m.setXYZ(y, 0, E * p, 0),
  56534. v.setXYZ(y, 0, p, 0),
  56535. i === !0 ? (h.x = o / r,
  56536. h.y = 0) : (h.x = (o - 1) / r,
  56537. h.y = 1),
  56538. A.setXY(y, h.x, h.y),
  56539. y++;
  56540. for (c = y,
  56541. o = 0; o <= r; o++) {
  56542. var f = o / r;
  56543. u.x = d * Math.sin(f * l + s),
  56544. u.y = E * p,
  56545. u.z = d * Math.cos(f * l + s),
  56546. m.setXYZ(y, u.x, u.y, u.z),
  56547. v.setXYZ(y, 0, p, 0),
  56548. A.setXY(y, f, i === !0 ? 1 : 0),
  56549. y++
  56550. }
  56551. for (o = 0; o < r; o++) {
  56552. var I = a + o
  56553. , b = c + o;
  56554. i === !0 ? (g.setX(C, b),
  56555. C++,
  56556. g.setX(C, b + 1),
  56557. C++,
  56558. g.setX(C, I),
  56559. C++) : (g.setX(C, b + 1),
  56560. C++,
  56561. g.setX(C, b),
  56562. C++,
  56563. g.setX(C, I),
  56564. C++)
  56565. }
  56566. }
  56567. n.BufferGeometry.call(this),
  56568. this.type = "CylinderBufferGeometry",
  56569. this.parameters = {
  56570. radiusTop: e,
  56571. radiusBottom: t,
  56572. height: i,
  56573. radialSegments: r,
  56574. heightSegments: o,
  56575. openEnded: a,
  56576. thetaStart: s,
  56577. thetaLength: l
  56578. },
  56579. e = void 0 !== e ? e : 20,
  56580. t = void 0 !== t ? t : 20,
  56581. i = void 0 !== i ? i : 100,
  56582. r = Math.floor(r) || 8,
  56583. o = Math.floor(o) || 1,
  56584. a = void 0 !== a && a,
  56585. s = void 0 !== s ? s : 0,
  56586. l = void 0 !== l ? l : 2 * Math.PI;
  56587. var p = c()
  56588. , f = h()
  56589. , g = new n.BufferAttribute(new (f > 65535 ? Uint32Array : Uint16Array)(f),1)
  56590. , m = new n.BufferAttribute(new Float32Array(3 * p),3)
  56591. , v = new n.BufferAttribute(new Float32Array(3 * p),3)
  56592. , A = new n.BufferAttribute(new Float32Array(2 * p),2)
  56593. , y = 0
  56594. , C = 0
  56595. , I = []
  56596. , E = i / 2;
  56597. u(),
  56598. a === !1 && (e > 0 && d(!0),
  56599. t > 0 && d(!1)),
  56600. this.setIndex(g),
  56601. this.addAttribute("position", m),
  56602. this.addAttribute("normal", v),
  56603. this.addAttribute("uv", A)
  56604. }
  56605. ,
  56606. n.CylinderBufferGeometry.prototype = Object.create(n.BufferGeometry.prototype),
  56607. n.CylinderBufferGeometry.prototype.constructor = n.CylinderBufferGeometry,
  56608. n.CylinderGeometry = function(e, t, i, r, o, a, s, l) {
  56609. n.Geometry.call(this),
  56610. this.type = "CylinderGeometry",
  56611. this.parameters = {
  56612. radiusTop: e,
  56613. radiusBottom: t,
  56614. height: i,
  56615. radialSegments: r,
  56616. heightSegments: o,
  56617. openEnded: a,
  56618. thetaStart: s,
  56619. thetaLength: l
  56620. },
  56621. this.fromBufferGeometry(new n.CylinderBufferGeometry(e,t,i,r,o,a,s,l)),
  56622. this.mergeVertices()
  56623. }
  56624. ,
  56625. n.CylinderGeometry.prototype = Object.create(n.Geometry.prototype),
  56626. n.CylinderGeometry.prototype.constructor = n.CylinderGeometry,
  56627. n.EdgesGeometry = function(e, t) {
  56628. function i(e, t) {
  56629. return e - t
  56630. }
  56631. n.BufferGeometry.call(this),
  56632. t = void 0 !== t ? t : 1;
  56633. var r, o = Math.cos(n.Math.degToRad(t)), a = [0, 0], s = {}, l = ["a", "b", "c"];
  56634. e instanceof n.BufferGeometry ? (r = new n.Geometry,
  56635. r.fromBufferGeometry(e)) : r = e.clone(),
  56636. r.mergeVertices(),
  56637. r.computeFaceNormals();
  56638. for (var c = r.vertices, h = r.faces, u = 0, d = h.length; u < d; u++)
  56639. for (var p = h[u], f = 0; f < 3; f++) {
  56640. a[0] = p[l[f]],
  56641. a[1] = p[l[(f + 1) % 3]],
  56642. a.sort(i);
  56643. var g = a.toString();
  56644. void 0 === s[g] ? s[g] = {
  56645. vert1: a[0],
  56646. vert2: a[1],
  56647. face1: u,
  56648. face2: void 0
  56649. } : s[g].face2 = u
  56650. }
  56651. var m = [];
  56652. for (var g in s) {
  56653. var v = s[g];
  56654. if (void 0 === v.face2 || h[v.face1].normal.dot(h[v.face2].normal) <= o) {
  56655. var A = c[v.vert1];
  56656. m.push(A.x),
  56657. m.push(A.y),
  56658. m.push(A.z),
  56659. A = c[v.vert2],
  56660. m.push(A.x),
  56661. m.push(A.y),
  56662. m.push(A.z)
  56663. }
  56664. }
  56665. this.addAttribute("position", new n.BufferAttribute(new Float32Array(m),3))
  56666. }
  56667. ,
  56668. n.EdgesGeometry.prototype = Object.create(n.BufferGeometry.prototype),
  56669. n.EdgesGeometry.prototype.constructor = n.EdgesGeometry,
  56670. n.ExtrudeGeometry = function(e, t) {
  56671. return "undefined" == typeof e ? void (e = []) : (n.Geometry.call(this),
  56672. this.type = "ExtrudeGeometry",
  56673. e = Array.isArray(e) ? e : [e],
  56674. this.addShapeList(e, t),
  56675. void this.computeFaceNormals())
  56676. }
  56677. ;
  56678. n.ExtrudeGeometry.prototype = Object.create(n.Geometry.prototype);
  56679. n.ExtrudeGeometry.prototype.constructor = n.ExtrudeGeometry,
  56680. n.ExtrudeGeometry.prototype.addShapeList = function(e, t) {
  56681. for (var i = e.length, n = 0; n < i; n++) {
  56682. var r = e[n];
  56683. this.addShape(r, t)
  56684. }
  56685. }
  56686. ,
  56687. n.ExtrudeGeometry.prototype.addShape = function(e, t) {
  56688. function i(e, t, i) {
  56689. return t || console.error("THREE.ExtrudeGeometry: vec does not exist"),
  56690. t.clone().multiplyScalar(i).add(e)
  56691. }
  56692. function r(e, t, i) {
  56693. 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;
  56694. if (Math.abs(d) > Number.EPSILON) {
  56695. var p = Math.sqrt(u)
  56696. , f = Math.sqrt(c * c + h * h)
  56697. , g = t.x - l / p
  56698. , m = t.y + s / p
  56699. , v = i.x - h / f
  56700. , A = i.y + c / f
  56701. , y = ((v - g) * h - (A - m) * c) / (s * h - l * c);
  56702. r = g + s * y - e.x,
  56703. o = m + l * y - e.y;
  56704. var C = r * r + o * o;
  56705. if (C <= 2)
  56706. return new n.Vector2(r,o);
  56707. a = Math.sqrt(C / 2)
  56708. } else {
  56709. var I = !1;
  56710. s > Number.EPSILON ? c > Number.EPSILON && (I = !0) : s < -Number.EPSILON ? c < -Number.EPSILON && (I = !0) : Math.sign(l) === Math.sign(h) && (I = !0),
  56711. I ? (r = -l,
  56712. o = s,
  56713. a = Math.sqrt(u)) : (r = s,
  56714. o = l,
  56715. a = Math.sqrt(u / 2))
  56716. }
  56717. return new n.Vector2(r / a,o / a)
  56718. }
  56719. function o() {
  56720. if (C) {
  56721. var e = 0
  56722. , t = z * e;
  56723. for (Y = 0; Y < W; Y++)
  56724. G = N[Y],
  56725. c(G[2] + t, G[1] + t, G[0] + t);
  56726. for (e = E + 2 * y,
  56727. t = z * e,
  56728. Y = 0; Y < W; Y++)
  56729. G = N[Y],
  56730. c(G[0] + t, G[1] + t, G[2] + t)
  56731. } else {
  56732. for (Y = 0; Y < W; Y++)
  56733. G = N[Y],
  56734. c(G[2], G[1], G[0]);
  56735. for (Y = 0; Y < W; Y++)
  56736. G = N[Y],
  56737. c(G[0] + z * E, G[1] + z * E, G[2] + z * E)
  56738. }
  56739. }
  56740. function a() {
  56741. var e = 0;
  56742. for (s(B, e),
  56743. e += B.length,
  56744. x = 0,
  56745. S = L.length; x < S; x++)
  56746. T = L[x],
  56747. s(T, e),
  56748. e += T.length
  56749. }
  56750. function s(e, t) {
  56751. var i, n;
  56752. for (Y = e.length; --Y >= 0; ) {
  56753. i = Y,
  56754. n = Y - 1,
  56755. n < 0 && (n = e.length - 1);
  56756. var r = 0
  56757. , o = E + 2 * y;
  56758. for (r = 0; r < o; r++) {
  56759. var a = z * r
  56760. , s = z * (r + 1)
  56761. , l = t + i + a
  56762. , c = t + n + a
  56763. , u = t + n + s
  56764. , d = t + i + s;
  56765. h(l, c, u, d, e, r, o, i, n)
  56766. }
  56767. }
  56768. }
  56769. function l(e, t, i) {
  56770. M.vertices.push(new n.Vector3(e,t,i))
  56771. }
  56772. function c(e, t, i) {
  56773. e += R,
  56774. t += R,
  56775. i += R,
  56776. M.faces.push(new n.Face3(e,t,i,null,null,0));
  56777. var r = _.generateTopUV(M, e, t, i);
  56778. M.faceVertexUvs[0].push(r)
  56779. }
  56780. function h(e, t, i, r, o, a, s, l, c) {
  56781. e += R,
  56782. t += R,
  56783. i += R,
  56784. r += R,
  56785. M.faces.push(new n.Face3(e,t,r,null,null,1)),
  56786. M.faces.push(new n.Face3(t,i,r,null,null,1));
  56787. var h = _.generateSideWallUV(M, e, t, i, r);
  56788. M.faceVertexUvs[0].push([h[0], h[1], h[3]]),
  56789. M.faceVertexUvs[0].push([h[1], h[2], h[3]])
  56790. }
  56791. 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;
  56792. b && (u = b.getSpacedPoints(E),
  56793. w = !0,
  56794. C = !1,
  56795. d = void 0 !== t.frames ? t.frames : new n.TubeGeometry.FrenetFrames(b,E,!1),
  56796. p = new n.Vector3,
  56797. f = new n.Vector3,
  56798. g = new n.Vector3),
  56799. C || (y = 0,
  56800. v = 0,
  56801. A = 0);
  56802. 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);
  56803. if (D) {
  56804. for (O = O.reverse(),
  56805. x = 0,
  56806. S = L.length; x < S; x++)
  56807. T = L[x],
  56808. n.ShapeUtils.isClockWise(T) && (L[x] = T.reverse());
  56809. D = !1
  56810. }
  56811. var N = n.ShapeUtils.triangulateShape(O, L)
  56812. , B = O;
  56813. for (x = 0,
  56814. S = L.length; x < S; x++)
  56815. T = L[x],
  56816. O = O.concat(T);
  56817. 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++,
  56818. Z++,
  56819. q++)
  56820. Z === X && (Z = 0),
  56821. q === X && (q = 0),
  56822. j[Y] = r(B[Y], B[Z], B[q]);
  56823. var K, Q = [], J = j.concat();
  56824. for (x = 0,
  56825. S = L.length; x < S; x++) {
  56826. for (T = L[x],
  56827. K = [],
  56828. Y = 0,
  56829. X = T.length,
  56830. Z = X - 1,
  56831. q = Y + 1; Y < X; Y++,
  56832. Z++,
  56833. q++)
  56834. Z === X && (Z = 0),
  56835. q === X && (q = 0),
  56836. K[Y] = r(T[Y], T[Z], T[q]);
  56837. Q.push(K),
  56838. J = J.concat(K)
  56839. }
  56840. for (F = 0; F < y; F++) {
  56841. for (U = F / y,
  56842. k = v * (1 - U),
  56843. V = A * Math.sin(U * Math.PI / 2),
  56844. Y = 0,
  56845. X = B.length; Y < X; Y++)
  56846. H = i(B[Y], j[Y], V),
  56847. l(H.x, H.y, -k);
  56848. for (x = 0,
  56849. S = L.length; x < S; x++)
  56850. for (T = L[x],
  56851. K = Q[x],
  56852. Y = 0,
  56853. X = T.length; Y < X; Y++)
  56854. H = i(T[Y], K[Y], V),
  56855. l(H.x, H.y, -k)
  56856. }
  56857. for (V = A,
  56858. Y = 0; Y < z; Y++)
  56859. H = C ? i(O[Y], J[Y], V) : O[Y],
  56860. w ? (f.copy(d.normals[0]).multiplyScalar(H.x),
  56861. p.copy(d.binormals[0]).multiplyScalar(H.y),
  56862. g.copy(u[0]).add(f).add(p),
  56863. l(g.x, g.y, g.z)) : l(H.x, H.y, 0);
  56864. var $;
  56865. for ($ = 1; $ <= E; $++)
  56866. for (Y = 0; Y < z; Y++)
  56867. H = C ? i(O[Y], J[Y], V) : O[Y],
  56868. w ? (f.copy(d.normals[$]).multiplyScalar(H.x),
  56869. p.copy(d.binormals[$]).multiplyScalar(H.y),
  56870. g.copy(u[$]).add(f).add(p),
  56871. l(g.x, g.y, g.z)) : l(H.x, H.y, m / E * $);
  56872. for (F = y - 1; F >= 0; F--) {
  56873. for (U = F / y,
  56874. k = v * (1 - U),
  56875. V = A * Math.sin(U * Math.PI / 2),
  56876. Y = 0,
  56877. X = B.length; Y < X; Y++)
  56878. H = i(B[Y], j[Y], V),
  56879. l(H.x, H.y, m + k);
  56880. for (x = 0,
  56881. S = L.length; x < S; x++)
  56882. for (T = L[x],
  56883. K = Q[x],
  56884. Y = 0,
  56885. X = T.length; Y < X; Y++)
  56886. H = i(T[Y], K[Y], V),
  56887. w ? l(H.x, H.y + u[E - 1].y, u[E - 1].x + k) : l(H.x, H.y, m + k)
  56888. }
  56889. o(),
  56890. a()
  56891. }
  56892. ,
  56893. n.ExtrudeGeometry.WorldUVGenerator = {
  56894. generateTopUV: function(e, t, i, r) {
  56895. var o = e.vertices
  56896. , a = o[t]
  56897. , s = o[i]
  56898. , l = o[r];
  56899. return [new n.Vector2(a.x,a.y), new n.Vector2(s.x,s.y), new n.Vector2(l.x,l.y)]
  56900. },
  56901. generateSideWallUV: function(e, t, i, r, o) {
  56902. var a = e.vertices
  56903. , s = a[t]
  56904. , l = a[i]
  56905. , c = a[r]
  56906. , h = a[o];
  56907. 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)]
  56908. }
  56909. },
  56910. n.ShapeGeometry = function(e, t) {
  56911. n.Geometry.call(this),
  56912. this.type = "ShapeGeometry",
  56913. Array.isArray(e) === !1 && (e = [e]),
  56914. this.addShapeList(e, t),
  56915. this.computeFaceNormals()
  56916. }
  56917. ,
  56918. n.ShapeGeometry.prototype = Object.create(n.Geometry.prototype),
  56919. n.ShapeGeometry.prototype.constructor = n.ShapeGeometry,
  56920. n.ShapeGeometry.prototype.addShapeList = function(e, t) {
  56921. for (var i = 0, n = e.length; i < n; i++)
  56922. this.addShape(e[i], t);
  56923. return this
  56924. }
  56925. ,
  56926. n.ShapeGeometry.prototype.addShape = function(e, t) {
  56927. void 0 === t && (t = {});
  56928. 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);
  56929. if (p) {
  56930. for (u = u.reverse(),
  56931. i = 0,
  56932. r = d.length; i < r; i++)
  56933. o = d[i],
  56934. n.ShapeUtils.isClockWise(o) && (d[i] = o.reverse());
  56935. p = !1
  56936. }
  56937. var f = n.ShapeUtils.triangulateShape(u, d);
  56938. for (i = 0,
  56939. r = d.length; i < r; i++)
  56940. o = d[i],
  56941. u = u.concat(o);
  56942. var g, m, v = u.length, A = f.length;
  56943. for (i = 0; i < v; i++)
  56944. g = u[i],
  56945. this.vertices.push(new n.Vector3(g.x,g.y,0));
  56946. for (i = 0; i < A; i++) {
  56947. m = f[i];
  56948. var y = m[0] + c
  56949. , C = m[1] + c
  56950. , I = m[2] + c;
  56951. this.faces.push(new n.Face3(y,C,I,null,null,s)),
  56952. this.faceVertexUvs[0].push(l.generateTopUV(this, y, C, I))
  56953. }
  56954. }
  56955. ,
  56956. n.LatheBufferGeometry = function(e, t, i, r) {
  56957. n.BufferGeometry.call(this),
  56958. this.type = "LatheBufferGeometry",
  56959. this.parameters = {
  56960. points: e,
  56961. segments: t,
  56962. phiStart: i,
  56963. phiLength: r
  56964. },
  56965. t = Math.floor(t) || 12,
  56966. i = i || 0,
  56967. r = r || 2 * Math.PI,
  56968. r = n.Math.clamp(r, 0, 2 * Math.PI);
  56969. 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),
  56970. 1 / t), m = new n.Vector3, v = new n.Vector2;
  56971. for (a = 0; a <= t; a++) {
  56972. var A = i + a * g * r
  56973. , y = Math.sin(A)
  56974. , C = Math.cos(A);
  56975. for (s = 0; s <= e.length - 1; s++)
  56976. m.x = e[s].x * y,
  56977. m.y = e[s].y,
  56978. m.z = e[s].x * C,
  56979. u.setXYZ(p, m.x, m.y, m.z),
  56980. v.x = a / t,
  56981. v.y = s / (e.length - 1),
  56982. d.setXY(p, v.x, v.y),
  56983. p++
  56984. }
  56985. for (a = 0; a < t; a++)
  56986. for (s = 0; s < e.length - 1; s++) {
  56987. o = s + a * e.length;
  56988. var I = o
  56989. , E = o + e.length
  56990. , b = o + e.length + 1
  56991. , w = o + 1;
  56992. h.setX(f, I),
  56993. f++,
  56994. h.setX(f, E),
  56995. f++,
  56996. h.setX(f, w),
  56997. f++,
  56998. h.setX(f, E),
  56999. f++,
  57000. h.setX(f, b),
  57001. f++,
  57002. h.setX(f, w),
  57003. f++
  57004. }
  57005. if (this.setIndex(h),
  57006. this.addAttribute("position", u),
  57007. this.addAttribute("uv", d),
  57008. this.computeVertexNormals(),
  57009. r === 2 * Math.PI) {
  57010. var _ = this.attributes.normal.array
  57011. , T = new n.Vector3
  57012. , x = new n.Vector3
  57013. , S = new n.Vector3;
  57014. for (o = t * e.length * 3,
  57015. a = 0,
  57016. s = 0; a < e.length; a++,
  57017. s += 3)
  57018. T.x = _[s + 0],
  57019. T.y = _[s + 1],
  57020. T.z = _[s + 2],
  57021. x.x = _[o + s + 0],
  57022. x.y = _[o + s + 1],
  57023. x.z = _[o + s + 2],
  57024. S.addVectors(T, x).normalize(),
  57025. _[s + 0] = _[o + s + 0] = S.x,
  57026. _[s + 1] = _[o + s + 1] = S.y,
  57027. _[s + 2] = _[o + s + 2] = S.z
  57028. }
  57029. }
  57030. ,
  57031. n.LatheBufferGeometry.prototype = Object.create(n.BufferGeometry.prototype),
  57032. n.LatheBufferGeometry.prototype.constructor = n.LatheBufferGeometry,
  57033. n.LatheGeometry = function(e, t, i, r) {
  57034. n.Geometry.call(this),
  57035. this.type = "LatheGeometry",
  57036. this.parameters = {
  57037. points: e,
  57038. segments: t,
  57039. phiStart: i,
  57040. phiLength: r
  57041. },
  57042. this.fromBufferGeometry(new n.LatheBufferGeometry(e,t,i,r)),
  57043. this.mergeVertices()
  57044. }
  57045. ,
  57046. n.LatheGeometry.prototype = Object.create(n.Geometry.prototype),
  57047. n.LatheGeometry.prototype.constructor = n.LatheGeometry,
  57048. n.PlaneGeometry = function(e, t, i, r) {
  57049. n.Geometry.call(this),
  57050. this.type = "PlaneGeometry",
  57051. this.parameters = {
  57052. width: e,
  57053. height: t,
  57054. widthSegments: i,
  57055. heightSegments: r
  57056. },
  57057. this.fromBufferGeometry(new n.PlaneBufferGeometry(e,t,i,r))
  57058. }
  57059. ,
  57060. n.PlaneGeometry.prototype = Object.create(n.Geometry.prototype),
  57061. n.PlaneGeometry.prototype.constructor = n.PlaneGeometry,
  57062. n.PlaneBufferGeometry = function(e, t, i, r) {
  57063. n.BufferGeometry.call(this),
  57064. this.type = "PlaneBufferGeometry",
  57065. this.parameters = {
  57066. width: e,
  57067. height: t,
  57068. widthSegments: i,
  57069. heightSegments: r
  57070. };
  57071. 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++)
  57072. for (var y = A * d - a, C = 0; C < c; C++) {
  57073. var I = C * u - o;
  57074. p[m] = I,
  57075. p[m + 1] = -y,
  57076. f[m + 2] = 1,
  57077. g[v] = C / s,
  57078. g[v + 1] = 1 - A / l,
  57079. m += 3,
  57080. v += 2
  57081. }
  57082. m = 0;
  57083. for (var E = new (p.length / 3 > 65535 ? Uint32Array : Uint16Array)(s * l * 6), A = 0; A < l; A++)
  57084. for (var C = 0; C < s; C++) {
  57085. var b = C + c * A
  57086. , w = C + c * (A + 1)
  57087. , _ = C + 1 + c * (A + 1)
  57088. , T = C + 1 + c * A;
  57089. E[m] = b,
  57090. E[m + 1] = w,
  57091. E[m + 2] = T,
  57092. E[m + 3] = w,
  57093. E[m + 4] = _,
  57094. E[m + 5] = T,
  57095. m += 6
  57096. }
  57097. this.setIndex(new n.BufferAttribute(E,1)),
  57098. this.addAttribute("position", new n.BufferAttribute(p,3)),
  57099. this.addAttribute("normal", new n.BufferAttribute(f,3)),
  57100. this.addAttribute("uv", new n.BufferAttribute(g,2))
  57101. }
  57102. ,
  57103. n.PlaneBufferGeometry.prototype = Object.create(n.BufferGeometry.prototype),
  57104. n.PlaneBufferGeometry.prototype.constructor = n.PlaneBufferGeometry,
  57105. n.RingBufferGeometry = function(e, t, i, r, o, a) {
  57106. n.BufferGeometry.call(this),
  57107. this.type = "RingBufferGeometry",
  57108. this.parameters = {
  57109. innerRadius: e,
  57110. outerRadius: t,
  57111. thetaSegments: i,
  57112. phiSegments: r,
  57113. thetaStart: o,
  57114. thetaLength: a
  57115. },
  57116. e = e || 20,
  57117. t = t || 50,
  57118. o = void 0 !== o ? o : 0,
  57119. a = void 0 !== a ? a : 2 * Math.PI,
  57120. i = void 0 !== i ? Math.max(3, i) : 8,
  57121. r = void 0 !== r ? Math.max(1, r) : 1;
  57122. 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;
  57123. for (l = 0; l <= r; l++) {
  57124. for (c = 0; c <= i; c++)
  57125. s = o + c / i * a,
  57126. C.x = A * Math.cos(s),
  57127. C.y = A * Math.sin(s),
  57128. p.setXYZ(m, C.x, C.y, C.z),
  57129. f.setXYZ(m, 0, 0, 1),
  57130. I.x = (C.x / t + 1) / 2,
  57131. I.y = (C.y / t + 1) / 2,
  57132. g.setXY(m, I.x, I.y),
  57133. m++;
  57134. A += y
  57135. }
  57136. for (l = 0; l < r; l++) {
  57137. var E = l * (i + 1);
  57138. for (c = 0; c < i; c++) {
  57139. s = c + E;
  57140. var b = s
  57141. , w = s + i + 1
  57142. , _ = s + i + 2
  57143. , T = s + 1;
  57144. d.setX(v, b),
  57145. v++,
  57146. d.setX(v, w),
  57147. v++,
  57148. d.setX(v, _),
  57149. v++,
  57150. d.setX(v, b),
  57151. v++,
  57152. d.setX(v, _),
  57153. v++,
  57154. d.setX(v, T),
  57155. v++
  57156. }
  57157. }
  57158. this.setIndex(d),
  57159. this.addAttribute("position", p),
  57160. this.addAttribute("normal", f),
  57161. this.addAttribute("uv", g)
  57162. }
  57163. ,
  57164. n.RingBufferGeometry.prototype = Object.create(n.BufferGeometry.prototype),
  57165. n.RingBufferGeometry.prototype.constructor = n.RingBufferGeometry,
  57166. n.RingGeometry = function(e, t, i, r, o, a) {
  57167. n.Geometry.call(this),
  57168. this.type = "RingGeometry",
  57169. this.parameters = {
  57170. innerRadius: e,
  57171. outerRadius: t,
  57172. thetaSegments: i,
  57173. phiSegments: r,
  57174. thetaStart: o,
  57175. thetaLength: a
  57176. },
  57177. this.fromBufferGeometry(new n.RingBufferGeometry(e,t,i,r,o,a))
  57178. }
  57179. ,
  57180. n.RingGeometry.prototype = Object.create(n.Geometry.prototype),
  57181. n.RingGeometry.prototype.constructor = n.RingGeometry,
  57182. n.SphereGeometry = function(e, t, i, r, o, a, s) {
  57183. n.Geometry.call(this),
  57184. this.type = "SphereGeometry",
  57185. this.parameters = {
  57186. radius: e,
  57187. widthSegments: t,
  57188. heightSegments: i,
  57189. phiStart: r,
  57190. phiLength: o,
  57191. thetaStart: a,
  57192. thetaLength: s
  57193. },
  57194. this.fromBufferGeometry(new n.SphereBufferGeometry(e,t,i,r,o,a,s))
  57195. }
  57196. ,
  57197. n.SphereGeometry.prototype = Object.create(n.Geometry.prototype),
  57198. n.SphereGeometry.prototype.constructor = n.SphereGeometry,
  57199. n.SphereBufferGeometry = function(e, t, i, r, o, a, s) {
  57200. n.BufferGeometry.call(this),
  57201. this.type = "SphereBufferGeometry",
  57202. this.parameters = {
  57203. radius: e,
  57204. widthSegments: t,
  57205. heightSegments: i,
  57206. phiStart: r,
  57207. phiLength: o,
  57208. thetaStart: a,
  57209. thetaLength: s
  57210. },
  57211. e = e || 50,
  57212. t = Math.max(3, Math.floor(t) || 8),
  57213. i = Math.max(2, Math.floor(i) || 6),
  57214. r = void 0 !== r ? r : 0,
  57215. o = void 0 !== o ? o : 2 * Math.PI,
  57216. a = void 0 !== a ? a : 0,
  57217. s = void 0 !== s ? s : Math.PI;
  57218. 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++) {
  57219. for (var v = [], A = m / i, y = 0; y <= t; y++) {
  57220. var C = y / t
  57221. , I = -e * Math.cos(r + C * o) * Math.sin(a + A * s)
  57222. , E = e * Math.cos(a + A * s)
  57223. , b = e * Math.sin(r + C * o) * Math.sin(a + A * s);
  57224. g.set(I, E, b).normalize(),
  57225. h.setXYZ(p, I, E, b),
  57226. u.setXYZ(p, g.x, g.y, g.z),
  57227. d.setXY(p, C, 1 - A),
  57228. v.push(p),
  57229. p++
  57230. }
  57231. f.push(v)
  57232. }
  57233. for (var w = [], m = 0; m < i; m++)
  57234. for (var y = 0; y < t; y++) {
  57235. var _ = f[m][y + 1]
  57236. , T = f[m][y]
  57237. , x = f[m + 1][y]
  57238. , S = f[m + 1][y + 1];
  57239. (0 !== m || a > 0) && w.push(_, T, S),
  57240. (m !== i - 1 || l < Math.PI) && w.push(T, x, S)
  57241. }
  57242. this.setIndex(new (h.count > 65535 ? n.Uint32Attribute : n.Uint16Attribute)(w,1)),
  57243. this.addAttribute("position", h),
  57244. this.addAttribute("normal", u),
  57245. this.addAttribute("uv", d),
  57246. this.boundingSphere = new n.Sphere(new n.Vector3,e)
  57247. }
  57248. ,
  57249. n.SphereBufferGeometry.prototype = Object.create(n.BufferGeometry.prototype),
  57250. n.SphereBufferGeometry.prototype.constructor = n.SphereBufferGeometry,
  57251. n.TextGeometry = function(e, t) {
  57252. t = t || {};
  57253. var i = t.font;
  57254. if (i instanceof n.Font == !1)
  57255. return console.error("THREE.TextGeometry: font parameter is not an instance of THREE.Font."),
  57256. new n.Geometry;
  57257. var r = i.generateShapes(e, t.size, t.curveSegments);
  57258. t.amount = void 0 !== t.height ? t.height : 50,
  57259. void 0 === t.bevelThickness && (t.bevelThickness = 10),
  57260. void 0 === t.bevelSize && (t.bevelSize = 8),
  57261. void 0 === t.bevelEnabled && (t.bevelEnabled = !1),
  57262. n.ExtrudeGeometry.call(this, r, t),
  57263. this.type = "TextGeometry"
  57264. }
  57265. ,
  57266. n.TextGeometry.prototype = Object.create(n.ExtrudeGeometry.prototype),
  57267. n.TextGeometry.prototype.constructor = n.TextGeometry,
  57268. n.TorusBufferGeometry = function(e, t, i, r, o) {
  57269. n.BufferGeometry.call(this),
  57270. this.type = "TorusBufferGeometry",
  57271. this.parameters = {
  57272. radius: e,
  57273. tube: t,
  57274. radialSegments: i,
  57275. tubularSegments: r,
  57276. arc: o
  57277. },
  57278. e = e || 100,
  57279. t = t || 40,
  57280. i = Math.floor(i) || 8,
  57281. r = Math.floor(r) || 6,
  57282. o = o || 2 * Math.PI;
  57283. 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;
  57284. for (a = 0; a <= i; a++)
  57285. for (s = 0; s <= r; s++) {
  57286. var C = s / r * o
  57287. , I = a / i * Math.PI * 2;
  57288. A.x = (e + t * Math.cos(I)) * Math.cos(C),
  57289. A.y = (e + t * Math.cos(I)) * Math.sin(C),
  57290. A.z = t * Math.sin(I),
  57291. u[f] = A.x,
  57292. u[f + 1] = A.y,
  57293. u[f + 2] = A.z,
  57294. v.x = e * Math.cos(C),
  57295. v.y = e * Math.sin(C),
  57296. y.subVectors(A, v).normalize(),
  57297. d[f] = y.x,
  57298. d[f + 1] = y.y,
  57299. d[f + 2] = y.z,
  57300. p[g] = s / r,
  57301. p[g + 1] = a / i,
  57302. f += 3,
  57303. g += 2
  57304. }
  57305. for (a = 1; a <= i; a++)
  57306. for (s = 1; s <= r; s++) {
  57307. var E = (r + 1) * a + s - 1
  57308. , b = (r + 1) * (a - 1) + s - 1
  57309. , w = (r + 1) * (a - 1) + s
  57310. , _ = (r + 1) * a + s;
  57311. h[m] = E,
  57312. h[m + 1] = b,
  57313. h[m + 2] = _,
  57314. h[m + 3] = b,
  57315. h[m + 4] = w,
  57316. h[m + 5] = _,
  57317. m += 6
  57318. }
  57319. this.setIndex(new n.BufferAttribute(h,1)),
  57320. this.addAttribute("position", new n.BufferAttribute(u,3)),
  57321. this.addAttribute("normal", new n.BufferAttribute(d,3)),
  57322. this.addAttribute("uv", new n.BufferAttribute(p,2))
  57323. }
  57324. ,
  57325. n.TorusBufferGeometry.prototype = Object.create(n.BufferGeometry.prototype),
  57326. n.TorusBufferGeometry.prototype.constructor = n.TorusBufferGeometry,
  57327. n.TorusGeometry = function(e, t, i, r, o) {
  57328. n.Geometry.call(this),
  57329. this.type = "TorusGeometry",
  57330. this.parameters = {
  57331. radius: e,
  57332. tube: t,
  57333. radialSegments: i,
  57334. tubularSegments: r,
  57335. arc: o
  57336. },
  57337. this.fromBufferGeometry(new n.TorusBufferGeometry(e,t,i,r,o))
  57338. }
  57339. ,
  57340. n.TorusGeometry.prototype = Object.create(n.Geometry.prototype),
  57341. n.TorusGeometry.prototype.constructor = n.TorusGeometry,
  57342. n.TorusKnotBufferGeometry = function(e, t, i, r, o, a) {
  57343. function s(e, t, i, n, r) {
  57344. var o = Math.cos(e)
  57345. , a = Math.sin(e)
  57346. , s = i / t * e
  57347. , l = Math.cos(s);
  57348. r.x = n * (2 + l) * .5 * o,
  57349. r.y = n * (2 + l) * a * .5,
  57350. r.z = n * Math.sin(s) * .5
  57351. }
  57352. n.BufferGeometry.call(this),
  57353. this.type = "TorusKnotBufferGeometry",
  57354. this.parameters = {
  57355. radius: e,
  57356. tube: t,
  57357. tubularSegments: i,
  57358. radialSegments: r,
  57359. p: o,
  57360. q: a
  57361. },
  57362. e = e || 100,
  57363. t = t || 40,
  57364. i = Math.floor(i) || 64,
  57365. r = Math.floor(r) || 8,
  57366. o = o || 2,
  57367. a = a || 3;
  57368. 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;
  57369. for (l = 0; l <= i; ++l) {
  57370. var T = l / i * o * Math.PI * 2;
  57371. for (s(T, o, a, e, I),
  57372. s(T + .01, o, a, e, E),
  57373. w.subVectors(E, I),
  57374. _.addVectors(E, I),
  57375. b.crossVectors(w, _),
  57376. _.crossVectors(b, w),
  57377. b.normalize(),
  57378. _.normalize(),
  57379. c = 0; c <= r; ++c) {
  57380. var x = c / r * Math.PI * 2
  57381. , S = -t * Math.cos(x)
  57382. , M = t * Math.sin(x);
  57383. A.x = I.x + (S * _.x + M * b.x),
  57384. A.y = I.y + (S * _.y + M * b.y),
  57385. A.z = I.z + (S * _.z + M * b.z),
  57386. p.setXYZ(m, A.x, A.y, A.z),
  57387. y.subVectors(A, I).normalize(),
  57388. f.setXYZ(m, y.x, y.y, y.z),
  57389. C.x = l / i,
  57390. C.y = c / r,
  57391. g.setXY(m, C.x, C.y),
  57392. m++
  57393. }
  57394. }
  57395. for (c = 1; c <= i; c++)
  57396. for (l = 1; l <= r; l++) {
  57397. var R = (r + 1) * (c - 1) + (l - 1)
  57398. , P = (r + 1) * c + (l - 1)
  57399. , O = (r + 1) * c + l
  57400. , L = (r + 1) * (c - 1) + l;
  57401. d.setX(v, R),
  57402. v++,
  57403. d.setX(v, P),
  57404. v++,
  57405. d.setX(v, L),
  57406. v++,
  57407. d.setX(v, P),
  57408. v++,
  57409. d.setX(v, O),
  57410. v++,
  57411. d.setX(v, L),
  57412. v++
  57413. }
  57414. this.setIndex(d),
  57415. this.addAttribute("position", p),
  57416. this.addAttribute("normal", f),
  57417. this.addAttribute("uv", g)
  57418. }
  57419. ,
  57420. n.TorusKnotBufferGeometry.prototype = Object.create(n.BufferGeometry.prototype),
  57421. n.TorusKnotBufferGeometry.prototype.constructor = n.TorusKnotBufferGeometry,
  57422. n.TorusKnotGeometry = function(e, t, i, r, o, a, s) {
  57423. n.Geometry.call(this),
  57424. this.type = "TorusKnotGeometry",
  57425. this.parameters = {
  57426. radius: e,
  57427. tube: t,
  57428. tubularSegments: i,
  57429. radialSegments: r,
  57430. p: o,
  57431. q: a
  57432. },
  57433. void 0 !== s && console.warn("THREE.TorusKnotGeometry: heightScale has been deprecated. Use .scale( x, y, z ) instead."),
  57434. this.fromBufferGeometry(new n.TorusKnotBufferGeometry(e,t,i,r,o,a)),
  57435. this.mergeVertices()
  57436. }
  57437. ,
  57438. n.TorusKnotGeometry.prototype = Object.create(n.Geometry.prototype),
  57439. n.TorusKnotGeometry.prototype.constructor = n.TorusKnotGeometry,
  57440. n.TubeGeometry = function(e, t, i, r, o, a) {
  57441. function s(e, t, i) {
  57442. return R.vertices.push(new n.Vector3(e,t,i)) - 1
  57443. }
  57444. n.Geometry.call(this),
  57445. this.type = "TubeGeometry",
  57446. this.parameters = {
  57447. path: e,
  57448. segments: t,
  57449. radius: i,
  57450. radialSegments: r,
  57451. closed: o,
  57452. taper: a
  57453. },
  57454. t = t || 64,
  57455. i = i || 1,
  57456. r = r || 8,
  57457. o = o || !1,
  57458. a = a || n.TubeGeometry.NoTaper;
  57459. 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;
  57460. for (this.tangents = D,
  57461. this.normals = N,
  57462. this.binormals = B,
  57463. v = 0; v < P; v++)
  57464. for (M[v] = [],
  57465. u = v / (P - 1),
  57466. m = e.getPointAt(u),
  57467. l = D[v],
  57468. c = N[v],
  57469. h = B[v],
  57470. p = i * a(u),
  57471. A = 0; A < r; A++)
  57472. d = A / r * 2 * Math.PI,
  57473. f = -p * Math.cos(d),
  57474. g = p * Math.sin(d),
  57475. O.copy(m),
  57476. O.x += f * c.x + g * h.x,
  57477. O.y += f * c.y + g * h.y,
  57478. O.z += f * c.z + g * h.z,
  57479. M[v][A] = s(O.x, O.y, O.z);
  57480. for (v = 0; v < t; v++)
  57481. for (A = 0; A < r; A++)
  57482. y = o ? (v + 1) % t : v + 1,
  57483. C = (A + 1) % r,
  57484. I = M[v][A],
  57485. E = M[y][A],
  57486. b = M[y][C],
  57487. w = M[v][C],
  57488. _ = new n.Vector2(v / t,A / r),
  57489. T = new n.Vector2((v + 1) / t,A / r),
  57490. x = new n.Vector2((v + 1) / t,(A + 1) / r),
  57491. S = new n.Vector2(v / t,(A + 1) / r),
  57492. this.faces.push(new n.Face3(I,E,w)),
  57493. this.faceVertexUvs[0].push([_, T, S]),
  57494. this.faces.push(new n.Face3(E,b,w)),
  57495. this.faceVertexUvs[0].push([T.clone(), x, S.clone()]);
  57496. this.computeFaceNormals(),
  57497. this.computeVertexNormals()
  57498. }
  57499. ,
  57500. n.TubeGeometry.prototype = Object.create(n.Geometry.prototype),
  57501. n.TubeGeometry.prototype.constructor = n.TubeGeometry,
  57502. n.TubeGeometry.NoTaper = function(e) {
  57503. return 1
  57504. }
  57505. ,
  57506. n.TubeGeometry.SinusoidalTaper = function(e) {
  57507. return Math.sin(Math.PI * e)
  57508. }
  57509. ,
  57510. n.TubeGeometry.FrenetFrames = function(e, t, i) {
  57511. function r() {
  57512. f[0] = new n.Vector3,
  57513. g[0] = new n.Vector3,
  57514. a = Number.MAX_VALUE,
  57515. s = Math.abs(p[0].x),
  57516. l = Math.abs(p[0].y),
  57517. c = Math.abs(p[0].z),
  57518. s <= a && (a = s,
  57519. d.set(1, 0, 0)),
  57520. l <= a && (a = l,
  57521. d.set(0, 1, 0)),
  57522. c <= a && d.set(0, 0, 1),
  57523. m.crossVectors(p[0], d).normalize(),
  57524. f[0].crossVectors(p[0], m),
  57525. g[0].crossVectors(p[0], f[0])
  57526. }
  57527. 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;
  57528. for (this.tangents = p,
  57529. this.normals = f,
  57530. this.binormals = g,
  57531. h = 0; h < A; h++)
  57532. u = h / (A - 1),
  57533. p[h] = e.getTangentAt(u),
  57534. p[h].normalize();
  57535. for (r(),
  57536. h = 1; h < A; h++)
  57537. f[h] = f[h - 1].clone(),
  57538. g[h] = g[h - 1].clone(),
  57539. m.crossVectors(p[h - 1], p[h]),
  57540. m.length() > Number.EPSILON && (m.normalize(),
  57541. o = Math.acos(n.Math.clamp(p[h - 1].dot(p[h]), -1, 1)),
  57542. f[h].applyMatrix4(v.makeRotationAxis(m, o))),
  57543. g[h].crossVectors(p[h], f[h]);
  57544. if (i)
  57545. for (o = Math.acos(n.Math.clamp(f[0].dot(f[A - 1]), -1, 1)),
  57546. o /= A - 1,
  57547. p[0].dot(m.crossVectors(f[0], f[A - 1])) > 0 && (o = -o),
  57548. h = 1; h < A; h++)
  57549. f[h].applyMatrix4(v.makeRotationAxis(p[h], o * h)),
  57550. g[h].crossVectors(p[h], f[h])
  57551. }
  57552. ,
  57553. n.PolyhedronGeometry = function(e, t, i, r) {
  57554. function o(e) {
  57555. var t = e.normalize().clone();
  57556. t.index = u.vertices.push(t) - 1;
  57557. var i = l(e) / 2 / Math.PI + .5
  57558. , r = c(e) / Math.PI + .5;
  57559. return t.uv = new n.Vector2(i,1 - r),
  57560. t
  57561. }
  57562. function a(e, t, i, r) {
  57563. var o = new n.Face3(e.index,t.index,i.index,[e.clone(), t.clone(), i.clone()],void 0,r);
  57564. u.faces.push(o),
  57565. C.copy(e).add(t).add(i).divideScalar(3);
  57566. var a = l(C);
  57567. u.faceVertexUvs[0].push([h(e.uv, e, a), h(t.uv, t, a), h(i.uv, i, a)])
  57568. }
  57569. function s(e, t) {
  57570. 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++) {
  57571. l[h] = [];
  57572. 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++)
  57573. 0 === g && h === i ? l[h][g] = d : l[h][g] = o(d.clone().lerp(p, g / f))
  57574. }
  57575. for (var h = 0; h < i; h++)
  57576. for (var g = 0; g < 2 * (i - h) - 1; g++) {
  57577. var m = Math.floor(g / 2);
  57578. 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)
  57579. }
  57580. }
  57581. function l(e) {
  57582. return Math.atan2(e.z, -e.x)
  57583. }
  57584. function c(e) {
  57585. return Math.atan2(-e.y, Math.sqrt(e.x * e.x + e.z * e.z))
  57586. }
  57587. function h(e, t, i) {
  57588. return i < 0 && 1 === e.x && (e = new n.Vector2(e.x - 1,e.y)),
  57589. 0 === t.x && 0 === t.z && (e = new n.Vector2(i / 2 / Math.PI + .5,e.y)),
  57590. e.clone()
  57591. }
  57592. n.Geometry.call(this),
  57593. this.type = "PolyhedronGeometry",
  57594. this.parameters = {
  57595. vertices: e,
  57596. indices: t,
  57597. radius: i,
  57598. detail: r
  57599. },
  57600. i = i || 1,
  57601. r = r || 0;
  57602. for (var u = this, d = 0, p = e.length; d < p; d += 3)
  57603. o(new n.Vector3(e[d],e[d + 1],e[d + 2]));
  57604. for (var f = this.vertices, g = [], d = 0, m = 0, p = t.length; d < p; d += 3,
  57605. m++) {
  57606. var v = f[t[d]]
  57607. , A = f[t[d + 1]]
  57608. , y = f[t[d + 2]];
  57609. g[m] = new n.Face3(v.index,A.index,y.index,[v.clone(), A.clone(), y.clone()],void 0,m)
  57610. }
  57611. for (var C = new n.Vector3, d = 0, p = g.length; d < p; d++)
  57612. s(g[d], r);
  57613. for (var d = 0, p = this.faceVertexUvs[0].length; d < p; d++) {
  57614. var I = this.faceVertexUvs[0][d]
  57615. , E = I[0].x
  57616. , b = I[1].x
  57617. , w = I[2].x
  57618. , _ = Math.max(E, b, w)
  57619. , T = Math.min(E, b, w);
  57620. _ > .9 && T < .1 && (E < .2 && (I[0].x += 1),
  57621. b < .2 && (I[1].x += 1),
  57622. w < .2 && (I[2].x += 1))
  57623. }
  57624. for (var d = 0, p = this.vertices.length; d < p; d++)
  57625. this.vertices[d].multiplyScalar(i);
  57626. this.mergeVertices(),
  57627. this.computeFaceNormals(),
  57628. this.boundingSphere = new n.Sphere(new n.Vector3,i)
  57629. }
  57630. ,
  57631. n.PolyhedronGeometry.prototype = Object.create(n.Geometry.prototype),
  57632. n.PolyhedronGeometry.prototype.constructor = n.PolyhedronGeometry,
  57633. n.DodecahedronGeometry = function(e, t) {
  57634. var i = (1 + Math.sqrt(5)) / 2
  57635. , r = 1 / i
  57636. , 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]
  57637. , 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];
  57638. n.PolyhedronGeometry.call(this, o, a, e, t),
  57639. this.type = "DodecahedronGeometry",
  57640. this.parameters = {
  57641. radius: e,
  57642. detail: t
  57643. }
  57644. }
  57645. ,
  57646. n.DodecahedronGeometry.prototype = Object.create(n.PolyhedronGeometry.prototype),
  57647. n.DodecahedronGeometry.prototype.constructor = n.DodecahedronGeometry,
  57648. n.IcosahedronGeometry = function(e, t) {
  57649. var i = (1 + Math.sqrt(5)) / 2
  57650. , 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]
  57651. , 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];
  57652. n.PolyhedronGeometry.call(this, r, o, e, t),
  57653. this.type = "IcosahedronGeometry",
  57654. this.parameters = {
  57655. radius: e,
  57656. detail: t
  57657. }
  57658. }
  57659. ,
  57660. n.IcosahedronGeometry.prototype = Object.create(n.PolyhedronGeometry.prototype),
  57661. n.IcosahedronGeometry.prototype.constructor = n.IcosahedronGeometry,
  57662. n.OctahedronGeometry = function(e, t) {
  57663. var i = [1, 0, 0, -1, 0, 0, 0, 1, 0, 0, -1, 0, 0, 0, 1, 0, 0, -1]
  57664. , 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];
  57665. n.PolyhedronGeometry.call(this, i, r, e, t),
  57666. this.type = "OctahedronGeometry",
  57667. this.parameters = {
  57668. radius: e,
  57669. detail: t
  57670. }
  57671. }
  57672. ,
  57673. n.OctahedronGeometry.prototype = Object.create(n.PolyhedronGeometry.prototype),
  57674. n.OctahedronGeometry.prototype.constructor = n.OctahedronGeometry,
  57675. n.TetrahedronGeometry = function(e, t) {
  57676. var i = [1, 1, 1, -1, -1, 1, -1, 1, -1, 1, -1, -1]
  57677. , r = [2, 1, 0, 0, 3, 2, 1, 3, 0, 2, 3, 1];
  57678. n.PolyhedronGeometry.call(this, i, r, e, t),
  57679. this.type = "TetrahedronGeometry",
  57680. this.parameters = {
  57681. radius: e,
  57682. detail: t
  57683. }
  57684. }
  57685. ,
  57686. n.TetrahedronGeometry.prototype = Object.create(n.PolyhedronGeometry.prototype),
  57687. n.TetrahedronGeometry.prototype.constructor = n.TetrahedronGeometry,
  57688. n.ParametricGeometry = function(e, t, i) {
  57689. n.Geometry.call(this),
  57690. this.type = "ParametricGeometry",
  57691. this.parameters = {
  57692. func: e,
  57693. slices: t,
  57694. stacks: i
  57695. };
  57696. var r, o, a, s, l, c = this.vertices, h = this.faces, u = this.faceVertexUvs[0], d = t + 1;
  57697. for (r = 0; r <= i; r++)
  57698. for (l = r / i,
  57699. o = 0; o <= t; o++)
  57700. s = o / t,
  57701. a = e(s, l),
  57702. c.push(a);
  57703. var p, f, g, m, v, A, y, C;
  57704. for (r = 0; r < i; r++)
  57705. for (o = 0; o < t; o++)
  57706. p = r * d + o,
  57707. f = r * d + o + 1,
  57708. g = (r + 1) * d + o + 1,
  57709. m = (r + 1) * d + o,
  57710. v = new n.Vector2(o / t,r / i),
  57711. A = new n.Vector2((o + 1) / t,r / i),
  57712. y = new n.Vector2((o + 1) / t,(r + 1) / i),
  57713. C = new n.Vector2(o / t,(r + 1) / i),
  57714. h.push(new n.Face3(p,f,m)),
  57715. u.push([v, A, C]),
  57716. h.push(new n.Face3(f,g,m)),
  57717. u.push([A.clone(), y, C.clone()]);
  57718. this.computeFaceNormals(),
  57719. this.computeVertexNormals()
  57720. }
  57721. ,
  57722. n.ParametricGeometry.prototype = Object.create(n.Geometry.prototype),
  57723. n.ParametricGeometry.prototype.constructor = n.ParametricGeometry,
  57724. n.WireframeGeometry = function(e) {
  57725. function t(e, t) {
  57726. return e - t
  57727. }
  57728. n.BufferGeometry.call(this);
  57729. var i = [0, 0]
  57730. , r = {}
  57731. , o = ["a", "b", "c"];
  57732. if (e instanceof n.Geometry) {
  57733. for (var a = e.vertices, s = e.faces, l = 0, c = new Uint32Array(6 * s.length), h = 0, u = s.length; h < u; h++)
  57734. for (var d = s[h], p = 0; p < 3; p++) {
  57735. i[0] = d[o[p]],
  57736. i[1] = d[o[(p + 1) % 3]],
  57737. i.sort(t);
  57738. var f = i.toString();
  57739. void 0 === r[f] && (c[2 * l] = i[0],
  57740. c[2 * l + 1] = i[1],
  57741. r[f] = !0,
  57742. l++)
  57743. }
  57744. for (var g = new Float32Array(2 * l * 3), h = 0, u = l; h < u; h++)
  57745. for (var p = 0; p < 2; p++) {
  57746. var m = a[c[2 * h + p]]
  57747. , v = 6 * h + 3 * p;
  57748. g[v + 0] = m.x,
  57749. g[v + 1] = m.y,
  57750. g[v + 2] = m.z
  57751. }
  57752. this.addAttribute("position", new n.BufferAttribute(g,3))
  57753. } else if (e instanceof n.BufferGeometry)
  57754. if (null !== e.index) {
  57755. var A = e.index.array
  57756. , a = e.attributes.position
  57757. , y = e.groups
  57758. , l = 0;
  57759. 0 === y.length && e.addGroup(0, A.length);
  57760. for (var c = new Uint32Array(2 * A.length), C = 0, I = y.length; C < I; ++C)
  57761. for (var E = y[C], b = E.start, w = E.count, h = b, _ = b + w; h < _; h += 3)
  57762. for (var p = 0; p < 3; p++) {
  57763. i[0] = A[h + p],
  57764. i[1] = A[h + (p + 1) % 3],
  57765. i.sort(t);
  57766. var f = i.toString();
  57767. void 0 === r[f] && (c[2 * l] = i[0],
  57768. c[2 * l + 1] = i[1],
  57769. r[f] = !0,
  57770. l++)
  57771. }
  57772. for (var g = new Float32Array(2 * l * 3), h = 0, u = l; h < u; h++)
  57773. for (var p = 0; p < 2; p++) {
  57774. var v = 6 * h + 3 * p
  57775. , T = c[2 * h + p];
  57776. g[v + 0] = a.getX(T),
  57777. g[v + 1] = a.getY(T),
  57778. g[v + 2] = a.getZ(T)
  57779. }
  57780. this.addAttribute("position", new n.BufferAttribute(g,3))
  57781. } else {
  57782. 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++)
  57783. for (var p = 0; p < 3; p++) {
  57784. var v = 18 * h + 6 * p
  57785. , S = 9 * h + 3 * p;
  57786. g[v + 0] = a[S],
  57787. g[v + 1] = a[S + 1],
  57788. g[v + 2] = a[S + 2];
  57789. var T = 9 * h + 3 * ((p + 1) % 3);
  57790. g[v + 3] = a[T],
  57791. g[v + 4] = a[T + 1],
  57792. g[v + 5] = a[T + 2]
  57793. }
  57794. this.addAttribute("position", new n.BufferAttribute(g,3))
  57795. }
  57796. }
  57797. ,
  57798. n.WireframeGeometry.prototype = Object.create(n.BufferGeometry.prototype),
  57799. n.WireframeGeometry.prototype.constructor = n.WireframeGeometry,
  57800. n.AxisHelper = function(e) {
  57801. e = e || 1;
  57802. var t = new Float32Array([0, 0, 0, e, 0, 0, 0, 0, 0, 0, e, 0, 0, 0, 0, 0, 0, e])
  57803. , i = new Float32Array([1, 0, 0, 1, .6, 0, 0, 1, 0, .6, 1, 0, 0, 0, 1, 0, .6, 1])
  57804. , r = new n.BufferGeometry;
  57805. r.addAttribute("position", new n.BufferAttribute(t,3)),
  57806. r.addAttribute("color", new n.BufferAttribute(i,3));
  57807. var o = new n.LineBasicMaterial({
  57808. vertexColors: n.VertexColors
  57809. });
  57810. n.LineSegments.call(this, r, o)
  57811. }
  57812. ,
  57813. n.AxisHelper.prototype = Object.create(n.LineSegments.prototype),
  57814. n.AxisHelper.prototype.constructor = n.AxisHelper,
  57815. n.ArrowHelper = function() {
  57816. var e = new n.Geometry;
  57817. e.vertices.push(new n.Vector3(0,0,0), new n.Vector3(0,1,0));
  57818. var t = new n.CylinderGeometry(0,.5,1,5,1);
  57819. return t.translate(0, -.5, 0),
  57820. function(i, r, o, a, s, l) {
  57821. n.Object3D.call(this),
  57822. void 0 === a && (a = 16776960),
  57823. void 0 === o && (o = 1),
  57824. void 0 === s && (s = .2 * o),
  57825. void 0 === l && (l = .2 * s),
  57826. this.position.copy(r),
  57827. this.line = new n.Line(e,new n.LineBasicMaterial({
  57828. color: a
  57829. })),
  57830. this.line.matrixAutoUpdate = !1,
  57831. this.add(this.line),
  57832. this.cone = new n.Mesh(t,new n.MeshBasicMaterial({
  57833. color: a
  57834. })),
  57835. this.cone.matrixAutoUpdate = !1,
  57836. this.add(this.cone),
  57837. this.setDirection(i),
  57838. this.setLength(o, s, l)
  57839. }
  57840. }(),
  57841. n.ArrowHelper.prototype = Object.create(n.Object3D.prototype),
  57842. n.ArrowHelper.prototype.constructor = n.ArrowHelper,
  57843. n.ArrowHelper.prototype.setDirection = function() {
  57844. var e, t = new n.Vector3;
  57845. return function(i) {
  57846. 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(),
  57847. e = Math.acos(i.y),
  57848. this.quaternion.setFromAxisAngle(t, e))
  57849. }
  57850. }(),
  57851. n.ArrowHelper.prototype.setLength = function(e, t, i) {
  57852. void 0 === t && (t = .2 * e),
  57853. void 0 === i && (i = .2 * t),
  57854. this.line.scale.set(1, Math.max(0, e - t), 1),
  57855. this.line.updateMatrix(),
  57856. this.cone.scale.set(i, t, i),
  57857. this.cone.position.y = e,
  57858. this.cone.updateMatrix()
  57859. }
  57860. ,
  57861. n.ArrowHelper.prototype.setColor = function(e) {
  57862. this.line.material.color.set(e),
  57863. this.cone.material.color.set(e)
  57864. }
  57865. ,
  57866. n.BoxHelper = function(e) {
  57867. 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])
  57868. , i = new Float32Array(24)
  57869. , r = new n.BufferGeometry;
  57870. r.setIndex(new n.BufferAttribute(t,1)),
  57871. r.addAttribute("position", new n.BufferAttribute(i,3)),
  57872. n.LineSegments.call(this, r, new n.LineBasicMaterial({
  57873. color: 16776960
  57874. })),
  57875. void 0 !== e && this.update(e)
  57876. }
  57877. ,
  57878. n.BoxHelper.prototype = Object.create(n.LineSegments.prototype),
  57879. n.BoxHelper.prototype.constructor = n.BoxHelper,
  57880. n.BoxHelper.prototype.update = function() {
  57881. var e = new n.Box3;
  57882. return function(t) {
  57883. if (e.setFromObject(t),
  57884. !e.isEmpty()) {
  57885. var i = e.min
  57886. , n = e.max
  57887. , r = this.geometry.attributes.position
  57888. , o = r.array;
  57889. o[0] = n.x,
  57890. o[1] = n.y,
  57891. o[2] = n.z,
  57892. o[3] = i.x,
  57893. o[4] = n.y,
  57894. o[5] = n.z,
  57895. o[6] = i.x,
  57896. o[7] = i.y,
  57897. o[8] = n.z,
  57898. o[9] = n.x,
  57899. o[10] = i.y,
  57900. o[11] = n.z,
  57901. o[12] = n.x,
  57902. o[13] = n.y,
  57903. o[14] = i.z,
  57904. o[15] = i.x,
  57905. o[16] = n.y,
  57906. o[17] = i.z,
  57907. o[18] = i.x,
  57908. o[19] = i.y,
  57909. o[20] = i.z,
  57910. o[21] = n.x,
  57911. o[22] = i.y,
  57912. o[23] = i.z,
  57913. r.needsUpdate = !0,
  57914. this.geometry.computeBoundingSphere()
  57915. }
  57916. }
  57917. }(),
  57918. n.BoundingBoxHelper = function(e, t) {
  57919. var i = void 0 !== t ? t : 8947848;
  57920. this.object = e,
  57921. this.box = new n.Box3,
  57922. n.Mesh.call(this, new n.BoxGeometry(1,1,1), new n.MeshBasicMaterial({
  57923. color: i,
  57924. wireframe: !0
  57925. }))
  57926. }
  57927. ,
  57928. n.BoundingBoxHelper.prototype = Object.create(n.Mesh.prototype),
  57929. n.BoundingBoxHelper.prototype.constructor = n.BoundingBoxHelper,
  57930. n.BoundingBoxHelper.prototype.update = function() {
  57931. this.box.setFromObject(this.object),
  57932. this.box.size(this.scale),
  57933. this.box.center(this.position)
  57934. }
  57935. ,
  57936. n.CameraHelper = function(e) {
  57937. function t(e, t, n) {
  57938. i(e, n),
  57939. i(t, n)
  57940. }
  57941. function i(e, t) {
  57942. r.vertices.push(new n.Vector3),
  57943. r.colors.push(new n.Color(t)),
  57944. void 0 === a[e] && (a[e] = []),
  57945. a[e].push(r.vertices.length - 1)
  57946. }
  57947. var r = new n.Geometry
  57948. , o = new n.LineBasicMaterial({
  57949. color: 16777215,
  57950. vertexColors: n.FaceColors
  57951. })
  57952. , a = {}
  57953. , s = 16755200
  57954. , l = 16711680
  57955. , c = 43775
  57956. , h = 16777215
  57957. , u = 3355443;
  57958. t("n1", "n2", s),
  57959. t("n2", "n4", s),
  57960. t("n4", "n3", s),
  57961. t("n3", "n1", s),
  57962. t("f1", "f2", s),
  57963. t("f2", "f4", s),
  57964. t("f4", "f3", s),
  57965. t("f3", "f1", s),
  57966. t("n1", "f1", s),
  57967. t("n2", "f2", s),
  57968. t("n3", "f3", s),
  57969. t("n4", "f4", s),
  57970. t("p", "n1", l),
  57971. t("p", "n2", l),
  57972. t("p", "n3", l),
  57973. t("p", "n4", l),
  57974. t("u1", "u2", c),
  57975. t("u2", "u3", c),
  57976. t("u3", "u1", c),
  57977. t("c", "t", h),
  57978. t("p", "c", u),
  57979. t("cn1", "cn2", u),
  57980. t("cn3", "cn4", u),
  57981. t("cf1", "cf2", u),
  57982. t("cf3", "cf4", u),
  57983. n.LineSegments.call(this, r, o),
  57984. this.camera = e,
  57985. this.camera.updateProjectionMatrix(),
  57986. this.matrix = e.matrixWorld,
  57987. this.matrixAutoUpdate = !1,
  57988. this.pointMap = a,
  57989. this.update()
  57990. }
  57991. ,
  57992. n.CameraHelper.prototype = Object.create(n.LineSegments.prototype),
  57993. n.CameraHelper.prototype.constructor = n.CameraHelper,
  57994. n.CameraHelper.prototype.update = function() {
  57995. function e(e, n, a, s) {
  57996. r.set(n, a, s).unproject(o);
  57997. var l = i[e];
  57998. if (void 0 !== l)
  57999. for (var c = 0, h = l.length; c < h; c++)
  58000. t.vertices[l[c]].copy(r)
  58001. }
  58002. var t, i, r = new n.Vector3, o = new n.Camera;
  58003. return function() {
  58004. t = this.geometry,
  58005. i = this.pointMap;
  58006. var n = 1
  58007. , r = 1;
  58008. o.projectionMatrix.copy(this.camera.projectionMatrix),
  58009. e("c", 0, 0, -1),
  58010. e("t", 0, 0, 1),
  58011. e("n1", -n, -r, -1),
  58012. e("n2", n, -r, -1),
  58013. e("n3", -n, r, -1),
  58014. e("n4", n, r, -1),
  58015. e("f1", -n, -r, 1),
  58016. e("f2", n, -r, 1),
  58017. e("f3", -n, r, 1),
  58018. e("f4", n, r, 1),
  58019. e("u1", .7 * n, 1.1 * r, -1),
  58020. e("u2", .7 * -n, 1.1 * r, -1),
  58021. e("u3", 0, 2 * r, -1),
  58022. e("cf1", -n, 0, 1),
  58023. e("cf2", n, 0, 1),
  58024. e("cf3", 0, -r, 1),
  58025. e("cf4", 0, r, 1),
  58026. e("cn1", -n, 0, -1),
  58027. e("cn2", n, 0, -1),
  58028. e("cn3", 0, -r, -1),
  58029. e("cn4", 0, r, -1),
  58030. t.verticesNeedUpdate = !0
  58031. }
  58032. }(),
  58033. n.DirectionalLightHelper = function(e, t) {
  58034. n.Object3D.call(this),
  58035. this.light = e,
  58036. this.light.updateMatrixWorld(),
  58037. this.matrix = e.matrixWorld,
  58038. this.matrixAutoUpdate = !1,
  58039. t = t || 1;
  58040. var i = new n.Geometry;
  58041. 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));
  58042. var r = new n.LineBasicMaterial({
  58043. fog: !1
  58044. });
  58045. r.color.copy(this.light.color).multiplyScalar(this.light.intensity),
  58046. this.lightPlane = new n.Line(i,r),
  58047. this.add(this.lightPlane),
  58048. i = new n.Geometry,
  58049. i.vertices.push(new n.Vector3, new n.Vector3),
  58050. r = new n.LineBasicMaterial({
  58051. fog: !1
  58052. }),
  58053. r.color.copy(this.light.color).multiplyScalar(this.light.intensity),
  58054. this.targetLine = new n.Line(i,r),
  58055. this.add(this.targetLine),
  58056. this.update()
  58057. }
  58058. ,
  58059. n.DirectionalLightHelper.prototype = Object.create(n.Object3D.prototype),
  58060. n.DirectionalLightHelper.prototype.constructor = n.DirectionalLightHelper,
  58061. n.DirectionalLightHelper.prototype.dispose = function() {
  58062. this.lightPlane.geometry.dispose(),
  58063. this.lightPlane.material.dispose(),
  58064. this.targetLine.geometry.dispose(),
  58065. this.targetLine.material.dispose()
  58066. }
  58067. ,
  58068. n.DirectionalLightHelper.prototype.update = function() {
  58069. var e = new n.Vector3
  58070. , t = new n.Vector3
  58071. , i = new n.Vector3;
  58072. return function() {
  58073. e.setFromMatrixPosition(this.light.matrixWorld),
  58074. t.setFromMatrixPosition(this.light.target.matrixWorld),
  58075. i.subVectors(t, e),
  58076. this.lightPlane.lookAt(i),
  58077. this.lightPlane.material.color.copy(this.light.color).multiplyScalar(this.light.intensity),
  58078. this.targetLine.geometry.vertices[1].copy(i),
  58079. this.targetLine.geometry.verticesNeedUpdate = !0,
  58080. this.targetLine.material.color.copy(this.lightPlane.material.color)
  58081. }
  58082. }(),
  58083. n.EdgesHelper = function(e, t, i) {
  58084. var r = void 0 !== t ? t : 16777215;
  58085. n.LineSegments.call(this, new n.EdgesGeometry(e.geometry,i), new n.LineBasicMaterial({
  58086. color: r
  58087. })),
  58088. this.matrix = e.matrixWorld,
  58089. this.matrixAutoUpdate = !1
  58090. }
  58091. ,
  58092. n.EdgesHelper.prototype = Object.create(n.LineSegments.prototype),
  58093. n.EdgesHelper.prototype.constructor = n.EdgesHelper,
  58094. n.FaceNormalsHelper = function(e, t, i, r) {
  58095. this.object = e,
  58096. this.size = void 0 !== t ? t : 1;
  58097. var o = void 0 !== i ? i : 16776960
  58098. , a = void 0 !== r ? r : 1
  58099. , s = 0
  58100. , l = this.object.geometry;
  58101. l instanceof n.Geometry ? s = l.faces.length : console.warn("THREE.FaceNormalsHelper: only THREE.Geometry is supported. Use THREE.VertexNormalsHelper, instead.");
  58102. var c = new n.BufferGeometry
  58103. , h = new n.Float32Attribute(2 * s * 3,3);
  58104. c.addAttribute("position", h),
  58105. n.LineSegments.call(this, c, new n.LineBasicMaterial({
  58106. color: o,
  58107. linewidth: a
  58108. })),
  58109. this.matrixAutoUpdate = !1,
  58110. this.update()
  58111. }
  58112. ,
  58113. n.FaceNormalsHelper.prototype = Object.create(n.LineSegments.prototype),
  58114. n.FaceNormalsHelper.prototype.constructor = n.FaceNormalsHelper,
  58115. n.FaceNormalsHelper.prototype.update = function() {
  58116. var e = new n.Vector3
  58117. , t = new n.Vector3
  58118. , i = new n.Matrix3;
  58119. return function() {
  58120. this.object.updateMatrixWorld(!0),
  58121. i.getNormalMatrix(this.object.matrixWorld);
  58122. 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++) {
  58123. var u = s[c]
  58124. , d = u.normal;
  58125. e.copy(a[u.a]).add(a[u.b]).add(a[u.c]).divideScalar(3).applyMatrix4(n),
  58126. t.copy(d).applyMatrix3(i).normalize().multiplyScalar(this.size).add(e),
  58127. r.setXYZ(l, e.x, e.y, e.z),
  58128. l += 1,
  58129. r.setXYZ(l, t.x, t.y, t.z),
  58130. l += 1
  58131. }
  58132. return r.needsUpdate = !0,
  58133. this
  58134. }
  58135. }(),
  58136. n.GridHelper = function(e, t) {
  58137. var i = new n.Geometry
  58138. , r = new n.LineBasicMaterial({
  58139. vertexColors: n.VertexColors
  58140. });
  58141. this.color1 = new n.Color(4473924),
  58142. this.color2 = new n.Color(8947848);
  58143. for (var o = -e; o <= e; o += t) {
  58144. 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));
  58145. var a = 0 === o ? this.color1 : this.color2;
  58146. i.colors.push(a, a, a, a)
  58147. }
  58148. n.LineSegments.call(this, i, r)
  58149. }
  58150. ,
  58151. n.GridHelper.prototype = Object.create(n.LineSegments.prototype),
  58152. n.GridHelper.prototype.constructor = n.GridHelper,
  58153. n.GridHelper.prototype.setColors = function(e, t) {
  58154. this.color1.set(e),
  58155. this.color2.set(t),
  58156. this.geometry.colorsNeedUpdate = !0
  58157. }
  58158. ,
  58159. n.HemisphereLightHelper = function(e, t) {
  58160. n.Object3D.call(this),
  58161. this.light = e,
  58162. this.light.updateMatrixWorld(),
  58163. this.matrix = e.matrixWorld,
  58164. this.matrixAutoUpdate = !1,
  58165. this.colors = [new n.Color, new n.Color];
  58166. var i = new n.SphereGeometry(t,4,2);
  58167. i.rotateX(-Math.PI / 2);
  58168. for (var r = 0, o = 8; r < o; r++)
  58169. i.faces[r].color = this.colors[r < 4 ? 0 : 1];
  58170. var a = new n.MeshBasicMaterial({
  58171. vertexColors: n.FaceColors,
  58172. wireframe: !0
  58173. });
  58174. this.lightSphere = new n.Mesh(i,a),
  58175. this.add(this.lightSphere),
  58176. this.update()
  58177. }
  58178. ,
  58179. n.HemisphereLightHelper.prototype = Object.create(n.Object3D.prototype),
  58180. n.HemisphereLightHelper.prototype.constructor = n.HemisphereLightHelper,
  58181. n.HemisphereLightHelper.prototype.dispose = function() {
  58182. this.lightSphere.geometry.dispose(),
  58183. this.lightSphere.material.dispose()
  58184. }
  58185. ,
  58186. n.HemisphereLightHelper.prototype.update = function() {
  58187. var e = new n.Vector3;
  58188. return function() {
  58189. this.colors[0].copy(this.light.color).multiplyScalar(this.light.intensity),
  58190. this.colors[1].copy(this.light.groundColor).multiplyScalar(this.light.intensity),
  58191. this.lightSphere.lookAt(e.setFromMatrixPosition(this.light.matrixWorld).negate()),
  58192. this.lightSphere.geometry.colorsNeedUpdate = !0
  58193. }
  58194. }(),
  58195. n.PointLightHelper = function(e, t) {
  58196. this.light = e,
  58197. this.light.updateMatrixWorld();
  58198. var i = new n.SphereGeometry(t,4,2)
  58199. , r = new n.MeshBasicMaterial({
  58200. wireframe: !0,
  58201. fog: !1
  58202. });
  58203. r.color.copy(this.light.color).multiplyScalar(this.light.intensity),
  58204. n.Mesh.call(this, i, r),
  58205. this.matrix = this.light.matrixWorld,
  58206. this.matrixAutoUpdate = !1
  58207. }
  58208. ,
  58209. n.PointLightHelper.prototype = Object.create(n.Mesh.prototype),
  58210. n.PointLightHelper.prototype.constructor = n.PointLightHelper,
  58211. n.PointLightHelper.prototype.dispose = function() {
  58212. this.geometry.dispose(),
  58213. this.material.dispose()
  58214. }
  58215. ,
  58216. n.PointLightHelper.prototype.update = function() {
  58217. this.material.color.copy(this.light.color).multiplyScalar(this.light.intensity)
  58218. }
  58219. ,
  58220. n.SkeletonHelper = function(e) {
  58221. this.bones = this.getBoneList(e);
  58222. for (var t = new n.Geometry, i = 0; i < this.bones.length; i++) {
  58223. var r = this.bones[i];
  58224. r.parent instanceof n.Bone && (t.vertices.push(new n.Vector3),
  58225. t.vertices.push(new n.Vector3),
  58226. t.colors.push(new n.Color(0,0,1)),
  58227. t.colors.push(new n.Color(0,1,0)))
  58228. }
  58229. t.dynamic = !0;
  58230. var o = new n.LineBasicMaterial({
  58231. vertexColors: n.VertexColors,
  58232. depthTest: !1,
  58233. depthWrite: !1,
  58234. transparent: !0
  58235. });
  58236. n.LineSegments.call(this, t, o),
  58237. this.root = e,
  58238. this.matrix = e.matrixWorld,
  58239. this.matrixAutoUpdate = !1,
  58240. this.update()
  58241. }
  58242. ,
  58243. n.SkeletonHelper.prototype = Object.create(n.LineSegments.prototype),
  58244. n.SkeletonHelper.prototype.constructor = n.SkeletonHelper,
  58245. n.SkeletonHelper.prototype.getBoneList = function(e) {
  58246. var t = [];
  58247. e instanceof n.Bone && t.push(e);
  58248. for (var i = 0; i < e.children.length; i++)
  58249. t.push.apply(t, this.getBoneList(e.children[i]));
  58250. return t
  58251. }
  58252. ,
  58253. n.SkeletonHelper.prototype.update = function() {
  58254. 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++) {
  58255. var a = this.bones[o];
  58256. a.parent instanceof n.Bone && (i.multiplyMatrices(t, a.matrixWorld),
  58257. e.vertices[r].setFromMatrixPosition(i),
  58258. i.multiplyMatrices(t, a.parent.matrixWorld),
  58259. e.vertices[r + 1].setFromMatrixPosition(i),
  58260. r += 2)
  58261. }
  58262. e.verticesNeedUpdate = !0,
  58263. e.computeBoundingSphere()
  58264. }
  58265. ,
  58266. n.SpotLightHelper = function(e) {
  58267. n.Object3D.call(this),
  58268. this.light = e,
  58269. this.light.updateMatrixWorld(),
  58270. this.matrix = e.matrixWorld,
  58271. this.matrixAutoUpdate = !1;
  58272. var t = new n.CylinderGeometry(0,1,1,8,1,!0);
  58273. t.translate(0, -.5, 0),
  58274. t.rotateX(-Math.PI / 2);
  58275. var i = new n.MeshBasicMaterial({
  58276. wireframe: !0,
  58277. fog: !1
  58278. });
  58279. this.cone = new n.Mesh(t,i),
  58280. this.add(this.cone),
  58281. this.update()
  58282. }
  58283. ,
  58284. n.SpotLightHelper.prototype = Object.create(n.Object3D.prototype),
  58285. n.SpotLightHelper.prototype.constructor = n.SpotLightHelper,
  58286. n.SpotLightHelper.prototype.dispose = function() {
  58287. this.cone.geometry.dispose(),
  58288. this.cone.material.dispose()
  58289. }
  58290. ,
  58291. n.SpotLightHelper.prototype.update = function() {
  58292. var e = new n.Vector3
  58293. , t = new n.Vector3;
  58294. return function() {
  58295. var i = this.light.distance ? this.light.distance : 1e4
  58296. , n = i * Math.tan(this.light.angle);
  58297. this.cone.scale.set(n, n, i),
  58298. e.setFromMatrixPosition(this.light.matrixWorld),
  58299. t.setFromMatrixPosition(this.light.target.matrixWorld),
  58300. this.cone.lookAt(t.sub(e)),
  58301. this.cone.material.color.copy(this.light.color).multiplyScalar(this.light.intensity)
  58302. }
  58303. }(),
  58304. n.VertexNormalsHelper = function(e, t, i, r) {
  58305. this.object = e,
  58306. this.size = void 0 !== t ? t : 1;
  58307. var o = void 0 !== i ? i : 16711680
  58308. , a = void 0 !== r ? r : 1
  58309. , s = 0
  58310. , l = this.object.geometry;
  58311. l instanceof n.Geometry ? s = 3 * l.faces.length : l instanceof n.BufferGeometry && (s = l.attributes.normal.count);
  58312. var c = new n.BufferGeometry
  58313. , h = new n.Float32Attribute(2 * s * 3,3);
  58314. c.addAttribute("position", h),
  58315. n.LineSegments.call(this, c, new n.LineBasicMaterial({
  58316. color: o,
  58317. linewidth: a
  58318. })),
  58319. this.matrixAutoUpdate = !1,
  58320. this.update()
  58321. }
  58322. ,
  58323. n.VertexNormalsHelper.prototype = Object.create(n.LineSegments.prototype),
  58324. n.VertexNormalsHelper.prototype.constructor = n.VertexNormalsHelper,
  58325. n.VertexNormalsHelper.prototype.update = function() {
  58326. var e = new n.Vector3
  58327. , t = new n.Vector3
  58328. , i = new n.Matrix3;
  58329. return function() {
  58330. var r = ["a", "b", "c"];
  58331. this.object.updateMatrixWorld(!0),
  58332. i.getNormalMatrix(this.object.matrixWorld);
  58333. var o = this.object.matrixWorld
  58334. , a = this.geometry.attributes.position
  58335. , s = this.object.geometry;
  58336. if (s instanceof n.Geometry)
  58337. for (var l = s.vertices, c = s.faces, h = 0, u = 0, d = c.length; u < d; u++)
  58338. for (var p = c[u], f = 0, g = p.vertexNormals.length; f < g; f++) {
  58339. var m = l[p[r[f]]]
  58340. , v = p.vertexNormals[f];
  58341. e.copy(m).applyMatrix4(o),
  58342. t.copy(v).applyMatrix3(i).normalize().multiplyScalar(this.size).add(e),
  58343. a.setXYZ(h, e.x, e.y, e.z),
  58344. h += 1,
  58345. a.setXYZ(h, t.x, t.y, t.z),
  58346. h += 1
  58347. }
  58348. else if (s instanceof n.BufferGeometry)
  58349. for (var A = s.attributes.position, y = s.attributes.normal, h = 0, f = 0, g = A.count; f < g; f++)
  58350. e.set(A.getX(f), A.getY(f), A.getZ(f)).applyMatrix4(o),
  58351. t.set(y.getX(f), y.getY(f), y.getZ(f)),
  58352. t.applyMatrix3(i).normalize().multiplyScalar(this.size).add(e),
  58353. a.setXYZ(h, e.x, e.y, e.z),
  58354. h += 1,
  58355. a.setXYZ(h, t.x, t.y, t.z),
  58356. h += 1;
  58357. return a.needsUpdate = !0,
  58358. this
  58359. }
  58360. }(),
  58361. n.WireframeHelper = function(e, t) {
  58362. var i = void 0 !== t ? t : 16777215;
  58363. n.LineSegments.call(this, new n.WireframeGeometry(e.geometry), new n.LineBasicMaterial({
  58364. color: i
  58365. })),
  58366. this.matrix = e.matrixWorld,
  58367. this.matrixAutoUpdate = !1
  58368. }
  58369. ,
  58370. n.WireframeHelper.prototype = Object.create(n.LineSegments.prototype),
  58371. n.WireframeHelper.prototype.constructor = n.WireframeHelper,
  58372. n.ImmediateRenderObject = function(e) {
  58373. n.Object3D.call(this),
  58374. this.material = e,
  58375. this.render = function(e) {}
  58376. }
  58377. ,
  58378. n.ImmediateRenderObject.prototype = Object.create(n.Object3D.prototype),
  58379. n.ImmediateRenderObject.prototype.constructor = n.ImmediateRenderObject,
  58380. n.MorphBlendMesh = function(e, t) {
  58381. n.Mesh.call(this, e, t),
  58382. this.animationsMap = {},
  58383. this.animationsList = [];
  58384. var i = this.geometry.morphTargets.length
  58385. , r = "__default"
  58386. , o = 0
  58387. , a = i - 1
  58388. , s = i / 1;
  58389. this.createAnimation(r, o, a, s),
  58390. this.setAnimationWeight(r, 1)
  58391. }
  58392. ,
  58393. n.MorphBlendMesh.prototype = Object.create(n.Mesh.prototype),
  58394. n.MorphBlendMesh.prototype.constructor = n.MorphBlendMesh,
  58395. n.MorphBlendMesh.prototype.createAnimation = function(e, t, i, n) {
  58396. var r = {
  58397. start: t,
  58398. end: i,
  58399. length: i - t + 1,
  58400. fps: n,
  58401. duration: (i - t) / n,
  58402. lastFrame: 0,
  58403. currentFrame: 0,
  58404. active: !1,
  58405. time: 0,
  58406. direction: 1,
  58407. weight: 1,
  58408. directionBackwards: !1,
  58409. mirroredLoop: !1
  58410. };
  58411. this.animationsMap[e] = r,
  58412. this.animationsList.push(r)
  58413. }
  58414. ,
  58415. n.MorphBlendMesh.prototype.autoCreateAnimations = function(e) {
  58416. for (var t, i = /([a-z]+)_?(\d+)/i, n = {}, r = this.geometry, o = 0, a = r.morphTargets.length; o < a; o++) {
  58417. var s = r.morphTargets[o]
  58418. , l = s.name.match(i);
  58419. if (l && l.length > 1) {
  58420. var c = l[1];
  58421. n[c] || (n[c] = {
  58422. start: 1 / 0,
  58423. end: -(1 / 0)
  58424. });
  58425. var h = n[c];
  58426. o < h.start && (h.start = o),
  58427. o > h.end && (h.end = o),
  58428. t || (t = c)
  58429. }
  58430. }
  58431. for (var c in n) {
  58432. var h = n[c];
  58433. this.createAnimation(c, h.start, h.end, e)
  58434. }
  58435. this.firstAnimation = t
  58436. }
  58437. ,
  58438. n.MorphBlendMesh.prototype.setAnimationDirectionForward = function(e) {
  58439. var t = this.animationsMap[e];
  58440. t && (t.direction = 1,
  58441. t.directionBackwards = !1)
  58442. }
  58443. ,
  58444. n.MorphBlendMesh.prototype.setAnimationDirectionBackward = function(e) {
  58445. var t = this.animationsMap[e];
  58446. t && (t.direction = -1,
  58447. t.directionBackwards = !0)
  58448. }
  58449. ,
  58450. n.MorphBlendMesh.prototype.setAnimationFPS = function(e, t) {
  58451. var i = this.animationsMap[e];
  58452. i && (i.fps = t,
  58453. i.duration = (i.end - i.start) / i.fps)
  58454. }
  58455. ,
  58456. n.MorphBlendMesh.prototype.setAnimationDuration = function(e, t) {
  58457. var i = this.animationsMap[e];
  58458. i && (i.duration = t,
  58459. i.fps = (i.end - i.start) / i.duration)
  58460. }
  58461. ,
  58462. n.MorphBlendMesh.prototype.setAnimationWeight = function(e, t) {
  58463. var i = this.animationsMap[e];
  58464. i && (i.weight = t)
  58465. }
  58466. ,
  58467. n.MorphBlendMesh.prototype.setAnimationTime = function(e, t) {
  58468. var i = this.animationsMap[e];
  58469. i && (i.time = t)
  58470. }
  58471. ,
  58472. n.MorphBlendMesh.prototype.getAnimationTime = function(e) {
  58473. var t = 0
  58474. , i = this.animationsMap[e];
  58475. return i && (t = i.time),
  58476. t
  58477. }
  58478. ,
  58479. n.MorphBlendMesh.prototype.getAnimationDuration = function(e) {
  58480. var t = -1
  58481. , i = this.animationsMap[e];
  58482. return i && (t = i.duration),
  58483. t
  58484. }
  58485. ,
  58486. n.MorphBlendMesh.prototype.playAnimation = function(e) {
  58487. var t = this.animationsMap[e];
  58488. t ? (t.time = 0,
  58489. t.active = !0) : console.warn("THREE.MorphBlendMesh: animation[" + e + "] undefined in .playAnimation()")
  58490. }
  58491. ,
  58492. n.MorphBlendMesh.prototype.stopAnimation = function(e) {
  58493. var t = this.animationsMap[e];
  58494. t && (t.active = !1)
  58495. }
  58496. ,
  58497. n.MorphBlendMesh.prototype.update = function(e) {
  58498. for (var t = 0, i = this.animationsList.length; t < i; t++) {
  58499. var r = this.animationsList[t];
  58500. if (r.active) {
  58501. var o = r.duration / r.length;
  58502. r.time += r.direction * e,
  58503. r.mirroredLoop ? (r.time > r.duration || r.time < 0) && (r.direction *= -1,
  58504. r.time > r.duration && (r.time = r.duration,
  58505. r.directionBackwards = !0),
  58506. r.time < 0 && (r.time = 0,
  58507. r.directionBackwards = !1)) : (r.time = r.time % r.duration,
  58508. r.time < 0 && (r.time += r.duration));
  58509. var a = r.start + n.Math.clamp(Math.floor(r.time / o), 0, r.length - 1)
  58510. , s = r.weight;
  58511. a !== r.currentFrame && (this.morphTargetInfluences[r.lastFrame] = 0,
  58512. this.morphTargetInfluences[r.currentFrame] = 1 * s,
  58513. this.morphTargetInfluences[a] = 0,
  58514. r.lastFrame = r.currentFrame,
  58515. r.currentFrame = a);
  58516. var l = r.time % o / o;
  58517. r.directionBackwards && (l = 1 - l),
  58518. r.currentFrame !== r.lastFrame ? (this.morphTargetInfluences[r.currentFrame] = l * s,
  58519. this.morphTargetInfluences[r.lastFrame] = (1 - l) * s) : this.morphTargetInfluences[r.currentFrame] = s
  58520. }
  58521. }
  58522. }
  58523. ,
  58524. "undefined" != typeof i ? ("undefined" != typeof t && t.exports && (i = t.exports = n),
  58525. i.THREE = n) : this.THREE = n
  58526. window.THREE = n
  58527. getObjLoader()
  58528. initByTHREE(THREE)
  58529. //getWebXRManager()
  58530. }
  58531. , {}]
  58532. }, {}, [116]);
  58533. class PanTransGuide{
  58534. constructor(player){
  58535. this.player = player
  58536. this.currentIndex = 0
  58537. this.getNodes()
  58538. }
  58539. getNodes(){
  58540. this.nodes = []
  58541. let path = this.player.path
  58542. let last
  58543. let index = this.player.model.heroLocations.findIndex(e=>e.name == '沉浸看展') //先去掉之前旧的数据
  58544. if(index>-1){
  58545. let locations = this.player.model.heroLocations[index].heroLocations
  58546. this.player.model.heroLocations.splice(index,1)
  58547. }
  58548. let get = (e, originItem)=>{
  58549. if(e.cameraMode != 'panorama'){
  58550. e.originItem = originItem
  58551. this.nodes.push(e)
  58552. return last = null //断连
  58553. }
  58554. if(last){
  58555. e.visited = true
  58556. path.setWarpDestination(e)
  58557. path.setWarpDestPano()
  58558. let A = path.getHeroPano(last),
  58559. B = path.warpDestPano
  58560. if(e.momentTour == 'black' && A!=B){
  58561. path.nodes = [A.id,B.id];//直接加入
  58562. }else{
  58563. path.nodes = path.findShortestPath(A, B)
  58564. if(path.nodes == null){//两个点之间不相通
  58565. console.log('两个点之间不相通',A.id,B.id)
  58566. path.nodes = [A.id,B.id];//直接加入
  58567. }
  58568. }
  58569. let wholeDis = 0, disSections = []
  58570. path.nodes.forEach((cur,i)=>{
  58571. if(i==0)return
  58572. let prePano = this.player.model.panos.get(path.nodes[i-1])
  58573. let curPano = this.player.model.panos.get(cur)
  58574. let dis = prePano.position.distanceTo(curPano.position)
  58575. disSections.push(dis)
  58576. wholeDis += dis
  58577. },0)
  58578. let quaStart = last.quaternion
  58579. let quaEnd = e.quaternion
  58580. path.nodes.forEach((panoId,j)=>{
  58581. if(j == 0){
  58582. if(path.nodes.length == 1)return this.nodes.push({panoId,quaternion:quaEnd})//原地旋转
  58583. if(!last) return //和上一段末尾重复
  58584. return this.nodes.push({panoId,quaternion:quaStart})
  58585. }
  58586. let r = disSections[j-1] / wholeDis
  58587. let quaternion = quaStart.clone()
  58588. lerp.quaternion(quaternion, quaEnd)(r)
  58589. this.nodes.push({panoId, quaternion})
  58590. })
  58591. }
  58592. last = e
  58593. }
  58594. this.player.model.heroLocations.forEach((e,i)=>{
  58595. if(e.heroLocations){
  58596. e.heroLocations.forEach((a,j)=> get(a, [i,j]))
  58597. }else{
  58598. get(e,[i,0])
  58599. }
  58600. })
  58601. //补 因为last前一个可能不是panorama,导致last没加进nodes
  58602. if(last && !last.visited){
  58603. get(last)
  58604. }
  58605. }
  58606. go(axis){
  58607. if(this.player.flying)return
  58608. let aimNode
  58609. let cur = this.nodes[this.currentIndex]
  58610. if(cur.panoId != this.player.currentPano.id && player.mode == 'panorama'){//已走动){//已走动
  58611. let curs = this.nodes.filter(e=>e.panoId == this.player.currentPano)
  58612. curs.sort((a,b)=>{ //如果有多个,找到和currentIndex最接近的,可能是刚走过的
  58613. let indexA = this.nodes.indexOf(a)
  58614. let indexB = this.nodes.indexOf(b)
  58615. return Math.abs(indexA - this.currentIndex) < Math.abs(indexB - this.currentIndex)
  58616. })
  58617. cur = curs[0]
  58618. if(!cur){//不在道上 . 找离当前位置最近的node
  58619. let disMap = new Map
  58620. let nodes_ = this.nodes.filter(e=>!e.originItem)
  58621. nodes_.forEach(e=>{
  58622. disMap.set(e,player.currentPano.position.distanceToSquared(this.player.model.panos.get(e.panoId).position))
  58623. })
  58624. let sorted = nodes_.slice().sort((a,b)=>{
  58625. return disMap.get(a) - disMap.get(b)
  58626. })
  58627. this.currentIndex = this.nodes.indexOf(sorted[0])//next
  58628. if(axis == -1){
  58629. this.moveIndex(-1)
  58630. }
  58631. aimNode = this.nodes[this.currentIndex]
  58632. }
  58633. }
  58634. let lastIndex = this.currentIndex
  58635. if(!aimNode){
  58636. this.moveIndex(axis)
  58637. aimNode = this.nodes[this.currentIndex]
  58638. }
  58639. if(aimNode.originItem){//要飞出的,直接用导览飞
  58640. player.director.setDestinationItem(aimNode.originItem)
  58641. player.director.goToDestination()
  58642. return
  58643. }
  58644. //let dis = this.player.model.panos.get(aimNode.panoId).position.distanceTo(this.player.position)
  58645. let moveStyle = (lastIndex == 0 && axis == -1 || this.currentIndex == 0 && axis != -1) ? "blackToPano" : "flyToPano"
  58646. this.player[moveStyle]({pano: this.player.model.panos.get(aimNode.panoId), quaternion:aimNode.quaternion}, ()=>{
  58647. //更新导览进度条
  58648. player.director.setDestinationItem( player.director.findNearestItem(true,true) )
  58649. })
  58650. }
  58651. moveIndex(step){
  58652. this.currentIndex += (step + this.nodes.length)
  58653. this.currentIndex %= this.nodes.length
  58654. return this.currentIndex
  58655. }
  58656. }
  58657. //2025新的需求 沉浸看展直接使用导览
  58658. window.tourPlayCtl = {
  58659. go(axis){
  58660. player.guider2.go(axis)
  58661. }
  58662. }
  58663. /*
  58664. function getWebXRManager(){
  58665. class ArrayCamera extends THREE.PerspectiveCamera {
  58666. constructor(array = []) {
  58667. super();
  58668. this.isArrayCamera = true;
  58669. this.cameras = array;
  58670. }
  58671. }
  58672. function WebGLAnimation() {
  58673. let context = null;
  58674. let isAnimating = false;
  58675. let animationLoop = null;
  58676. let requestId = null;
  58677. function onAnimationFrame(time, frame) {
  58678. animationLoop(time, frame);
  58679. requestId = context.requestAnimationFrame(onAnimationFrame);
  58680. }
  58681. return {
  58682. start: function () {
  58683. if (isAnimating === true) return;
  58684. if (animationLoop === null) return;
  58685. requestId = context.requestAnimationFrame(onAnimationFrame);
  58686. isAnimating = true;
  58687. },
  58688. stop: function () {
  58689. context.cancelAnimationFrame(requestId);
  58690. isAnimating = false;
  58691. },
  58692. setAnimationLoop: function (callback) {
  58693. animationLoop = callback;
  58694. },
  58695. setContext: function (value) {
  58696. context = value;
  58697. }
  58698. };
  58699. }
  58700. function WebXRManager( renderer, gl ) {
  58701. var scope = this;
  58702. var session = null;
  58703. // var framebufferScaleFactor = 1.0;
  58704. var referenceSpace = null;
  58705. var referenceSpaceType = 'local-floor';
  58706. var pose = null;
  58707. var controllers = [];
  58708. var sortedInputSources = [];
  58709. function isPresenting() {
  58710. return session !== null && referenceSpace !== null;
  58711. }
  58712. //
  58713. var cameraL = new THREE.PerspectiveCamera();
  58714. cameraL.layers.enable( 1 );
  58715. cameraL.viewport = new THREE.Vector4();
  58716. var cameraR = new THREE.PerspectiveCamera();
  58717. cameraR.layers.enable( 2 );
  58718. cameraR.viewport = new THREE.Vector4();
  58719. var cameraVR = new ArrayCamera( [ cameraL, cameraR ] );
  58720. cameraVR.layers.enable( 1 );
  58721. cameraVR.layers.enable( 2 );
  58722. //
  58723. this.enabled = false;
  58724. this.getController = function ( id ) {
  58725. var controller = controllers[ id ];
  58726. if ( controller === undefined ) {
  58727. controller = new THREE.Group();
  58728. controller.matrixAutoUpdate = false;
  58729. controller.visible = false;
  58730. controllers[ id ] = controller;
  58731. }
  58732. return controller;
  58733. };
  58734. //
  58735. function onSessionEvent( event ) {
  58736. for ( var i = 0; i < controllers.length; i ++ ) {
  58737. if ( sortedInputSources[ i ] === event.inputSource ) {
  58738. controllers[ i ].dispatchEvent( { type: event.type } );
  58739. }
  58740. }
  58741. }
  58742. function onSessionEnd() {
  58743. renderer.setFramebuffer( null );
  58744. renderer.setRenderTarget( renderer.getRenderTarget() ); // Hack #15830
  58745. animation.stop();
  58746. scope.dispatchEvent( { type: 'sessionend' } );
  58747. }
  58748. function onRequestReferenceSpace( value ) {
  58749. referenceSpace = value;
  58750. animation.setContext( session );
  58751. animation.start();
  58752. scope.dispatchEvent( { type: 'sessionstart' } );
  58753. }
  58754. this.setFramebufferScaleFactor = function ( ) {
  58755. // framebufferScaleFactor = value;
  58756. };
  58757. this.setReferenceSpaceType = function ( value ) {
  58758. referenceSpaceType = value;
  58759. };
  58760. this.getSession = function () {
  58761. return session;
  58762. };
  58763. this.setSession = function ( value ) {
  58764. session = value;
  58765. if ( session !== null ) {
  58766. session.addEventListener( 'select', onSessionEvent );
  58767. session.addEventListener( 'selectstart', onSessionEvent );
  58768. session.addEventListener( 'selectend', onSessionEvent );
  58769. session.addEventListener( 'end', onSessionEnd );
  58770. // eslint-disable-next-line no-undef
  58771. session.updateRenderState( { baseLayer: new XRWebGLLayer( session, gl, { antialias: false } ) } );
  58772. session.requestReferenceSpace( referenceSpaceType ).then( onRequestReferenceSpace );
  58773. //
  58774. session.addEventListener( 'inputsourceschange', updateInputSources );
  58775. updateInputSources();
  58776. }
  58777. };
  58778. function updateInputSources() {
  58779. for ( var i = 0; i < controllers.length; i ++ ) {
  58780. sortedInputSources[ i ] = findInputSource( i );
  58781. }
  58782. }
  58783. function findInputSource( id ) {
  58784. var inputSources = session.inputSources;
  58785. for ( var i = 0; i < inputSources.length; i ++ ) {
  58786. var inputSource = inputSources[ i ];
  58787. var handedness = inputSource.handedness;
  58788. if ( id === 0 && ( handedness === 'none' || handedness === 'right' ) ) return inputSource;
  58789. if ( id === 1 && ( handedness === 'left' ) ) return inputSource;
  58790. }
  58791. }
  58792. //
  58793. function updateCamera( camera, parent ) {
  58794. if ( parent === null ) {
  58795. camera.matrixWorld.copy( camera.matrix );
  58796. } else {
  58797. camera.matrixWorld.multiplyMatrices( parent.matrixWorld, camera.matrix );
  58798. }
  58799. camera.matrixWorldInverse.getInverse( camera.matrixWorld );
  58800. }
  58801. this.getCamera = function ( camera ) {
  58802. if ( isPresenting() ) {
  58803. var parent = camera.parent;
  58804. var cameras = cameraVR.cameras;
  58805. updateCamera( cameraVR, parent );
  58806. for ( var i = 0; i < cameras.length; i ++ ) {
  58807. updateCamera( cameras[ i ], parent );
  58808. }
  58809. // update camera and its children
  58810. camera.matrixWorld.copy( cameraVR.matrixWorld );
  58811. var children = camera.children;
  58812. for ( var i = 0, l = children.length; i < l; i ++ ) {
  58813. children[ i ].updateMatrixWorld( true );
  58814. }
  58815. setProjectionFromUnion( cameraVR, cameraL, cameraR );
  58816. return cameraVR;
  58817. }
  58818. return camera;
  58819. };
  58820. this.isPresenting = isPresenting;
  58821. // Animation Loop
  58822. var onAnimationFrameCallback = null;
  58823. function onAnimationFrame( time, frame ) {
  58824. pose = frame.getViewerPose( referenceSpace );
  58825. if ( pose !== null ) {
  58826. var views = pose.views;
  58827. var baseLayer = session.renderState.baseLayer;
  58828. renderer.setFramebuffer( baseLayer.framebuffer );
  58829. for ( var i = 0; i < views.length; i ++ ) {
  58830. var view = views[ i ];
  58831. var viewport = baseLayer.getViewport( view );
  58832. var viewMatrix = view.transform.inverse.matrix;
  58833. var camera = cameraVR.cameras[ i ];
  58834. camera.matrix.fromArray( viewMatrix ).getInverse( camera.matrix );
  58835. camera.projectionMatrix.fromArray( view.projectionMatrix );
  58836. camera.viewport.set( viewport.x, viewport.y, viewport.width, viewport.height );
  58837. if ( i === 0 ) {
  58838. cameraVR.matrix.copy( camera.matrix );
  58839. }
  58840. }
  58841. }
  58842. //
  58843. for ( var i = 0; i < controllers.length; i ++ ) {
  58844. var controller = controllers[ i ];
  58845. var inputSource = sortedInputSources[ i ];
  58846. if ( inputSource ) {
  58847. var inputPose = frame.getPose( inputSource.targetRaySpace, referenceSpace );
  58848. if ( inputPose !== null ) {
  58849. controller.matrix.fromArray( inputPose.transform.matrix );
  58850. controller.matrix.decompose( controller.position, controller.rotation, controller.scale );
  58851. controller.visible = true;
  58852. continue;
  58853. }
  58854. }
  58855. controller.visible = false;
  58856. }
  58857. if ( onAnimationFrameCallback ) onAnimationFrameCallback( time );
  58858. }
  58859. var animation = new WebGLAnimation();
  58860. animation.setAnimationLoop( onAnimationFrame );
  58861. this.setAnimationLoop = function ( callback ) {
  58862. onAnimationFrameCallback = callback;
  58863. };
  58864. this.dispose = function () {};
  58865. // DEPRECATED
  58866. this.getStandingMatrix = function () {
  58867. console.warn( 'THREE.WebXRManager: getStandingMatrix() is no longer needed.' );
  58868. return new THREE.Matrix4();
  58869. };
  58870. this.getDevice = function () {
  58871. console.warn( 'THREE.WebXRManager: getDevice() has been deprecated.' );
  58872. };
  58873. this.setDevice = function () {
  58874. console.warn( 'THREE.WebXRManager: setDevice() has been deprecated.' );
  58875. };
  58876. this.setFrameOfReferenceType = function () {
  58877. console.warn( 'THREE.WebXRManager: setFrameOfReferenceType() has been deprecated.' );
  58878. };
  58879. this.submitFrame = function () {};
  58880. }
  58881. Object.assign( WebXRManager.prototype, THREE.EventDispatcher.prototype );
  58882. THREE.WebXRManager = WebXRManager
  58883. }
  58884. function getWebXRManager(){
  58885. class ArrayCamera extends THREE.PerspectiveCamera {
  58886. constructor(array = []) {
  58887. super();
  58888. this.isArrayCamera = true;
  58889. this.cameras = array;
  58890. }
  58891. }
  58892. class WebXRController {
  58893. constructor() {
  58894. this._targetRay = null;
  58895. this._grip = null;
  58896. this._hand = null;
  58897. }
  58898. getHandSpace() {
  58899. if (this._hand === null) {
  58900. this._hand = new THREE.Group();
  58901. this._hand.matrixAutoUpdate = false;
  58902. this._hand.visible = false;
  58903. this._hand.joints = {};
  58904. this._hand.inputState = {
  58905. pinching: false
  58906. };
  58907. }
  58908. return this._hand;
  58909. }
  58910. getTargetRaySpace() {
  58911. if (this._targetRay === null) {
  58912. this._targetRay = new THREE.Group();
  58913. this._targetRay.matrixAutoUpdate = false;
  58914. this._targetRay.visible = false;
  58915. this._targetRay.hasLinearVelocity = false;
  58916. this._targetRay.linearVelocity = new THREE.Vector3();
  58917. this._targetRay.hasAngularVelocity = false;
  58918. this._targetRay.angularVelocity = new THREE.Vector3();
  58919. }
  58920. return this._targetRay;
  58921. }
  58922. getGripSpace() {
  58923. if (this._grip === null) {
  58924. this._grip = new THREE.Group();
  58925. this._grip.matrixAutoUpdate = false;
  58926. this._grip.visible = false;
  58927. this._grip.hasLinearVelocity = false;
  58928. this._grip.linearVelocity = new THREE.Vector3();
  58929. this._grip.hasAngularVelocity = false;
  58930. this._grip.angularVelocity = new THREE.Vector3();
  58931. }
  58932. return this._grip;
  58933. }
  58934. dispatchEvent(event) {
  58935. if (this._targetRay !== null) {
  58936. this._targetRay.dispatchEvent(event);
  58937. }
  58938. if (this._grip !== null) {
  58939. this._grip.dispatchEvent(event);
  58940. }
  58941. if (this._hand !== null) {
  58942. this._hand.dispatchEvent(event);
  58943. }
  58944. return this;
  58945. }
  58946. disconnect(inputSource) {
  58947. this.dispatchEvent({
  58948. type: 'disconnected',
  58949. data: inputSource
  58950. });
  58951. if (this._targetRay !== null) {
  58952. this._targetRay.visible = false;
  58953. }
  58954. if (this._grip !== null) {
  58955. this._grip.visible = false;
  58956. }
  58957. if (this._hand !== null) {
  58958. this._hand.visible = false;
  58959. }
  58960. return this;
  58961. }
  58962. update(inputSource, frame, referenceSpace) {
  58963. let inputPose = null;
  58964. let gripPose = null;
  58965. let handPose = null;
  58966. const targetRay = this._targetRay;
  58967. const grip = this._grip;
  58968. const hand = this._hand;
  58969. if (inputSource && frame.session.visibilityState !== 'visible-blurred') {
  58970. if (hand && inputSource.hand) {
  58971. handPose = true;
  58972. for (const inputjoint of inputSource.hand.values()) {
  58973. // Update the joints groups with the XRJoint poses
  58974. const jointPose = frame.getJointPose(inputjoint, referenceSpace);
  58975. if (hand.joints[inputjoint.jointName] === undefined) {
  58976. // The transform of this joint will be updated with the joint pose on each frame
  58977. const joint = new THREE.Group();
  58978. joint.matrixAutoUpdate = false;
  58979. joint.visible = false;
  58980. hand.joints[inputjoint.jointName] = joint; // ??
  58981. hand.add(joint);
  58982. }
  58983. const joint = hand.joints[inputjoint.jointName];
  58984. if (jointPose !== null) {
  58985. joint.matrix.fromArray(jointPose.transform.matrix);
  58986. joint.matrix.decompose(joint.position, joint.rotation, joint.scale);
  58987. joint.jointRadius = jointPose.radius;
  58988. }
  58989. joint.visible = jointPose !== null;
  58990. } // Custom events
  58991. // Check pinchz
  58992. const indexTip = hand.joints['index-finger-tip'];
  58993. const thumbTip = hand.joints['thumb-tip'];
  58994. const distance = indexTip.position.distanceTo(thumbTip.position);
  58995. const distanceToPinch = 0.02;
  58996. const threshold = 0.005;
  58997. if (hand.inputState.pinching && distance > distanceToPinch + threshold) {
  58998. hand.inputState.pinching = false;
  58999. this.dispatchEvent({
  59000. type: 'pinchend',
  59001. handedness: inputSource.handedness,
  59002. target: this
  59003. });
  59004. } else if (!hand.inputState.pinching && distance <= distanceToPinch - threshold) {
  59005. hand.inputState.pinching = true;
  59006. this.dispatchEvent({
  59007. type: 'pinchstart',
  59008. handedness: inputSource.handedness,
  59009. target: this
  59010. });
  59011. }
  59012. } else {
  59013. if (grip !== null && inputSource.gripSpace) {
  59014. gripPose = frame.getPose(inputSource.gripSpace, referenceSpace);
  59015. if (gripPose !== null) {
  59016. grip.matrix.fromArray(gripPose.transform.matrix);
  59017. grip.matrix.decompose(grip.position, grip.rotation, grip.scale);
  59018. if (gripPose.linearVelocity) {
  59019. grip.hasLinearVelocity = true;
  59020. grip.linearVelocity.copy(gripPose.linearVelocity);
  59021. } else {
  59022. grip.hasLinearVelocity = false;
  59023. }
  59024. if (gripPose.angularVelocity) {
  59025. grip.hasAngularVelocity = true;
  59026. grip.angularVelocity.copy(gripPose.angularVelocity);
  59027. } else {
  59028. grip.hasAngularVelocity = false;
  59029. }
  59030. }
  59031. }
  59032. }
  59033. if (targetRay !== null) {
  59034. inputPose = frame.getPose(inputSource.targetRaySpace, referenceSpace); // Some runtimes (namely Vive Cosmos with Vive OpenXR Runtime) have only grip space and ray space is equal to it
  59035. if (inputPose === null && gripPose !== null) {
  59036. inputPose = gripPose;
  59037. }
  59038. if (inputPose !== null) {
  59039. targetRay.matrix.fromArray(inputPose.transform.matrix);
  59040. targetRay.matrix.decompose(targetRay.position, targetRay.rotation, targetRay.scale);
  59041. if (inputPose.linearVelocity) {
  59042. targetRay.hasLinearVelocity = true;
  59043. targetRay.linearVelocity.copy(inputPose.linearVelocity);
  59044. } else {
  59045. targetRay.hasLinearVelocity = false;
  59046. }
  59047. if (inputPose.angularVelocity) {
  59048. targetRay.hasAngularVelocity = true;
  59049. targetRay.angularVelocity.copy(inputPose.angularVelocity);
  59050. } else {
  59051. targetRay.hasAngularVelocity = false;
  59052. }
  59053. this.dispatchEvent(_moveEvent);
  59054. }
  59055. }
  59056. }
  59057. if (targetRay !== null) {
  59058. targetRay.visible = inputPose !== null;
  59059. }
  59060. if (grip !== null) {
  59061. grip.visible = gripPose !== null;
  59062. }
  59063. if (hand !== null) {
  59064. hand.visible = handPose !== null;
  59065. }
  59066. return this;
  59067. }
  59068. }
  59069. function WebGLAnimation() {
  59070. let context = null;
  59071. let isAnimating = false;
  59072. let animationLoop = null;
  59073. let requestId = null;
  59074. function onAnimationFrame(time, frame) {
  59075. animationLoop(time, frame);
  59076. requestId = context.requestAnimationFrame(onAnimationFrame);
  59077. }
  59078. return {
  59079. start: function () {
  59080. if (isAnimating === true) return;
  59081. if (animationLoop === null) return;
  59082. requestId = context.requestAnimationFrame(onAnimationFrame);
  59083. isAnimating = true;
  59084. },
  59085. stop: function () {
  59086. context.cancelAnimationFrame(requestId);
  59087. isAnimating = false;
  59088. },
  59089. setAnimationLoop: function (callback) {
  59090. animationLoop = callback;
  59091. },
  59092. setContext: function (value) {
  59093. context = value;
  59094. }
  59095. };
  59096. }
  59097. class WebXRManager extends THREE.EventDispatcher {
  59098. constructor(renderer, gl) {
  59099. super();
  59100. const scope = this;
  59101. let session = null;
  59102. let framebufferScaleFactor = 1.0;
  59103. let referenceSpace = null;
  59104. let referenceSpaceType = 'local-floor';
  59105. let customReferenceSpace = null;
  59106. let pose = null;
  59107. let glBinding = null;
  59108. let glProjLayer = null;
  59109. let glBaseLayer = null;
  59110. let xrFrame = null;
  59111. const attributes = gl.getContextAttributes();
  59112. let initialRenderTarget = null;
  59113. let newRenderTarget = null;
  59114. const controllers = [];
  59115. const controllerInputSources = []; //
  59116. const cameraL = new THREE.PerspectiveCamera();
  59117. cameraL.layers.enable(1);
  59118. cameraL.viewport = new THREE.Vector4();
  59119. const cameraR = new THREE.PerspectiveCamera();
  59120. cameraR.layers.enable(2);
  59121. cameraR.viewport = new THREE.Vector4();
  59122. const cameras = [cameraL, cameraR];
  59123. const cameraVR = new ArrayCamera();
  59124. cameraVR.layers.enable(1);
  59125. cameraVR.layers.enable(2);
  59126. let _currentDepthNear = null;
  59127. let _currentDepthFar = null; //
  59128. this.cameraAutoUpdate = true;
  59129. this.enabled = false;
  59130. this.isPresenting = false;
  59131. this.getController = function (index) {
  59132. let controller = controllers[index];
  59133. if (controller === undefined) {
  59134. controller = new WebXRController();
  59135. controllers[index] = controller;
  59136. }
  59137. return controller.getTargetRaySpace();
  59138. };
  59139. this.getControllerGrip = function (index) {
  59140. let controller = controllers[index];
  59141. if (controller === undefined) {
  59142. controller = new WebXRController();
  59143. controllers[index] = controller;
  59144. }
  59145. return controller.getGripSpace();
  59146. };
  59147. this.getHand = function (index) {
  59148. let controller = controllers[index];
  59149. if (controller === undefined) {
  59150. controller = new WebXRController();
  59151. controllers[index] = controller;
  59152. }
  59153. return controller.getHandSpace();
  59154. }; //
  59155. function onSessionEvent(event) {
  59156. const controllerIndex = controllerInputSources.indexOf(event.inputSource);
  59157. if (controllerIndex === -1) {
  59158. return;
  59159. }
  59160. const controller = controllers[controllerIndex];
  59161. if (controller !== undefined) {
  59162. controller.dispatchEvent({
  59163. type: event.type,
  59164. data: event.inputSource
  59165. });
  59166. }
  59167. }
  59168. function onSessionEnd() {
  59169. session.removeEventListener('select', onSessionEvent);
  59170. session.removeEventListener('selectstart', onSessionEvent);
  59171. session.removeEventListener('selectend', onSessionEvent);
  59172. session.removeEventListener('squeeze', onSessionEvent);
  59173. session.removeEventListener('squeezestart', onSessionEvent);
  59174. session.removeEventListener('squeezeend', onSessionEvent);
  59175. session.removeEventListener('end', onSessionEnd);
  59176. session.removeEventListener('inputsourceschange', onInputSourcesChange);
  59177. for (let i = 0; i < controllers.length; i++) {
  59178. const inputSource = controllerInputSources[i];
  59179. if (inputSource === null) continue;
  59180. controllerInputSources[i] = null;
  59181. controllers[i].disconnect(inputSource);
  59182. }
  59183. _currentDepthNear = null;
  59184. _currentDepthFar = null; // restore framebuffer/rendering state
  59185. renderer.setRenderTarget(initialRenderTarget);
  59186. glBaseLayer = null;
  59187. glProjLayer = null;
  59188. glBinding = null;
  59189. session = null;
  59190. newRenderTarget = null; //
  59191. animation.stop();
  59192. scope.isPresenting = false;
  59193. scope.dispatchEvent({
  59194. type: 'sessionend'
  59195. });
  59196. }
  59197. this.setFramebufferScaleFactor = function (value) {
  59198. framebufferScaleFactor = value;
  59199. if (scope.isPresenting === true) {
  59200. console.warn('THREE.WebXRManager: Cannot change framebuffer scale while presenting.');
  59201. }
  59202. };
  59203. this.setReferenceSpaceType = function (value) {
  59204. referenceSpaceType = value;
  59205. if (scope.isPresenting === true) {
  59206. console.warn('THREE.WebXRManager: Cannot change reference space type while presenting.');
  59207. }
  59208. };
  59209. this.getReferenceSpace = function () {
  59210. return customReferenceSpace || referenceSpace;
  59211. };
  59212. this.setReferenceSpace = function (space) {
  59213. customReferenceSpace = space;
  59214. };
  59215. this.getBaseLayer = function () {
  59216. return glProjLayer !== null ? glProjLayer : glBaseLayer;
  59217. };
  59218. this.getBinding = function () {
  59219. return glBinding;
  59220. };
  59221. this.getFrame = function () {
  59222. return xrFrame;
  59223. };
  59224. this.getSession = function () {
  59225. return session;
  59226. };
  59227. this.setSession = async function (value) {
  59228. session = value;
  59229. if (session !== null) {
  59230. initialRenderTarget = renderer.getCurrentRenderTarget();
  59231. session.addEventListener('select', onSessionEvent);
  59232. session.addEventListener('selectstart', onSessionEvent);
  59233. session.addEventListener('selectend', onSessionEvent);
  59234. session.addEventListener('squeeze', onSessionEvent);
  59235. session.addEventListener('squeezestart', onSessionEvent);
  59236. session.addEventListener('squeezeend', onSessionEvent);
  59237. session.addEventListener('end', onSessionEnd);
  59238. session.addEventListener('inputsourceschange', onInputSourcesChange);
  59239. if (attributes.xrCompatible !== true) {
  59240. await gl.makeXRCompatible();
  59241. }
  59242. if (session.renderState.layers === undefined || renderer.capabilities.isWebGL2 === false) {
  59243. const layerInit = {
  59244. antialias: session.renderState.layers === undefined ? attributes.antialias : true,
  59245. alpha: attributes.alpha,
  59246. depth: attributes.depth,
  59247. stencil: attributes.stencil,
  59248. framebufferScaleFactor: framebufferScaleFactor
  59249. };
  59250. glBaseLayer = new XRWebGLLayer(session, gl, layerInit);
  59251. session.updateRenderState({
  59252. baseLayer: glBaseLayer
  59253. });
  59254. newRenderTarget = new THREE.WebGLRenderTarget(glBaseLayer.framebufferWidth, glBaseLayer.framebufferHeight, {
  59255. format: THREE.RGBAFormat,
  59256. type: THREE.UnsignedByteType,
  59257. encoding: renderer.outputEncoding
  59258. });
  59259. } else {
  59260. let depthFormat = null;
  59261. let depthType = null;
  59262. let glDepthFormat = null;
  59263. if (attributes.depth) {
  59264. glDepthFormat = attributes.stencil ? gl.DEPTH24_STENCIL8 : gl.DEPTH_COMPONENT24;
  59265. depthFormat = attributes.stencil ? DepthStencilFormat : DepthFormat;
  59266. depthType = attributes.stencil ? UnsignedInt248Type : UnsignedIntType;
  59267. }
  59268. const projectionlayerInit = {
  59269. colorFormat: gl.RGBA8,
  59270. depthFormat: glDepthFormat,
  59271. scaleFactor: framebufferScaleFactor
  59272. };
  59273. glBinding = new XRWebGLBinding(session, gl);
  59274. glProjLayer = glBinding.createProjectionLayer(projectionlayerInit);
  59275. session.updateRenderState({
  59276. layers: [glProjLayer]
  59277. });
  59278. newRenderTarget = new THREE.WebGLRenderTarget(glProjLayer.textureWidth, glProjLayer.textureHeight, {
  59279. format: THREE.RGBAFormat,
  59280. type: THREE.UnsignedByteType,
  59281. depthTexture: new THREE.DepthTexture(glProjLayer.textureWidth, glProjLayer.textureHeight, depthType, undefined, undefined, undefined, undefined, undefined, undefined, depthFormat),
  59282. stencilBuffer: attributes.stencil,
  59283. encoding: renderer.outputEncoding,
  59284. samples: attributes.antialias ? 4 : 0
  59285. });
  59286. const renderTargetProperties = renderer.properties.get(newRenderTarget);
  59287. renderTargetProperties.__ignoreDepthValues = glProjLayer.ignoreDepthValues;
  59288. }
  59289. newRenderTarget.isXRRenderTarget = true; // TODO Remove this when possible, see #23278
  59290. // Set foveation to maximum.
  59291. this.setFoveation(1.0);
  59292. customReferenceSpace = null;
  59293. referenceSpace = await session.requestReferenceSpace(referenceSpaceType);
  59294. animation.setContext(session);
  59295. animation.start();
  59296. scope.isPresenting = true;
  59297. scope.dispatchEvent({
  59298. type: 'sessionstart'
  59299. });
  59300. }
  59301. };
  59302. function onInputSourcesChange(event) {
  59303. // Notify disconnected
  59304. for (let i = 0; i < event.removed.length; i++) {
  59305. const inputSource = event.removed[i];
  59306. const index = controllerInputSources.indexOf(inputSource);
  59307. if (index >= 0) {
  59308. controllerInputSources[index] = null;
  59309. controllers[index].dispatchEvent({
  59310. type: 'disconnected',
  59311. data: inputSource
  59312. });
  59313. }
  59314. } // Notify connected
  59315. for (let i = 0; i < event.added.length; i++) {
  59316. const inputSource = event.added[i];
  59317. let controllerIndex = controllerInputSources.indexOf(inputSource);
  59318. if (controllerIndex === -1) {
  59319. // Assign input source a controller that currently has no input source
  59320. for (let i = 0; i < controllers.length; i++) {
  59321. if (i >= controllerInputSources.length) {
  59322. controllerInputSources.push(inputSource);
  59323. controllerIndex = i;
  59324. break;
  59325. } else if (controllerInputSources[i] === null) {
  59326. controllerInputSources[i] = inputSource;
  59327. controllerIndex = i;
  59328. break;
  59329. }
  59330. } // If all controllers do currently receive input we ignore new ones
  59331. if (controllerIndex === -1) break;
  59332. }
  59333. const controller = controllers[controllerIndex];
  59334. if (controller) {
  59335. controller.dispatchEvent({
  59336. type: 'connected',
  59337. data: inputSource
  59338. });
  59339. }
  59340. }
  59341. } //
  59342. const cameraLPos = new THREE.Vector3();
  59343. const cameraRPos = new THREE.Vector3();
  59344. function setProjectionFromUnion(camera, cameraL, cameraR) {
  59345. cameraLPos.setFromMatrixPosition(cameraL.matrixWorld);
  59346. cameraRPos.setFromMatrixPosition(cameraR.matrixWorld);
  59347. const ipd = cameraLPos.distanceTo(cameraRPos);
  59348. const projL = cameraL.projectionMatrix.elements;
  59349. const projR = cameraR.projectionMatrix.elements; // VR systems will have identical far and near planes, and
  59350. // most likely identical top and bottom frustum extents.
  59351. // Use the left camera for these values.
  59352. const near = projL[14] / (projL[10] - 1);
  59353. const far = projL[14] / (projL[10] + 1);
  59354. const topFov = (projL[9] + 1) / projL[5];
  59355. const bottomFov = (projL[9] - 1) / projL[5];
  59356. const leftFov = (projL[8] - 1) / projL[0];
  59357. const rightFov = (projR[8] + 1) / projR[0];
  59358. const left = near * leftFov;
  59359. const right = near * rightFov; // Calculate the new camera's position offset from the
  59360. // left camera. xOffset should be roughly half `ipd`.
  59361. const zOffset = ipd / (-leftFov + rightFov);
  59362. const xOffset = zOffset * -leftFov; // TODO: Better way to apply this offset?
  59363. cameraL.matrixWorld.decompose(camera.position, camera.quaternion, camera.scale);
  59364. camera.translateX(xOffset);
  59365. camera.translateZ(zOffset);
  59366. camera.matrixWorld.compose(camera.position, camera.quaternion, camera.scale);
  59367. camera.matrixWorldInverse.copy(camera.matrixWorld).invert(); // Find the union of the frustum values of the cameras and scale
  59368. // the values so that the near plane's position does not change in world space,
  59369. // although must now be relative to the new union camera.
  59370. const near2 = near + zOffset;
  59371. const far2 = far + zOffset;
  59372. const left2 = left - xOffset;
  59373. const right2 = right + (ipd - xOffset);
  59374. const top2 = topFov * far / far2 * near2;
  59375. const bottom2 = bottomFov * far / far2 * near2;
  59376. camera.projectionMatrix.makePerspective(left2, right2, top2, bottom2, near2, far2);
  59377. }
  59378. function updateCamera(camera, parent) {
  59379. if (parent === null) {
  59380. camera.matrixWorld.copy(camera.matrix);
  59381. } else {
  59382. camera.matrixWorld.multiplyMatrices(parent.matrixWorld, camera.matrix);
  59383. }
  59384. camera.matrixWorldInverse.copy(camera.matrixWorld).invert();
  59385. }
  59386. this.updateCamera = function (camera) {
  59387. if (session === null) return;
  59388. cameraVR.near = cameraR.near = cameraL.near = camera.near;
  59389. cameraVR.far = cameraR.far = cameraL.far = camera.far;
  59390. if (_currentDepthNear !== cameraVR.near || _currentDepthFar !== cameraVR.far) {
  59391. // Note that the new renderState won't apply until the next frame. See #18320
  59392. session.updateRenderState({
  59393. depthNear: cameraVR.near,
  59394. depthFar: cameraVR.far
  59395. });
  59396. _currentDepthNear = cameraVR.near;
  59397. _currentDepthFar = cameraVR.far;
  59398. }
  59399. const parent = camera.parent;
  59400. const cameras = cameraVR.cameras;
  59401. updateCamera(cameraVR, parent);
  59402. for (let i = 0; i < cameras.length; i++) {
  59403. updateCamera(cameras[i], parent);
  59404. }
  59405. cameraVR.matrixWorld.decompose(cameraVR.position, cameraVR.quaternion, cameraVR.scale); // update user camera and its children
  59406. camera.position.copy(cameraVR.position);
  59407. camera.quaternion.copy(cameraVR.quaternion);
  59408. camera.scale.copy(cameraVR.scale);
  59409. camera.matrix.copy(cameraVR.matrix);
  59410. camera.matrixWorld.copy(cameraVR.matrixWorld);
  59411. const children = camera.children;
  59412. for (let i = 0, l = children.length; i < l; i++) {
  59413. children[i].updateMatrixWorld(true);
  59414. } // update projection matrix for proper view frustum culling
  59415. if (cameras.length === 2) {
  59416. setProjectionFromUnion(cameraVR, cameraL, cameraR);
  59417. } else {
  59418. // assume single camera setup (AR)
  59419. cameraVR.projectionMatrix.copy(cameraL.projectionMatrix);
  59420. }
  59421. };
  59422. this.getCamera = function () {
  59423. return cameraVR;
  59424. };
  59425. this.getFoveation = function () {
  59426. if (glProjLayer !== null) {
  59427. return glProjLayer.fixedFoveation;
  59428. }
  59429. if (glBaseLayer !== null) {
  59430. return glBaseLayer.fixedFoveation;
  59431. }
  59432. return undefined;
  59433. };
  59434. this.setFoveation = function (foveation) {
  59435. // 0 = no foveation = full resolution
  59436. // 1 = maximum foveation = the edges render at lower resolution
  59437. if (glProjLayer !== null) {
  59438. glProjLayer.fixedFoveation = foveation;
  59439. }
  59440. if (glBaseLayer !== null && glBaseLayer.fixedFoveation !== undefined) {
  59441. glBaseLayer.fixedFoveation = foveation;
  59442. }
  59443. }; // Animation Loop
  59444. let onAnimationFrameCallback = null;
  59445. function onAnimationFrame(time, frame) {
  59446. pose = frame.getViewerPose(customReferenceSpace || referenceSpace);
  59447. xrFrame = frame;
  59448. if (pose !== null) {
  59449. const views = pose.views;
  59450. if (glBaseLayer !== null) {
  59451. renderer.setRenderTargetFramebuffer(newRenderTarget, glBaseLayer.framebuffer);
  59452. renderer.setRenderTarget(newRenderTarget);
  59453. }
  59454. let cameraVRNeedsUpdate = false; // check if it's necessary to rebuild cameraVR's camera list
  59455. if (views.length !== cameraVR.cameras.length) {
  59456. cameraVR.cameras.length = 0;
  59457. cameraVRNeedsUpdate = true;
  59458. }
  59459. for (let i = 0; i < views.length; i++) {
  59460. const view = views[i];
  59461. let viewport = null;
  59462. if (glBaseLayer !== null) {
  59463. viewport = glBaseLayer.getViewport(view);
  59464. } else {
  59465. const glSubImage = glBinding.getViewSubImage(glProjLayer, view);
  59466. viewport = glSubImage.viewport; // For side-by-side projection, we only produce a single texture for both eyes.
  59467. if (i === 0) {
  59468. renderer.setRenderTargetTextures(newRenderTarget, glSubImage.colorTexture, glProjLayer.ignoreDepthValues ? undefined : glSubImage.depthStencilTexture);
  59469. renderer.setRenderTarget(newRenderTarget);
  59470. }
  59471. }
  59472. let camera = cameras[i];
  59473. if (camera === undefined) {
  59474. camera = new THREE.PerspectiveCamera();
  59475. camera.layers.enable(i);
  59476. camera.viewport = new THREE.Vector4();
  59477. cameras[i] = camera;
  59478. }
  59479. camera.matrix.fromArray(view.transform.matrix);
  59480. camera.projectionMatrix.fromArray(view.projectionMatrix);
  59481. camera.viewport.set(viewport.x, viewport.y, viewport.width, viewport.height);
  59482. if (i === 0) {
  59483. cameraVR.matrix.copy(camera.matrix);
  59484. }
  59485. if (cameraVRNeedsUpdate === true) {
  59486. cameraVR.cameras.push(camera);
  59487. }
  59488. }
  59489. } //
  59490. for (let i = 0; i < controllers.length; i++) {
  59491. const inputSource = controllerInputSources[i];
  59492. const controller = controllers[i];
  59493. if (inputSource !== null && controller !== undefined) {
  59494. controller.update(inputSource, frame, customReferenceSpace || referenceSpace);
  59495. }
  59496. }
  59497. if (onAnimationFrameCallback) onAnimationFrameCallback(time, frame);
  59498. xrFrame = null;
  59499. }
  59500. const animation = new WebGLAnimation();
  59501. animation.setAnimationLoop(onAnimationFrame);
  59502. this.setAnimationLoop = function (callback) {
  59503. onAnimationFrameCallback = callback;
  59504. };
  59505. this.dispose = function () {};
  59506. }
  59507. }
  59508. THREE.WebXRManager = WebXRManager
  59509. } */
  59510. /*
  59511. var addMagnifier = function(){
  59512. class Magnifier extends THREE.Object3D {
  59513. constructor () {
  59514. super()
  59515. let circleGeo = new THREE.CircleGeometry(0.1, 100);
  59516. this.camera = new THREE.PerspectiveCamera(50, 1, 0.1, 1); //fov aspect near far
  59517. this.renderTarget = new THREE.WebGLRenderTarget(256,256, {
  59518. minFilter: THREE.LinearFilter, magFilter: THREE.LinearFilter,
  59519. format: THREE.RGBAFormat ,
  59520. //type: THREE.FloatType,
  59521. //minFilter: THREE.NearestFilter,
  59522. //magFilter: THREE.NearestFilter,
  59523. } )
  59524. this.mesh = new THREE.Mesh(circleGeo, new THREE.MeshBasicMaterial({
  59525. side: THREE.DoubleSide ,
  59526. map: this.renderTarget.texture ,
  59527. transparent:true,
  59528. depthTest: !1,
  59529. depthWrite: !1,
  59530. }))
  59531. this.overlayMesh = new THREE.Mesh(circleGeo, new THREE.MeshBasicMaterial({
  59532. side: THREE.DoubleSide ,
  59533. map: Texture.load('images/crosshair.png') ,
  59534. transparent:true,
  59535. depthTest: !1,
  59536. depthWrite: !1,
  59537. }))
  59538. this.add(this.mesh)
  59539. this.add(this.overlayMesh)
  59540. player.model.add(this);
  59541. player.magnifier = this;
  59542. }
  59543. update(aimPos){
  59544. const magDistance_ = 0.3;
  59545. var playerPos = player.position
  59546. var vec = playerPos.clone().sub(aimPos).normalize().multiplyScalar(magDistance_)
  59547. this.camera.position.copy(aimPos.clone().add(vec))
  59548. this.camera.lookAt(aimPos)
  59549. var playerCamera = player.camera
  59550. this.quaternion.copy(playerCamera.quaternion);
  59551. var pos2d = player.mouse.clone();
  59552. var shift = 400;
  59553. var clientHeight = player.domElement.clientHeight
  59554. var clientY = - (pos2d.y - 1) * clientHeight / 2;
  59555. pos2d.y = clientY < 300 ? pos2d.y - shift/clientHeight : pos2d.y + shift/clientHeight
  59556. let newPos = new THREE.Vector3(pos2d.x,pos2d.y,0.7).unproject(playerCamera);
  59557. this.position.copy(newPos)
  59558. var renderer = player.sceneRenderer.renderer
  59559. var oldAutoClear = renderer.autoClear
  59560. renderer.autoClear = false
  59561. //renderer.clear( true, true, true );
  59562. renderer.render(player.sceneRenderer.scene, this.camera, this.renderTarget, true)
  59563. renderer.autoClear = oldAutoClear
  59564. }
  59565. }
  59566. new Magnifier()
  59567. }
  59568. */
  59569. /*
  59570. 笔记:
  59571. 导览缩放的几处: 1 搜索smoothZoomFovTo 2 flightStepWalk里
  59572. {
  59573. //到导览中某个点位(假设点位不重复)
  59574. var id = 73
  59575. var p = player.model.heroLocations.find(e=>e.heroLocations && e.heroLocations.find(e=>e.panoId == id))
  59576. var i = player.model.heroLocations.indexOf(p)
  59577. var p1 = p.heroLocations.find(e=>e.panoId == id)
  59578. var j = p.heroLocations.indexOf(p1)
  59579. player.director.goToHighlight([i,j])
  59580. }
  59581. 展示版导览改为就近导览,所以一开始并非第一个。如果在最后一个点上会自动从头开始
  59582. 关于pc-nav 4k
  59583. 两种选择,1 按照正常流程,因为nav为4k所以直接使用4k的tiledPanoRenderTarget, 但useUltraHighResolutionPanos需要开启才能达到4k,否则是2k。这样的话第一个点位需要手动重新替换tiledPanoRenderTarget,所以废弃
  59584. 2 使zoomed一直为true,直接使用zoomRenderTarget。 参考之前写过的三屏的本地4k。 且创建的tiledPanoRenderTarget不能超过2048否则过渡卡顿;且直到到达该点后才能下载4k,否则不会渲染到zoomRenderTarget上
  59585. 如果body使用transform旋转90度,需要改的地方:
  59586. convertScreenPositionToNDC: function(e, t, i) {//rotate 90 body: transform: rotate(90deg);
  59587. return i = i || new n.Vector2,
  59588. i.y = e / $("#player").height() * 2 - 1, //注意,当body旋转90度后,虽然clientX和clinetY是按照正常垂直视角,但player的长宽和原先一样,不会因为倒转而交换
  59589. i.x = t / $("#player").width() * 2 - 1,
  59590. i
  59591. },
  59592. outsideControl的 n.prototype.onTouchMove = function(e) {中的
  59593. this.pan(this.panDelta.x, this.panDelta.y) 改为 this.pan(this.panDelta.y, -this.panDelta.x), //rotate 90
  59594. 还有
  59595. this.rotateLeft(2 * Math.PI * this.rotateDelta.y / $("#player").width() * this.rotateSpeed), //rotate 90
  59596. this.rotateUp(2 * Math.PI * -this.rotateDelta.x / $("#player").height() * this.rotateSpeed),
  59597. ===================
  59598. 一些事件
  59599. player.model.on("floor.changed",(currentFloor, mode, oldFloor)=>{//楼层变化
  59600. player.on("pano.chosen", 旧的pano, 新的pano) //点位变化前
  59601. player.on("flying.ended", 新位置, 旧位置, 新的pano, 旧的pano) //点位变化后,或飞出后
  59602. 一些后缀
  59603. &panoLabel 加pano标签
  59604. director.on("tour.end") //导览结束 是否在导览播放中:player.director.tourInProgress() 不包括点击item
  59605. player.isWarping() //是否在导览中,包括点击item的fly
  59606. 我加了个 director.on("warp.end")
  59607. */